Lecture #19 - Internet Protocol Version 6: Part 1

What's the Problem with IPv4?

Well that depends who you ask - the answer could be "nothing" or "lots"...

IPv4 was designed in the 1970's and deployed in the early 1980's. At the time the 32 bit address space seemed to be huge, however the classful based assignment has rapidly led to address space exhaustion.

Classful based address allocation and Name Address Translation (NAT) have both helped to ease this problem, however neither is a complete solution. Classful allocation has slowed down the problem, however it is still eminent. NAT on the other hand has created other problems, especially when two devices want to communicate directly with each other from behind NAT gateways.

Additionally, there have been significant changes in the number of Internet hosts, the number and type of applications used over IP and the way in which the Internet is used (eg. Internet access from a mobile phone) - none of this existed when IPv4 was designed and we tend to need to work around issues that crop up (eg. change IP address when changing location).

The Future Of IP

In 1998 the IETF released RFC2460 detailing the specification for Internet Protocol version 6 (IPv6). IPv6 is the planned successor to IPv4.

Key features of IPv6 include:

  • Larger addresses. IPv6 addresses are 16 bytes (128 bits) in length. Address space exhaustion will not be a problem in the foreseeable future.
  • Flexible header format. IPv6 uses a fixed size base header, with extension headers being added if necessary.
  • Improved options. IPv6 datagrams can have many more options than IPv4 datagrams. Options are implemented via extension headers.
  • Support for resource allocation/Quality of Service (QoS). IPv6 datagrams can have preallocated network resources such as bandwidth and delay - provided they are supported by the underlying network technology!
  • Support for stateless automatic configuration of host interfaces.

IPv6 Deployment and Uptake

The last 10 years have seen a very minimal uptake of IPv6. There are a number of factors involved:

  • People are "comfortable" with IPv4 - they know how it works and IPv6 is foreign to them.
  • Upgrading the entire Internet is an interesting problem - how do we get people to move to IPv6?
  • There has been very little motivation from a technical perspective. Yes it's arguably better, but IPv4 works and we still have address space.
  • In Australia, very few ISPs (if any?) are providing IPv6 connectivity, let alone IPv6 address allocation.

Deployment has significantly increased in the last year and the next couple of years will most likely see this trend continue. Notably:

  • Every major operating system now ships with IPv6 support and for most current operating systems it is enabled by default.
  • The US military has committed to reaching IPv6 "readiness" by 2008, with all miltary networks to be moved to IPv6 only between 2010-2012.
  • Even the Australian Government has committed to IPv6 readiness by the end of 2009, with transition between 2010-2012 and full implementation between 2013 and 2015.
  • Six of the thirteen authorative root nameservers were given IPv6 "AAAA" DNS resource records in early February 2008. This now makes DNS lookups possible using IPv6 only.
  • Google made their search engine accessible via IPv6 on the 13/05/2008. You can access it at ipv6.google.com, however you will need to have IPv6 connectivity in order to do so!

The IPv6 Base Header

Preliminary observations:

  • Header is always a fixed size of 40 bytes or 320 bits, unlike IPv4 where the header size can vary based on IP options.
  • Alignment is now a multiple of 64 bits, instead of the 32 bits in IPv4.
  • The header length field has been replaced with a payload length.
  • Fragmentation information is now in an extension header.
  • Time-to-live has been replaced by a hop limit.

In detail:

Version
4-bit protocol version identifier (has a value of 6).
Traffic Class
8-bit traffic class field, used for Quality of Service (QoS).
Flow Label
20-bit flow label which can be used to identify datagrams that are part of the same transport layer "flow". Datagrams with a flow label value of zero are treated as being independent.
Payload Length
16-bit unsigned integer which specifies the payload length of the IPv6 datagram. This includes the size of the IPv6 extension headers (if any).
Next Header
8-bit selector which identifies the type of header that immediately follows the IPv6 base header. Can be set to type 59 indicating that no header follows the base header.
Hop Limit
8-bit unsigned integer which is decremented by one each time the packet is forwarded. Packets are discarded once hop limit is zero.
Source Address
128-bit IPv6 address of originator.
Destination Address
128-bit IPv6 address of intended recipient.

IPv6 Extension Headers

Every IPv6 datagram has a base IPv6 header - any additional information is provided via additional extension headers, if required. The Next Header field is used to indicate the type of header that follows the base header. This can be an IPv6 extension header, or that of the encapsulated payload (eg. TCP). Headers are simply chained together, for example:

A key feature of this design is that parsing (processing) an IPv6 datagram containing only a base header is more efficient than parsing an IPv4 datagram. Most extension headers do not need to be processed by intermediate routers, further improving routing efficiency.

IP extension headers include:

  • Fragmentation - although IPv6 only permits source fragmentation. This means that PMTU discovery must be used, otherwise the host must use an MTU of 1280 bytes - the minimum size that networks must support.
  • Hop-by-Hop Options - optional information that must be examined by every node along a packet's delivery path.
  • Destination Options - optional information that is only examined by the destination host.
  • Authentication headers, enabling IPsec (see next lecture).

Quality of Service

Another interesting aspect of IPv6 is its built in ability to support Quality of Service (QoS). If used, the 20-bit flow label will uniquely identify a flow of packets (for example, those belonging to a single TCP connection) between two nodes. As a result, the flow label must be unique for the current source/destination IP addresses. If packets are not identified as being part of a "flow", the flow label value must be zero.

The actual QoS must however be setup outside of IPv6 and negotiated with the intermediate routers using a protocol like Resource-Reservation Protocl (RSVP). The source address/destination address/flow label triplet however allows routers to identify specific flows in order to provide them with a level of service that differs from the default service.

IPv6 Addresses

The 16 byte (128 bit) IPv6 address space is almost unimaginably huge - IPv6 theoretically has 340,282,366,920,938,463,463,374,607,431,768,211,456 addresses. That's enough to to give every square meter of the earth's surface 667 * 1021 addresses. Or we could give every person on earth 5.1 * 1028 or 51,557,934,381,960,373,252,026,455,671 addresses. Given that IPv4 has a total of 4,294,967,296 addresses, this would result in each person having address space equivalent to 1.2 * 1019 times the size of the current Internet!

The "traditional" dotted-decimal notation is not easily used with IPv6 addresses. For example:

120.30.8.240.101.17.67.0.0.0.0.0.10.19.4.202

The notation to be used in IPv6 is called colon hexadecimal (or colon hex), where 16-bit sections of the address are written in hex, and colon separated, thus:

781e:08f0:6511:4300:0000:0000:0a13:04ca

Colon hex notation allows zero suppression, so that the above address could be written:

781e:08f0:6511:4300::0a13:04ca

Or even:

781e:8f0:6511:4300::a13:4ca

Address Types

IPv6 allows for three types of address classes:

Unicast
A unicast IP address identifies a single interface (same as for IPv4).
Anycast
Anycast IP addresses are identifiers for a set of interfaces, typically belonging to different nodes. An IPv6 packet is sent to any one of these interfaces, typically being the "nearest".
Multicast
Multicast IP addresses identify a set of interfaces, typically belonging to different nodes. A packet is sent to all interfaces within the multicast group (usually in a bandwidth effective manner).

Address Type Identification

The type of an IPv6 address is determined by the high-order bits of the address, otherwise known as the binary prefix:

Binary Prefix Hexadecimal Prefix Type Of Address
00...0 ::/128 Unspecified
00...1 ::1/128 Loopback
1111 1111 ff00::/8 Multicast
1111111010 f380::/10 Link-Local Unicast Addresses
(everything else) Global Unicast

All other addresses are reserved for future allocation (with some exceptions).

Special IPv6 Addresses and Prefixes

Like IPv4, IPv6 has a number of addresses that have a special meaning. Furthermore certain prefixes are reserved for specific purposes.

Address/Prefix Purpose
::/128 Unspecified address (equivalent to 0.0.0.0 for IPv4)
::1/128 Loopback address (equivalent to 127.0.0.1 for IPv4)
::ffff:0:0/96 Prefix for IPv4 addresses that are mapped to IPv6 address space.
2002::/16 Prefix used for 6to4 tunnelling (see next lecture)
fe80::/10 Link-local addresses - only valid on the local network segment (equivalent to the IPv4 autoconfiguration address range of 169.254.0.0/16)
ff00::/8 Multicast addresses (equivalent to IPv4 class D)

DNS for IPv6

Modifications have also been needed to DNS so that it can support queries and responses for IPv6 addresses. IPv6 support has been added via the addition of a new Resource Record (RR) type known as "AAAA" (or just quad-A).

DNS queries proceed as per normal, with the difference being that an IPv6 capable name server can be queried for AAAA records, which will result in it returning an AAAA record instead of the normal A record.

For example:

ironbark:~ joel$ dig ipv6.google.com AAAA

; <<>> DiG 9.3.4 <<>> ipv6.google.com AAAA
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39907
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 7, ADDITIONAL: 7

;; QUESTION SECTION:
;ipv6.google.com.               IN      AAAA

;; ANSWER SECTION:
ipv6.google.com.        10752   IN      CNAME   ipv6.l.google.com.
ipv6.l.google.com.      252     IN      AAAA    2001:4860:0:2001::68