Introduction to IPv6
Internet Protocol Version 6 was developed by the Internet Engineering Task Force to address the most critical flaw of IPv4: the complete exhaustion of its 32 bit address space.
IPv6 is the next generation protocol for the Network Layer. It completely revamps the addressing architecture and vastly simplifies the datagram header to speed up packet processing across global routing infrastructure.
Key Characteristics of IPv6
- 128 Bit Address Space: Provides an astronomically large number of unique addresses, practically ensuring we will never run out of IP addresses again.
- Hexadecimal Notation: Addresses are written in hexadecimal format separated by colons. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
- Zero Compression: To make addresses easier to write, continuous blocks of zeros can be compressed using a double colon (::). For example, the previous address can be shortened to 2001:0db8:85a3::8a2e:0370:7334.
- No Broadcasts: IPv6 completely eliminates broadcast traffic. It relies entirely on Unicast, Multicast, and a new concept called Anycast (delivering to the closest node in a group).
- Native Security: Unlike IPv4, which requires add on security, IPv6 was designed with IPSec integrated natively, providing robust authentication and encryption by default.
- No Router Fragmentation: In IPv6, intermediate routers are explicitly forbidden from fragmenting packets. If a packet is too large, the router drops it. All fragmentation must be handled exclusively by the sending host before transmission.
The IPv6 Datagram Header
To maximize router efficiency, the IPv6 base header has a strict, fixed size of exactly 40 bytes. All unnecessary optional fields and checksums were removed to drastically reduce processing overhead.
Header Fields
- Version (4 bits): Contains the binary value 0110 to strictly indicate Internet Protocol version 6.
- Traffic Class (8 bits): Functions identically to the IPv4 Type of Service field, allowing packets to be prioritized for Quality of Service handling.
- Flow Label (20 bits): A brand new field designed to identify a sequence of packets that require special, real time handling. It ensures that packets belonging to the exact same flow take the exact same path, minimizing delays for video and voice streaming.
- Payload Length (16 bits): Specifies the size of the data payload strictly excluding the 40 byte base header. For example, if a datagram carries 1000 bytes of data, the payload length is exactly 1000.
- Next Header (8 bits): Replaces the IPv4 Protocol field. It identifies the immediate next header following the base IPv6 header, which could be an Extension Header or a Transport Layer protocol like TCP.
- Hop Limit (8 bits): Replaces the IPv4 Time to Live field. It is decremented by 1 at every router. If it reaches 0, the packet is forcefully discarded to prevent infinite loops.
- Source Address (128 bits): The exact IPv6 address of the originating device.
- Destination Address (128 bits): The exact IPv6 address of the intended receiving device.
Extension Headers
Because the base IPv6 header is fixed at 40 bytes, optional features are handled using Extension Headers. These headers are daisy chained directly between the base header and the upper layer data payload.
For example, if a packet requires strict routing rules and encryption, the Next Header field points to a Routing Extension Header, which then points to an Encapsulating Security Payload Header, which finally points to the TCP payload. This modular approach keeps the base header lightning fast.
Major Improvements Over IPv4
- No Header Checksum: IPv6 deliberately removes the header checksum field. In IPv4, this checksum had to be recalculated at every single router because the TTL field changed. Removing it eliminates a massive processing bottleneck.
- Stateless Auto Configuration: Devices can generate their own globally unique IPv6 addresses automatically without needing a central DHCP server, simply by interacting with local routers.
- Simplified Processing: Because intermediate routers no longer handle fragmentation or checksum recalculations, packets pass through network infrastructure significantly faster.
Comparison: IPv4 vs IPv6
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address Size | 32 bits | 128 bits |
| Notation | Dotted Decimal | Hexadecimal Colon |
| Header Size | Variable (20 to 60 bytes) | Fixed at 40 bytes |
| Checksum | Required in header | No header checksum |
| Fragmentation | Performed by sender and routers | Performed exclusively by the sender |
| Security | Optional (requires add ons) | Native integrated IPSec |
| Broadcasts | Supported | Not supported (uses Multicast and Anycast) |
