The IPv6 Packet Header is found at the start of every IPv6 Packet. It is always 40 bytes in length, Every bit of it is accounted for. It is twice the size of the IPv4 Packet Header (which results in 20 bytes of additional overhead in every IPv6 packet, compared to IPv4), yet has fewer fields. This is due to the far larger (4X) Source Address and Destination Address fields. It not only has fewer fields, it is actually much simpler. The complexity is moved off into Packet Header Extensions.
The Version field (4 bits) contains the value 6 in all IPv6 packets (imagine that!). In comparison, the Version field in all IPv4 packets contains the value 4. This field allows IPv4 and IPv6 traffic to be mixed in a single network.
The Traffic Class field (8 bits) is available for use by originating nodes and/or forwarding routers to identify and distinguish between different classes or priorities of IPv6 traffic, in a manner identical to that of IPv4 “Type of Service”. For details, see RFC 2474 and RFC 2475.
The Flow Label field (20 bits) is something new in IPv6. It can be used to tag up to 220 (1,048,576) distinct traffic flows, for purposes such as fine grained bandwidth management (QoS). Its use is still experimental. Hosts or routers that do not support this function should set it to zero when originating a packet, or ignore it when receiving a packet. The semantics and usage of this field are specified in RFC 3697, “IPv6 Flow Label Field Specification”, March 2004. A specific traffic flow is identified by a 3-tuple which includes the Source Address, Destination Address and a Flow Control number. As with Differentiated Service, the Flow Label field is just a request for prioritization – the actual prioritization is done in routers in the path. Unfortunately most current routers do not process the Flow Label field, so at this time, QoS in IPv6 is identical to that in IPv4. Once routers process the Flow Label information, IPv6 QoS will be significantly better than that in IPv4.
The Payload Length field (16 bits) is the length of the IPv6 packet payload (data field) in bytes, not counting the standard packet header (as it is in IPv4 Total Length). However, the Payload Length DOES include the size of any extension headers, which don’t even exist in IPv4. You can think of packet extension headers as being the first part of the data field (payload) of the IPv6 packet. Since the Payload Length field is 16 bits, the data field can be up to 65,535 bytes long. A new Hop-by-Hop extension header is defined in RFC 2675, “IP Jumbograms”, August 1999. If this extension header is present, it overrides the Payload Length field with a 32 bit value. This allows the payload length to be up to 4 gigabytes.
The Next Header field (8 bits) indicates the type of header immediately following the basic IPv6 packet header. It uses some of the same values as the IPv4 Protocol field, as defined in RFC 1700, “Assigned Numbers”, October 1994, but there are some new values possible in IPv6 Packet Headers. Here are some common protocol numbers for use in the IPv6 Next Header field. The ones without RFC references are defined in RFC 2460, “Internet Protocol, Version 6 (IPv6) Specification”, December 1998.
43 Routing Extension Header
89 OSPF – Open Shortest Path First routing (RFC 1583)
132 SCTP – Streams Control Transmission Protocol (RFC 4960)
If the Next Header field in the basic packet header contains the code for TCP (6), UDP (17) or SCTP (132), then the transport layer header (TCP, UDP or SCTP) begins immediately after the basic packet header, followed by the data. If the Next Header field contains the value for ICMPv6 (58), then the ICMPv6 header begins immediately after the basic packet header, and may be followed with data. Otherwise one or more IPv6 extension headers will be found between the basic packet header and the transport or ICMPv6 header, which may be followed by data. Since each extension header has another Next Header field (and a Header Length field), this constitutes a linked list of headers before the transport or ICMPv6 header, which is followed by the data.
The Hop Limit field (8 bits) serves the same purpose as the Time To Live field in the IPv4 Packet Header. It is used to prevent packets from being circling around indefinitely on a network. Every time a packet crosses a switch or router, the hop count is decremented by one. If the hop count reaches zero, the packet is dropped, and the node that drops the packet sends an ICMPv6 “time exceeded” message to the packet sender. This mechanism is used to implement the traceroute command.
The Source Address field (128 bits) contains the IPv6 address of the packet sender. This can be any unicast IPv6 address (link local, global or ULA). It cannot be a multicast address. In some cases (if the node does not yet have any unicast address), the unspecified address (::) may be used.
The Destination Address field (128 bits) contains the IPv6 address of the packet recipient. This can be a unicast IPv6 address (link local, global or ULA). It can also be a multicast IPv6 address of any scope. It cannot be the unspecified address (::).
Summary of changes from the IPv4 Packet Header to IPv6 Packet Header:
- IPv4 IHL field was discarded (IPv6 basic header is fixed length of 40 bytes, no need for IHL)
- IPv4 Type of Service field was renamed the IPv6 Traffic Class field (same functionality)
- IPv4 Total Length field became the IPv6 Payload Length field (it no longer includes the length of the basic packet header)
- IPv4 Fragmentation fields moved to the IPv6 Fragment Extension Header
- IPv4 Time To Live field renamed as the IPv6 Hop Limit field (same functionality)
- IPv4 Protocol field renamed as the IPv6 Next Header field (same functionality, slightly different list of possible values)
- IPv4 Header Checksum discarded
- 32 bit IPv4 Source Address grew to 128 bit IPv6 Source Address, but otherwise same function
- 32 bit IPv4 Destination Address few to 128 bit IPv6 Destination Address, but otherwise same function
- New 20-bit Flow Label field added to the basic IPv6 packet header
- Several new Packet Extension headers already defined, more can easily be specified in the future
Various typical IPv6 packet header chains: