Skip to content

Flex-Algorithm

IGP Flexible Algorithm (Flex-Algo) allows operators to define custom path computation algorithms within the IGP (IS-IS or OSPFv3). Combined with SRv6, it enables network slicing — multiple logical topologies over a single physical infrastructure.

The Problem

Traditional IGP computes a single shortest path based on link metric. But modern networks need different paths for different services:

  • Voice/Video: Lowest latency path
  • Bulk data: Highest bandwidth path
  • Critical services: Path avoiding certain nodes/links
  • Redundancy: Disjoint paths for protection

The Solution

Flex-Algo lets you define multiple algorithms (algo 128-255), each with its own:

  • Metric type (IGP metric, latency, TE metric)
  • Constraints (include/exclude affinities, SRLGs)
  • Calculation type (SPF, strict SPF)

Each algorithm produces its own set of SRv6 SIDs, creating independent forwarding planes.

How It Works

  • PE1 → P1 (10ms, BW:100G)
  • PE1 → P2 (2ms, BW:10G)
  • P1 → PE2 (5ms, BW:100G)
  • P2 → PE2 (3ms, BW:10G)
Algorithm Metric Best Path PE1→PE2 Use Case
Algo 0 IGP metric (default) PE1→P2→PE2 Default routing
Algo 128 Latency PE1→P2→PE2 (5ms) Low-latency services
Algo 129 TE metric (operator-set, often derived from bandwidth) PE1→P1→PE2 (100G) High-bandwidth services

Per-Algorithm SRv6 Locators

Each Flex-Algo gets its own SRv6 locator, which means its own set of SIDs:

Node PE2 advertises:
  Algo 0:   fcbb:bb01:0002::/48  → Default IGP path
  Algo 128: fcbb:bb02:0002::/48  → Latency-optimized path
  Algo 129: fcbb:bb03:0002::/48  → TE-metric path (bandwidth-derived TE metric)

To steer traffic on the low-latency path, simply use the Algo 128 SID as the destination. The IGP handles path computation automatically.

Network Slicing with Flex-Algo

Flex-Algo is the foundation of SRv6 network slicing for 5G and enterprise services:

  • Router 1 → Router 2
  • Router 2 → Router 3
  • R1 → R2
  • R2 → R3
  • R1 → R2
  • R2 → R3

Configuration

!! Define Flex-Algo 128 (low latency)
router isis CORE
 flex-algo 128
  metric-type delay
  advertise-definition
 !
 address-family ipv6 unicast
  segment-routing srv6
   locator LATENCY algo 128
  !
 !
!

!! Define SRv6 locator for Algo 128
segment-routing
 srv6
  locators
   locator LATENCY
    micro-segment behavior unode psp-usd
    prefix fcbb:bb02::/48
    algorithm 128
   !
  !
 !
!
set routing-options flex-algorithm 128 definition metric-type delay-metric
set protocols isis source-packet-routing flex-algorithm 128
set routing-options source-packet-routing srv6 locator latency fcbb:bb02::/48
set protocols isis source-packet-routing srv6 locator latency algorithm 128

This snippet is illustrative. In Junos the Flex-Algo definition sits under routing-options flex-algorithm, IS-IS participation under protocols isis source-packet-routing flex-algorithm, and the locator is mapped to an algorithm with the algorithm option at the [edit protocols isis source-packet-routing srv6 locator] level. Check the exact statements for your release in Juniper's Flexible Algorithms in IGP for Segment Routing and SRv6 Network Programming in IS-IS guides.

Flex-Algo Properties

Property Options Description
Algorithm ID 128-255 User-defined algorithm number
Metric Type IGP, delay, TE Which metric to optimize
Calculation Type SPF, Strict SPF How to compute the path
Include-any Admin groups Links MUST have at least one of these affinities
Include-all Admin groups Links MUST have ALL of these affinities
Exclude-any Admin groups Links MUST NOT have any of these affinities
Exclude SRLG SRLG values Avoid links sharing a risk group

Verification

show isis flex-algo 128
show segment-routing srv6 locator LATENCY
show isis route ipv6 fcbb:bb02:0002::/48 detail
show isis flex-algorithm 128
show spring-traffic-engineering srv6-sid

Production validated

According to a joint announcement by Cisco and SoftBank, SRv6 Flex-Algo was deployed on a commercial 5G network in April 2022.

Further Reading

References

  1. RFC 9350 - IGP Flexible Algorithm - Defines Flex-Algo extensions for IS-IS, OSPFv2, and OSPFv3 enabling custom path computation with constraint-based metrics
  2. Cisco Marks World's First SRv6 Flex-Algo Deployment on SoftBank's 5G Network - Cisco blog announcing the first commercial SRv6 Flex-Algo deployment for 5G network slicing
  3. Cisco IOS-XR: Enabling Segment Routing Flexible Algorithm - Cisco IOS-XR configuration guide for Flex-Algo on NCS 5500 routers
  4. Cisco CVD: Quantum-Safe SRv6 Fabric for Mission-Critical Networks - Validated Flex-Algo 128/129 slicing design (secure + low-latency) with dedicated locator blocks per algorithm on IOS-XE