Lecture #22 - Internet Protocol Version 6
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 short(ish) base header, and extra extension headers if needed.
- 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 length of the payload length of the IPv6 datagram. This includes the size of the IPv6 extention 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.
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::/128Unspecified 00...1::1/128Loopback 1111 1111ff00::/8Multicast 1111111010f380::/10Link-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 ::/128Unspecified address (equivalent to 0.0.0.0 for IPv4) ::1/128Loopback address (equivalent to 127.0.0.1 for IPv4) ::ffff:0:0/96Prefix for IPv4 addresses that are mapped to IPv6 address space. 2002::/16Prefix used for 6to4 tunnelling. fe80::/10Link-local addresses - only valid on the local network segment (equivalent to the IPv4 autoconfiguration address range of 169.254.0.0/16) ff00::/8Multicast addresses (equivalent to IPv4 class D)
ICMPv6
Like IPv4, IPv6 requires a control protocol for exchanging information regarding the operation of the network layer. IPv6 has its own version of the Internet Message Control Protocol (ICMP), which is not too dissimilar from IPv4's ICMP. The protocol number (or next header value) is 58, or ICMPv6.
The format of an ICMPv6 message is as follows:
Neighbour Discovery Protocol (NDP)
One of the significant benefits of IPv6 relate to its network discovery and autoconfiguration features. This is achieved through the use of the Neighbour Discovery Protocol or NDP, defined in RFC2461.
NDP allows for:
- Router discovery.
- Prefix discovery.
- Parameter discovery.
- Address autoconfiguration.
- Address resolution.
- Next-hop determination.
- Neighbour unreachability detection.
- Duplicate address detection.
- Redirection.
NDP Messages
In order to achieve its discovery, detection and configuration functions, NDP uses the following messages:
- Router Advertisement (RA) - messages originated by routers on a periodic basis to advertise their presence and link-specific parameters (eg. prefix, MTU, etc).
- Router Solicitation (RS) - sent by a host in order to request an immediate RA response from any available routers.
- Neighbor Solication (NS) - sent by a host in order to request another node's link-layer address. NS messages are also used to perform Duplicate Address Detection (DAD) and neighbour unreachability detection.
- Neighbor Advertisement (NA) - sent by a host in response to receiving a NS message. Unsolicited NA messages can also be sent if a host changes its link-layer address.
- Redirect - sent by a router to indicate that a host should be using another router as the next hop for the given traffic.
Address Autoconfiguration
One of the nicest features of IPv6 is its stateless address autoconfiguration. In the case of IPv4 either a IP address must be assigned manually or a DHCP server can be used to provide automatic assignment - either way either a human or a server must be involved.
With IPv6 a host can self-configure its own interface address as soon as it is connected to a network. Firstly a 64-bit interface ID needs to be generated - in the case of Ethernet networks this is done using a process known as MAC-to-EUI64, which converts the 48-bit MAC address by flipping the two 24-bit halves and inserting 0xfffe in between.
Obviously this interface ID is only half the size of an IPv6 address. This can now be prefixed with the link-local prefix extended to a /64 length, resulting in a 128-bit IPv6 link-local address that is almost certain to be unique.
Stateless autoconfiguration can now be performed by acquiring a link prefix via a RA message. This prefix can then be added to the previously generated interface ID resulting in a globally unique IPv6 address.
IPv4 to IPv6 Transitioning
One of the more interesting challenges with the deployment of IPv6 is that of communicating using existing IPv4 infrastructure. One approach is to use IPv6-to-IPv4 tunnelling, more commonly known as 6to4. This mechanism is detailed in RFC3056.
An additional IPv4 protocol type has been defined (type 41) which indicates that an IPv4 packet encapsulates an IPv6 datagram. In many ways the process is similar to that used by VPNs - an IPv6 capable gateway must encapsulate the IPv6 traffic inside an IPv4 datagram and send it to a IPv4-to-IPv6 capable router, which will in term decapsulate the IPv6 datagram and route it into the IPv6 network.
Routing Protocols
Routing protocols also need to be capable of supporting IPv6. As a result OSPFv3 has been designed to support IPv6 only, rather than OSPFv2 which operates with IPv4. OSPF for IPv6 is detailed in RFC2740.
For exterior routing, BGP4 has been modified via the use of a multiprotocol extension for IPv6. RFC2545 defines an additional two BGP attributes which allow for the annoucement and withdrawel of IPv6 network layer reachability information.
References
Stallings: Chapter 18.5 (pp. 586-595)
AARNet's IPv6 Migration Broker.
RFC2460 - Internet Protocol Version 6.
RFC4291 - IPv6 Addressing Architecture.
RFC2461 - Neighbor Discovery for IPv6.