What are IPv6 extension headers? Name the main ones and the order they go in.
Show the answer
Say this first
Optional headers between the IPv6 header and the payload, chained by the Next Header field: each one says what comes after it. The main ones are Hop-by-Hop Options (0), Routing (43), Fragment (44), ESP (50), AH (51) and Destination Options (60). Only Hop-by-Hop is meant for routers along the path, and only if they are configured to process it. The rest are for the destination, or for the nodes listed in a Routing header.
Go deeper
The chain
IPv6 header Next Header = 0 (Hop-by-Hop)
Hop-by-Hop Next Header = 44 (Fragment)
Fragment Next Header = 6 (TCP)
TCP segmentThe headers
| Value | Header | Who processes it |
|---|---|---|
| 0 | Hop-by-Hop Options | routers on the path, if configured to (RFC 8200) |
| 60 | Destination Options | the destination, or each listed hop when placed before a Routing header |
| 43 | Routing | the nodes listed in it |
| 44 | Fragment | the destination, at reassembly |
| 51 | AH | the destination |
| 50 | ESP | the destination |
| 59 | No Next Header | nothing follows |
Recommended order (RFC 8200)
- IPv6 header
- Hop-by-Hop Options (must come first if present)
- Destination Options (for the hops in the Routing header)
- Routing
- Fragment
- AH
- ESP
- Destination Options (for the final destination)
- Upper layer (TCP, UDP, ICMPv6)
Each appears at most once, except Destination Options, which may appear twice.
Routing header types
- Type 0: source routing through a list of hops. Deprecated by RFC 5095 because a packet could bounce between two hosts many times and amplify traffic.
- Type 2: Mobile IPv6.
- Type 4: the Segment Routing Header used by SRv6 (RFC 8754).
They will ask next
How does a firewall find the TCP port in an IPv6 packet?
It walks the chain, header by header, following Next Header until it reaches the upper layer. That is slower than IPv4's fixed offset, and it is why RFC 7112 requires the whole chain to be in the first fragment.
Where is the Router Alert option carried?
In a Hop-by-Hop Options header. MLD reports use it so routers inspect them.
Traps
- Saying every router processes every extension header.
- Forgetting that ESP and AH are extension headers too.