Segment Routing Introduction - Building Blocks

Segment Routing (SR) is new way of routing which is flexible and scalable. SR is based on source routing and allows to create a path by combining segments. The source chooses a path and encodes it in the packet header as an ordered list of segments.



Each segment is identified by the segment ID (SID) consisting of a flat unsigned 32-bit integer. 


One Segment is equal to one Label.

Segment List = Label Stack.


While we implement SR, the network no longer requires to maintain a per-application and per-flow state. Rather, it obeys the forwarding instructions provided in the packet. The interesting thing to note is that in SR labels are not distributed by LDP or RSVP. Then how the labels are distributed. The IGPs OSPF and ISIS are extended with new sub-TLVs to carry or advertise the labels. For more details regarding these TLVs, kindly read our another important SR article "How Segment Routing Works?"


However, the MPLS forwarding plane/table will remain the same to switch the packet until it reaches the destination using Push, Swap, and PoP operations.


Another important point to learn is that besides the MPLS forwarding plane (or Data Plane), Segment Routing also supports the IPv6 forwarding plane. SR can be applied to the IPv6 architecture with a new type of routing extension header. A segment is encoded as an IPv6 address. An ordered list of segments is encoded as an ordered list of IPv6 addresses in the routing extension header. The segment to process is indicated by a pointer in the routing extension header. The pointer is incremented, after the completion of a segment. 


Using either type of data planes (MPLS or IPv6), SR integrates with the rich multi-service capabilities of MPLS, including Layer 3 VPN (L3VPN), AToM(or VPWS), Virtual Private LAN Service (VPLS), and Ethernet VPN (EVPN).


Each node/router and each link (adjacency) has an associated SID. Node segment identifiers are globally unique and represent the shortest path to a node/router as determined by the IGP. The network administrator allocates a Node ID to each router from a reserved block. On the other hand, an Adjacency SID is locally significant and represents a specific adjacency, such as egress interface, to a neighboring node/router. SR capable nodes/routers automatically generate adjacency identifiers outside of the reserved block of node IDs. In an MPLS network, a SID is encoded as an MPLS label stack entry. SIDs direct the data along a specified path. There are two kinds of segment IDS:


Prefix SID:  A SID that contains an IP address prefix calculated by an IGP in the service provider's core network. Prefix SIDs are globally unique. A prefix segment represents the shortest path (as computed by IGP) to reach a specific prefix. Important point: A Node Segment is a special prefix segment that is bound to the loopback address of a node. It is advertised as an index into the node-specific SR Global Block or SRGB. We will discuss SRGB in detail too.


Adjacency SID: A SID that contains an advertising router’s adjacency to a neighbor. An Adjacency SID is a link between two nodes/routers. Since the adjacency SID is relative to a specific router, it is locally unique.