Contents

Introduction

Prerequisites

Flex-Algo Overview

Network Topology

Network

Flex-Algo Configuration

Flex-Algo 129 Defined by Metric-type TE

Configuration

Verification

Flex-Algo 128 Defined by Metric-type Delay

Configuration

Verification

Topology-independent Loop-Free Alternate (TI-LFA) and Microloop Avoidance ( MLA ) on FLEX-ALGO 129

Link Affinity-Map Constraints

Configuration

Verification

Configuration on ABR-2 of the Affinity Map

Verification

Conclusion

Commands

Introduction

This document describes operating Flexible Algorithm (Flex-Algo) in ISIS as well as, provides relevant commands for verification and troubleshooting.

Prerequisites

Requirements

- Cisco recommends that you have basic knowledge of ISIS Segment routing traffic engineering.

Components Used

- The information in this document is based on Device: Aggregation Services Router 9000 (ASR9K).

- The information in this document was created from the devices in a specific lab environment. All the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.

Flex-Algo Overview

- Flexible Algorithm (Flex-Algo) is identified by a numerical value in the range 0–255; values 0–127 are reserved, while 128–255 are user-defined.

- A Flex-Algo is defined by a metric type (Interior Gateway Protocol (IGP) metric, delay metric, or TE metric) and a set of constraints (example link affinity, Shared Risk Link Group (SRLG)).

- By leveraging Flex-Algo, networks can implement network slicing, that is  logical segmentation of the network, where path computation is restricted to the topology that satisfies the defined constraints.

Figure 1: Prefix-SID Sub-TLV Format (with Algorithm Field)

Figure 2: Flex-Algo Definition（FAD) TLV Format

Network Topology

Figure 3: Network Topology Diagram

Network

- Algorithm 128 → Defines a latency-optimized slice.

- Algorithm 129 → Defines a TE-optimized slice.

- ABR1 and ABR2 advertise their Flex-Algo Definitions (FAD TLVs) in IS-IS Link-State Protocol Data Unit (LSPs).

- A FAD originator can be any router in the IS-IS domain; a router does not need to participate in each Flex-Algo to advertise its definition.

Flex-Algo Configuration

router isis core

flex-algo 128

interface Loopback100

passive

address-family ipv4 unicast

prefix-sid index 11 explicit-null

prefix-sid algorithm 128 index 811 explicit-null

Note:

- index 11 - Prefix-SID bound to Flex-Algo 0 (default  shortest path first (SPF)).

- index 811 - Prefix-SID bound to Flex-Algo 128.

- Flex-Algo Prefix-SIDs enable network slicing , For a given prefix (example Loopback100), multiple Prefix-SIDs can be advertised—each tied to a specific Flex-Algo.

- The first Prefix-SID (Index 11) is automatically associated with Flex-Algo 0 (default IGP shortest-path algorithm).

- The second Prefix-SID (Index 811) is explicitly associated with Flex-Algo 128, a user-defined algorithm.

Flex-Algo 129 Defined by Metric-type TE

Configuration

On ABR2:

router isis core

flex-algo 129

priority 50

metric-type te

advertise-definition

interface Loopback100

address-family ipv4 unicast

prefix-sid algorithm 129 index 92 explicit-null >> Prefix-SID bound to Flex-Algo 129

interface HundredGigE0/1/0/2

point-to-point

address-family ipv4 unicast

fast-reroute per-prefix

fast-reroute per-prefix ti-lfa

te-metric flex-algo 20 level 2 >> 20 is the TE metric value for this link , need to be enabled on the links only between those routers participating in Flex-Algo 129

Verification

PE3#show isis flex-algo 129

IS-IS core Flex-Algo Database

Flex-Algo 129:

Level-2:

Definition Priority: 100

Definition Source: ASR9906-2-ABR-1.00

Definition Equal to Local: No

Definition Metric Type: TE

Definition Flex-Algo Prefix Metric: No

<snip>

FRR Disabled: No

Microloop Avoidance Disabled: No

UCMP Disabled: No

Data Plane Segment Routing: Yes

Data Plane IP: Yes

PE3#show isis database 55A1-2-PE4.00-00  verbose internal

IS-IS core (Level-2) Link State Database

LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime/Rcvd  ATT/P/OL  Len  Received  From           On          Reason

55A1-2-PE4.00-00      0x00000149   0xfe2f        995  /1200         0/0/0     282  09:21:39  ASR9910-4-ABR-2 Hu0/1/0/0    Flooded

<snip>

TLV code:242 length:28

Router Cap:     10.10.44.44 D:0 S:0

SubTLV code:2 length:9

Segment Routing: I:1 V:0, SRGB Base: 16000 Range: 8000

SubTLV code:23 length:2

Node Maximum SID Depth:

Label Imposition: 12

SubTLV code:19 length:3

SR Algorithm:

Algorithm: 0

Algorithm: 1

Algorithm: 129

SubTLV code:29 length:1

IP Algorithm:

Algorithm: 129

TLV code:22 length:117

Metric: 10         IS-Extended ASR9910-4-ABR-2.00

SubTLV code:4 length:8

Local Interface ID: 32, Remote Interface ID: 38

SubTLV code:6 length:4

Interface IP Address: 10.10.244.44

SubTLV code:8 length:4

Neighbor IP Address: 10.10.244.2

SubTLV code:9 length:4

Physical BW: 10000000 kbits/sec

SubTLV code:16 length:9

Application Specific Link Attributes:

L flag: 0, SA-Length: 1, UDA-Length: 1

Standard Applications: 0x10 FLEX-ALGO

User Defined Applications: 0x10

SubTLV code:18 length:3

Admin. Weight: 20 >>>>>>>>>> configured TE metric

PE3#show isis topology flex-algo 129

IS-IS core paths to IPv4 Unicast (Level-2) routers

System Id        Metric     Next-Hop        Interface        SNPA

ASR9910-4-ABR-2   20        ASR9910-4-ABR-2  Hu0/1/0/0       *PtoP*        >> 1 hop away from PE3

55A1-2-PE4        40        ASR9910-4-ABR-2  Hu0/1/0/0       *PtoP*        >> 2 hops away from PE3

PE3#show isis database 55A1-2-01EEA29-PE4.00-00  verbose internal

IS-IS core (Level-2) Link State Database

LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime/Rcvd  ATT/P/OL  Len  Received  From           On          Reason

55A1-2-01EEA29-PE4.00-00  0x00000149   0xfe2f        995  /1200         0/0/0     282  09:21:39  ASR9910-4-01F8486-ABR-2 Hu0/1/0/0   Flooded

<snip>

TLV code:242 length:28

Router Cap:     10.10.44.44 D:0 S:0

SubTLV code:2 length:9

Segment Routing: I:1 V:0, SRGB Base: 16000 Range: 8000

SubTLV code:23 length:2

Node Maximum SID Depth:

Label Imposition: 12

SubTLV code:19 length:3

SR Algorithm:

Algorithm: 0

Algorithm: 1

Algorithm: 129

SubTLV code:29 length:1

IP Algorithm:

Algorithm: 129

TLV code:22 length:117

Metric: 10         IS-Extended ASR9910-4-01F8486-ABR-2.00

SubTLV code:4 length:8

Local Interface ID: 32, Remote Interface ID: 38

SubTLV code:6 length:4

Interface IP Address: 10.10.244.44

SubTLV code:8 length:4

Neighbor IP Address: 10.10.244.2

SubTLV code:9 length:4

Physical BW: 10000000 kbits/sec

SubTLV code:16 length:9

Application Specific Link Attributes:

L flag: 0, SA-Length: 1, UDA-Length: 1

Standard Applications: 0x10 FLEX-ALGO

User Defined Applications: 0x10

SubTLV code:18 length:3

Admin. Weight: 20 >>>>>>>>>> configured TE metric

Flex-Algo 128 Defined by Metric-type Delay

Configuration

router isis core

flex-algo 128

priority 100

metric-type delay

advertise-definition

performance-measurement

interface HundredGigE0/1/0/0

delay-measurement >>> this CLI needs to be enabled only on those interfaces between those routers participating in Flex-Algo 128

!

!

interface HundredGigE0/1/0/3

delay-measurement

Verification

PE1#show isis flex-algo 128

IS-IS core Flex-Algo Database

Flex-Algo 128:

Level-2:

Definition Priority: 100

Definition Source: ASR9906-2-ABR-1.00

Definition Equal to Local: No

Definition Metric Type: Delay

Definition Flex-Algo Prefix Metric: No

Note: On PE2, the performance-measurement interface HundredGigE0/1/0/1 >> link between PE2 and ABR 1 delay-measurement advertise-delay 100 >> delay is statically configured. This increases the delay metric by +100 in the direction from PE2 towards PE1, hence the delay to reach ABR 1 from PE2 is 100.

PE1#show isis database ASR-9904-5-PE2.00-00 verbose internal

IS-IS core (Level-2) Link State Database

LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime/Rcvd ATT/P/OL LSP Length

ASR-9904-5-PE2.00-00  0x00000231   0x6084        1131 /1200         0/0/0   310

<snip>

TLV code:242 length:25

<snip>

SubTLV code:19 length:3

SR Algorithm:

Algorithm: 0

Algorithm: 1

Algorithm: 128

TLV code:22 length:144

Metric: 10         IS-Extended ASR9906-2-ABR-1.00

SubTLV code:4 length:8

Local Interface ID: 17, Remote Interface ID: 22

SubTLV code:6 length:4

Interface IP Address: 10.10.221.22

SubTLV code:8 length:4

Neighbor IP Address: 10.10.221.1

SubTLV code:9 length:4

Physical BW: 99999998 kbits/sec

SubTLV code:33 length:4

Link Average Delay: 100 us

SubTLV code:34 length:8

Link Min/Max Delay: 100/100 us

SubTLV code:35 length:4

Link Delay Variation: 0 us

SubTLV code:16 length:14

Application Specific Link Attributes:

L flag: 0, SA-Length: 1, UDA-Length: 1

Standard Applications: 0x10 FLEX-ALGO

User Defined Applications: 0x10

SubTLV code:34 length:8

Link Min/Max Delay: 100/100 us >>> delay calculated on this link due to the confoguration

PE2#show isis topology flex-algo 128

IS-IS core paths to IPv4 Unicast (Level-2) routers

System Id                Metric    Next-Hop                 Interface       SNPA

ASR9906-2-ABR-1          100       ASR9906-2-ABR-1          Hu0/1/0/1       *PtoP*

ASR9906-1-PE1            112       ASR9906-2-ABR-1          Hu0/1/0/1       *PtoP*

When there is no manual advertise-delay configured on the interface, and using the default delay measurement profile enabled on the interface, probes are sent on the links to measure the delay on the interface.

ABR-1#show performance-measurement sessions

----------------------------------------------------------------------------------------------------------------------------------------------------------------

0/1/CPU0

----------------------------------------------------------------------------------------------------------------------------------------------------------------

Transport type              : Interface

Measurement type            : Delay Measurement

Interface name              : HundredGigE0/1/0/0

Nexthop                     : Unknown

Delay Measurement session:

Session ID                   : 4097

Profile Keys:

Profile name                 : default

Profile type.                : Interface Delay Measurement

Last advertisement:

Advertised at: Sep 26 2025 14:00:36.179 (247623.282 seconds ago)

Advertised reason: Periodic timer, min delay threshold crossed

Advertised delays (uSec): avg: 12, min: 12, max: 13, variance: 0

A flag set: False

Next advertisement:

Threshold check scheduled in 2 more probes (roughly every 120 seconds)

Aggregated delays (uSec): avg: 12, min: 11, max: 12, variance: 1

Rolling average (uSec): 11

Current computation:

Started at: Sep 29 2025 10:47:17.373 (22.88 seconds ago)

Packets Sent: 8, received: 8

Measured delays (uSec): avg: 12, min: 11, max: 12, variance: 1 >>>>>>>>>>>> the delay measured using probes on this interface

Next probe scheduled at: Sep 29 2025 10:47:47.369 (in 7.908 seconds)

Next packet will be sent in 1.908 seconds

Packet sent every 3.0 seconds

Responder IP : 10.10.111.11

Number of Hops : 1

ABR-1#show isis database ASR9906-1-PE1.00-00 verbose internal

IS-IS core (Level-2) Link State Database

LSPID               LSP Seq Num LSP Checksum  LSP Holdtime/Rcvd  ATT/P/OL LSP Length

ASR9906-1-PE1.00-00 0x00000777  0x13ef         497 /1200         0/0/0    370

<snip>

TLV code:22 length:197

Metric: 10 IS-Extended ASR9906-2-ABR-1.00

SubTLV code:4 length:8

Local Interface ID: 40, Remote Interface ID: 21

SubTLV code:6 length:4

Interface IP Address: 10.10.111.11

SubTLV code:8 length:4

Neighbor IP Address: 10.10.111.1

SubTLV code:9 length:4

Physical BW: 99999998 kbits/sec

SubTLV code:33 length:4

Link Average Delay: 12 us >>>>>>>>>>>>>> the calculated delay is propagated via ISIS which is used by the Headend router to calculate the path with minimum delay

SubTLV code:34 length:8

Link Min/Max Delay: 12/13 us

SubTLV code:35 length:4

Link Delay Variation: 0 us

SubTLV code:16 length:14

Application Specific Link Attributes:

L flag: 0, SA-Length: 1, UDA-Length: 1

Standard Applications: 0x10 FLEX-ALGO

User Defined Applications: 0x10

SubTLV code:34 length:8

Link Min/Max Delay: 12/13 us

PE1#show isis topology flex-algo 128

IS-IS core paths to IPv4 Unicast (Level-2) routers

System Id                 Metric    Next-Hop                 Interface       SNPA

ASR9906-2-ABR-1           12        ASR9906-2-ABR-1          Hu0/1/0/0       *PtoP*

ASR-9904-5-PE2            24        ASR9906-2-ABR-1          Hu0/1/0/0       *PtoP*

Note:

- From PE1 to reach ABR 1 there is only 12 us delay

- From PE1 to reach PE2 there is 24 us delay

Topology-independent Loop-Free Alternate (TI-LFA) and Microloop Avoidance ( MLA ) on FLEX-ALGO 129

Figure 4: Network Topology Diagram Used to Demonstrate TI-LFA and  MLA for Flex-Algo 129

ABR-1#show isis fast-reroute flex-algo 129 10.10.2.2/32  detail

L2 10.10.2.2/32 [20/115] Label: 16092, medium priority

Installed Sep 17 10:40:08.503 for 00:16:25

via 10.10.12.2, HundredGigE0/1/0/1, Label: Exp-Null-v4, ASR9910-4-ABR-2, SRGB Base: 16000, Weight: 0

Backup path: TI-LFA (link), via 10.10.221.22, HundredGigE0/1/0/3 ASR-9904-5-PE2, SRGB Base: 16000, Weight: 0, Metric: 60

P node: ASR9910-3-PE3.00 [10.10.33.33], Label: 16933 >>>>>>>>>> TI-LFA precomputed path for FRR

Prefix label: 16092

Backup-src: ASR9910-4-ABR-2.00

P: No, TM: 60, LC: No, NP: No, D: No, SRLG: Yes

src ASR9910-4-ABR-2.00-00, 10.10.2.2, prefix-SID index 92, R:0 N:1 P:1 E:1 V:0 L:0, Alg:129

Note:

- 16933 PE3 Flex-Algo 129 label

- 16092 ABR -2 Flex-Algo 129 label

- The TI-LFA path is also restricted with the logical network slice of flex algo 129

On ABR-1 when the link between ABR 1 and 2 is shut down MLA-tunnel is triggered:

ABR-1 #show isis microloop avoidance 10.10.2.2/32 flex-algo 129 detail

10.10.2.2/32 participated in 1 of 6 microloop avoidance events

number start     spf             duration  cleanup        duration  pins: ipv4   ipv6

---    ---       ---               ---     ---               ---        ---     ---

5      restart   10:59:16.440     0 ms    10:59:16.643                   3      0

trigger: Link down, near node: ASR9906-2-ABR-1.00, far node: ASR9910-4-ABR-2.00

via 10.10.221.22, Hu0/1/0/3, Labels: 16933

In both the TI-LFA and MLA , Flex-Algo 129 runs its own constrained SPF, precomputes a fast reroute tunnel that respects Algo 129 constraints, using only FLEX-ALGO 129 labels.

Link Affinity-Map Constraints

- Affinity is a 32-bit attribute associated with an IGP link, administratively assigned by the operator.

- Each bit position corresponds to a semantic meaning defined by the operator.

- These affinity bits are advertised in the IGP (OSPF/IS-IS) as part of the link’s TE attributes.

When a Flex-Algo computes its shortest path tree (SPF), it applies affinity constraints during path selection:

- Include-Any (IA): The computed path must traverse at least one link that has any of the specified affinity bits set.

- Include-All (IAll): The computed path must traverse only links that collectively contain all of the specified affinity bits.

- Exclude-Any (EA): The computed path must avoid all links that carry any of the specified affinity bits.

Configuration

On ABR 1and 2:

On ABR 1and 2

router isis core

affinity-map ALGO-129 bit-position 6

flex-algo 129

priority 100

metric-type te

advertise-definition

affinity exclude-any ALGO-129

Post this configuration on the FAD advertised.

Verification

PE4#show isis database ASR9906-2-ABR-1.00-00  verbose internal

IS-IS core (Level-2) Link State Database

LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime/Rcvd  ATT/P/OL  Len  Received  From           On          Reason

ASR9906-2-ABR-1.00-00  0x0000023f   0xa89f        871  /1200         0/0/0     453  11:12:43  ASR9906-1-PE1 Hu0/0/0/5   Flooded

TLV code:242 length:44

Router Cap:     10.10.1.1 D:0 S:0

<snip>

SubTLV code:19 length:4

SR Algorithm:

Algorithm: 0

Algorithm: 1

Algorithm: 128

Algorithm: 129

SubTLV code:26 length:4

Flex-Algo Definition:

Algorithm: 129 Metric-Type: 2 Alg-type: 0 Priority: 100

SubTLV code:1 length:4

Flex-Algo Exclude-Any Ext Admin Group: >>> FAD to exclude any link with this bit position set

0x00000040

PE4#show isis flex-algo 129

IS-IS core Flex-Algo Database

Flex-Algo 129:

Level-2:

Definition Priority: 100

Definition Source: ASR9906-2-ABR-1.00

Definition Equal to Local: No

Definition Metric Type: TE

Definition Flex-Algo Prefix Metric: No

Exclude Any Affinity Bit Positions: 6

Path taken from PE4 to PE3 when the link affinity-map is not configured on any of the links:

PE4#traceroute sr-mpls labels 16933 lsp-end-point 10.10.33.33

Type escape sequence to abort.

0 10.10.244.44 MRU 1500 [Labels: 16933/explicit-null Exp: 0/0] >>>>>>>>>>>>>>>>>>>> PE4

L 1 10.10.244.2 MRU 1500 [Labels: explicit-null/explicit-null Exp: 0/0] 5 ms >>>>>>>>ABR2

! 2 10.10.32.33 4 ms >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>PE3

Figure 5: traceroute Between PE4 to PE3 with no Affinity Map Defined

Configuration on ABR-2 of the Affinity Map

router isis core

affinity-map ALGO-129 bit-position 6 >> define the bit position and associate it with a name

router isis core

interface HundredGigE0/1/0/2 >>> link between ABR-2 to PE3

affinity flex-algo ALGO-129 >>>>> link affinity map

point-to-point

address-family ipv4 unicast

fast-reroute per-prefix

fast-reroute per-prefix ti-lfa

te-metric flex-algo 20 level 2

Verification

PE4#show isis database ASR9910-4-ABR-2.00-00  verbose internal

<snip>

TLV code:22 length:193

<snip>

SubTLV code:6 length:4

Interface IP Address: 10.10.32.2

SubTLV code:8 length:4

Neighbor IP Address: 10.10.32.33

SubTLV code:9 length:4

Physical BW: 99999998 kbits/sec, 12499999744 bytes/sec

SubTLV code:16 length:21

Application Specific Link Attributes:

L flag: 0, SA-Length: 1, UDA-Length: 1

Standard Applications: 0x10 FLEX-ALGO

User Defined Applications: 0x10

SubTLV code:14 length:4

Ext Admin Group:

0x00000040 >>>>>> link affinity flooded via IGP

SubTLV code:3 length:4

Affinity: 0x00000040

SubTLV code:18 length:3

Admin. Weight: 20

As per the FAD for Flex Algo 129 from PE4 towards PE3, it needs to exclude any link with affinity map bit position 6.

PE4#traceroute sr-mpls labels 16933 lsp-end-point 10.10.33.33

0 10.10.244.44 MRU 1500 [Labels: 16933/explicit-null Exp: 0/0]

L 1 10.10.244.2 MRU 1500 [Labels: 16933/explicit-null Exp: 0/0] 5 ms >>>>>>>>>>>>> ABR2

L 2 10.10.12.1 MRU 1500 [Labels: 16933/explicit-null Exp: 0/0] 4 ms >>>>>>>>>>>>>> ABR1

L 3 10.10.221.22 MRU 1500 [Labels: explicit-null/explicit-null Exp: 0/0] 15 ms >>> PE2

! 4 10.10.233.33 4 ms >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PE3

Figure 6: Path Taken from PE4 to PE3 after Configuring the Affinity Map

Note: Similarly, using “include any” and “include all” in the FAD of a flex algo, we can influence the path calculation from the head end towards the tail end.

Conclusion

This document describes the use of Flexible Algorithm (Flex-Algo) to logically slice an IS-IS domain into multiple network slices. Each slice can define its own path computation rules and constraints, enabling differentiated treatment of traffic streams based on SLA requirements or traffic sensitivity.

Commands

show isis flex-algo <>

show isis flex-algo 129 neighbors

show isis topology flex-algo

show isis database <> verbose detail

show isis route <>  flex-algo <> detail

show mpls forwarding labels <> detail

show isis microloop avoidance <> flex-algo <>  detail

show isis fast-reroute flex-algo <>  <prefix> detail