In this blog post we will be taking a deeper look at Node/Prefix SID and SR/LDP Interworking. If you work or have an interest in the Routing area, then by this time you may have already heard about Segment Routing (SR) and I am assuming that you already have some awareness with the basic concepts of Segment Routing. There is plenty of material available over the Internet, which gives a good overview of Segment Routing and its use cases. For some reason if you just came out of the cave and weren’t aware about it, I recommend you starting from http://www.segment-routing.net/.
So we know that Segment routing (SR) is a source routing concept in which an ingress node selects a path and encodes that into the packet header as an ordered list of segments. From a control plane perspective IGP’s (ISIS or OSPF), BGP, PCE-P and BGP-LS are being extended to support Segment Routing. There is no need to have LDP or RSVP to distribute the labels anymore in a pure SR domain. From a data plane perspective, we can use MPLS labels where MPLS labels represent a Segment ID (SID) or IPv6 (with option segment routing header). In this post we will be focusing on ISIS for control plane and MPLS from a data plane perspective.
SR: Segment Routing
SID: Segment ID
SRGB: Segment Routing Global Block
Node/Prefix-SID and Segment Routing Global Block (SRGB)
The first major type of SID is Node-SID or Prefix-SID. A Node-SID represents a Node and has a global significance, something like a loopback of a router. Like an operator assigns a loopback’s to their routers, it’s expected that the Node-SID value will be assigned to every node. The assigned value can be an absolute or Index value and must be globally unique.
All the nodes, switch packets towards Node-SID via the shortest path. From global significance we mean here that every node in the SR domain will install an MPLS label in the forwarding plane representing Node-SID. Okay, so how is this different then every router installing a label for /32 loopback’s in the case of MPLS+LDP domain? Let’s wait till the end of this section to see if there is any difference.
In the Fig.1 , each Router has been assigned a unique Node-SID value. IGP metrics are highlighted in Blue. The idea here is pretty simple, if R1 wants to send a packet to R6, it will slap the Node label (16006) of R6 on the top of the packet and every router on the shortest path will swap the labels till it reaches R6. If you want to send a packet through specific Node before it reaches its destination like R1 wants to send data to R6 via R4 then it can slap Node-SID label of 16006 and 16004,16004 being at the top of the stack. Once the packet reaches R4, R4 sees the label value of 16006 sends the packet towards R6.
Fig.1 *PHP happens
Pretty simple, isn’t it. But how does every router install the same label value in the forwarding plane? Or is it always the case?
Segment Routing Global Block
Segment Routing Global Block (SRGB) is the range of labels reserved for segment routing. SRGB is a local property of a segment routing node. In MPLS, architecture, SRGB is the set of local labels reserved for assigning labels to global segments like Node-SIDs originated by a router. In IOS-XR default SRGB range is from 16000-23999 and Dynamic label range is 24000-1048575. Every SR node advertises its SRGB as label base and label range. So in the case of IOS-XR it will be Base=16000 and range = 8000 via IGP. It is possible that different nodes can have different SRGB values either because the operator configured or due to vendor implementation differences and hence the absolute Node-SID value associated with an IGP Prefix Segment can change from node to node.
So far we have established that there is a reserved SR (SRGB) block at every node and allocations of labels for Prefix/Node-SID value happens from that block.
In an SR domain if SRGB range of all the nodes is same then all the SR nodes will install the same SID label value for a node or prefix. So for instance, in the below Fig.2, I can assign an absolute value of 104 to R4 and R4 advertises that via an IGP, When R3 receives this information, It reserves 104 from its SRGB block for R4. This information gets further relayed to R2 via IGP.
But what if the SRGB are different for different nodes. In the below fig.3, If I assign an absolute value of 104 as Node-SID to R4 and when R4 advertises this via an IGP, R2 can’t not assign 104 as it’s outside of its SRGB range. So how do we solve this situation? In order to avoid a situation like this we have an option to assign a Unique Index value than an Absolute value to a Node-SID.
In the below Fig.4, The operator has configured Unique Index values to each SR Node. When R4 advertises its Index Value to R3, then R3 programs 104 as a local label. R3 further advertises Index value of R4 to R2, R2 assigns its local label 504 (500+4) based on the below formula
Local Label (Prefix SID) = Start label + SID Index
Now, as you can see that the label operation looks very similar to LDP when operating in the independent label distribution mode with the difference that the label value used to forward a packet to each downstream router is computed by the upstream router based on the advertised prefix SID index using the formula Local Label (Prefix SID) = Start label + SID Index.
The other most important SID is the Adjacency SID. They usually represent a link and have a local significance. What I mean by local significance is that the remote SR node, unlike for Node-SID doesn’t install a state in the forwarding plane for an Adjacency SID. Only the directly connected Nodes program the forwarding plane for Adjacency SIDs. They are absolute values (Not Index) and allocated dynamically by the router from the dynamic label range, which is outside of SRGB block. So in the case of IOS-XR they will be allocated from the Dynamic label range i.e. 24000-1048575. Since Adjacency SID’s has local significance they don’t have to be unique in the SR domain. For instance, in the below Fig. 5, 24001 Adjacency SID is present between R1- R4 and R3-R5.
One other thing, which I wanted to cover in this post, is about SR/LDP interworking. For a technology to be successful, it’s very important that it doesn’t require a forklift upgrade and provide a migration/interoperability with current systems. So If an operator is already running an LDP network and wants to implement SR but not every node is SR capable which could be due to various reasons like those nodes are from different vendors and don’t support SR yet, or they may not be running the SR capable operating system. SR/LDP interworking could be an option for him.
Let’s look at an example. In the below Fig.6, R1, R2, R3 and R10 (In Blue) are only running LDP and R4-to-R8 Routers are SR capable Routers. R4 and R6 will be running both SR and LDP as they are on the border between SR and LDP. The whole network is running single IGP let’s say IS-IS
From LDP to SR Domain
So if a router from LDP only domain wants to communicate with SR domain, it’s pretty straightforward. Let’s say R1 wants to send a packet to R8.Since R4 and R6 are running LDP, they will allocate labels corresponding to the SR Nodes including R8 and advertise it to other LDP neighbors. When R1 sends the packet with label advertised by the LDP to R10, R10 swaps to the label towards either R4 or R6 (based on shortest path and in the example it’s R4). R4 upon receiving the LDP label swaps to the SR label corresponding to the R8.So this part was easy.
From SR to LDP Domain
Now In Fig.6, if R8 which is SR only node, wants to send a packet to LDP only nodes then we have a problem. Since R8 doesn’t know the Node-SID corresponds to R1 it can’t send a packet to R1 (or other LDP nodes). In order to solve this problem, Mapping server functionality was created.
In the below Fig.8, I am showing a separate mapping server node for one reason that it doesn’t have to be in line as long as its participating in the IGP domain, otherwise any SR node can be a mapping server and doesn’t have to have a separate box. But obviously it will be a crucial box as it failure means the failure of communication between SR and LDP domain.
On the mapping server, we define the Node-SID and their corresponding label value mapping something like this:
Where 22.214.171.124 /32 is the starting address of the loopback, 2001 is the starting label Index Value and range is 3.Mapping server will advertise this mapping to all the SR Nodes via IGP.Assuming SRGB range is 16000-23999 then Node-SID values derived by SR Nodes for LDP routers will be
126.96.36.199 /32 Node-SID label value is = 18001 (SRGB Base 16000+2001)
188.8.131.52 /32 Node-SID label value is = 18002 (SRGB Base 16000+2002)
184.108.40.206 /32 Node-SID label value is = 18003 (SRGB Base 16000+2003)
This way now SR Nodes will know what Node-SID value to use if they want to reach an LDP only Node.
In the below fig.9, Once the packet reaches at R4 which is on the border of SR and LDP, it will swap the label from the SR-to-LDP Label which was advertised by R10 for R1.
I hope I have given some deeper level insight about Node/Prefix-SID and SR/LDP interworking. In the next post we will look at TI-LFA.