Updated August 19, 2023
Introduction IPv6 Header Format
IPV6 header format is 40 bytes in length and contains information essential to routing and delivery, consisting of 8 fields, Version, Traffic Class, Flow Label, Payload length, next header, HOP limit, Source address, and destination address, where each has its features and provides essential data required to transmit the data. Version is a 4-bit field; traffic class is 8-bit; the flow label is 20 bits; payload length is a 2-byte field; next header is 8-bit, hop limit is an 8-bit field, the source address is 16 bytes, and the destination address is of 16 bytes.
List of IPv6 Header Format Component
IPv6 Header Format Component the data packet of IPv6 encompasses two main parts, i.e., header and the payload. The IPv6 consists of a 40 bytes long fixed header containing the following fields.
Let’s see the significance of the individual components of the IPv6 Header in detail-
It signifies the version of the Internet protocol in a 4-bit sequence, i.e., 0110. This field is unimportant as the IPv6 and IPv4 packets are not determined based on the version field but by the protocol type inside the layer 2 envelopes.
2. Traffic Class
This field is similar to the Service Field of the IPv4 packet. It signifies the priority of the IPv6 packet. It is responsible for handling the traffic based on the packet’s priority. In case of congestion on the router, it discards the packets with low priority.
It uses 8 bits of memory to control traffic congestion.
|0||No specific traffic|
|2||Unattended data traffic|
|4||Attended bulk data traffic|
The source node can set the priorities, but the destination can’t expect the same set of priorities, as the router can change the priorities on the way.
3. Flow Label
- This label ensures the packets maintain the sequential flow of the same communication. With the source’s help, the label router identifies which packet belongs to which flow of information. It also helps to avoid the reordering of the data packets.
- The flow label must be set to 0 if the router and host don’t support the flow label functionality. It uses 20 bits of memory for its functioning.
4. Payload Length (16-bits)
Payload length indicates the router the size of the information contained by a particular packet. Payload length includes the upper layer packet and extension header (if any). If the payload length becomes greater than 65,535 bytes, then the payload length field becomes 0.
5. Next Header (8-bits)
The next header signifies the Extension Header type; in some cases, when it is not present, it means the protocols present inside the upper layer packet like UDP, TCP, etc. UDP (17) and TCP (6) are the most common Next Headers, but other types of headers are also possible. If compared with the IPv4 protocol, the Next Header is similar to the IPv4 protocol field.
6. Hop Limit (8-bits)
This field ensures the packet does not go into an infinite loop; every time the packet passes the link (router), this field is decremented by 1, and when it finally reaches where the package is discarded. This field also sets an upper threshold on the maximum number of links between two nodes of the IPv6 protocol. It allows a maximum of 255 hops between the nodes, and anything afterward will be discarded.
7. Source Address (128 bits)
This 128-bit source address field signifies the origin address of the package.
8. Destination Address (128 bits)
This 128-bit destination address field signifies the intended recipient address of the packet.
9. Extension Headers IPv6 Header Format
- Extension Headers are introduced in IPv6 to overcome the limitation of the Options Field of IPv4. Unlike IPv4, In IPv6, the only necessary information is defined in the Fixed Header, and all the information that is not so important or doesn’t get frequently used is defined in the Extension Header. The extension Header is between the Upper-Layer Header and the Fixed Header. Each Extension Header has a unique value that differentiates it from the others.
- The Fixed Header’s Next Header field will point to the first Extension Header if extension headers are used. Similarly, if there are multiple Extension headers, then it works similarly.
The IPv6 packet can have one or more than one extension headers; these headers should present in a specific sequence as mentioned below:
|Order||Header Type||Next Header Code|
|1||Basic IPv6 Header||–|
|2||Hop by Hop option||0|
|3||Destination options (with routing options)||60|
|7||Encapsulation Security Payload Header||50|
|No Next Header||59|
Rules of Headers
Some predefined rules define the headers’ order; let’s look at these rule sets.
- If Hop by Hop option is present, it should be after the IPv6 base header.
- All other Headers can appear only once in the list except for Destination Header.
- In case the Destination Header is placed before the Routing Header, then the Destination Header will be examined by all the intermediate nodes present in the Routing Header.
- If the Destination Header is placed before Upper Layer, then the Destination Header will be examined only by the Destination Node.
Sequence of Headers
Let’s look at the sequence in which all the Extension headers should be arranged in an IPv6 packet.
|Hop by Hop Options||Examined by all devices on the path|
|Destination Options (with routing options)||Examined by the destination of the packet|
|Routing Header||Methods to take a routing decision.|
|Fragment Header||Contains parameters of fragmented datagram done by the source|
|Authentication Header||Verify authenticity|
|Encapsulation Security Payload||Carries Encrypted data|
We have learned the IPv6 Header format and the different components present in the header. We have seen each component’s significance and how these components are different from those of the IPv4 protocol. We have also learned the different rule sets that should be considered while sequencing the header type.
This has been a guide to IPv6 Header Format. Here we have discussed the basic concept, components, and the sequence where ipv6 packets are arranged. You can also go through our other suggested articles to learn more –