In Segment Routing Architecture 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. Segment Routing Adj-SIDs usually represent a link (peering) and have a local significance. 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 and End.X function. These functions works like (not exactly similar) Prefix SID and Adj SID of MPLS data plane.
End.X Function
End.X function is defined locally and it points an outgoing interface. Offical definition for End.X function is Endpoint with cross-connect to an array of layer-3 adjacencies.
NH: Next Header,
SRH: Segment Routing Header,
SL: Segment Left,
DA: Destination Address.
End.X Function works as below; IF NH=SRH and SL > 0 decrement SL update the IPv6 DA with SRH[SL] forward to layer-3 adjacency bound to the SID (no routing) ELSE (SL=0) Drop the packet
Topology
Packet Forwarding Explanation
- A1, pushes SRH with 3 SID. From the SID list inside the SRH the first SRv6 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 incoming interface.
- On A4, Destination Address of the packet is defined in the Local SID table with an END.X Function says the packet should be cross-connect to interface45 which is a connection between A4 and A5. Instead of IPv6 routing A4 will cross-connect packet to the Interface 45 and will decrease the Segment Left by one, (Segment Left will be 0) the next SRv6 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 A5, Destination Address of the packet is NOT defined in the Local SID table. A5 will just do IPv6 routing, it will not care about Segment Routing header, will not process or update.
- On A6, Destination Address of the packet is defined in the Local SID table with an END function but Segment Left is 0. A6 will Remove the IP and SR header and process the payload.