This lesson focuses on the differences between IPv4 and IPv6 headers. We will explore which IPv4 header fields have been removed in IPv6, what new fields and capabilities have been added, and which fields have been renamed. Additionally, we will discuss how the experiences learned from IPv4 have contributed to the development of a more efficient IPv6 header.
Table of Contents
IPv4 versus IPv6 Hedaer
This image illustrates the differences between the 20-byte IPv4 header and the 40-byte IPv6 header. Although the IPv6 address size (16 bytes) is four times larger than the IPv4 address size (4 bytes), the overall IPv6 header is only twice as large as the IPv4 header. This highlights the efficiency of the IPv6 design, which optimizes header size even with expanded addressing capabilities.
I am not going to deep into details of IPv6 and IPv4 headers, but I will provide an overview of the key differences between them and explain how the IPv6 header has been optimized.
I’ve highlighted certain fields in the headers using colored boxes: red indicates fields that have been removed in IPv6, blue shows fields that still exist but with a different name, green highlights new fields added in IPv6, and fields with no colored boxes including version, source address and destination address have the same name and function in both IPv4 and IPv6.
Fields removed in IPv6 Header
Let’s begin with the header fields marked in red, which have been removed and no longer exist in the IPv6 header.
Header Length (IHL): In IPv4, this field indicated the header length because the size of the IPv4 header could vary due to “options“ fields. However the options field is rarely used but the IPv4 header’s size is variable by nature. In contrast, the IPv6 header has a fixed length, making the IHL field unnecessary in IPv6.
Total Length / Payload Length: In IPv4, the “Total Length” field represents the combined length of the header and the data. In contrast, IPv6 uses the “Payload Length” field to indicate only the size of the data, as the header size is fixed and does not need to be included in this calculation.
Identification, Flags, Fragment Offset: These fields are used for fragmentation in IPv4. In IPv6, the fragmentation header is not included in the main header and it will not be used mostly since:
– Fragmentation is handled only at the source node, and it is not allowed by intermediate routers.
– Path MTU Discovery (PMTUD) is used to avoid fragmentation by ensuring packets are sized appropriately for the entire path.
Header Checksum: In IPv6 header, the checksum is removed since it relies on error detection mechanisms provided by higher-layer protocols (e.g., TCP/UDP) to ensure data integrity.
Options: IPv4 Options are part of the main header but are rarely used in practice. They allow for functionalities such as source routing and can extend the header length up to 60 bytes. . Since these options must be processed by routers, they can impact network performance and efficiency.
In IPv6, the equivalent of IPv4 options are called extension headers. Unlike IPv4 options, which are part of the main header, extension headers are separate and processed only when necessary. This design enhances flexibility and efficiency by keeping the primary header fixed and streamlined. Shortly, we will provide an overview of IPv6 extension headers.
Fields renamed in IPv6 Header
Now, let’s consider the IPv6 header fields where only the name has changed, while the functionality remains unchanged.
Type of Service / Traffic Class: In IPv6, the “Type of Service” field from IPv4 has been renamed to “Traffic Class.” Despite the name change, its function remains the same: to classify different types of traffic and manage varying levels of Quality of Service (QoS).
Time to Live / Hop Limit: Both are used to limit the packet’s lifetime.
Protocol / Next Header: In IPv4, it’s called Protocol, indicating the next level protocol like TCP, UDP and ICMP which have in order the protocol numbers 6, 17 and 1. In IPv6, it’s Next Header, which can be a higher-layer protocol or an extension header. Shortly, we will provide an overview of IPv6 extension headers.
Fields new in IPv6 header
Flow Label: is the only new field in the IPv6 header with no equivalent in the IPv4 header. It is specifically designed to work alongside the “Traffic Class” field to classify traffic for Quality of Service (QoS) purposes. To compare the “Flow Label” with the “Traffic Class”:
Traffic Class is used to classify and prioritize different types of traffic, such as data, voice, and video, and to apply different levels of Quality of Service (QoS) based on these classifications. For example, it can be used to ensure that video traffic gets higher priority than data traffic or that voice traffic is handled with lower latency.
Flow Label, on the other hand, is used to identify and manage packets that belong to the same flow. Within a single Traffic Class, the Flow Label can differentiate between different flows of the same type of traffic. For instance, within a Traffic Class designated for voice traffic, the Flow Label can distinguish between different voice calls. This allows for potential QoS variations and optimized handling for different voice calls or flows, even though they share the same Traffic Class.
IPv6 Extension Headers
Finally, what is particularly interesting about the IPv6 header is that it has a fixed size, making it more efficient and requiring less processing time compared to the IPv4 header. This efficiency is achieved because optional fields in IPv4 have been restructured as extension headers in IPv6.
When optional information is needed, it is added as a separate extension header, with the “Next Header” field pointing to it instead of directly to the upper-layer protocols. Each extension header has its own “Next Header” field, which can either point to another extension header or to the appropriate upper-layer protocol.
A brief overview of IPv6 extension headers
I won’t delve deeply into the details of IPv6 extension headers, but I’ll provide a brief overview of each one for reference. I’ll give a quick definition of each header in the typical order they might appear.
1. Hop-by-Hop Options Header: Carries optional information that must be processed by every node along the packet’s path such as collecting packet delay or throughput data
2. Routing Header: Specifies a list of intermediate nodes that the packet must visit on its way to the destination called source routing.
3. Fragment Header: Handles packet fragmentation and reassembly.
4. Authentication Header (AH): Provides integrity and authentication for the packet, ensuring that the data has not been tampered with and is from a legitimate source. It is a protocol part of the IPsec framework.
5. Encapsulating Security Payload (ESP): Provides confidentiality (encryption) as well as optional integrity and authentication for the packet. It is another IPsec protocol.
6. Destination Options Header: Carries optional information that is processed only by the destination node such as mobile node’s home address in IPv6 Monility.
7. Mobility Header: Used specifically for Mobile IPv6 (MIPv6) signaling messages