Segment Routing architecture can be applied to MPLS data plane and IPv6 data plane (SRv6). IN MPLS Data plane IGP Prefix SID and IGP Adj SIDs (Adj-SID) are used for traffic engineering. (Segment Routing IGP Segments). An SR Policy may use both Prefix SID and Adj-SIDs which are encoded as mpls label or label stack. But we don’t have MPLS labels in the IPv6 data plane. Actually Segment Routing MPLS data plane can be applied directly to the IPv6 also but we are talking about native IPv6 support of Segment Routing.
IGP Prefix Segment Identifer (Prefix-SID) is a Global Segment, advertised by ISIS or OSPF and associated with a prefix, commonly with a loopback ip address. It is also called Node SID. In SRv6 SID we have Locator and Function. Locator: Routed to the node performing the function. In SRv6 we have several functions but in this post I will examine End function. This function works like -but not exactly similar- Prefix SID of MPLS data plane.
End Function
NH: Next Header,
SRH: Segment Routing Header,
SL: Segment Left,
DA: Destination Address.
END Function works as below;
IF NH=SRH and SL > 0 decrement SL update the IPv6 DA with SRH[SL] FIB lookup on the updated DA forward accordingly to the matched entry ELSE (SL=0) Drop the packet
The english meaning of End Function is, if the Segment Left is not 0, then decrease it by one, update Destination Address of IPv6 header with next Segment in the Segment List and forward the packet according to routing table.
Now Let’s combine all these information in the first example with actual headers and tables.
Packet Forwarding Explanation
- A1, pushes SRH with 3 SID. From the SID list inside the SRH the first SID is copied into Destination Address field of IPv6 Header. Segment Left is set to 2. (n-1 where the n is total SID count)
- On A2, Destination Address of the packet is defined in the Local SID table with an END function. That’s why, A2 will decrease the Segment Left by one, the next SID from the list will be copied into Destination Address field of IPv6 Header and packet will be forwarded according to IPv6 routing table which is bound to incomin interface.
- On A4, Destination Address of the packet is defined in the Local SID table with an END function. That’s why, SRH will be updated; A4 will decrease the Segment Left by one, (Segment Left will be 0) the next SID from the list will be copied into Destination Address field of IPv6 Header and packet will be forwarded according to IPv6 routing table which is bound to incoming interface.
- On A6, Destination Address of the packet is defined in the Local SID table with an END function but Segment Left is 0. A4 will Remove the IP and SR header and process the payload.