Beginner's Guide to IPv6

Recently, I attended a 3-day RIPE NCC Training Course. In one of the sessions, we discussed IPv6 and I was inspired to write this post.

IPv4 Address Exhaustion

The primary reason for the development and deployment of IPv6 is IPv4 address exhaustion.

IP Address space is managed by the Internet Assigned Numbers Authority (IANA) globally. IANA, then allocates these resources to the five regional internet registries (RIRs) (AfriNIC, APNIC, ARIN, LACNIC and RIPE NCC) and they are responsible allocating resources to end users and local internet registries (such as ISPs).

IANA Regional Internet Registries

On 3rd February 2011, IANA allocated the last five /8 blocks to the five RIRs. This means there are no longer any IPv4 addresses available for allocation from IANA.

Nobody was caught off guard by this, the Internet technical community had been planning for IPv4 depletion for quite some time. But it meant that the adoption of IPv6 is now of paramount importance.

Reasons for Accelerated Address Depletion

Although the main reason for IPv4 address exhaustion is insufficient design capacity of the original internet infrastructure, some additional driving factors have made the depletion occur faster:

  • Mobile Devices have become viable internet hosts. This essentially means that each mobile device needs to have an IPv4 address.
  • Always On Connections are always active so IPv4 address recycling continued to decline at an accelerating pace.
  • As more developing countries started to get access to the internet (such as China), they required more IPv4 Addresses.
  • Organizations that obtained IP Addresses in the 1980s were often allocated far more addresses than they actually required. For example, large corporations and universities were assigned /8s (over 16 million IPv4 addresses).

IPv6

The main advantage of IPv6 over IPv4 is the larger address space which is approximately 3.4×1038 addresses.

The total number of IPv6 addresses is 340282366920938463463374607431768211456 (340 undecillion 282 decillion 366 nonillion 920 octillion 938 septillion 463 sextillion 463 quintillion 374 quadrillion 607 trillion 431 billion 768 million 211 thousand 456) while in IPv4 it was just 4294967296 (4 billion 294 million 967 thousand 296)

Address Distribution

Unlike IPv4, IANA doesn't have the full IPv6 addressing system (the /0 block), but rather it has been allocated a /3. The rest have not been allocated to anyone else but are there for future use. Maybe we use them on Mars or other planets, or maybe we use them when the IANA IPv6 address block is nearing depletion.

From that block, IANA has given /12s to the five RIRs.
IPv6 IANA Allocation

IPv6 Address Basics

An IPv6 address is 128 bits as opposed to a 32 bit IPv4. The 128 bits of an IPv6 address are represented in 8 groups of 16 bits each. Each group is written as four hexadecimal digits and the groups are separated by colons (:). An example of this representation is 2001:0db8:0000:0000:0000:ff00:0042:8329.

The smallest subnet should be a /64 since the other 64 bits are allocated to the interface ID. In IPv6, interfaces are expected to have multiple addresses.

RIPE NCC IPv6 Subnetting Card

Compressing an IPv6 Address

For convenience, an IPv6 address may be abbreviated to shorter notations by application of the following rules.

  • One or more leading zeroes from any groups of hexadecimal digits are removed; this is usually done to either all or none of the leading zeroes. For example, the group 0042 is converted to 42.
  • Consecutive sections of zeroes are replaced with a double colon (::). The double colon may only be used once in an address, as multiple use would render the address indeterminate. RFC 5952 recommends that a double colon must not be used to denote an omitted single section of zeroes.

An example of application of these rules:

  • Initial address: 2001:0db8:0000:0000:0000:ff00:0042:8329
  • After removing all leading zeroes in each group: 2001:db8:0:0:0:ff00:42:8329
  • After omitting consecutive sections of zeroes: 2001:db8==::==ff00:42:8329

The loopback address, 0000:0000:0000:0000:0000:0000:0000:0001, may be abbreviated to ::1 by using both rules.

Link Local Address

All interfaces of IPv6 hosts require a link-local address. A link-local address is derived from the MAC address of the interface and the prefix fe80::/10. The process involves filling the address space with prefix bits left-justified to the most-significant bit, and filling the MAC address in EUI-64 format into the least-significant bits. If any bits remain to be filled between the two parts, those are set to zero.

Transitioning Mechanisms

IPv6 is not foreseen to replace IPv4 instantaneously. Both protocols will continue to operate simultaneously for some time. Therefore, some IPv6 transition mechanisms are needed to enable IPv6 hosts to reach IPv4 services and to allow isolated IPv6 hosts and networks to reach each other over IPv4 infrastructure. Some of these are:

  • Dual Stacking provides both IPv4 and IPv6 protocol stacks at the same time. This is the most desirable IPv6 implementation during the transition from IPv4 to IPv6.
  • Tunnelling encapsulates IPv4 Packets in IPv6 or vice versa. In effect, you would be using IPv6 as a link layer for IPv4.

IPv6 has been implemented on all major operating systems in use in commercial, business, and home consumer environments. As of 2014, IPv4 still carried more than 99% of worldwide Internet traffic.

Resources