Segment Routing

Flex-Algo in OcNOS: Optimizing Network Paths Using Link Delay

In Part 2, we used TE-metric to optimize paths for bandwidth capacity. Part 3 takes this further: instead of a statically configured cost, we use measured link delay — the actual microsecond latency of each link as measured by TWAMP (Two-Way Active Measurement Protocol) — as the Flex-Algo optimization metric. When a link becomes congested and delay increases, IS-IS re-advertises the new delay value, and Flex-Algo SPF automatically reroutes latency-sensitive traffic to the lower-delay path.

Link Delay vs. TE-Metric: Key Difference

Metric Source Dynamic? Best For
IGP metric Static config No Default routing
TE metric Static config No Capacity-based steering
Link delay TWAMP measurement Yes — updates dynamically Latency-sensitive apps (5G, VoIP, gaming)

How Delay-Based Flex-Algo Works

PE1 SID 101 P-N TWAMP active P-S TWAMP active PE2 SID 102 ⚠ CONGESTION EVENT delay spikes: 1ms → 15ms 1ms (normal) 4ms 2ms (normal) 3ms Normal: upper path (3ms total delay) After congestion: reroute lower (7ms)
Dynamic delay-based rerouting: when link P-N experiences congestion and delay spikes from 1ms to 15ms, TWAMP detects the change. IS-IS re-advertises the new delay value. Flex-Algo 128 recomputes SPF and reroutes latency-sensitive traffic to the southern path (7ms total) — automatically, without manual intervention.

Step 1: Configure TWAMP for Delay Measurement

! OcNOS -- TWAMP: active delay measurement between adjacent nodes
!
! On all routers: configure TWAMP server
twamp server
  port 862
  timer inactivity 900
!
! On all routers: configure TWAMP sender sessions to neighbors
twamp sender
  session PEER-R2
    destination 10.0.0.2            ! Neighbor loopback
    port 862
    dscp 46                         ! EF -- high-priority measurement packets
    interval 1000                   ! Test every 1 second
    packet-size 64                  ! Small packets for accurate delay
  !
  session PEER-R3
    destination 10.0.0.3
    port 862
    dscp 46
    interval 1000
    packet-size 64
  !
!
! Verify delay measurements are active:
show twamp session summary
! Expected: sessions in ACTIVE state with delay values in microseconds

Step 2: Advertise Measured Delay via IS-IS

! OcNOS -- Advertise link delay in IS-IS (all routers)
!
router isis CORE
  mpls traffic-eng router-id Loopback0
  mpls traffic-eng level-2
  !
  ! Enable delay advertisement on each interface
!
interface eth-0-1
  ip router isis CORE
  isis metric 10
  !
  ! Bind TWAMP-measured delay to IS-IS advertisement
  performance-measurement delay-measurement
    protocol twamp-light             ! Use TWAMP measurement
    advertise-delay                  ! Flood measured delay in IS-IS TE LSP
    delay-threshold 5000             ! Re-advertise only if change exceeds 5ms
  !
!
interface eth-0-2
  ip router isis CORE
  isis metric 10
  performance-measurement delay-measurement
    protocol twamp-light
    advertise-delay
    delay-threshold 5000
  !

Step 3: Flex-Algo 128 with Delay Metric

! OcNOS -- Flex-Algo 128: delay-optimized topology
!
router isis CORE
  flex-algo 128
    metric-type delay                ! SPF uses advertised TWAMP delay values
    advertise-definition
    priority 128
  !
  address-family ipv4 unicast
    segment-routing mpls
  exit-address-family
!
! Assign Algo 128 SID (per-router, all nodes must configure this)
interface lo
  ip address 10.0.0.1/32
  ip router isis CORE
  isis segment-routing prefix-sid index 1               ! Algo 0
  isis segment-routing prefix-sid algorithm 128 index 1001  ! Algo 128 delay

Step 4: Steer 5G/Latency-Sensitive Traffic

! OcNOS -- Route 5G fronthaul traffic via Algo 128 delay-optimized path
!
! Method 1: SR-TE policy with dynamic delay-metric computation
segment-routing
  traffic-eng
    policy 5G-FRONTHAUL
      color 128 end-point 10.0.0.5
      candidate-paths
        preference 100
          dynamic
            metric type latency      ! Use accumulated delay as path metric
          !
        !
      !
    !
  !
!
! Method 2: Classify 5G traffic and bind to SR policy using PBR
ip access-list 5G-TRAFFIC
  permit ip 172.16.100.0/24 any     ! 5G fronthaul source subnet
!
policy-map STEER-5G
  class 5G-TRAFFIC
    set sr-te color 128              ! Apply 5G-FRONTHAUL policy
!
interface eth-0-10
  service-policy input STEER-5G     ! Apply on CE-facing interface
!
! Verification:
show isis flex-algo 128 detail
show isis route 10.0.0.5 flex-algo 128
show performance-measurement delay interface eth-0-1
show twamp session detail

IP Infusion Engineering Team

Share