IPv6 Header Structure Explained
A detailed breakdown of the IPv6 packet header, extension headers, and how the simplified design improves routing performance over IPv4.
IPv6 Header: Simplified by Design
The IPv6 header is a fixed 40 bytes, compared to IPv4's variable 20-60 bytes. This fixed size was a deliberate design choice -- routers can process packets faster when they do not need to parse variable-length headers.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Length | Next Header | Hop Limit |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Source Address +
| (128 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Destination Address +
| (128 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The 8 Fields
| Field | Bits | Purpose |
|---|---|---|
| Version | 4 | Always 6 |
| Traffic Class | 8 | QoS priority (equivalent to IPv4 DSCP + ECN) |
| Flow Label | 20 | Identifies packet flows for QoS handling |
| Payload Length | 16 | Length of data after the header (up to 65,535 bytes) |
| Next Header | 8 | Identifies the next header type (TCP=6, UDP=17, ICMPv6=58) |
| Hop Limit | 8 | Decremented by 1 at each router; packet discarded at 0 (like IPv4 TTL) |
| Source Address | 128 | Sender's IPv6 address |
| Destination Address | 128 | Recipient's IPv6 address |
What Was Removed from IPv4?
Several IPv4 header fields were deliberately eliminated:
- Header Length -- Unnecessary because the IPv6 header is always 40 bytes.
- Identification / Flags / Fragment Offset -- Fragmentation is handled by extension headers, not the base header. Routers never fragment IPv6 packets.
- Header Checksum -- Removed because link-layer (Ethernet) and transport-layer (TCP/UDP) checksums already protect the data. This saves processing time at every hop.
Extension Headers
Optional features are implemented as a chain of extension headers between the main header and the payload:
IPv6 Header (Next: Routing) -> Routing Header (Next: Fragment) -> Fragment Header (Next: TCP) -> TCP + Data
| Next Header Value | Extension Header | Purpose |
|---|---|---|
| 0 | Hop-by-Hop Options | Options processed by every router |
| 43 | Routing | Source routing (specify path) |
| 44 | Fragment | Fragmentation by the source |
| 50 | ESP | IPsec encryption |
| 51 | AH | IPsec authentication |
| 60 | Destination Options | Options for the final destination |
Performance Impact
The fixed header size and removal of per-hop checksum recalculation means routers process IPv6 packets faster. In high-throughput environments, this translates to measurable performance gains. The flow label field also enables efficient ECMP hashing without deep packet inspection.