Although it has been long foreseen that the IPv4 address space will not be enough for the tremendous growth of the internet, the rollout of IPv6 has been much slower than initially anticipated. There are many reasons for this, but I won’t discuss them in this article. Superficially, IPv6 simply blows up the address space by using 128-bit addresses. However, there are a few details and conventions beyond the sheer length of the address. This article summarizes a few points without claiming to be an extensive list and introduces common address prefixes.
- Addresses are 128 bits, or 16 bytes
- Addresses are 4 times as long as IPv4 address
- An address consists of 8 segments
- Each address segment is 16 bits or 2 bytes
- Segments are written as four hexadecimal characters
- Leading zeros in a segment can be omitted (
2001:0db8::
->2001:db8::
) - Segments are separated by colons
- Two consecutive colons denote a sequence of zero-segments (
0000
). This may only appear once in each address. - Currently, only 1/8 of the address space is assigned as global unicast addresses.
- The convention is to assign a whole 64-bit prefix network to a classical link-local network. Each machine in that network can use a public 128-bit address using the prefix. Various methods exist to avoid address collision (e.g. methods based on the mac address).
- Often providers assign a 56-bit or 48-bit prefix to their customers allowing them to set up 256 or 65536 independent subnetworks.
- In the case of IPv4-embedded addresses, the last two segments (32-bits) might be written as four dot-separated decimal bytes (
::ffff:8.8.8.8
) - In IPv6, local NATs are considered obsolete. Each link-local client receives a globally unique address.
Address visualization
The following sketch illustrates the structure of an IPv6 global unicast address. In this example, the IPv6 address of debugci.dev is used: 2a01:4f8:272:4f0e::2
Common prefixes
Prefix | Lowest and highest address | Description |
---|---|---|
fe80::/10 |
fe80:0000:0000:0000:0000:0000:0000:0000 febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff |
Link-local addresses |
2000::/3 |
2000:0000:0000:0000:0000:0000:0000:0000 3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff |
Global unicast addresses |
2001:db8::/32 |
2001:0db8:0000:0000:0000:0000:0000:0000 2001:0db8:ffff:ffff:ffff:ffff:ffff:ffff |
Address for documentation purposes, like example.com. Subnet of global unicast. |
fc00::/7 |
fc00:0000:0000:0000:0000:0000:0000:0000 fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff |
Unique-local addresses |
::ffff:x.x.x.x/96 |
0000:0000:0000:000000000:ffff:0000:0000 0000:0000:0000:0000:0000:ffff:ffff:ffff |
IPv4-mapped IPv6 addresses Often written in decimal, e.g., ::ffff:8.8.8.8 |
::1/128 |
0000:0000:0000:0000:0000:0000:0000:0001 |
Local host |
64:ff9b::/96 |
0064:ff9b:0000:0000:0000:0000:0000:0000 0064:ff9b:0000:0000:0000:0000:ffff:ffff |
NAT64 embedded IPv4 addresses |
0100::/64 |
0100:0000:0000:0000:0000:0000:0000:0000 0100:0000:0000:0000:ffff:ffff:ffff:ffff |
Discard-only addresses |
ff00::/8 |
ff00:0000:0000:0000:0000:0000:0000:0000 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff |
IPv6 multicast |
:: |
0000:0000:0000:0000:0000:0000:0000:0000 |
Unspecified addresses, equivalent of 0.0.0.0 |
This might also interest you