IPv6 is the next generation of IP which uses 128 bits to represent addresses rather than 32 bits as used in IPv4. It also adds some additional features to overcome some limitations in IPv4.
The 32 bit address space used in IPv4 allows for 4,294,967,296 (4.29 billion) addresses. With the growth in use of the internet these addresses are running out. Switching to a 128 bit address space gives 340 undecillion addresses.
(That is the number 340, followed by 36 zeros)
IPv6 was first standardised in the late 1990s and since then has seen gradual but slow adoption. Network Address Translation which allows a single public IPv4 address to be shared by multiple devices such as all the computers, smartphones and set-top boxes in a house, has allowed IPv4 to continue
longer than first anticipated.
Regional Internet Registries (RIR) are responsible for IP address allocations in different continents. IPv4 addresses ran out in all continents except Africa between 2011 and 2015. Africa is expected to run out of spare IPv4
addresses by 2020.
Whereas IPv4 addresses are typically written as 4 groups of 3 digit decimal numbers, each group representing 1 byte, IPv6 is typically written in hexadecimal with each character representing 4 bits and the characters grouped in 4's separated by colons
For example: fdf2:1912:2734:1:44e3:2bf1:71c8:b0b3
Each group is called a hextet and can be written in uppercase or lowercase. Two rules can be applied to enable the address to be written in a shortened format.
1. All leading zeros in a hextet can be omitted
2. A group of all zeros can be omitted BUT you can only do this once. To omit multiple groups of all zeros they must all be next to each other
IPv6 addresses fall into one of 3 categories:
Unicast - uniquely identifies an interface on a device
Multicast - used to send a single packet to multiple destinations.
Anycast - any IPv6 unicast address that can be assigned to multiple devices. A packet sent to an anycast address is routed to the nearest device having that address
Unlike IPv4, IPv6 does not have a broadcast address. However, there is an all-nodes multicast address that gives the same result.
The 128 bits of an IPv6 address can be split into several sections.The first section is called the prefix and identifies the network to which the address belongs. The prefix can be any length and is appended to the end of the
address in slash notation
For example: fdf2:1912:2734:1:44e3:2bf1:71c8:b0b3/64 indicates that 64 bits are used for the prefix
The remaining bits are used for the Interface ID - this is the part which identifies the actual devices interface on that network
A unicast address uniquely identifies an interface on a device. Packets sent to that address will be delivered to the corresponding devices interface. When a packet is sent the from address is ALWAYS a unicast address
A global unicast address is a standard public IPv6 address which is valid and routable across the internet.
A link-local unicast address is valid only on the local network segment/link i.e up as far as the nearest router. A router never forwards a packet with a link-local source or destination address. All IPv6 interfaces MUST
have a link-local address even if they also have another address as well. The link-local address can be either manually assigned or automatically assigned. See the sidebar on EUI-64
A unique-local address (ULA) is a private address not valid and routable across the internet. They can be used within an organisation but must be translated by a router at the network boundary for packets to traverse the internet.
ULAs start with FDXX:XXXX:XXXX where the X's represent 40 bits generated pseudorandomly using the process defined in RFC4193. This process aims to make it unlikely that two networks will have the same 40 bit prefix. Although ULAs are private
non globally routable addresses, hence there is not an issue if one network uses the same value, aiming to reduce the likely hood of a collision means less headaches if two private networks are linked, for example via a VPN.
Addresses starting FC were also intended to be in the ULA range but on a registration basis - organisations would purchase a block for their use only but this has never been implemented.
Both global unicast, link-local and unique-local addresses can either be manually assigned or assigned automatically. Like in IPv4, the Dynamic Host Configuration Protocol (DHCP) can be used to obtain an IPv6 address, as well as other information.
IPv6 also provides
an alternative method called Stateless Auto Address Config (SLAAC). SLAAC allows a device to obtain its prefix, prefix length, default gateway address, and other information from an IPv6 router without the use of a DHCPv6 server. SLAAC can also be used
in combination with DHCP (called stateless DHCP). This is where SLAAC is used to obtain an IP address and default gateway but other information such as DNS servers are obtained using DHCP. The side bar explains SLAAC in more detail.
Unique Local Addresses have replaced an earlier range called Site Local Addresses. Site Local Addresses are now not recommended for use, Unique Local Addresses should be used instead.