SRTE Flex-Algo configuration

The below chapter illustrates an use case of the Flex-Algorithm usage with SR policies.

Using ISIS Flex-algorithm configuration

Basic Flex-algorithm configuration

The below segment routing topology is used to interconnect two networks located behind the rt0 and the rt9 devices. A BGP peering is performed to let each device know the destination address of the remote networks. The use case is based on an IS-IS Flex-Algorithm configuration, where segment routing policies are relying on the specificities of the Flex-Algorithm definitions.

../../../../_images/flexalgo_topo_1_2.svg

IS-IS segment routing topology for the Flex-Algo 128 and 129 definitions.

The use case is made up of two SR policies configured on the rt0 device, to reach two remote networks located behind the rt9 device. The policies with the color 10 and 20 will respectively steer traffic to the 10.253.9.0/24 and the 10.254.9.0/24 networks. Each policy will follow the constrained SPF computation obtained by the Flex-Algorithm 128 and 129.

The below IS-IS Flex-Algorithm configuration for the rt0 and rt9 devices is given below:

rt0

rt0 running config# vrf main
rt0 running vrf main# interface physical eth-rt1
rt0 running physical eth0#! ipv4 address 10.1.0.10/24
rt0 running physical eth0#! port pci-b0s4
rt0 running physical eth0# .. ..
rt0 running vrf main# interface physical eth-rt5
rt0 running physical eth0#! ipv4 address 10.5.0.10/24
rt0 running physical eth0#! port pci-b0s5
rt0 running physical eth0# .. ..
rt0 running vrf main# interface loopback loop1
rt0 running loopback loop1# ipv4 address 10.10.10.10/32
rt0 running loopback loop1# .. ..
rt0 running vrf main# routing interface loop1
rt0 running interface loop1# isis area-tag 1
rt0 running interface loop1#! isis ipv4-routing true
rt0 running interface loop1# .. ..
rt0 running vrf main# routing interface eth-rt1
rt0 running interface eth-rt1# isis area-tag 1
rt0 running interface eth-rt1# isis metric 15
rt0 running interface eth-rt1#! isis ipv4-routing true
rt0 running interface eth-rt1# .. ..
rt0 running vrf main# routing interface eth-rt5
rt0 running interface eth-rt5# isis area-tag 1
rt0 running interface eth-rt5#! isis ipv4-routing true
rt0 running interface eth-rt5# .. ..
rt0 running vrf main# routing isis instance 1
rt0 running isis# area-address 49.0001.0000.1979.00
rt0 running isis# segment-routing enabled true
rt0 running isis# segment-routing prefix-sid-map 10.10.10.10/32 sid-value 0
rt0 running isis# / routing traffic-engineering affinity-map red bit-position 1
rt0 running isis# / routing traffic-engineering affinity-map green bit-position 2
rt0 running config# / vrf main routing interface eth-rt1 traffic-engineering affinity-map green
rt0 running config# / vrf main routing interface eth-rt1 traffic-engineering affinity-map red
rt0 running config# / vrf main routing isis instance 1
rt0 running instance 1# traffic-engineering ipv4-router-address 10.10.10.10
rt0 running instance 1# flex-algorithm 128
rt0 running flex-algorithm 128# dataplane sr-mpls
rt0 running flex-algorithm 128# segment-routing prefix-sid-map 10.10.10.10/32 sid-value 100
rt0 running flex-algorithm 128# definition advertise true
rt0 running flex-algorithm 128# definition affinity include-any green
rt0 running flex-algorithm 128# .. flex-algorithm 129
rt0 running flex-algorithm 129# dataplane sr-mpls
rt0 running flex-algorithm 129# segment-routing prefix-sid-map 10.10.10.10/32 sid-value 200
rt0 running flex-algorithm 129# definition advertise true
rt0 running flex-algorithm 129# definition affinity exclude-any red

rt9

rt9 running config# vrf main
rt9 running vrf main# interface physical eth-rt3
rt9 running physical eth0#! ipv4 address 10.39.0.9/24
rt9 running physical eth0#! port pci-b0s4
rt9 running physical eth0# .. ..
rt9 running vrf main# interface physical eth-rt7
rt9 running physical eth0#! ipv4 address 10.79.0.9/24
rt9 running physical eth0#! port pci-b0s5
rt9 running physical eth0# .. ..
rt9 running vrf main# interface loopback loop1
rt9 running loopback loop1# ipv4 address 9.9.9.9/32
rt9 running loopback loop1# .. ..
rt9 running vrf main# routing interface loop1
rt9 running interface loop1# isis area-tag 1
rt9 running interface loop1#! isis ipv4-routing true
rt9 running interface loop1# .. ..
rt9 running vrf main# routing interface eth-rt3
rt9 running interface eth-rt1# isis area-tag 1
rt9 running interface eth-rt1#! isis ipv4-routing true
rt9 running interface eth-rt1# .. ..
rt9 running vrf main# routing interface eth-rt7
rt9 running interface eth-rt5# isis area-tag 1
rt9 running interface eth-rt5#! isis ipv4-routing true
rt9 running interface eth-rt5# .. ..
rt9 running vrf main# routing isis instance 1
rt9 running isis# area-address 49.0009.0000.1979.00
rt9 running isis# segment-routing enabled true
rt9 running isis# segment-routing prefix-sid-map 9.9.9.9/32 sid-value 0
rt9 running isis# / routing traffic-engineering affinity-map red bit-position 1
rt9 running isis# / routing traffic-engineering affinity-map green bit-position 2
rt9 running config# / vrf main routing interface eth-rt3 traffic-engineering affinity-map red
rt9 running config# / vrf main routing interface eth-rt3 traffic-engineering affinity-map green
rt9 running config# / vrf main routing isis instance 1
rt9 running instance 1# traffic-engineering ipv4-router-address 9.9.9.9
rt9 running instance 1# flex-algorithm 128
rt9 running flex-algorithm 128# dataplane sr-mpls
rt9 running flex-algorithm 128# segment-routing prefix-sid-map 9.9.9.9/32 sid-value 109
rt9 running flex-algorithm 128# definition advertise true
rt9 running flex-algorithm 128# definition affinity include-any green
rt9 running flex-algorithm 128# definition metric-type te
rt9 running flex-algorithm 128# .. flex-algorithm 129
rt9 running flex-algorithm 129# dataplane sr-mpls
rt9 running flex-algorithm 129# segment-routing prefix-sid-map 9.9.9.9/32 sid-value 209
rt9 running flex-algorithm 129# definition advertise true
rt9 running flex-algorithm 129# definition affinity exclude-any red
rt9 running flex-algorithm 129#

The BGP configuration is given separately, each incoming BGP route from the rt9 device will be marked with a specific color.

Note

The SR policies are applied to unidirectional traffic. The setup focuses on steering traffic from the rt0 to the rt9 devices. No SR policies is given to steer reverse traffic from the rt0 to the rt9 devices. This explains why the incoming BGP routes on the rt9 device are not marked with a color.

rt0

rt0 running config# routing route-map rmap
rt0 running route-map rmap#! seq 10 policy permit
rt0 running route-map rmap# seq 10 set sr-te color 10
rt0 running route-map rmap# seq 10 match ip address access-list 10
rt0 running route-map rmap# seq 20 policy permit
rt0 running route-map rmap# seq 20 set sr-te color 20
rt0 running route-map rmap# seq 20 match ip address access-list 20
rt0 running route-map rmap# / routing ipv4-access-list 10 seq 10 permit 10.253.9.0/24
rt0 running route-map rmap# / routing ipv4-access-list 20 seq 10 permit 10.254.9.0/24
rt0 running route-map rmap# / vrf main routing bgp
rt0 running bgp#! as 65500
rt0 running bgp# router-id 10.10.10.10
rt0 running bgp# neighbor 9.9.9.9 remote-as 65500
rt0 running bgp# neighbor 9.9.9.9 update-source 10.10.10.10
rt0 running bgp# neighbor 9.9.9.9 address-family ipv4-unicast route-map in route-map-name rmap
rt0 running bgp# network-import-check false
rt0 running bgp# address-family ipv4-unicast network 10.255.0.0/24
rt0 running network 10.255.0.0/24# .. .. ..
rt0 running bgp# address-family ipv4-unicast network 10.254.0.0/24
rt0 running network 10.254.0.0/24#

rt9

rt9 running config# vrf main routing bgp
rt9 running bgp#! as 65500
rt9 running bgp# router-id 9.9.9.9
rt9 running bgp# neighbor 10.10.10.10 remote-as 65500
rt9 running bgp# neighbor 10.10.10.10 update-source 9.9.9.9
rt9 running bgp# network-import-check false
rt9 running bgp# address-family ipv4-unicast network 10.254.9.0/24
rt9 running network 10.254.9.0/24# .. .. ..
rt9 running bgp# address-family ipv4-unicast network 10.253.9.0/24
rt9 running network 10.253.9.0/24#

Before setting the SR-TE configuration, the IS-IS computes a route to reach the 9.9.9.9 IP address, by using the SID value of the rt9 device. The incoming BGP routes heading to the 9.9.9.9 IP address will recursively use the IS-IS route to determine the BGP route to install.

rt0

rt0> show ipv4-routes protocol bgp
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

B>  10.253.9.0/24 [200/0] via 9.9.9.9 (recursive), weight 1, 00:05:40
  *                         via 10.5.0.5, eth-rt5, label 20009, weight 1, backup 0, 00:05:40
B>  10.254.9.0/24 [200/0] via 9.9.9.9 (recursive), weight 1, 00:05:40
  *                         via 10.5.0.5, eth-rt5, label 20009, weight 1, backup 0, 00:05:40

The marked color is reflected in the BGP nexthop information. The nexthop of each BGP update inherits the SR-TE color marked by the route-map. This information will be updated by the SR-TE service, when the SR policies are available.

rt0

rt0> show bgp nexthop-cache
Current BGP nexthop cache:
 9.9.9.9 valid [IGP metric 50], #paths 0, peer 9.9.9.9
  gate 10.5.0.5, if eth-rt5
  Last update: Tue Sep 27 18:09:41 2022

 SR-TE color 10 - 9.9.9.9 valid [IGP metric 50], #paths 1
  gate 10.5.0.5, if eth-rt5
  Last update: Tue Sep 27 18:09:41 2022

 SR-TE color 20 - 9.9.9.9 valid [IGP metric 50], #paths 1
  gate 10.5.0.5, if eth-rt5
  Last update: Tue Sep 27 18:09:41 2022

The below SR-TE configuration defines two segment routing policies on the rt0 device.

rt0

rt0 running vrf main# routing segment-routing enabled true
rt0 running vrf main# routing segment-routing traffic-engineering
rt0 running traffic-engineering# flex-algorithm import isis instance 1
rt0 running traffic-engineering# policy color 10 endpoint 9.9.9.9
rt0 running policy color 10 endpoint 9.9.9.9# name to_10_253_9_network
rt0 running policy color 10 endpoint 9.9.9.9# candidate-path 10 name flexalgo128 type flex-algorithm algorithm 128
rt0 running policy color 10 endpoint 9.9.9.9# ..
rt0 running traffic-engineering# policy color 20 endpoint 9.9.9.9
rt0 running policy color 10 endpoint 9.9.9.9# name to_10_254_9_network
rt0 running policy color 10 endpoint 9.9.9.9# candidate-path 10 name flexalgo129 type flex-algorithm algorithm 129
rt0 running policy color 10 endpoint 9.9.9.9#

After having applied the two SR policies, the nexthop resolution differs for each routes. Actually, each LSP forged stands for the path provided by each Flex-Algorithm configuration: the MPLS labels are specific to each Flex-Algorithm, and the next-hop is compliant with the topology of each Flex-Algorithm.

rt0

rt0> show ipv4-routes protocol bgp
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

B>  10.253.9.0/24 [200/0] via 9.9.9.9 (recursive), weight 1, 00:00:20
  *                         via 10.1.0.1, eth-rt1, label 20109, weight 1, 00:00:20
B>  10.254.9.0/24 [200/0] via 9.9.9.9 (recursive), weight 1, 00:00:19
  *                         via 10.5.0.5, eth-rt5, label 20209, weight 1, 00:00:19

Each SR policy is active and it is visible via the following command. A segment-list has been forged by the SR-TE service using the feedback given by the IS-IS Flex-Algo information shared.

Note

The following IS-IS command can be used to dump the routing information provided by the Flex-Algo 128 definition: show isis route flex-algorithm 128.

rt0

rt0> show segment-routing te-policies detail
Endpoint: 9.9.9.9  Color: 10  Name: to_10_253_9_network  BSID: -  Status: Active
  * Preference: 10  Name: flexalgo128  Type: flex-algo  Segment-List: flexalgo128-fa-p10  Protocol-Origin: Local
      SID-list: 20109

Endpoint: 9.9.9.9  Color: 20  Name: to_10_254_9_network  BSID: -  Status: Active
  * Preference: 10  Name: flexalgo129  Type: flex-algo  Segment-List: flexalgo129-fa-p10  Protocol-Origin: Local
      SID-list: 20209

The SR policies can also impact the MPLS table when configuring a BSID. This configuration is very useful for connecting MPLS networks together. As illustrated on the Flex-Algo 130 definition, MPLS traffic can be received by the rt0 device, from the cpe1 device, and switched to the segment list heading to the 10.255.9.0/24 network.

rt0

rt0 running vrf main# interface physical eth-cpe1
rt0 running interface eth-cpe1# port pci-b0s7
rt0 running interface eth-cpe1# ipv4-address 10.254.0.10/24
rt0 running interface eth-cpe1# .. ..
rt0 running vrf main# routing static ipv4-route 10.255.0.0/24 next-hop 10.254.0.20 mpls-label implicit-null
rt0 running vrf main# routing segment-routing traffic-engineering
rt0 running traffic-engineering# policy color 10 endpoint 9.9.9.9
rt0 running policy color 10 endpoint 9.9.9.9# binding-sid 600
rt0 running policy color 10 endpoint 9.9.9.9#

rt0

rt0> show mpls table
 Inbound Label  Type        Nexthop   Outbound Label
 -----------------------------------------------------
 600            SR-TE       10.1.0.1  20109
 [..]

Handling inactive SR policies

The SR policy follows the SID list given by the Flex-Algorithm. If a topology change happens, and impacts the Flex-Algorithm route computation, the SR policy will be impacted too. For instance, if the eth-rt1 link connected to the rt1 device becomes down, then the SR policy using the only eth-rt1 link becomes inactive, and the BGP route for the Flex-Algorithm 128 is changed accordingly, and the routes proposed by the standard IGP algorithm is used.

rt0> show segment-routing te-policies detail

Endpoint: 9.9.9.9  Color: 10  Name: to_10_253_9_network  BSID: -  Status: Inactive
    Preference: 10  Name: flexalgo128    Type: flex-algo  Segment-List: (undefined)  Protocol-Origin: Local
      SID-list: (empty)

rt0> show ipv4-routes protocol bgp
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure
[..]
B>  10.253.9.0/24 [200/0] via 9.9.9.9 (recursive), weight 1, 00:00:05
  *                         via 10.5.0.5, eth-rt5, label 20009, weight 1, backup 0, 00:00:05

Note

Whenever an SR policy becomes inactive, the SR path applied to the marked routes is the SR path provided by the standard SPF algorithm.

Handling backup candidate paths with SR policies

To handle backup routes for Flex-Algorithm configurations that do not have multiple link available, backup candidate SR policies can be configured. The non availability of a given nexthop is detected by the IS-IS routing protocol. The below configuration introduces backup candidate paths for SR policies with the 10 and 20 colors.

rt0

rt0 running vrf main# routing segment-routing enabled true
rt0 running vrf main# routing segment-routing traffic-engineering
rt0 running traffic-engineering# flex-algorithm import isis instance 1
rt0 running traffic-engineering# policy color 10 endpoint 9.9.9.9
rt0 running policy color 10 endpoint 9.9.9.9# name to_10_253_9_network
rt0 running policy color 10 endpoint 9.9.9.9# candidate-path 5 name flexalgo129 type flex-algorithm algorithm 129
rt0 running policy color 10 endpoint 9.9.9.9# candidate-path 10 name flexalgo128 type flex-algorithm algorithm 128
rt0 running policy color 10 endpoint 9.9.9.9# ..
rt0 running traffic-engineering# policy color 20 endpoint 9.9.9.9
rt0 running policy color 10 endpoint 9.9.9.9# name to_10_254_9_network
rt0 running policy color 10 endpoint 9.9.9.9# candidate-path 5 name flexalgo128 type flex-algorithm algorithm 128
rt0 running policy color 10 endpoint 9.9.9.9# candidate-path 10 name flexalgo129 type flex-algorithm algorithm 129
rt0 running policy color 10 endpoint 9.9.9.9# ..

A given SR policy will become active, when selecting a candidate path which is valid and which has the highest preference value among the list of the valid candidate paths. To have a valid candidate path, it has to return a segment list, and the top-label of the segment list has to be resolved locally. When the eth-rt5 interface goes down, only the segment lists with the eth-rt1 interfaces is valid.

The Flex-Algorithm 129 can not offer any segment list. In the SR policy for the 20 color, the candidate path with preference 10 is unselected and replaced with the candidate path with preference 5.

rt0> show ipv4-routes protocol bgp
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

B>  10.253.9.0/24 [200/0] via 9.9.9.9 (recursive), weight 1, 00:08:53
  *                         via 10.1.0.1, eth-rt1, label 20109, weight 1, 00:08:53
B>  10.254.9.0/24 [200/0] via 9.9.9.9 (recursive), weight 1, 00:00:07
  *                         via 10.1.0.1, eth-rt1, label 20109, weight 1, 00:00:07
[..]

rt0> show segment-routing te-policies detail
Endpoint: 9.9.9.9  Color: 10  Name: to_10_253_9_network  BSID: -  Status: Active
    Preference: 5  Name: flexalgo129  Type: flex-algo  Segment-List: flexalgo129-fa-p5  Protocol-Origin: Local
      SID-list: 20209

  * Preference: 10  Name: flexalgo128  Type: flex-algo  Segment-List: (undefined)  Protocol-Origin: Local
      SID-list: 20109

Endpoint: 9.9.9.9  Color: 20  Name: to_10_254_9_network  BSID: -  Status: Active
  * Preference: 5  Name: flexalgo128  Type: flex-algo  Segment-List: flexalgo128-fa-p5  Protocol-Origin: Local
      SID-list: 20109

    Preference: 10  Name: flexalgo129  Type: flex-algo  Segment-List: (undefined)  Protocol-Origin: Local
      SID-list: 20209
[..]

Handling TI-LFA routes in candidate paths

As illustrated in the below figure, BGP is used to interconnect the networks behind rt0 and rt9 devices. One SR policy is bound to the Flex-Algorithm 130 and steers the traffic to the 10.255.9.0/24 network. The below figure can help:

../../../../_images/flexalgo_topo_fa130_tilfa.svg

IS-IS segment routing topology for the Flex-Algo 130 definition.

The below configuration configures TI-LFA on the eth-rt5 interface. For each IS-IS route using the eth-rt5 interface, backup routes are computed. This also includes the routes from the Flex-Algorithm 130.

The Flex-Algorithm 130 uses the TE metric to compute paths, instead of using the standard IGP metric. On rt0, the TE metrics are configured with different weights for each interface. Using this metric only for the Flex-Algorihthm 130 guarantees there is no impact in the SPF computing in the main IS-IS routing decisions and the other configured Flex-Algorithms.

../../../../_images/flexalgo_topo_fa130_tilfa.svg

IS-IS segment routing topology for the Flex-Algo 130 definitions using TI-LFA.

The rt0 and rt9 configurations is given below. .. rubric:: rt0

rt0 running config# vrf main
rt0 running vrf main# interface physical eth-rt1
rt0 running physical eth0#! ipv4 address 10.1.0.10/24
rt0 running physical eth0#! port pci-b0s4
rt0 running physical eth0# .. ..
rt0 running vrf main# interface physical eth-rt5
rt0 running physical eth0#! ipv4 address 10.5.0.10/24
rt0 running physical eth0#! port pci-b0s5
rt0 running physical eth0# .. ..
rt0 running vrf main# interface loopback loop1
rt0 running loopback loop1# ipv4 address 10.10.10.10/32
rt0 running loopback loop1# .. ..
rt0 running vrf main# routing interface loop1
rt0 running interface loop1# isis area-tag 1
rt0 running interface loop1#! isis ipv4-routing true
rt0 running interface loop1# .. ..
rt0 running vrf main# routing interface eth-rt1
rt0 running interface eth-rt1# isis area-tag 1
rt0 running interface eth-rt1# isis metric 15
rt0 running interface eth-rt1#! isis ipv4-routing true
rt0 running interface eth-rt1# .. ..
rt0 running vrf main# routing interface eth-rt5
rt0 running interface eth-rt5# isis area-tag 1
rt0 running interface eth-rt5#! isis ipv4-routing true
rt0 running interface eth-rt5# .. ..
rt0 running vrf main# / routing traffic-engineering affinity-map blue bit-position 0
rt0 running vrf main# routing interface eth-rt1 traffic-engineering affinity-map blue
rt0 running vrf main# routing interface eth-rt5 traffic-engineering affinity-map blue
rt0 running vrf main# routing isis instance 1
rt0 running isis# area-address 49.0001.0000.1979.00
rt0 running isis# segment-routing enabled true
rt0 running isis# segment-routing prefix-sid-map 10.10.10.10/32 sid-value 0
rt0 running isis# flex-algorithm 130
rt0 running flex-algorithm 130# dataplane sr-mpls
rt0 running flex-algorithm 130# segment-routing prefix-sid-map 10.10.10.10/32 sid-value 100
rt0 running flex-algorithm 130# definition advertise true
rt0 running flex-algorithm 130# definition affinity include-any blue
rt0 running flex-algorithm 130# /
rt0 running config# routing route-map rmap
rt0 running route-map rmap#! seq 30 policy permit
rt0 running route-map rmap# seq 30 policy permit
rt0 running route-map rmap# seq 30 set sr-te color 30
rt0 running route-map rmap# seq 30 match ip address access-list 30
rt0 running route-map rmap# /
rt0 running config# routing ipv4-access-list 30 seq 10 permit 10.255.9.0/24
rt0 running config# / vrf main routing isis instance 1 spf ietf-backoff-delay
rt0 running ietf-backoff-delay#! init-delay 15000 short-delay 0 long-delay 0 hold-down 0 time-to-learn 0
rt0 running ietf-backoff-delay# .. .. flex-algorithm 130
rt0 running flex-algorithm 130# definition metric-type te
rt0 running flex-algorithm 130# priority 130
rt0 running flex-algorithm 130# / vrf main routing interface eth-rt5
rt0 running interface eth-rt5# isis fast-reroute ti-lfa level-1
rt0 running interface ti-lfa level-1# .. .. .. traffic-engineering
rt0 running traffic-engineering# metric 100
rt0 running traffic-engineering# / vrf main routing interface eth-rt1 traffic-engineering
rt0 running traffic-engineering# metric 5
rt0 running traffic-engineering# /
rt0 running config# vrf main routing bgp
rt0 running bgp#! as 65500
rt0 running bgp# router-id 10.10.10.10
rt0 running bgp# neighbor 9.9.9.9 remote-as 65500
rt0 running bgp# neighbor 9.9.9.9 update-source 10.10.10.10
rt0 running bgp# neighbor 9.9.9.9 address-family ipv4-unicast route-map in route-map-name rmap
rt0 running bgp# network-import-check false
rt0 running bgp# address-family ipv4-unicast network 10.255.0.0/24
rt0 running network 10.255.0.0/24#

rt9

rt9 running config# vrf main
rt9 running vrf main# interface physical eth-rt3
rt9 running physical eth0#! ipv4 address 10.39.0.9/24
rt9 running physical eth0#! port pci-b0s4
rt9 running physical eth0# .. ..
rt9 running vrf main# interface physical eth-rt7
rt9 running physical eth0#! ipv4 address 10.79.0.9/24
rt9 running physical eth0#! port pci-b0s5
rt9 running physical eth0# .. ..
rt9 running vrf main# interface loopback loop1
rt9 running loopback loop1# ipv4 address 9.9.9.9/32
rt9 running loopback loop1# .. ..
rt9 running vrf main# routing interface loop1
rt9 running interface loop1# isis area-tag 1
rt9 running interface loop1#! isis ipv4-routing true
rt9 running interface loop1# .. ..
rt9 running vrf main# routing interface eth-rt3
rt9 running interface eth-rt1# isis area-tag 1
rt9 running interface eth-rt1#! isis ipv4-routing true
rt9 running interface eth-rt1# .. ..
rt9 running vrf main# routing interface eth-rt7
rt9 running interface eth-rt5# isis area-tag 1
rt9 running interface eth-rt5#! isis ipv4-routing true
rt9 running interface eth-rt5# .. ..
rt9 running vrf main# / routing traffic-engineering affinity-map blue bit-position 0
rt9 running vrf main# routing interface eth-rt3 traffic-engineering affinity-map blue
rt9 running vrf main# routing interface eth-rt7 traffic-engineering affinity-map blue
rt9 running vrf main# routing isis instance 1
rt9 running isis# area-address 49.0009.0000.1979.00
rt9 running isis# segment-routing enabled true
rt9 running isis# segment-routing prefix-sid-map 9.9.9.9/32 sid-value 0
rt9 running config# / vrf main routing interface eth-rt3 traffic-engineering affinity-map red
rt9 running config# / vrf main routing interface eth-rt7 traffic-engineering affinity-map green
rt9 running config# / vrf main routing isis instance 1
rt0 running isis# flex-algorithm 130
rt9 running flex-algorithm 130# dataplane sr-mpls
rt9 running flex-algorithm 130# segment-routing prefix-sid-map 9.9.9.9/32 sid-value 109
rt9 running flex-algorithm 130# definition advertise true
rt9 running flex-algorithm 130# definition affinity include-any blue
rt9 running flex-algorithm 130# definition metric-type te
rt9 running flex-algorithm 130# /
rt9 running config# / vrf main routing interface eth-rt3 traffic-engineering metric 10
rt9 running config# / vrf main routing interface eth-rt7 traffic-engineering metric 10
rt9 running config# vrf main routing bgp
rt9 running bgp#! as 65500
rt9 running bgp# router-id 9.9.9.9
rt9 running bgp# neighbor 10.10.10.10 remote-as 65500
rt9 running bgp# neighbor 10.10.10.10 update-source 9.9.9.9
rt9 running bgp# neighbor 10.10.10.10 address-family ipv4-unicast route-map in route-map-name rmap
rt9 running bgp# network-import-check false
rt9 running bgp# address-family ipv4-unicast network 10.255.9.0/24
rt9 running network 10.255.9.0/24#

Below the configuration of the SR policies on the rt0 device:

rt0

rt0 running vrf main# routing segment-routing enabled true
rt0 running vrf main# routing segment-routing traffic-engineering
rt0 running traffic-engineering# flex-algorithm import isis instance 1
rt0 running traffic-engineering# policy color 30 endpoint 9.9.9.9
rt0 running policy color 10 endpoint 9.9.9.9# name to_10_255_9_network
rt0 running policy color 10 endpoint 9.9.9.9# binding-sid 601
rt0 running policy color 10 endpoint 9.9.9.9# candidate-path 10 name flexalgo130 type flex-algorithm algorithm 130
rt0 running policy color 10 endpoint 9.9.9.9#

The calculated backup routes show an alternate path and labels for reaching the 9.9.9.9/32 SID.

rt0> show isis route backup flex-algorithm 130
 Prefix          Metric  Interface  Nexthop   Label(s)
 ------------------------------------------------------------
 9.9.9.9/32    250     eth-rt1    10.1.0.1  20303/20309
[..]

rt0> show isis route flex-algorithm 130
 Prefix          Metric  Interface  Nexthop   Label(s)
 ------------------------------------------------------------
 9.9.9.9/32      45      eth-rt5    10.5.0.5  20309
[..]

Before the link to eth-rt5 interface is down, the active routes are showed below, as well as the active MPLS entries.

rt0> show ipv4-routes protocol bgp
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

 B>  10.255.9.0/24 [200/0] via 9.9.9.9 (recursive), weight 1, 00:02:43
  *                         via 10.5.0.5, eth-rt5, label 20309, weight 1, 00:02:43
 [..]

rt0> show segment-routing te-policies detail
Endpoint: 9.9.9.9  Color: 30  Name: to_10_255_9_network  BSID: 600  Status: Active
  * Preference: 10  Name: flexalgo130  Type: flex-algo  Segment-List: flexalgo130-fa-p10  Protocol-Origin: Local
      SID-list: 20309
[..]

rt0> show mpls table
 Inbound Label  Type        Nexthop   Outbound Label
 -----------------------------------------------------
 601            SR-TE       10.5.0.5  20309
[..]

After turning off the eth-rt0 interface on the rt5 machine, the backup route is considered, and the label stack of the backup route is transmitted to the SR policy. The BGP route is now steered to the eth-rt1 interface on rt0 with the new label stack. Also, the MPLS entry for the BSID 601 is changed too.

rt0> show ipv4-routes protocol bgp
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

 B>  10.255.9.0/24 [200/0] via 9.9.9.9 (recursive), weight 1, 00:02:43
  *                         via 10.1.0.1, eth-rt1, label 20303/20309, weight 1, 00:00:04
 [..]

rt0> show segment-routing te-policies detail
Endpoint: 9.9.9.9  Color: 30  Name: to_10_255_9_network  BSID: -    Status: Active
  * Preference: 10  Name: flexalgo130  Type: flex-algo  Segment-List: flexalgo130-fa-p10  Protocol-Origin: Local
      SID-list: 20303 20309
[..]

rt0> show mpls table
 Inbound Label  Type        Nexthop   Outbound Label
 -----------------------------------------------------
 601            SR-TE       10.1.0.1  20303/20309
[..]

Note that the TI-LFA switchover is only transitory, while waiting the next SPF computation to happen. The new BGP route will follow the 20309 label stack using the eth-rt1 interface.