IPv6

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

Table of contents

  1. Introduction
  2. The IPv6 header
    1. Extension headers
  3. IPv6 addresses
  4. References

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 header

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

The main header:

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |Version| Traffic class |           Flow label                  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |         Payload length        |  Next header  |   Hop limit   |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   +                                                               +
   |                                                               |
   +                         Source address                        +
   |                                                               |
   +                                                               +
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   +                                                               +
   |                                                               |
   +                      Destination address                      +
   |                                                               |
   +                                                               +
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

[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 Payload length field specifies the number of bytes that follow the 40 byte header.

The Next header field can specify whether another header follows the current one. If this header is the last IP header, Next header defines which transport protocol is contained in the IP payload.

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:

  • Protocol (Next header is used instead).
  • 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]

Extension headers

Extension headers are an approach for adding extra options to an IPv6 header.

There are six kinds of extension headers:

Extension header Description
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
Encrypted security payload Information about the encrypted contents

[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.

IPv6 addresses

IPv6 addresses are 128-bits, which gives 3x10^38 possible addresses.

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.