Theoretical foundations and architecture

Segment Routing over MPLS (SR-MPLS, RFC 8402) is a source-routing paradigm that removes the separate label distribution protocol (LDP) and path signaling protocol (RSVP-TE). In classic MPLS transit routers keep dynamic state for LDP sessions and RSVP signaling. In SR the head-end encodes the path as an ordered list of Segment Identifiers (SIDs), each SID becomes an ordinary 20-bit MPLS label, and transit nodes do not keep per-LSP state: they only need LFIB entries per SID that they derive from the IGP. SIDs are advertised by IS-IS/OSPF extensions. The cornerstone of SR-MPLS is the Segment Routing Global Block (SRGB): the label range every router reserves for global SIDs. A Prefix-SID is advertised as an index, and the label is computed as SRGB base + index. The range 16000-23999 is a common choice and the Cisco default, but RFC 8402 does not fix it: other vendors have different defaults, so the SRGB is best configured explicitly and identically on all nodes of the domain.

What a segment is and why the core is stateless

Segment Routing (RFC 8402) carries the path of a packet in the packet itself. A segment is an instruction ("deliver to node X along the shortest path", "leave through link Y"), and a route is an ordered list of segments. In SR-MPLS (RFC 8660) a segment is an ordinary 20-bit MPLS label and the segment list is a label stack, so ASICs and the header format do not change. The difference from LDP and RSVP-TE is that labels are not negotiated by a separate protocol: the IGP itself (IS-IS or OSPF) floods them, and a transit node stores only LFIB entries for SIDs, not tunnel state. The number of entries in the core grows with the number of nodes and adjacencies, not with the number of LSPs.

SRGB: index and absolute label

A Prefix-SID is advertised not as a label but as an index, a small number unique within the SR domain. The real label is computed as SRGB base + index. The SRGB (Segment Routing Global Block) is the label range that every router reserves for global SIDs and advertises to its neighbours. For PE1 with index 1 and SRGB 16000-23999 the label is 16001, for PE2 with index 2 it is 16002. The range 16000-23999 (8000 labels) is a typical choice and the Cisco default, but RFC 8402 does not fix it: other vendors have different defaults, so the SRGB is always configured explicitly and identically on all nodes.

An important detail: the label on the wire is determined by the receiver. When node A sends a packet for the prefix with index i to neighbour B, it uses the label SRGB_B.base + i, where SRGB_B is taken from B's advertisement. If the SRGBs are identical, the label value does not change along the whole path (in the LFIB this is a swap to the same number; RFC 8660 calls the operation CONTINUE), and a trace can be read without tables. If B has a different range, forwarding still works, but the value differs at every hop, and debugging and policies with manual stacks become harder. An SRGB may consist of several ranges (indexes are numbered across them), but in practice one contiguous block is used.

SRGB restrictions:

  • labels 0-15 are reserved; the block must not overlap static labels, labels already allocated dynamically by LDP/RSVP, or the SRLB;
  • the index must be smaller than the block size: with a size of 1000, index 1200 yields no label and the node does not program the prefix (the route is in the IGP but not in the LFIB);
  • two nodes with the same index cause a SID conflict: per RFC 8660 conflicting entries are not programmed, and the exact behaviour depends on the implementation;
  • changing the SRGB on a running node reprograms the LFIB and may be rejected if the labels are already in use.

SRLB and local segments

The SRLB (Segment Routing Local Block) is the range for local SIDs, for example manually assigned Adjacency-SIDs or SIDs that a controller allocates for policies. It is not used as a global range: the value is meaningful only on the owning node, and neighbours are told about the SRLB so that a controller knows the allowed values. Cisco's default SRLB is 15000-15999; the SRGB and SRLB must not overlap. Dynamic Adjacency-SIDs come from the dynamic label pool, not from the SRGB.

How SIDs get into the IGP

IS-IS (RFC 8667). Node capabilities are carried by the Router Capability TLV 242. Inside it: the SR-Capabilities sub-TLV (type 2) with flags I (SR-MPLS IPv4) and V (IPv6) and SRGB descriptors (a 3-byte range size and a SID/Label sub-TLV of type 1 with the first label), the SR-Algorithm sub-TLV (type 19), the SR Local Block sub-TLV (type 22) and the Node MSD sub-TLV (type 23, RFC 8491). The Prefix-SID is a sub-TLV of type 3 inside the prefix reachability TLV (135, 235, 236, 237). This requires wide metrics: with narrow metrics (TLV 128/130) the sub-TLVs cannot be carried, and SR will not work on such an IS-IS.

OSPFv2 (RFC 8665). Capabilities are carried by the Router Information Opaque LSA (type 4): the SR-Algorithm TLV (type 8), the SID/Label Range TLV (type 9), the SR Local Block TLV (type 14), the SRMS Preference TLV (type 15) and the Node MSD TLV (type 12, RFC 8476). The Prefix-SID sits in the Extended Prefix Opaque LSA (Opaque type 7) and the Adjacency-SID in the Extended Link Opaque LSA (type 8). Therefore OSPF needs working opaque functionality, and the flooding scope determines who sees the SIDs.