Skip to content

The IPv6 Datagram Format

The IPv6 protocol was designed to overcome the limitations of IPv4, primarily its address space exhaustion, and to simplify packet processing in routers.

It features a streamlined, fixed-length 40-byte header with reduced processing overhead. IP address size increased from 32 to 128 bits.

IPv6 address: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Supports unicast, multicast, and new anycast addressing. Many IPv4 header fields removed or made optional.

Key IPv6 Header Fields

  • Version (4 bits): Always set to 6.

  • Traffic Class (8 bits): Used for quality of service (QoS) to prioritize packets.

  • Flow Label (20 bits): A new field used to identify sequences of packets ("flows") that require special, real-time handling. (e.g., real-time audio/video).

  • Payload Length (16 bits): The size of the data payload in bytes.

  • Next Header (8 bits): Identifies the protocol of the encapsulated payload (e.g., TCP, UDP) or indicates the presence of an optional extension header.

  • Hop Limit (8 bits): Replaces IPv4's TTL. It's decremented by each router, and the packet is discarded if the limit reaches zero.

  • Source Address (128 bits): The expanded address of the sending host.

  • Destination Address (128 bits): The expanded address of the receiving host.

  • Data (Payload): Transport-layer segment or upper-layer data.

Major Changes from IPv4

IPv6 simplifies its header by removing or redesigning several IPv4 fields to speed up router processing.

  • No Header Checksum: To reduce processing time, the header checksum was removed. Error checking is now handled by the transport layer (e.g., TCP/UDP) and the link layer.

  • No Fragmentation in Routers: Routers no longer fragment oversized packets. If a packet is too big for a link, the router drops it and sends an ICMPv6 "Packet Too Big" message back to the sender. Fragmentation, if needed, is performed only by the source host.

  • No Options Field: The complex Options field is replaced by a more flexible system of Extension Headers, which are placed between the IPv6 header and the payload only when needed.

Transitioning from IPv4 to IPv6

Since IPv4 and IPv6 are not directly compatible, the global transition requires mechanisms that allow both protocols to coexist. A "flag day" switchover is not feasible.

The two primary transition strategies are:

1. Dual Stack

This is the most common approach where Devices and routers run both the IPv4 and IPv6 protocol stacks simultaneously.

When initiating communication, a dual-stack device queries the DNS. If the destination has an IPv6 address (an AAAA record), it connects using IPv6. If not, it falls back to using the IPv4 address (an A record).

2. Tunneling

Tunneling a method where an entire IPv6 datagram is encapsulated inside an IPv4 datagram, enabling IPv6 packet to traverse over an IPv4-only network.

The IPv4 packet is routed through the intermediate IPv4 network. At the end of the "tunnel," the IPv4 header is removed, and the original IPv6 packet is extracted and forwarded to its destination.

Network-layer transitions are slower and more complex compared to application-layer changes.

Made with ❤️ for students, by a fellow learner.