# IPv6

IPv6 is the next version of IP after IPv4. It solves the problem of address scarcity that IPv4 suffers from.

## Introduction

There were several design goals for IPv6:

• Support billions of hosts
• Reduce the size of routing tables
• Speed up packet processing
• Improve security
• Support different types of service, e.g. VoIP
• Enable host roaming without changing IP address
• Enable protocol to evolve in future
• Permit both protocols to coexist for long period of time

[1, P. 456]

Despite IPv6 being standardized in 1998, the Internet still mostly uses version IPv4.

The IPv6 main header is simple. IPv6 uses an extensions header system to add extra options, which will be discussed later in this section.

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic class |           Flow label                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


[2, P. 4]

The Version field is always 6. Routers use this field to determine whether to process packets as IPv4 packets or IPv6 packets.

The Traffic class field describes the class of service, e.g. VoIP.

The Flow label field is used to mark groups of packets as having the same requirements.

The Hop limit field is the TTL field renamed. It limits the number of hops a packet can take before it’s dropped.

The Source address and Destination address fields specify the IPv6 address of the source and destination respectively.

[1, Pp. 458-9]

Some fields included in the IPv4 header were removed from the IPv6 header:

• Fragmentation fields (IPv6 takes different approach to fragmentation).
• The Checksum field (calculating it reduces performance, and other protocols perform their own checksums anyway).

[1, Pp. 460-1]

There are six kinds of extension headers:

Hop-by-hop options Miscellaneous information for routers
Destination options Additional information for the destination
Routing Loose list of routers to visit
Fragmentation Management of datagram fragments
Authentication Verification of the sender’s identity

[1, P. 461]

Each header is optional, but if one is present it must appear directly after the fixed header [1, P. 461].

Some headers are a fixed length, others contain a variable number of variable-length options.

For fields that contain variable number of items, each item is encoded as a <Type, Length, Value> tuple. Type is a 1-byte field that specifies the type of option, Length is a 1-byte field that tells how long the value is (up to 255 bytes). Value can be any information required [1, P. 461].

Each extension header includes a Next header field which works the same way as the Next header field in the IP main header, and is used to specify which extension header (if any) comes next.

The notation for IPv6 address is eight groups of four hexadecimal digits separated by colons:

8000:0000:0000:0000:0123:4567:89AB:CDEF


Leading zeroes in a group can be omitted, and one or more groups of zeros can be replaced by two colons:

8000::123:4567:89AB:CDEF


[1, P. 460]

## References

1. [1] A. Tanenbaum and D. Wetherall, Computer Networks, 5th ed. 2011.
2. [2] B. Hinden and D. S. E. Deering, “Internet Protocol, Version 6 (IPv6) Specification,” no. 2460. RFC Editor, Dec-1998.