Segment Routing

Flex-Algo in OcNOS: Optimizing Network Paths Using TE-Metric

Part of IP Infusion's guide to Segment Routing.

In Part 1, we covered Flex-Algo fundamentals and how multiple algorithms coexist in a single IS-IS domain. This article focuses specifically on the TE-metric optimization type, the most common Flex-Algo deployment for separating high-bandwidth bulk traffic from latency-sensitive services.

What is TE-Metric and Why Does it Matter?

Every IS-IS link has two metrics: the IGP metric (used by standard SPF) and the TE metric (used by Traffic Engineering extensions, RFC 3630/5305). These are configured independently, allowing operators to define a completely separate cost structure for TE-based path computation.

A typical deployment assigns:

  • IGP metric based on distance or administrative preference (for default routing)
  • TE metric based on available bandwidth or congestion cost (for capacity-optimized routing)

When a Flex-Algorithm uses metric-type te-metric, IS-IS runs a separate SPF using TE metrics as link costs. Links with a low TE metric (high available capacity) become preferred, even when their IGP metric is higher. This lets bulk transfer jobs and video streaming traffic follow high-bandwidth paths, while VoIP and 5G control-plane traffic continues on the default IGP shortest path. In the lab shown below, two TE-metric Flex-Algorithms, 130 and 131, are defined side by side, giving two independent TE-metric planes over the same physical topology.

TE-Metric Topology: The 7-Node Lab

The lab is a 7-node IS-IS domain, R1 through R7, running the OcNOS instance OCNOS as a single level-2 area. Every core link carries a per-interface TE metric that is applied only to the IPv4 Flex-Algo topology through isis te-metric flex-algo ipv4 <value>, leaving the plain IGP metric at its default. Because the TE metrics differ from the IGP metrics, the TE-metric SPF for Algorithm 130 and Algorithm 131 can select paths that diverge from the default IGP shortest path across the mesh.

Traffic is placed onto a given algorithm by its per-algorithm prefix-SID, advertised on each router's loopback (for example prefix-sid algorithm-num 130 index 1804 and prefix-sid algorithm-num 131 absolute 17904). Steering therefore relies on the prefix-SID for the chosen algorithm; no separate SR-TE policy is required. R7 raises its Flex-Algo priority to 101 so that it wins the definition election for both algorithms.

OcNOS 7 router IS-IS mesh: solid navy Algo 0 IGP shortest path vs dashed Flex-Algo 130 te-metric path, both from R1 to R6, with SR-MPLS prefix-SIDs.
In this seven router SR-MPLS IS-IS lab, Algorithm 0 forwards R1 to R6 along the IGP shortest path (R1, R2, R3, R6; total IGP metric 25, solid navy). A Flex-Algorithm 130 defined with metric-type te-metric computes its own constrained path across a different set of links (R1, R2, R7, R6; dashed), letting you steer traffic on a TE metric while Algorithm 0 keeps using the plain IGP cost.

Configuration: Flex-Algo with TE-Metric

! OcNOS running-config from R4, a PE router that runs both TE-metric Flex-Algos (130 and 131).
!
! Loopback: default Algo 0 prefix-SID plus a per-algorithm prefix-SID for each Flex-Algo.
R4#show running-config interface loopback1
!
interface loopback1
 ip address 10.10.100.4/32
 prefix-sid index 104
 prefix-sid algorithm-num 130 index 1804
 prefix-sid algorithm-num 131 absolute 17904
 ip router isis OCNOS
!
!
! Core interface: per-link TE metric applied to the IPv4 Flex-Algo topology.
! The plain IGP metric is left at its default; only the te-metric is set here.
R4#show running-config interface cd0
!
interface cd0
 description To-R2-cdo
 load-interval 30
 ip address 10.66.24.4/24
 mtu 9216
 label-switching
 isis network point-to-point
 isis circuit-type level-2-only
 ip router isis OCNOS
 no isis hello padding
 isis te-metric flex-algo ipv4 20
!
!
! Router IS-IS: Flex-Algo 130 and 131 defined, both using metric-type te-metric.
! segment-routing mpls and metric-style wide are configured under router isis.
R4#show running-config router isis
!
router isis OCNOS
 is-type level-2-only
 capability flex-algo routing
 flex-algo 130
  metric-type te-metric
  ti-lfa
 exit-flex-algo
 !
 flex-algo 131
  metric-type te-metric
  ti-lfa
 exit-flex-algo
 !
 metric-style wide
 mpls traffic-eng router-id 10.10.100.4
 mpls traffic-eng level-2
 capability cspf
 dynamic-hostname
 fast-reroute ti-lfa level-2 proto ipv4
 bfd all-interfaces
 net 49.0001.0000.0000.0004.00
 segment-routing mpls
!
!
! On a router intended to win the Flex-Algo election, priority is raised above the
! default of 5. Excerpt transcribed from R7 (default is 5; R7 uses 101).
R7#show running-config router isis
!
router isis OCNOS
 flex-algo 130
  metric-type te-metric
  priority 101
  ti-lfa
 exit-flex-algo
 !
 flex-algo 131
  metric-type te-metric
  priority 101
  ti-lfa
 exit-flex-algo
!

Validation: Verifying Algo 130/131 Path Computation

! OcNOS verification commands for the TE-metric Flex-Algos (130 and 131).
! Traffic is steered onto each algorithm by its per-algorithm prefix-SIDs; the
! commands below confirm topology, routes, SR state, forwarding, and data plane.
!
! IS-IS adjacencies
show clns neighbors
!
! Per-algorithm topology (the Metric column reflects the te-metric)
show isis topology algorithm 130
show isis topology algorithm 131
!
! Per-algorithm IS-IS routes
show ip isis route algorithm 131
!
! Segment Routing state and SRGB
show isis segment-routing state
show isis segment-routing capability
!
! Flex-Algo user configuration and election status
show isis flex-algo all status usercfg summary
show isis flex-algo all status usercfg detail
show isis flex-algo all status election summary
!
! IS-IS link-state database
show isis database
!
! MPLS forwarding (FTN) and incoming-label (ILM) tables, per algorithm
show mpls forwarding-table
show mpls forwarding-table algorithm 130
show mpls ilm-table
show mpls ilm-table algorithm 130
!
! TI-LFA backup coverage, per algorithm
show ip isis route tilfa algorithm 131
show isis tilfa pq algorithm 131
!
! Data-plane validation (per-algorithm MPLS ping and trace)
ping mpls isis-sr ipv4 10.10.100.5/32 detail
ping mpls isis-sr ipv4 10.10.100.5/32 algorithm 130 detail
ping mpls isis-sr ipv4 10.10.100.5/32 algorithm 131 detail
trace mpls isis-sr ipv4 10.10.100.5/32 detail

IP Infusion Engineering Team

Compartir