In the previous lab, we migrated an MPLS backbone from LDP to Segment Routing (SR-MPLS), eliminating per-LSP state overhead and LDP-IGP synchronization issues. Now we turn to Segment Routing Traffic Engineering (SR-TE)—specifically using BGP Auto-Steering with Color extended communities to steer internal traffic across constrained paths effortlessly.
Why SR-TE? Overcoming Legacy RSVP-TE Scaling Limits
Cisco Fellow Clarence Filsfils invented Segment Routing (SR) in 2013. Because SR is a source-routing architecture where path state exists only at the network edge, it scales to massive traffic-engineering deployments while integrating natively with SDN for application-driven networking.
By contrast, RSVP-TE models IP traffic like circuit-switched paths, requiring every hop’s interface address or label along the path to be signaled and maintained in soft state, rather than encoding paths concisely with a handful of Prefix-SIDs.
RSVP-TE demands a full mesh of k×N² always-on tunnels across N nodes and k ECMP paths—creating severe scalability bottlenecks compounded by soft-state refresh overhead, to the point where many operators eventually tore down their RSVP-TE tunnels.
Adapted from New Generation Segment Routing Traffic Engineering — SR Policy, Cisco Reference PDF (ZH)
Key Limitations of Legacy RSVP-TE
- Heavy control-plane state: Every transit router must maintain synchronized TEDB and per-tunnel soft-state reservations.
- k×N² full-mesh explosion: Always-on tunnels scale quadratically with network size.
- Weak inter-domain & ECMP support: Requires manual parallel tunnel interfaces to achieve ECMP load balancing.
- Coarse traffic steering: Relies on AutoRoute or PBR with limited granularity and forwarding overhead.
Advantages of SR-TE Policies
- Compact segment encoding: A few Prefix-SIDs (plus selective Adj-SIDs) express any explicit path.
- Stateless transit core: Path state lives exclusively on the headend router.
- Native ECMP: Automatically load-balances across equal-cost segments using standard IP/IGP ECMP.
- Color-based BGP Auto-Steering: Seamlessly steers IPv4 or VPNv4 prefixes without PBR or static routes.
SR-TE Policy Building Blocks
An SR Policy is globally identified by the tuple (Headend, Color, Endpoint)—or (Color, Endpoint) from the perspective of a given headend. Candidate paths can be computed dynamically using constraints such as metric type (IGP, TE, or Latency), link affinity (admin-groups), disjointness, and Maximum SID Depth (MSD). In this lab, we combine TE Metrics and Link Affinities.
Lab Topology & Traffic-Steering Requirements
All interface IGP metrics, TE metrics, and affinities are preconfigured as shown above, with an iBGP IPv4 session active between headend R1 (10.0.0.1) and tailend R8 (10.0.0.8). From Client-A toward Client-B, traffic must follow three distinct policies:
100.64.1.0/24→ StrictBLUEaffinity path (Color 10, BSID15555); do not fall back outside BLUE while the policy is valid.100.64.2.0/24→ TE-optimal path includingORANGEaffinity (Color 20, BSID15556).100.64.3.0/24→ Follow native IGP shortest path without SR-TE steering.
Unidirectional Scope: SR-TE policies steer traffic solely in the headend-to-endpoint direction (R1 → R8). Symmetric return steering requires matching SR Policies on R8.
Step 1: Link Affinities, IGP Link-State Distribution & SR Policies
First, tag link affinities under segment-routing traffic-eng and enable distribute link-state inside IS-IS so the SR TEDB receives TE topology attributes:
// Assign link affinities (colors) on each router according to your naming scheme
// Apply matching affinity configuration on every relevant router interface.
segment-routing
traffic-eng
interface GigabitEthernet0/0/0/1
affinity
name BLUE
!
affinity-map
name BLUE bit-position 0
// Mandatory: distribute IGP link-state into the SR TEDB before computing TE paths
// Enable link-state distribution inside whichever IGP process you run.
RP/0/RP0/CPU0:R1#show run router isis
router isis 1
{..snip..}
distribute link-state
Next, configure SR Policies blue (color 10, include-all BLUE) and orange (color 20, include-any ORANGE) on headend R1 with explicit Binding-SIDs from the SRLB:
// Configure SR-TE Policies on headend R1
segment-routing
traffic-eng
policy blue // Define SR Policy named 'blue'
binding-sid mpls 15555 // Static Binding-SID from SRLB; keep BSIDs consistent across policies
color 10 end-point ipv4 10.0.0.8 // Color 10 & tailend endpoint 10.0.0.8
candidate-paths
preference 100 // Candidate path preference (highest wins)
dynamic
metric
type te // Dynamic path computation optimizing on TE metric
!
!
constraints // Path constraints
affinity // Link affinity constraint
include-all // Every traversed link must carry affinity BLUE
name BLUE
!
!
policy orange // Define SR Policy named 'orange' with include-any ORANGE
binding-sid mpls 15556
color 20 end-point ipv4 10.0.0.8
candidate-paths
preference 100
dynamic
metric
type te
!
!
constraints
affinity
include-any
name ORANGE
!
!
Step 2: Inspect Computed SID-Lists & Why Adj-SIDs Appear
Verify both SR-TE policies on R1 and examine the dynamically computed segment lists:
Policy BLUE:
RP/0/RP0/CPU0:R1#show segment-routing traffic-eng policy name srte_c_10_ep_10.$
Sun Jun 13 12:13:15.812 UTC
SR-TE policy database
---------------------
Color: 10, End-point: 10.0.0.8
Name: srte_c_10_ep_10.0.0.8
Status:
Admin: up Operational: up for 21:40:04 (since Jun 12 14:33:11.720)
Candidate-paths:
Preference: 100 (configuration) (active)
Name: blue
Requested BSID: 15555
Constraints:
Protection Type: protected-preferred
Affinity:
include-all:
BLUE
Maximum SID Depth: 10
Dynamic (valid)
Metric Type: TE, Path Accumulated Metric: 23
16002 [Prefix-SID, 10.0.0.2]
16003 [Prefix-SID, 10.0.0.3]
15003 [Adjacency-SID, 10.10.34.3 - 10.10.34.4]
16008 [Prefix-SID, 10.0.0.8]
Attributes:
Binding SID: 15555 (SRLB)
{..snip..}
Policy ORANGE:
RP/0/RP0/CPU0:R1#show segment-routing traffic-eng policy name srte_c_20_ep_10.$
Sun Jun 13 12:13:20.586 UTC
SR-TE policy database
---------------------
Color: 20, End-point: 10.0.0.8
Name: srte_c_20_ep_10.0.0.8
Status:
Admin: up Operational: up for 21:23:54 (since Jun 12 14:49:26.513)
Candidate-paths:
Preference: 100 (configuration) (active)
Name: orange
Requested BSID: 15556
Protection Type: protected-preferred
Maximum SID Depth: 10
Dynamic (valid)
Metric Type: TE, Path Accumulated Metric: 20
16002 [Prefix-SID, 10.0.0.2]
16003 [Prefix-SID, 10.0.0.3]
15001 [Adjacency-SID, 10.10.38.3 - 10.10.38.8]
Attributes:
Binding SID: 15556 (SRLB)
{..snip..}
Policy BLUE computes R1 → R2 → R3 → R4 → R8 (accumulated TE metric 23), while Policy ORANGE computes R1 → R2 → R3 → R8 (TE metric 20).
Why Did SR-TE Inject Adjacency-SIDs (15003 and 15001)?
Understanding how IOS-XR translates a TE-computed path into a minimal SID-list explains why Adj-SIDs appear automatically. First, SR-TE finds the optimal path using TE Metric + Affinity constraints; second, it encodes that path using IGP Cost:
- From
R1, pushing16003directly would allow ECMP across the bottom path (R1→R5→R6→R7→R3has IGP cost40, equal toR1→R2→R3 = 20+20 = 40), violatingBLUEaffinity—soR1first pushesPrefix-SID 16002(R2) and then16003(R3). - At
R3, the direct linkR3→R4has an IGP cost of50, whereas looping viaR3→R7→R8→R4has an IGP cost of10 + 10 + 20 = 40. A Prefix-SID for R4 or R8 would detour off the BLUE path, so SR-TE inserts explicitAdjacency-SID 15003(10.10.34.3 → 10.10.34.4). - From
R4toR8, the direct IGP cost (20) is strictly optimal, so finalPrefix-SID 16008completes the stack.
Policy ORANGE follows the exact same logic: because direct R3→R8 IGP cost is 50 versus 20 via R3→R7→R8, SR-TE ends the stack with Adjacency-SID 15001 (10.10.38.3 → 10.10.38.8).
Step 3: BGP Color Extended Communities & Auto-Steering
Now configure opaque Color extended communities (10 and 20) on R1 and attach an inbound RPL policy (import-from-GRT) on the iBGP session from 10.0.0.8. By default, a BGP route steers automatically into an SR Policy whenever its BGP Next-Hop + Color match the policy’s Endpoint + Color:
extcommunity-set opaque ORANGE
20
end-set
!
extcommunity-set opaque BLUE
10
end-set
// Define opaque Color extended communities matching each SR Policy color
route-policy import-from-GRT
if destination in (100.64.1.0/24) then
set extcommunity color BLUE additive // Tag 100.64.1.0/24 with Color 10 (BLUE)
pass
else
if destination in (100.64.2.0/24) then
set extcommunity color ORANGE additive // Tag 100.64.2.0/24 with Color 20 (ORANGE)
pass
else
pass // Leave all other prefixes uncolored to follow IGP
endif
endif
end-policy
router bgp 65000
{..snip..}
!
neighbor 10.0.0.8
{..snip..}
address-family ipv4 unicast
route-policy import-from-GRT in // Apply inbound route coloring on routes learned from 10.0.0.8
Inspect the BGP table and CEF forwarding entries on R1 to confirm recursive resolution onto BSIDs 15555 and 15556:
RP/0/RP0/CPU0:R1#show bgp
{..snip..}
Network Next Hop Metric LocPrf Weight Path
*> 100.64.0.0/24 0.0.0.0 0 32768 i
*>i100.64.1.0/24 10.0.0.8 C:10 0 100 0 i // Colored with C:10 (BLUE)
*>i100.64.2.0/24 10.0.0.8 C:20 0 100 0 i // Colored with C:20 (ORANGE)
*>i100.64.3.0/24 10.0.0.8 0 100 0 i
Processed 4 prefixes, 4 paths
RP/0/RP0/CPU0:R1#show cef 100.64.1.0/24
Sun Jun 13 12:46:44.518 UTC
100.64.1.0/24, version 449, internal 0x5000001 0x40 (ptr 0xd7adf38) [1], 0x0 (0xe339f48), 0x0 (0x0)
Updated Jun 12 14:57:39.356
Prefix Len 24, traffic index 0, precedence n/a, priority 4
via local-label 15555, 3 dependencies, recursive [flags 0x6000]
path-idx 0 NHID 0x0 [0xd8f44c8 0x0]
recursion-via-label
next hop via 15555/1/21
next hop srte_c_10_ep labels imposed {ImplNull} // Resolves via BSID 15555 into SR Policy BLUE
RP/0/RP0/CPU0:R1#show cef 100.64.2.0/24
Sun Jun 13 12:46:46.637 UTC
100.64.2.0/24, version 451, internal 0x5000001 0x40 (ptr 0xd7ad698) [1], 0x0 (0xe33a458), 0x0 (0x0)
Updated Jun 12 14:57:39.356
Prefix Len 24, traffic index 0, precedence n/a, priority 4
via local-label 15556, 3 dependencies, recursive [flags 0x6000]
path-idx 0 NHID 0x0 [0xd8f3960 0x0]
recursion-via-label
next hop via 15556/1/21
next hop srte_c_20_ep labels imposed {ImplNull} // Resolves via BSID 15556 into SR Policy ORANGE
Step 4: End-to-End Verification from Client-A
Run mtr from Client-A toward each of the three prefixes behind Client-B to confirm real data-plane steering:
root@Client-A:~# mtr 100.64.1.2 -n --report Start: 2021-06-13T12:57:48+0000 HOST: Client-A Loss% Snt Last Avg Best Wrst StDev 1.|-- 100.64.0.1 0.0% 10 3.4 3.3 2.1 6.3 1.2 2.|-- 10.10.12.2 0.0% 10 10.5 11.4 6.3 16.3 3.4 3.|-- 10.10.23.3 0.0% 10 6.8 6.1 3.3 8.8 1.8 4.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0 5.|-- 10.10.48.8 0.0% 10 9.3 11.6 5.9 20.7 5.1 6.|-- 100.64.1.2 0.0% 10 11.9 7.2 3.3 12.5 3.2 // Policy BLUE verified path: R1 -> R2 -> R3 -> R4 -> R8 root@Client-A:~# mtr 100.64.2.2 -n --report Start: 2021-06-13T12:59:58+0000 HOST: Client-A Loss% Snt Last Avg Best Wrst StDev 1.|-- 100.64.0.1 0.0% 10 4.2 7.0 2.3 19.4 6.1 2.|-- 10.10.12.2 0.0% 10 5.4 8.2 5.2 13.4 3.3 3.|-- 10.10.23.3 0.0% 10 7.0 4.0 2.8 7.0 1.1 4.|-- 10.10.38.8 0.0% 10 3.7 9.1 3.6 17.4 4.4 5.|-- 100.64.2.2 0.0% 10 3.3 6.4 3.3 9.6 2.1 // Policy ORANGE verified path: R1 -> R2 -> R3 -> R8 root@Client-A:~# mtr 100.64.3.2 -n --report Start: 2021-06-13T13:00:18+0000 HOST: Client-A Loss% Snt Last Avg Best Wrst StDev 1.|-- 100.64.0.1 0.0% 10 2.9 4.7 2.1 9.6 2.6 2.|-- 10.10.15.5 0.0% 10 8.1 7.1 2.9 10.9 2.6 3.|-- 10.10.56.6 0.0% 10 3.1 4.8 3.1 7.7 1.8 4.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0 5.|-- 10.10.78.8 0.0% 10 3.9 6.6 3.7 10.1 1.9 6.|-- 100.64.3.2 0.0% 10 3.4 5.4 3.4 12.8 2.9 // Uncolored Follow-IGP path: R1 -> R5 -> R6 -> R7 -> R8
Every prefix follows its exact intended path: 100.64.1.2 traverses R1→R2→R3→R4→R8 (BLUE), 100.64.2.2 traverses R1→R2→R3→R8 (ORANGE), and 100.64.3.2 follows the bottom IGP shortest path R1→R5→R6→R7→R8. Next in this series, we tackle on-demand SR-TE policies (DTM) and real-world caveats on Juniper Junos.