详解 Segment Routing:为何 SR-MPLS 正在取代 LDP 和 RSVP-TE

Segment Routing (SR) has become the dominant MPLS evolution path for service providers. It eliminates the operational complexity of LDP and RSVP-TE, enables deterministic traffic engineering without per-flow state, and integrates natively with modern automation tools. This article explains how it works, why it matters, and how to configure it in OcNOS.

Why Segment Routing?

Traditional MPLS networks rely on two signaling protocols to distribute labels and engineer traffic paths:

  • LDP (Label Distribution Protocol): distributes labels for destination-based forwarding, but creates tight coupling between IGP and label state, causing synchronization issues during convergence
  • RSVP-TE (Resource Reservation Protocol for Traffic Engineering): enables explicit path control but requires per-flow signaling state on every transit router in the path, creating significant scalability and operational challenges

Segment Routing addresses both problems simultaneously. Labels (called "segments") are distributed by the IGP itself, with no separate signaling protocol required. Traffic engineering is achieved by inserting an ordered list of segments at the ingress router, with no per-flow state on transit nodes.

How Segment Routing Works

In an SR network, each router assigns a globally unique numeric identifier called a Node SID (Segment Identifier) to its loopback address. These SIDs are flooded through the IS-IS or OSPF topology, giving every router a complete map of the network's segment structure.

When a packet enters the network, the ingress router (PE) encodes a "segment stack" (an ordered list of SIDs representing the desired forwarding path) into the packet header. In SR-MPLS, this stack is implemented as a standard MPLS label stack. Transit routers swap labels and forward based on the top segment, requiring no knowledge of the end-to-end path.

Segment Routing MPLS explained on OcNOS: node SID versus adjacency SID across PE and P routers with an ingress segment label stack
Segment Routing over MPLS: PE1 imposes a segment label stack that steers the packet through the P core to PE2. Node SIDs (101 to 105) identify each router globally, while adjacency SIDs (9001, 9002) pin the path to a specific PE1 link. The ingress stack at PE1 lists node SID labels 16102 (P1), 16104 (P3) and 16105 (PE2).

Types of Segments

Prefix Segments (Node SIDs)

A Prefix Segment represents a destination prefix (typically a router's loopback address) and instructs the network to forward toward that destination using the IGP shortest path. Node SIDs are globally unique within the SR domain and are allocated from the Segment Routing Global Block (SRGB).

Adjacency Segments (Adj SIDs)

An Adjacency Segment represents a specific link between two routers. Using an Adj SID in the segment stack forces the packet to traverse that exact link, regardless of the IGP shortest path. Adj SIDs are locally significant (only meaningful to the router that originates them) and enable precise, link-level traffic steering.

Segment Routing Global Block (SRGB)

The SRGB is the range of MPLS labels reserved for SR-assigned Node SIDs. All routers in an SR domain typically share the same SRGB range, so a Node SID of "index 5" always maps to the same MPLS label value (SRGB base + 5) on every router, which greatly simplifies operations and troubleshooting.

In OcNOS, Segment Routing for the MPLS data plane is enabled under the IGP. You can keep the default SRGB or override it under IS-IS:

! OcNOS: use the default SRGB [16000-23999].
! No block configuration is required. Enable Segment Routing (MPLS) under IS-IS:
!
configure terminal
router isis CORE
  segment-routing mpls
  commit
  exit
!
! Verify:
show isis segment-routing state
show isis database detail

! OcNOS: override the SRGB under IS-IS.
! The SRGB is configured under router isis; the isis prefix is required.
!
configure terminal
router isis CORE
  segment-routing mpls
  isis segment-routing global block 30000 33999
  commit
  exit
!
! Verify:
show isis database detail

Assigning Node SIDs in OcNOS

! OcNOS: assign a Node SID to the router loopback
!
configure terminal
interface lo
  ip address 10.0.0.1/32
  ip router isis CORE
  prefix-sid index 1
  commit
  exit
! Label value = SRGB base + index
! With the default SRGB base 16000: label = 16001
!
! Flex-Algo: multiple prefix SIDs per loopback, one per algorithm
configure terminal
interface lo
  prefix-sid index 1                       ! Default SPF (algorithm 0)
  prefix-sid algorithm-num 128 index 1001  ! Delay algorithm
  prefix-sid algorithm-num 129 index 2001  ! TE-metric algorithm
  commit
  exit
!
! Verify SID assignment and distribution:
show isis segment-routing state
show mpls forwarding-table

Key Benefits of SR over LDP and RSVP-TE

能力 LDP RSVP-TE SR-MPLS
Signaling protocol Separate (LDP) Separate (RSVP) None (IGP distributes SIDs)
Transit router state Per-destination Per-flow (RSVP state) None (stateless transit)
Traffic engineering Not supported Complex RSVP tunnels Simple segment stacks at ingress
Fast reroute LFA only FRR with complex setup TI-LFA (topology-independent)
Network slicing Not supported Limited Flex-Algo (native)
SDN integration Limited Limited Native PCE and gNMI support

SR-MPLS vs SRv6: Choosing a Data Plane

Segment Routing is defined independently of any single forwarding technology. The SR architecture (RFC 8402) can be instantiated over two different data planes, and the segments (Node SIDs, Adjacency SIDs, and the segment stack) work the same way conceptually in both.

  • SR-MPLS encodes segments as standard MPLS 标签, and the segment stack is an ordinary MPLS label stack. It reuses the existing MPLS forwarding plane, so it runs on the hardware most service-provider networks already operate. Everything covered above in this article is SR-MPLS.
  • SRv6 encodes segments as 128-bit IPv6 addresses. The segment list is carried in a Segment Routing Header (SRH), an IPv6 routing extension header defined in RFC 8754. Because each SID is a routable IPv6 address that also encodes an instruction (a function), SRv6 enables network programming (RFC 8986), where behaviors such as VPN, traffic engineering, and service chaining are expressed directly in the SID itself, with no separate MPLS label plane.

SRv6 SID lists can be long, which adds packet header overhead. uSID (micro-SID) addresses this by packing several short micro-instructions into a single 128-bit IPv6 address, compressing the SID list and reducing header size while staying within standard IPv6 forwarding.

Characteristic SR-MPLS SRv6
Data plane MPLS Native IPv6
Segment encoding MPLS label 128-bit IPv6 address
Path carried in MPLS label stack Segment Routing Header (SRH)
Hardware requirement Reuses existing MPLS forwarding plane Requires IPv6 data plane with SRv6 (and, for compression, uSID) support
Network programming Not native (labels are opaque) Native (each SID encodes a function, RFC 8986)
Header overhead 4 bytes per label Larger SRH; reduced by uSID compression
Typical use Existing MPLS/service-provider cores evolving off LDP and RSVP-TE IPv6-first and greenfield fabrics wanting end-to-end programmability and VPNs without MPLS

Both data planes share the same IGP control plane (IS-IS or OSPF) and the same traffic-engineering model. OcNOS supports SR-MPLS and SRv6, including uSID; see the Segment Routing technology overview 了解详情。

TI-LFA: Sub-50ms Fast Reroute

Topology-Independent Loop-Free Alternate (TI-LFA) is Segment Routing's fast-reroute mechanism. It pre-computes a backup path for every protected destination before any failure occurs, so when a link, node, or shared-risk link group (SRLG) fails, traffic is switched to the precomputed path in under 50 milliseconds.

What makes TI-LFA distinct is how the backup is expressed: the router encodes the repair path as a Segment Routing segment stack that steers traffic explicitly to the post-convergence path, the exact path the network will settle on once the IGP reconverges. This delivers 100% coverage in any topology for link, node, and SRLG protection, without the micro-loops or partial coverage that limit classic Loop-Free Alternate (LFA). Because the repair is just another segment stack, no additional signaling or tunnel state is required.

For an IS-IS SR configuration walkthrough with TI-LFA in OcNOS, see IS-IS SR with TI-LFA in OcNOS.

Flexible Algorithm (Flex-Algo): Intent-Based Path Selection

Flexible Algorithm (Flex-Algo) lets operators define custom IGP topologies that compute shortest paths against a chosen optimization metric rather than the single default IGP cost. Instead of every path following the same SPF result, you can define one algorithm that minimizes link delay, another that optimizes a dedicated TE metric, and another that uses standard IGP cost, each producing its own set of paths across the same physical network.

Each Flex-Algo is identified by an algorithm ID in the range 128 to 255 and advertises its own prefix SIDs, so a single loopback can carry a different SID per algorithm (as shown in the Node SID configuration above). This enables network slicing (multiple intent-based logical topologies over one infrastructure) using only the IGP, with no external controller required.

Deep-dive guides for OcNOS:

Segment Routing: Related Guides

Fundamentals & migration

IS-IS SR & fast reroute

Flexible Algorithm(Flex-Algo)

EVPN over Segment Routing

OcNOS product & platforms


Suraj Kumar Singh is Senior Solution Lead at IP Infusion. Connect on LinkedIn.

了解如何在经过验证的开放硬件上设计开放式 SR-MPLS 核心

分享