Flex algo is a flexible algorithm that allows you to create a separate topology and calculate paths in an IGP (OSPF, ISIS). A Flex-Algo provides a simple way with separated routing planes, low-delay routes with constrained TE paths, meeting differentiated requirements of various services. This article will show you how Flex Algo Configuration with Segment Routing OSPF in Nokia Router (7750SR, 7250IXR).
Mục lục
Topology and Prepare
We need 7 nokia routers using timos os and connected’s link will have static delay values configured as shown below:

Router Name | Interface Name | Delay Value |
---|---|---|
PE1 | to-CE6 | 1000 |
to-PE3 | 10 | |
to-PE2 | 10 | |
PE2 | to-CE7 | 1000 |
to-PE1 | 10 | |
to-PE4 | 10 | |
PE3 | to-PE4 | 1000 |
to-PE1 | 10 | |
to-CE6 | 10 | |
PE4 | to-PE3 | 1000 |
to-PE2 | 10 | |
to-CE8 | 10 | |
CE6 | to-PE1 | 1000 |
to-PE3 | 10 | |
CE7 | to-PE2 | 1000 |
to-CE8 | 10 | |
CE8 | to-PE4 | 10 |
to-CE7 | 10 |
The ultimate goal of this test is that traffic will follow the yellow line from CE6 to CE7.

Configure OSPF as IGP
You can refer to the following article to configure OSPF: Basic OSPF configuration in Nokia SROS
Enable SR-OSPF on all routers
You can refer to the following article to configure Segment Routing OSPF: Basic Segment Routing with MPLS Data Plane (SR-MPLS) using OSPF routing protocol
Flex Algo Configuration
On every routers, add flex-algo 129 which use delay as metric.
#FlexAgo
/configure router flexible-algorithm-definitions flex-algo FlexAgoTest create
metric-type delay
no shutdown
/configure router ospf flexible-algorithms flex-algo 129
participate
advertise FlexAgoTest
/configure router ospf flexible-algorithms no shutdown
/configure router ospf area 0 interface "system" flex-algo 129 node-sid index <id>
About node-sid index, you can configure with value in Table 2: Node-sid index planning
Router Name | Node-sid index Global | Node-sid index Flex-algo |
---|---|---|
PE1 | 1 | 11 |
PE2 | 2 | 12 |
PE3 | 3 | 13 |
PE4 | 4 | 14 |
CE6 | 6 | 16 |
CE7 | 7 | 17 |
CE8 | 8 | 18 |
Base on Table 1: Static delay values, configure static delay with following command:
/configure router interface {interface_name} if-attribute delay static {delay_value}
Configure services according to Flex Algo
On CE6 and CE7, use policy-options policy to manage community will be selected to forward packets with flex-algo.
/configure router policy-options
begin
community "VPRN-55" members "target:65555:55"
policy-statement "VPRN-55-EXPORT"
default-action accept community add "VPRN-55"
exit
policy-statement "VPRN-55-IMPORT" entry 10
from community "VPRN-55"
action accept flex-algo 129
exit
commit
On CE6 and CE7, create vprn 55, RD = 65555:55, RT = target:65555:55. Import and Export policies created in the previous step. Each router creates a loopback interface to test after completing the configuration
A:CE6# configure service vprn 55
interface "Tester6" create
address 192.168.6.6/24
loopback
exit
bgp-ipvpn
mpls
auto-bind-tunnel
resolution-filter
sr-ospf
exit
resolution filter
exit
route-distinguisher 65555:55
vrf-import "VPRN-55-IMPORT"
vrf-export "VPRN-55-EXPORT"
no shutdown
exit
exit
no shutdown
A:CE7# configure service vprn 55
interface "Tester7" create
address 192.168.7.7/24
loopback
exit
bgp-ipvpn
mpls
auto-bind-tunnel
resolution-filter
sr-ospf
exit
resolution filter
exit
route-distinguisher 65555:55
vrf-import "VPRN-55-IMPORT"
vrf-export "VPRN-55-EXPORT"
no shutdown
exit
exit
no shutdown
Verify Flex Algo Configuration
Verify Flexible Algorithm configuration in router CE6. Router CE7 is similar:
A:CE6# show router 55 route-table 192.168.7.7
===============================================================================
Route Table (Service: 55)
===============================================================================
Dest Prefix[Flags] Type Proto Age Pref
Next Hop[Interface Name] Metric
-------------------------------------------------------------------------------
192.168.7.7/32 Remote BGP VPN 01d03h33m 170
7.7.7.7 (tunneled:SR-OSPF:524300) 60
-------------------------------------------------------------------------------
No. of Routes: 1
Flags: n = Number of times nexthop is repeated
B = BGP backup route available
L = LFA nexthop available
S = Sticky ECMP requested
===============================================================================
A:CE6# show router tunnel-table 7.7.7.7
===============================================================================
IPv4 Tunnel Table (Router: Base)
===============================================================================
Destination Owner Encap TunnelId Pref Nexthop Metric
Color
-------------------------------------------------------------------------------
7.7.7.7/32 ospf (0) MPLS 524303 10 10.1.16.1 6
7.7.7.7/32 ospf (0) MPLS 524300 10 10.1.36.3 60
-------------------------------------------------------------------------------
Flags: B = BGP or MPLS backup hop available
L = Loop-Free Alternate (LFA) hop available
E = Inactive best-external BGP route
k = RIB-API or Forwarding Policy backup hop
===============================================================================
A:CE6# show router tunnel-table 7.7.7.7/32 detail
===============================================================================
Tunnel Table (Router: Base)
===============================================================================
Destination : 7.7.7.7/32
NextHop : 10.1.16.1
Tunnel Flags : entropy-label-capable
Age : 01d03h19m
CBF Classes : (Not Specified)
Owner : ospf (0) Encap : MPLS
Tunnel ID : 524303 Preference : 10
Tunnel Label : 20007 Tunnel Metric : 6
Tunnel MTU : 9194 Max Label Stack : 1
-------------------------------------------------------------------------------
Destination : 7.7.7.7/32
NextHop : 10.1.36.3
Tunnel Flags : entropy-label-capable
Age : 01d03h19m
CBF Classes : (Not Specified)
Owner : ospf (0) Encap : MPLS
Algorithm : 129
Tunnel ID : 524300 Preference : 10
Tunnel Label : 20017 Tunnel Metric : 60
Tunnel MTU : 9194 Max Label Stack : 1
-------------------------------------------------------------------------------
Number of tunnel-table entries : 2
Number of tunnel-table entries with LFA : 0
===============================================================================
A:CE6#
A:CE6# ping 192.168.7.7 router 55
PING 192.168.7.7 56 data bytes
64 bytes from 192.168.7.7: icmp_seq=1 ttl=64 time=398ms.
64 bytes from 192.168.7.7: icmp_seq=2 ttl=64 time=95.5ms.
64 bytes from 192.168.7.7: icmp_seq=3 ttl=64 time=64.0ms.
64 bytes from 192.168.7.7: icmp_seq=4 ttl=64 time=83.5ms.
64 bytes from 192.168.7.7: icmp_seq=5 ttl=64 time=75.1ms.
---- 192.168.7.7 PING Statistics ----
5 packets transmitted, 5 packets received, 0.00% packet loss
round-trip min = 64.0ms, avg = 143ms, max = 398ms, stddev = 128ms
A:CE6#
At the present time of writing, there is no lsp trace mechanism in segment-routing. According to the plan Nokia will update this feature in version 23.
If you have questions or discussions, please leave a comment below the article. You can download the full configuration and topology using the download button below. Thank you for reading.
Dear h2ttool.com administrator, You always provide helpful diagrams and illustrations.
thanks