The IPv6 protocol defines a set of headers, including the basic IPv6 header and the IPv6 extension headers.
The following figure shows the elements that appear in the IPv6 header and the order in which they appear.
The following list describes the function of each header field.
Version - 4-bit Internet protocol version number = 6
Priority - 4-bit priority value (see "Priority")
Flow Label - 24-bit field (see "IPv6 Quality-of-Service Capabilities")
Payload Length - 16-bit unsigned integer, which is the rest of the packet following the IPv6 header, in octets
Next Header - 8-bit selector. Identifies the type of header immediately following the IPv6 header. Uses the same values as the IPv4 protocol field (see "Extension Headers").
Hop Limit - 8-bit unsigned integer. Decremented by 1 by each node that forwards the packet. The packet is discarded if Hop Limit is decremented to zero.
Source Address - 128 bits. The address of the initial sender of the packet (see "IPv6 Addressing").
Destination Address - 128 bits. The address of the intended recipient of the packet (not necessarily the recipient if an optional Routing Header is present)
IPv6 includes an improved option mechanism over IPv4. IPv6 options are placed in separate extension headers that are located between the IPv6 header and the transport-layer header in a packet. Most IPv6 extension headers are not examined or processed by any router along a packet's delivery path until it arrives at its final destination. This facilitates a major improvement in router performance for packets containing options. In IPv4, the presence of any options requires the router to examine all options.
The other improvement is that, unlike IPv4 options, IPv6 extension headers can be of arbitrary length and the total amount of options carried in a packet is not limited to 40 bytes. This feature, plus the manner in which they are processed, permits IPv6 options to be used for functions that were not practical in IPv4. A good example of this is the IPv6 authentication and security encapsulation options.
To improve performance when handling subsequent option headers (and the transport protocol that follows), IPv6 options are always an integer multiple of 8 octets long so that alignment of subsequent headers is retained.
The following IPv6 extension headers are currently defined.
Routing - Extended routing (like IPv4 loose source route)
Fragmentation - Fragmentation and reassembly
Authentication - Integrity and authentication; security
Encapsulation - Confidentiality
Hop-by-Hop Option - Special options that require hop-by-hop processing
Destination Options - Optional information to be examined by the destination node