- π― Lab Overview
- π§ Concepts Deep Dive
- πΊοΈ Network Topology
- βοΈ SR-SIM Configuration Deep Dive
- π Quick Start
- π¬ Checking the Lab
- π Telemetry Stack
- π§ Traffic Generation & Delay Manipulation
- π References
This lab demonstrates traffic-engineered paths using SRv6 transport with FlexAlgo between two customer endpoints (Client1 β R1 β R5 β Client2) with:
| Component | Technology |
|---|---|
| Transport | Classic SRv6 (Algo 0) + FlexAlgo 128 with delay metric |
| Service | EVPN IFL (Interface-Less) for VPRN 50 |
| Delay Measurement | STAMP (Simple Two-Way Active Measurement Protocol) |
| Telemetry | gNMIc β Prometheus β Grafana |
An end-to-end SRv6 transport based on Nokia SR OS routers is spanning from Access/Aggregation using (7250 IXR Gen2/2c) to Edge/Core using (7750 SR, FP4/FP5-based):
After completing this lab, you will understand:
- β SRv6 locator and function concepts (End, End.DT46, End.X)
- β FlexAlgo configuration for delay-optimized routing
- β TWAMP-light dynamic delay measurement
- β Streaming telemetry with gNMI subscriptions
Segment Routing over IPv6 (SRv6) encodes forwarding instructions in IPv6 addresses:
SRv6 Address Structure
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββ Locator (64 bits) βββββββΊβββββ Function (16 bits) ββΊ
ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββ
β c128:0db8:0aaa:0101 β 0001 (End) β
β β 0040 (End.DT46) β
β Identifies the node β 0041 (End.X) β
ββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββ
β β
βΌ βΌ
"Route to me" "What to do here"
| Function | Purpose | Example |
|---|---|---|
| End | Continue to next segment | Node traversal |
| End.X | Exit via specific interface | Adjacency SID |
| End.DT46 | Decap and lookup in VRF | Service termination |
Flexible Algorithm (FlexAlgo) allows multiple routing topologies using different metrics:
βββββββββββββββββββββββββββββββββββββββββββββββββ
β FlexAlgo 128 (Delay Metric) β
β β
ββββββββΊ β R1 βββββββ R3 βββββββ R5 β Lowest β
β β β 5ms β 3ms β Delay β
β β β β β Path β
β β βΌ βΌ β β
β β R2 βββββββ R4 ββββββββββ β
β β 15ms 10ms β
β βββββββββββββββββββββββββββββββββββββββββββββββββ
Client1 βββββ OR
β βββββββββββββββββββββββββββββββββββββββββββββββββ
β β Algorithm 0 (IGP Metric) β
β β β
ββββββββΊ β R1 βββββββ R2 βββββββ R4 βββββββ R5 β
β 10 10 10 β
β β
β Shortest hop count path β
βββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. FLEX-ALGO DEFINITION β
β routing-options { β
β flexible-algorithm-definitions { β
β flex-algo "flexalgo-128" { β
β admin-state enable β
β metric-type delay βββ Use delay instead of IGP β
β } β
β } β
β } β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 2. ISIS PARTICIPATION β
β isis 0 { β
β flexible-algorithms { β
β flex-algo 128 { β
β participate true β
β advertise "flexalgo-128" β
β } β
β } β
β } β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 3. SRV6 LOCATOR WITH ALGORITHM β
β segment-routing { β
β segment-routing-v6 { β
β locator "loc-128" { β
β algorithm 128 βββ Bind to FlexAlgo 128 β
β prefix { β
β ip-prefix c128:db8:aaa:101::/64 β
β } β
β } β
β } β
β } β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Node | Chassis Type | Role | SRv6 Locators |
|---|---|---|---|
| R1 | 7250 IXR-e2c | PE (Provider Edge) | c000:db8:aaa:101::/64 (Algo 0)c128:db8:aaa:101::/64 (Algo 128) |
| R2 | 7250 IXR-e2 | P (Transit) | c000:db8:aaa:102::/64 (Algo 0)c128:db8:aaa:102::/64 (Algo 128) |
| R3 | 7250 IXR-R6D | P (Transit) | c000:db8:aaa:103::/64 (Algo 0)c128:db8:aaa:103::/64 (Algo 128) |
| R4 | 7750 SR-1 | P (Transit) | c000:db8:aaa:104::/64 (Algo 0)c128:db8:aaa:104::/64 (Algo 128) |
| R5 | 7750 SR-1se | PE (Provider Edge) | c000:db8:aaa:105::/64 (Algo 0)c128:db8:aaa:105::/64 (Algo 128) |
The lab uses nokia_srsim kind for SR OS simulation:
# Node Definition for Different Chassis Types
topology:
kinds:
nokia_srsim:
image: registry.srlinux.dev/pub/nokia_srsim:25.10.R2
license: /opt/nokia/sros/license-25.txt
env:
CLAB_SROS_DISABLE_COMPONENT_CONFIG: "xyz"
nodes:
# Simple chassis (IXR-e2c)
R1:
kind: nokia_srsim
type: ixr-e2c # Chassis type
mgmt-ipv4: 172.90.90.11
startup-config: configs/R1/R1.partial.cfg
# Multi-component chassis (IXR-R6D)
R3:
kind: nokia_srsim
type: ixr-r6d
components:
- slot: A # CPM slot
- slot: 1
type: cpm-ixr-r6d/iom-ixr-r6d # Line card type
env:
NOKIA_SROS_SFM: cpm-ixr-r6d/iom-ixr-r6d
NOKIA_SROS_MDA_1: m5-100g-qsfp28 # MDA typeβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SRv6 CONFIGURATION HIERARCHY β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β 1. GLOBAL SRV6 LOCATORS (segment-routing context) β β
β β β β
β β segment-routing { β β
β β segment-routing-v6 { β β
β β locator "loc-0" { βββ Algorithm 0 β β
β β admin-state enable β β
β β block-length 48 βββ Prefix portion β β
β β prefix { β β
β β ip-prefix c000:db8:aaa:101::/64 β β
β β } β β
β β } β β
β β locator "loc-128" { βββ FlexAlgo 128 β β
β β admin-state enable β β
β β block-length 48 β β
β β algorithm 128 βββ Bound to FlexAlgo β β
β β prefix { β β
β β ip-prefix c128:db8:aaa:101::/64 β β
β β } β β
β β } β β
β β } β β
β β } β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β 2. ISIS SRV6 ADVERTISEMENT β β
β β β β
β β isis 0 { β β
β β segment-routing-v6 { β β
β β admin-state enable β β
β β locator "loc-0" { β β
β β level-capability 2 βββ Advertise in L2 β β
β β } β β
β β locator "loc-128" { β β
β β level-capability 2 β β
β β } β β
β β } β β
β β } β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β 3. SRV6 FUNCTIONS FOR BASE ROUTING β β
β β β β
β β base-routing-instance { β β
β β locator "loc-0" { β β
β β function { β β
β β end 1 { βββ Node SID β β
β β srh-mode usp βββ Ultimate Segment β β
β β } Pop β β
β β end-x-auto-allocate usp βββ Adjacency SIDs β β
β β protection protected β β
β β } β β
β β } β β
β β } β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VPRN 50 - FlexAlgo 128 Service β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β β
β service { β
β vprn "50" { β
β admin-state enable β
β description "vprn_using_flex-algo_128_srv6" β
β customer "1" β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SRv6 Instance - Binds service to FlexAlgo locator β β
β β β β
β β segment-routing-v6 1 { β β
β β locator "loc-128" { βββ Uses FlexAlgo 128 β β
β β function { β β
β β end-dt46 { } βββ Decap & VRF lookup β β
β β } β β
β β } β β
β β } β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β BGP-EVPN Control Plane β β
β β β β
β β bgp-evpn { β β
β β segment-routing-v6 1 { β β
β β admin-state enable β β
β β route-distinguisher "1.1.1.1:50" β β
β β vrf-target { β β
β β community "target:100:50" β β
β β } β β
β β vrf-import { β β
β β policy ["vprn50"] βββ Applies FlexAlgo β β
β β } β β
β β srv6 { β β
β β instance 1 β β
β β default-locator "loc-128" β β
β β } β β
β β } β β
β β } β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Customer Interface β β
β β β β
β β interface "to-Client1" { β β
β β ipv4 { β β
β β primary { β β
β β address 172.17.11.1 β β
β β prefix-length 30 β β
β β } β β
β β } β β
β β sap 1/1/c3/1 { } βββ Service Access Point β β
β β } β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β } β
β } β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DYNAMIC DELAY MEASUREMENT β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Interface Delay Configuration β β
β β β β
β β interface "to-R3" { β β
β β if-attribute { β β
β β delay { β β
β β delay-selection dynamic βββ Use measured delay β β
β β dynamic { β β
β β measurement-template "standard-direct" β β
β β twamp-light { β β
β β ipv4 { β β
β β admin-state enable β β
β β } β β
β β } β β
β β } β β
β β } β β
β β } β β
β β } β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β TWAMP-Light Reflector (responds to probes) β β
β β β β
β β twamp-light { β β
β β reflector { β β
β β admin-state enable β β
β β udp-port 862 βββ Standard TWAMP port β β
β β prefix 0.0.0.0/0 { } βββ Accept from any source β β
β β } β β
β β } β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Measurement Template β β
β β β β
β β test-oam { β β
β β link-measurement { β β
β β measurement-template "standard-direct" { β β
β β admin-state enable β β
β β aggregate-sample-window { β β
β β multiplier 5 βββ 5 samples per window β β
β β window-integrity 1 β β
β β threshold { β β
β β relative 50 βββ % change threshold β β
β β absolute 50 βββ Absolute threshold β β
β β } β β
β β } β β
β β } β β
β β } β β
β β } β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FLEXALGO IMPORT POLICY β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β β
β policy-options { β
β community "vprn50" { β
β member "target:100:50" { } β
β } β
β β
β policy-statement "vprn50" { β
β entry 10 { β
β from { β
β community { β
β name "vprn50" βββ Match RT community β
β } β
β } β
β action { β
β action-type accept β
β flex-algo 128 βββ Force FlexAlgo 128 β
β } resolution for routes β
β } β
β } β
β } β
β β
β This ensures all VPRN 50 routes use the delay-optimized path! β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Requirement | Version | Notes |
|---|---|---|
| Docker | Latest | Container runtime |
| containerlab | β₯ 0.71 | Lab orchestration |
| Nokia SR-SIM image | 25.7.R1+ | SR OS simulation |
| License file | Valid | Required for SR-SIM |
Click one of the badges at the top to launch in:
- GitHub Codespaces - Zero local setup required
- DevPod - Portable dev environment
# Clone the repository
git clone https://github.com/sros-labs/srv6-flexalgo-telemetry-lab.git
cd srv6-flexalgo-telemetry-lab
# Deploy the lab
clab deploy --reconfigure
# Wait for all nodes to boot (approximately 2 minutes for SR-SIM)
watch -n 5 'docker ps --format "table {{.Names}}\t{{.Status}}"'# Check all containers are running
docker ps
# Connect to routers
ssh admin@R1 # Password: admin
ssh admin@R5 # Password: admin
# Access telemetry
open http://localhost:3000 # Grafana (admin/admin)
open http://localhost:9090 # PrometheusA:admin@R1# show router segment-routing srv6 locator
=========================================================================================
Segment Routing v6 Locators
=========================================================================================
Name Admin Operational Function Prefix
State State Count
-----------------------------------------------------------------------------------------
loc-0 Up Up 3 c000:db8:aaa:101::/64
loc-128 Up Up 3 c128:db8:aaa:101::/64
-----------------------------------------------------------------------------------------
No. of SRv6 Locators: 2
π― What to observe:
- Two locators: one for Algo 0, one for FlexAlgo 128
- Different prefix schemes (c000 vs c128)
A:admin@R1# show router isis flexible-algorithms
===============================================================================
ISIS Flexible Algorithms
===============================================================================
Flex-Algo Metric Type Advertised FAD
-------------------------------------------------------------------------------
128 delay flexalgo-128
-------------------------------------------------------------------------------
No. of Flex-Algos: 1
A:admin@R1# show router isis srv6-endpoint
===============================================================================
SRv6 Endpoints
===============================================================================
SID Endpoint Locator
-------------------------------------------------------------------------------
c000:db8:aaa:101::1 End loc-0
c000:db8:aaa:101::40 End.DT46 loc-0
c128:db8:aaa:101::1 End loc-128
c128:db8:aaa:101::40 End.DT46 loc-128
-------------------------------------------------------------------------------
No. of SRv6 Endpoints: 4
A:admin@R1# show router isis flex-algo 128 spf-log
===============================================================================
ISIS Flex-Algo 128 SPF Log
===============================================================================
When Duration Reason
-------------------------------------------------------------------------------
2024-03-04 12:30:15 2ms Link delay change
2024-03-04 12:25:10 3ms Initial calculation
-------------------------------------------------------------------------------
A:admin@R1# show service id 50 base
===============================================================================
Service Basic Information
===============================================================================
Service Id : 50
Service Type : VPRN
Customer Id : 1
Description : vprn_using_flex-algo_128_srv6
Admin State : Up
Oper State : Up
===============================================================================
SRv6 Information
===============================================================================
Locator : loc-128
Function : End.DT46
A:admin@R1# show router interface "to-R3" delay
===============================================================================
Interface Delay Information
===============================================================================
Interface : to-R3
Delay Selection : dynamic
Current Delay : 8 microseconds
Last Update : 2024-03-04 12:35:00
TWAMP-Light Status: Active
Measurement Template: standard-direct
A:admin@R1# traceroute 50.0.0.5 source 50.0.0.1
traceroute to 50.0.0.5, 30 hops max, 60 byte packets
1 192.168.13.2 (R3) 2.103 ms
2 192.168.35.2 (R5) 4.215 ms
3 50.0.0.5 5.891 ms
# Note: Path goes via R3 (lower delay) instead of R2-R4 (higher delay)
Nowadays, observability is becoming essential for every organisation. An open source GPG (gnmic/prometheus/grafana) telemetry stack is used to collect and report all the objects of interest via Telemetry/gRPC (links delay, interfaces state, metrics, cpu, mem, etc.).
gnmic is then using prometheus TSDB as output for storing the metrics which can then be fetched by Grafana for monitoring (PromQL).
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TELEMETRY DATA FLOW β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β β
β βββββββββββ β
β β β β
β β β β
β βββββββββββ gNMI Subscribe β gNMIc β β
β β R1-R5 β ββββββββββββββββββΊ β β β
β βββββββββββ β :9804 β β
β β β β
β β β β
β ββββββ¬βββββ β
β β β
β Prometheus β
β Remote Write β
β β β
β βΌ β
β βββββββββββββββ β
β β Prometheus β β
β β :9090 β β
β ββββββββ¬βββββββ β
β β β
β PromQL β
β Queries β
β β β
β βΌ β
β βββββββββββββββ β
β β Grafana β β
β β :3000 β β
β βββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# gNMIc Configuration Excerpt
subscriptions:
- /state/router[router-name=Base]/interface[interface-name=*]/statistics
- /state/router[router-name=Base]/isis[isis-instance=0]/statistics
- /state/system/cpu[sample-period=*]
- /state/system/memory-pools
- /state/test-oam/link-measurement| Dashboard | Metrics Displayed |
|---|---|
| Interface Statistics | Throughput, errors, discards per interface |
| Link Delay | TWAMP-measured delay per link |
| BGP Overview | Peers, routes, states |
| System Resources | CPU, memory utilization |
| Flow Visualization | Traffic flow through the network |
Using Grafana dashboard, it is possible to get direct correlation between the sum of TWAMP delay measurement on individual links and the IPv6 route table as shown below:
# Grafana UI
http://localhost:3000
# Credentials: admin/admin
# Prometheus UI
http://localhost:9090
# gNMIc metrics endpoint
http://localhost:9804/metrics# Generate 2Mbps UDP traffic from Client1 to Client2
./start_traffic.sh
# Or manually from Client1
docker exec -it client1 iperf3 -c 172.17.44.2 -u -b 2M -t 3600./stop_traffic.sh
# Or manually
docker exec -it client1 pkill iperf3# Add 100ms delay to R1-R2 link (makes R1-R3 path preferred)
containerlab tools netem set -n R1 -i eth1 --delay 100ms
# Add delay to R1-R3 link (may shift traffic to R2)
containerlab tools netem set -n R1 -i eth2 --delay 200ms
# Remove delay
containerlab tools netem set -n R1 -i eth1 --delay 0ms- Before: Check the path in Grafana Flow dashboard
- Add delay:
containerlab tools netem set -n R1 -i eth2 --delay 100ms - Wait: 30-60 seconds for TWAMP to measure new delay
- Observe: FlexAlgo recalculates and traffic shifts!
- Verify: Check ISIS SPF log and path trace
# Destroy the lab and remove all resources
clab destroy --cleanupThis lab is provided for educational purposes. Nokia SR OS requires a valid license.


