Source routing for modern IP/MPLS backbones: SIDs, SR-MPLS vs SRv6, TI-LFA, and Flex-Algo — the parts worth explaining at a whiteboard.
Segment Routing (SR) rethinks how a packet is steered through a network. Instead of the control plane signaling and holding per-flow / per-LSP state in every core node (LDP, RSVP-TE), the ingress node encodes the entire path as an ordered list of segments in the packet header. The core just executes instructions and forwards.
SR is source routing: the head-end decides the path and writes it into the packet as an ordered segment list. Each segment is an instruction ("go to node X via the shortest path", "cross this specific link", "run this function"). The core keeps no per-flow state — it only needs to know the globally-agreed meaning of each segment, which the IGP already floods.
A segment is an identifier called a SID (Segment Identifier). The ingress imposes a stack/list of SIDs; each hop pops or reads the active segment, forwards toward it, and the next segment becomes active. The path lives in the packet, not in the routers.
| Segment Routing | LDP / RSVP-TE | |
|---|---|---|
| Path encoding | Ordered SID list in the packet (source routing) | Hop-by-hop state established by signaling |
| Core state | None per-flow; only global SID→prefix mappings (from IGP) | Per-LSP label state in every transit LSR |
| Signaling protocol | None extra — the IGP distributes SIDs | LDP (label distribution) or RSVP-TE (per-LSP) |
| Traffic engineering | Encode the path at the head-end, no signaling | RSVP-TE with reservations along the path |
| Scale | State ∝ number of nodes/links, not number of flows | State ∝ number of LSPs (N² mesh problem) |
The practical payoff: a full-mesh TE topology that would need N² RSVP LSPs (and state in every hop) becomes a stateless SID list computed once at the edge.
Segments come in two broad flavors: global segments (meaningful network-wide, advertised by the IGP, everyone installs the same forwarding) and local segments (meaningful only on the node that allocated them).
| SID | Scope | Meaning / instruction |
|---|---|---|
| Prefix-SID | Global | "Forward along the IGP shortest path to this prefix." Advertised by the IGP, drawn from the SRGB. ECMP-friendly (uses all equal-cost paths). |
| Node-SID | Global | A Prefix-SID for a router's loopback — i.e. "get me to node X." The most common building block of a path. |
| Adjacency-SID | Local | "Send out this specific link/adjacency." Locally allocated by the router that owns the link; lets you pin an exact hop (e.g. force a non-shortest link). |
| Anycast-SID | Global | Same Prefix-SID advertised by multiple nodes; the closest one wins — used for redundancy and to steer to "any member of a group" (e.g. a pair of border routers). |
| BGP Prefix-SID | Global | Prefix-SID signaled by BGP (e.g. BGP-LU / EPE, SR in the DC) rather than the IGP. |
The SRGB is the range of label values (in SR-MPLS, e.g. 16000–23999) reserved on
every node for global segments. A Prefix-SID is advertised as an index; each node computes the
local label as SRGB_base + index.
SR is an architecture; it runs over two data planes. The control-plane concepts (SIDs, IGP flooding, TI-LFA, Flex-Algo) are shared — the difference is how the segment list is carried on the wire.
| SR-MPLS | SRv6 | |
|---|---|---|
| SID is… | An MPLS label | An IPv6 address (128-bit) |
| Segment list carried in… | The MPLS label stack | The Segment Routing Header (SRH) — an IPv6 routing extension header (type 4) |
| Distribution | IGP (IS-IS/OSPF) floods prefix-SIDs → no LDP | IGP floods locators/SIDs; forwarding is native IPv6 |
| Underlay requirement | MPLS forwarding in the core | Plain IPv6 forwarding (SRH-aware at SR nodes) |
| Header overhead | 4 bytes per label | 40-byte IPv6 + SRH (heavier; uSID compresses it) |
| Model | Label stack = path | "Network programming": locator:function:args |
The IGP (IS-IS or OSPF, with SR extensions) distributes prefix-SIDs, so LDP is no longer needed to build a transport LSP — one protocol (the IGP) both computes reachability and distributes labels. A TE path is just a stack of Node-SIDs (with Adjacency-SIDs where you must pin a link):
Ingress builds label stack to steer PE1 → PE2 via node R5:
┌──────────┐
│ 16005 │ ← Node-SID(R5) (top: go to R5 shortest path)
├──────────┤
│ 16002 │ ← Node-SID(PE2) (then to PE2)
├──────────┤
│ payload │
└──────────┘
Each core LSR: forward on shortest path to the top SID's prefix,
pop when it becomes the owner (PHP / next-segment), no per-LSP state.
In SRv6 each SID is a 128-bit IPv6 address structured as locator:function[:args]. The
locator routes the packet to the node that owns the SID (it's just an IPv6 prefix in the IGP); the
function is an instruction that node executes — this is SRv6 network programming.
End (plain shortest-path to the next SID),
End.X (forward out a specific adjacency — the SRv6 Adjacency-SID), End.DT4/DT6
(decapsulate + lookup in a VRF — used for L3VPN), End.DX2 (L2 cross-connect).SRv6 SID layout (locator : function):
2001:db8: aaaa : 0100 :: 0
└─ locator (routes to the node) ─┘ └ function (End, End.DT4, …) ┘
uSID carrier (micro-program in one 128-bit address):
2001:db8: 0001 0002 0005 0002 :: ← visit nodes 1→2→5→2 in order
└── micro-SIDs shifted left as each is consumed ──┘
SR reuses the link-state IGP you already run to flood SID information — no new distribution protocol:
Because reachability and label distribution collapse into one protocol, the failure/convergence story is the IGP's — one SPF, one set of timers — instead of coordinating IGP + LDP (and avoiding the classic LDP/IGP synchronization pitfalls).
TI-LFA (Topology-Independent Loop-Free Alternate) gives guaranteed, loop-free fast reroute with sub-50 ms protection against link, node, or SRLG failure — for essentially any topology. It leans on SR's key property: the ability to express an explicit repair path as a SID list.
| LFA / rLFA (classic) | TI-LFA (SR) | |
|---|---|---|
| Coverage | Topology-dependent — no backup exists for some topologies (esp. rings) | ~100%, topology-independent |
| Repair path | Limited to a directly usable loop-free neighbor (rLFA adds one remote node via a targeted LDP session) | Any path, expressed as a repair SID list to the post-convergence point |
| Loops during repair | Possible micro-loops | Steers onto the post-convergence path → avoids micro-loops |
| Extra protocol/state | rLFA needs targeted LDP | None — SID list in the packet |
Flexible Algorithm (Flex-Algo) lets the IGP compute shortest paths against a custom optimization objective instead of only the default IGP metric — and binds that path to a prefix-SID. Steering onto a Flex-Algo path is then just "use that SID," no explicit SID list needed.
Flex-Algo is a distributed, IGP-computed intent bound to a single SID — cheap and simple, but the objective is coarse (one metric + constraints, computed by every node). Explicit SR-TE (head-end or PCE computed, arbitrary SID list) can express any path and per-flow constraints, at the cost of head-end/controller computation. Many designs use Flex-Algo for the common planes and SR-TE for the exceptions.
| Property | Segment Routing | LDP / RSVP-TE |
|---|---|---|
| Protocols to run | Just the IGP (SR extensions) | IGP + LDP, and RSVP-TE for traffic engineering |
| Core per-flow state | None — path is in the packet | Per-LSP state in every transit node |
| TE without signaling | Yes — encode the SID list at the head-end | No — RSVP reservation along the whole path |
| ECMP | Native / friendly (Prefix-SIDs follow all equal-cost paths) | RSVP LSPs pin a single path; ECMP is awkward |
| Fast reroute | TI-LFA: ~100% coverage, loop-free, sub-50 ms | LFA (partial) or RSVP FRR (more state) |
| Scaling limit | ∝ nodes/links | ∝ number of LSPs (N² mesh) |
| Operational complexity | Lower — one protocol, predictable label plan (SRGB) | Higher — IGP/LDP sync, RSVP soft-state refresh |
The headline talking points: no LDP, no per-LSP core state, ECMP-friendly, TE without a signaling protocol, and a simpler overall control plane — plus TI-LFA and Flex-Algo as capabilities that are hard or impossible in the legacy stack.