IPv6 Datagram Header

The streamlined header structure of IPv6.

A New Blueprint for the Internet's Envelope

As we explored in the discussion of the IPv4 Header, a acts as the "envelope" for every packet of data traveling across the internet. It contains the instructions that routers use to guide the packet to its destination. The designers of IPv6 had the benefit of decades of experience with IPv4's limitations and set out to create a header that was not only larger in address capacity but also fundamentally more efficient.

The core design philosophy of the IPv6 header is simplicity and performance. While the addresses themselves became four times longer (128 bits vs. 32 bits), the base header was streamlined. Many fields from the IPv4 header that were optional, rarely used, or required processing at every router were removed or moved into optional Extension Headers. This design choice significantly speeds up packet processing in core internet routers, which is crucial for handling modern network traffic volumes.

Anatomy of the IPv6 Header: Fixed, Fast, and Focused

Unlike the IPv4 header, which had a variable length that routers had to check every time, the base IPv6 header has a fixed size of 40 bytes (320 bits). This predictability allows routers to process packets much faster, as they always know exactly where the header ends and the data begins.

Interactive IPv6 header

Tap a field to understand it and review real packet examples.

Version
bits 0–3

Always 6 for IPv6 packets.

Example datagrams

HTTPS request

Client establishing TLS over TCP.

Let's dissect each of the eight fields of the base IPv6 header to understand its role.

First Line: Classification and Flow Control

1. Version - 4 bits

This is the very first field, just like in IPv4. It identifies the IP version. For IPv6, this field always contains the binary value 0110 (decimal 6). When a router receives a packet, the first thing it looks at is this field. If it sees a '6', it knows to interpret the rest of the header according to IPv6 rules. If it sees a '4' (0100), it uses the IPv4 rules. This is the fundamental mechanism that allows IPv4 and IPv6 to coexist on the same network links.

2. Traffic Class - 8 bits

This field is the direct successor to the IPv4 Type of Service (ToS) / DSCP field. Its purpose is to provide routers with a way to handle different types of traffic differently, enabling . For instance, packets belonging to a real-time video conference (which is sensitive to delay) can be marked with a higher priority than packets from a large file download (which is less sensitive). Routers along the path can then use this information to prioritize the video conference packets if the network becomes congested. This helps maintain a smooth user experience for critical applications.

3. Flow Label - 20 bits

The Flow Label is a brand-new field in IPv6, designed to improve QoS and routing efficiency. A "flow" is a sequence of packets from a specific source to a specific destination that are all part of the same conversation and require the same special handling.

Instead of having every router inspect every packet's full header to decide on its priority, the source host can assign a unique Flow Label to all packets in a particular flow. Core routers only need to look at this label to know how to handle the packet, which is much faster. It's like putting a specific colored sticker on every box in a single shipment; handlers along the way only need to see the color to know which priority lane to put it in, rather than reading the full address on every box. This is particularly useful for real-time applications like VoIP and video streaming.

Second Line: Length and Extensibility

4. Payload Length - 16 bits

This 16-bit field specifies the length of the payload only (the data portion of the packet, including any extension headers) in bytes. The base header itself is a fixed 40 bytes and is not included in this count.

  • Being a 16-bit field, it can specify a payload length of up to 2161=65,5352^{16} - 1 = 65,535 bytes.
  • IPv6 also supports "jumbograms," which are packets larger than 65,535 bytes. This is handled via an option in an extension header, in which case the Payload Length field is set to zero.

This is a simplification from IPv4, where the 'Total Length' field included the header, which could be variable.

5. Next Header - 8 bits

This field is one of the most powerful innovations in IPv6. It serves two purposes. First, it identifies the type of header that immediately follows the base IPv6 header. This could be:

  • A transport layer header, like TCP (value 6) or UDP (value 17), just like the Protocol field in IPv4.
  • The header of an IPv6 Extension Header.

are the mechanism used to handle optional information without cluttering the base header. The 'Next Header' field of the main header points to the first extension header. That extension header has its own 'Next Header' field, which points to the next one, and so on, forming a chain. The final header in the chain points to the transport layer payload (e.g., TCP). This "daisy-chain" approach allows for great flexibility and extensibility while keeping the base header simple for fast router processing.

6. Hop Limit - 8 bits

This 8-bit field is the direct equivalent of the Time To Live (TTL) field in IPv4. The name was changed to more accurately reflect its function: it is a hop counter, not a time measurement.

  • The sending host sets an initial Hop Limit value.
  • Every router that forwards the packet decrements the Hop Limit by 1.
  • If a router decrements the Hop Limit to 0, it discards the packet.

Its purpose remains the same: to prevent packets from being caught in an infinite routing loop and congesting the network forever.

The Addressing Fields

7. Source Address - 128 bits

This field contains the full 128-bit IPv6 address of the original sender of the packet. It occupies 16 bytes of the header.

8. Destination Address - 128 bits

This field contains the full 128-bit IPv6 address of the final recipient of the packet. This is the primary field used by internet routers to make their forwarding decisions. It occupies the final 16 bytes of the 40-byte base header.

What's Missing and Why? The Genius of Subtraction

Just as important as what's in the IPv6 header is what was deliberately removed compared to IPv4. These omissions are key to IPv6's improved efficiency.

  • No Header Length (IHL) field: Since the base IPv6 header is always a fixed 40 bytes, this field is no longer necessary. Routers don't have to spend time calculating where the header ends.
  • No Fragmentation Fields (ID, Flags, Offset): Fragmentation is a costly process for routers. In IPv6, routers in the middle of the network do not fragment packets. If a packet is too large, the router drops it and sends an error message back. It is the responsibility of the sending host to ensure the packet is the right size (using a process called Path MTU Discovery). If fragmentation is required, it is handled using the optional Fragmentation Extension Header, which is only processed by the destination host, not by intermediate routers.
  • No Header Checksum: This is a massive performance enhancement. In IPv4, every router had to re-calculate the header checksum because the TTL field changed at every hop. This consumed valuable processing cycles. IPv6 designers eliminated this field entirely, assuming that data link layer technologies (like Ethernet, which has its own checksum) and transport layer protocols (like TCP and UDP, which also have checksums) provide sufficient error detection. This significantly reduces the processing load on routers, allowing them to forward packets much faster.
    IPv6 Datagram Header | Teleinf Edu