The data plane in one sentence
In SRv6, the path is carried in the IPv6 packet itself, and every hop is just an IPv6 lookup on the destination address. The thing that makes it work is a small extension header, the Segment Routing Header (SRH), plus a rule for rewriting the destination address at each segment endpoint. This post walks through exactly what is in the packet and what each router does to it. If you want the address-format side (locator, function, argument), read SRv6 SID structure. Here we stay on the packet and the forwarding.
The Segment Routing Header
The SRH is defined in RFC 8754. It is an IPv6 routing header with Routing Type 4, so the IPv6 Next Header value that points at it is 43. The fixed part is 8 bytes:
Next Header (8 bits) what follows the SRH (e.g. 41 = IPv6, 4 = IPv4, 6 = TCP)
Hdr Ext Len (8 bits) SRH length in 8-octet units, not counting the first 8 octets
Routing Type (8 bits) 4
Segments Left (8 bits) index of the active segment in the list
Last Entry (8 bits) index of the last element in the Segment List
Flags (8 bits)
Tag (16 bits)
Segment List[0..n] 128-bit SIDs, optionally followed by TLVsTwo details trip people up. First, the Segment List is encoded in reverse order: Segment List[0] is the last segment of the path, and the first one to visit is the highest index. Second, the active segment is always Segment List[Segments Left]. When a packet is built for a three-segment path, Segments Left starts at 2, and the first SID to visit sits in Segment List[2].
What a SID actually is on the wire
A SID is a 128-bit value that looks like an IPv6 address and is routable like one. The locator part (the leading bits) is advertised by the IGP, so every router in the domain has a normal IPv6 route toward it. The remaining bits identify a behavior on the node that owns that locator. Only the node that owns the SID executes the behavior; every other node just forwards on the locator prefix. For how the locator and node bits are carved up, see locator, node ID and SID block.
Three roles: source, transit, endpoint
RFC 8754 distinguishes the nodes by what they do with the packet.
SR source node: builds the packet and chooses the segment list. This is the head-end, which can be a router or a host.
Transit node: any IPv6 router that is not the destination. It does not look at the SRH. It forwards on the outer destination address using its normal FIB, and decrements Hop Limit as usual. A router with no SRv6 support at all can be a transit node.
SR segment endpoint: a node whose local SID table matches the packet's destination address. This is the only place SRH processing happens.
This is the key difference from SR-MPLS: there is no label stack to swap at every hop, and no per-hop state beyond the IGP routes. The cost is packet size, because the SIDs travel in the header.
The basic endpoint rule (End)
RFC 8986 defines the endpoint behaviors. The simplest is End. When a packet arrives with a destination address that matches a local End SID and the SRH is present, the node does the following (simplified from the RFC pseudocode):
1. If Segments Left == 0, stop SRH processing (the packet has reached its last segment).
2. Otherwise: decrement Segments Left.
3. Copy Segment List[Segments Left] into the IPv6 Destination Address.
4. Decrement Hop Limit.
5. Look up the new Destination Address in the FIB and forward.That is the whole idea. The destination address walks down the segment list, one entry per endpoint, and between endpoints the packet is ordinary IPv6 traffic.
A worked example (illustrative)
Take a path R1 to R2 to R3 to R4, where traffic must pass through R2 and R3 explicitly. The addresses below use the documentation prefix and are made up for illustration only.
R2 End SID: 2001:db8:0:2:: (illustrative)
R3 End SID: 2001:db8:0:3::
R4 End SID: 2001:db8:0:4:: (egress; would normally be a service SID)
Packet leaving R1:
IPv6 DA = 2001:db8:0:2::
SRH Segments Left = 2
Segment List[2] = 2001:db8:0:2::
Segment List[1] = 2001:db8:0:3::
Segment List[0] = 2001:db8:0:4::
At R2 (End): SL 2 to 1, DA = 2001:db8:0:3::
At R3 (End): SL 1 to 0, DA = 2001:db8:0:4::
At R4: SL == 0, last segment reachedNotice that R1 already put the first SID, R2's, in the destination address when it sent the packet. The SRH carries the same entry in Segment List[2], which is why the list is initialized this way. Between R1 and R2, and between R2 and R3, any intermediate routers just route on the destination address using IGP shortest paths.
Encapsulation versus insertion
There are two ways a source can attach an SRH. RFC 8754 only standardizes the case where the SRH lives in an IPv6 header created by the source. For traffic that already exists, the standard approach (named in RFC 8986) is encapsulation: the head-end wraps the original packet in a new outer IPv6 header and adds the SRH to the outer header.
H.Encaps: push a new outer IPv6 header plus SRH carrying the segment list. The inner packet (IPv6 with Next Header 41, or IPv4 with Next Header 4) is untouched, so Hop Limit or TTL of the customer packet is not tampered with by the core.
H.Encaps.Red: the same, but the first SID is carried only in the destination address and omitted from the SRH, saving 16 bytes. This is the "reduced" encapsulation from RFC 8986.
Inserting an SRH directly into an existing packet (H.Insert, which RFC 8986 also describes) modifies a packet that someone else originated. RFC 8754 does not allow transit nodes to do that, so encapsulation is the normal and recommended case.
The last segment: service behaviors and decapsulation
At the end of the list, the SID often does more than forward. Common RFC 8986 endpoint behaviors:
End.X: like End, but also forwards the packet out a specific interface or to a specific next hop (a cross-connect to an adjacency).
End.DT4 / End.DT6: decapsulate the outer IPv6 header and do a lookup in a specific IPv4 or IPv6 VRF table. This is how L3VPN service is delivered over SRv6.
End.DX4 / End.DX6: decapsulate and send to a specific next hop without a table lookup.
Flavors modify the basic behavior. For example, PSP (penultimate segment pop) lets the second-to-last endpoint remove the SRH, so the final node does not need to parse it. The USP and USD flavors cover SRH removal and decapsulation at the ultimate segment.
Looking at it on a router (illustrative CLI)
Syntax differs by platform, so the snippet below is a generic sketch of what you would expect to verify, not output captured from a specific device.
! Illustrative only - not copied from a real device
show segment-routing srv6 sid
2001:db8:0:2:: End locator: MAIN
2001:db8:0:2:1:: End.X interface: to-R3
2001:db8:0:2:100:: End.DT4 vrf: CUSTOMER-A
show ipv6 route 2001:db8:0:3::
(should be learned from the IGP as a normal IPv6 prefix)If you are building this in a lab, the IS-IS locator advertisement and SID allocation steps are covered in the IOS XR IS-IS lab.
Capturing it: what to look for in Wireshark
A capture of an SRv6 packet is the best way to make this concrete. Useful display filters:
ipv6.nxt == 43 # IPv6 packets whose next header is a routing header
ipv6.routing.type == 4 # Segment Routing Header
ipv6.routing.srh.left # inspect Segments Left per hopCapture the same flow on two links, before and after an endpoint. You should see the IPv6 destination address change and Segments Left drop by one, while the Segment List stays identical (unless a PSP or USD flavor removed the SRH). Field names can vary a little between Wireshark versions, so expand the "Routing Header for IPv6 (Segment Routing)" tree if a filter does not match.
Security: the trust boundary
Because the SRH steers traffic, RFC 8754 requires that it only be honored inside a trusted domain. At the domain edge, filter inbound packets whose destination address is a local SID or falls in your SID block, and drop them unless they come from inside. Without that, an outside host could address your SIDs directly. HMAC TLV support exists in the RFC for integrity checking of the SRH, though it is optional.
The practical cost: header size and MTU
Every SID adds 16 bytes. A 40-byte outer IPv6 header, an 8-byte SRH fixed part and, say, three SIDs makes 96 bytes of overhead before the payload, which must be accounted for in your MTU planning. That overhead is the motivation for compressed SID formats such as the work in RFC 9800 (compressed SRv6 segment list encoding), so check which your platforms support before designing around long segment lists.
Recap
The SRH is routing type 4, next header 43, with the segment list stored in reverse order.
The active segment is Segment List[Segments Left].
Transit routers ignore the SRH. Only the node owning the SID in the destination address processes it.
End decrements Segments Left, copies the next SID into the destination address, and forwards.
Endpoint behaviors such as End.X and End.DT4 add adjacency forwarding and VRF delivery on top.
Filter SRv6 at the domain edge, and budget for 16 bytes per SID.
For how this compares to label-based forwarding, continue with SRv6 vs SR-MPLS data plane comparison.
Comments (0)
Please sign in to comment.