Mon, 8 Apr 2013
As many of our London colocation and dedicated server customers will know, the last /8 has now been administered in the UK by RIPE and no more PI space is on offer, the focus is slowly turning to IPv6, the next generation addressing system designed to solve many of the problems of IPv4 in use on the Internet today.
An example IPv6 address is: 2001:0DB8:0001:0000:0000:0000:0000:0001
The first observation is that it’s ridiculously long (we’ll deal with that in a moment) and secondly that when writing IPv6 addresses we use hexadecimal (hex) notation to represent the underlying computer language of binary, as opposed to decimal as used in IPv4.
In hex, each “digit” can represent 4 bits, ensuring 2 “digits” per octet (8 bits) rather than up to 3 in IPv4. For example, a host address of ‘254’ would be written as 11111110 in binary, whilst in hex it is written as FE. Similarly, the 16-bit binary 1111111011111110 is written as FEFE.
IPv6 uses 16 bits per address field instead of 8 as in IPv4. There are also 8 address fields in IPv6, as opposed to 4 groups in IPv4. In this way, IPv6 massively extends the overall IP space; when the total number of IPs for each version are calculated, this becomes clear:
IPv4 – 4,294,967,296
IPv6 – 340,282,366,920,938,463,463,374,607,431,768,211,456
Before we take a closer look how IPv6 is broken up into network and host portions, let’s deal briefly with the problem of writing long IPv6 addresses such as:
Firstly, we can drop any leading zeros from each pair of octets as we assume that if a pair is shorter than 4 digits, any leading zeros can be reinserted (just as we write 10.0.28.1 in IPv4 rather than 010.000.028.001). We therefore have:
That’s better, but in a similar fashion, there’s still a string of zeros which it would be nice to ignore. We can condense those by means of a double colon which signifies an omitted string of consecutive zeros, as follows:
The :: means “fill in here as many zero octet-pairs as will fit”. It can therefore only be used once in any address (wherever the longest string of zeros is found), otherwise it would be impossible to know the number of octets in each ::
An extreme case of this is IPv6 “unspecified address” which is simply :: (a string of all zeros). The local loop-back address, equivalent of 127.0.0.1, is ::1 (all zeros except the very last bit).
The diagram below demonstrates the point:
IPv6 addresses are 128 bits wide [8 bits per field, 8 fields with either a 0 or 1: (8×8)x2], but the last 64 bits are always host bits. Whilst it is possible to use a prefix longer than /64 (i.e. fewer host bits), this is strongly discouraged as various features of IPv6 depend on this convention.
Whilst we therefore have 128 bit wide addresses, only the first 64 bits can be used for global and per-ISP subnetting; the last 64 bits are used for individual hosts on a given subnet. This also means that each home user at a minimum should receive a /64 subnet from their ISP; this is capable of supporting up to 18,446,744,073,709,551,616 devices per home! This seems incredibly wasteful, and could end up with us having the same IPv4 problems we have now.
Each home user is capable of supporting up to 18,446,744,073,709,551,616 devices per home
But, we can also have in the region of 18,446,744,073,700 millon homes online – that’s still more than there are people in the world. Even with individuals owning multiple IP connected devices and the proliferation of those devices set to increase, every person on the planet would need to own over 2.5 billion devices each, per person, before we begin to run out of IPv6 space.
Despite the increasing lack of IPv4 space, many website administrators and ISPs continue to ignore IPv6, as has been discussed elsewhere in our blog. ConnetU routinely provides IPv6 space with each issuance of IPv4 addresses, whether for IP transit, colocation or dedicated servers. We always urge customers to take advantage of this complimentary resource.