IPv6 Packet Header Structure
An IPv6 (Internet Protocol version 6) packet consists of a fixed-length 40-byte basic header, followed by optional extension headers and the payload. Compared to the IPv4 header, the number of fields is reduced, and optional information is separated out into extension headers. This article explains the role of each field in the basic header.
Description of Each Field
| Field Name | Size | Description |
|---|---|---|
| Version | 4 bits | Indicates the IP version. Fixed at 6 for IPv6. |
| Traffic Class | 8 bits | Equivalent to IPv4’s Type of Service field. Represents packet priority and congestion notification, used as DSCP and ECN. |
| Flow Label | 20 bits | A value used to identify packets belonging to the same flow (a sequence of related communication). RFC 6437 recommends that the sender assign a pseudo-random value. It lets a router identify a flow without having to re-parse the upper-layer headers, which is useful for load balancing and similar purposes. Using it is optional, however, and the value itself does not express a priority (priority handling is the job of the Traffic Class field). |
| Payload Length | 16 bits | The number of bytes of extension headers plus data, excluding the basic header. Does not include the 40 bytes of the basic header itself. |
| Next Header | 8 bits | Equivalent to IPv4’s Protocol field. Indicates the type of the header that immediately follows — the type of the next extension header if one follows, or the upper-layer protocol type (TCP, UDP, etc.) otherwise. |
| Hop Limit | 8 bits | Equivalent to IPv4’s TTL. The maximum number of router hops the packet may traverse; decremented by 1 at each router and discarded once it reaches 0. |
| Source Address | 128 bits | The source IPv6 address of the packet. |
| Destination Address | 128 bits | The destination IPv6 address of the packet. |
Key Differences from the IPv4 Header
The following fields present in the IPv4 header have been removed or changed in the IPv6 basic header.
| Handling in IPv4 | Handling in IPv6 |
|---|---|
| Header Checksum | Removed. Error detection is handled by the upper layer (TCP/UDP) or lower layer (Ethernet, etc.), reducing recalculation cost at the IP level. In exchange, the UDP checksum — optional in IPv4 — is mandatory in IPv6 (RFC 8200 §8.1). |
| Identification, Flags, Fragment Offset | Removed from the basic header. When fragmentation is needed, it is added as a Fragment extension header. Fragmentation along the path by routers no longer occurs — only the source performs it. |
| IHL (Header Length) | Removed. Unnecessary since the basic header is always a fixed 40 bytes. |
| Options | Removed. Replaced by a scheme in which Extension Headers are chained together via the Next Header field. |
Common Extension Header Values
The value of the Next Header field indicates the type of extension header or upper-layer protocol. Common values are as follows.
| Next Header Value | Type |
|---|---|
0 | Hop-by-Hop Options extension header |
6 | TCP |
17 | UDP |
43 | Routing extension header |
44 | Fragment extension header |
50 | ESP (IPsec) |
51 | AH (IPsec) |
58 | ICMPv6 |
59 | No Next Header (indicates no header follows) |
60 | Destination Options extension header |
Extension headers are chained together using the Next Header field, eventually reaching the upper-layer protocol. Protocol numbers (Next Header values) are managed by IANA, and the full list of assigned values is published here.
Header Size
| Item | Size | Notes |
|---|---|---|
| IPv6 basic header | Fixed at 40 bytes | A simplified field layout that is always a fixed length. |
| Extension headers | Variable length (zero or more) | Chained together, with each one’s type indicated by the Next Header field. |
| Entire IPv6 packet | Up to 65575 bytes (excluding jumbograms) | The 40-byte basic header plus the maximum Payload Length of 65535 bytes. |
Unlike IPv4, if the packet size is larger than the MTU of a link along the path, routers do not perform fragmentation. The source host determines the appropriate size via Path MTU Discovery and, if necessary, fragments the packet itself using a Fragment extension header. A router that receives a packet exceeding the MTU discards it and returns an ICMPv6 Packet Too Big message to the source.
Related RFCs
| RFC | Title | Summary |
|---|---|---|
| RFC 8200 | Internet Protocol, Version 6 (IPv6) Specification | The current IPv6 specification. Defines the basic header structure and the extension-header chaining scheme. An Internet Standard that replaced RFC 2460. |
| RFC 2460 | Internet Protocol, Version 6 (IPv6) Specification | The previous IPv6 specification. Obsoleted by RFC 8200, but often referenced for historical context. |
| RFC 6437 | IPv6 Flow Label Specification | Defines how the Flow Label is set and what it is used for. Recommends that the sender assign a pseudo-random value, and specifies that use of the field by routers is optional. |