IS-IS Flexible Algorithm (Flex-Algo)

In the MPLS-SR lab and the follow-up on Fast Reroute and TI-LFA, every prefix-SID followed the same path: the IGP shortest path. That’s fine until the business asks for something like this:
- “Voice and trading traffic must take the lowest-latency path, not the cheapest one.”
- “Customer X may never cross the leased line we rent from a third party.”
The classic answers are RSVP-TE tunnels or SR-TE policies with explicit paths, or a PCE that computes them. Both work, but both add state, operations, and a dependency. Flexible Algorithm solves a large part of this inside the IGP itself. Each router computes extra SPF trees with different constraints, and each tree gets its own prefix-SID. The ingress router chooses a plane just by choosing a label. There are no tunnels, no head-end state, and no controller.
In this post I build a small IS-IS Flex-Algo lab in CML with three planes over the same physical topology.
What is Flex-Algo?
Normal SPF (Algorithm 0) asks one question: what’s the lowest IGP metric path?
Flex-Algo (RFC 9350) lets you define a new algorithm (number 128–255) with three components:
| Component | Options | Example |
|---|---|---|
| Metric type | IGP metric, min. unidirectional link delay, TE metric | metric-type delay |
| Calculation type | SPF | (always SPF today) |
| Constraints | include-any / include-all / exclude-any affinities, SRLG exclude | affinity exclude-any RED |
This combination is the Flex-Algo Definition (FAD). Every router that participates in algorithm 128 runs an extra SPF on the topology, after pruning links that violate the constraints, using the selected metric. It then installs a forwarding entry for every algorithm-128 prefix-SID.
The result is that 16006 (algo 0) and 16106 (algo 128) both lead to PE6’s loopback, but they follow different paths, hop by hop, with no state on the head-end.
Algorithm 1 is Strict SPF, not Flex-Algo. It’s the “don’t let any local policy override my SPF path” algorithm.
How it is encoded in IS-IS
This is the part that helps when you troubleshoot with show isis database verbose:
| What | Where in IS-IS |
|---|---|
| “I participate in algos 0, 1, 128, 129” | SR-Algorithm sub-TLV (19) inside the Router Capability TLV (242) |
| The definition itself (FAD) | FAD sub-TLV (26) inside TLV 242, sent only by routers configured with advertise-definition |
| Per-algorithm prefix-SID | Prefix-SID sub-TLV (3) with the Algorithm field set to 128/129 |
| Link delay | Min. unidirectional link delay (RFC 8570), carried in ASLA sub-TLVs (RFC 8919) with the Flex-Algo application bit |
| Link affinity | Extended Admin Group in ASLA |
FAD election: you don’t need to configure the definition everywhere. Routers pick the advertised FAD with the highest priority, then the highest system-ID as a tie-breaker. In this lab, P1 (priority 200) and P2 (priority 150) both advertise the definition, and P2 is the backup if P1 goes away. All other routers only participate.
Lab setup
Logical View: six routers in one IS-IS Level-2 domain (CORE). The link costs are chosen on purpose so that each algorithm picks a different path from PE5 to PE6:
Topology



























