Address Notation

An IPv6 address has 128 bits, or 16 bytes. The address is divided into eight, 16-bit hexidecimal blocks, separated by colons. For example:

FE80:0000:0000:0000:0202:B3FF:FE1E:8329

To make life easier, some abbreviations are possible. For instance, leading zeros in a 16-bit block can be skipped. The example address now looks like:

FE80:0:0:0:202:B3FF:FE1E:8329

A double colon can replace consecutive zeros, or leading or trailing zeros, within the address. If we apply this rule, our address looks as follows:

FE80::202:B3FF:FE1E:8329

Note that the double colon can appear only once in an address. The reason for this rule is that the computer always uses a full 128-bit binary representation of the address, even if the displayed address is simplified. When the computer finds a double colon, it expands it with as many zeros as are needed to get 128 bits. If an address had two double colons, the computer would not know how many zeros to add for each. So the IPv6 address CAFF:CA01:0000:0056:0000:ABCD:EF12:1234 can be represented in the following ways (note the two possible positions for the double colon):

  • CAFF:CA01:0000:0056:0000:ABCD:EF12:1234

  • CAFF:CA01::56:0:ABCD:EF12:1234

  • CAFF:CA01:0:56::ABCD:EF12:1234

In environments where IPv4 and IPv6 nodes are mixed, another convenient form of IPv6 address notation is to put the values of an IPv4 address into the four low-order byte pieces of the address. An IPv4 address of 192.168.0.2 can be represented by x:x:x:x:x:x:192.168.0.2 ...

Get IPv6 Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.