The three ways in which IPv6 addresses can be represented are as follows:
- The preferred or complete address representation or form
- Compressed representation
- IPv6 addresses with an embedded IPv4 address
While the preferred form or representation is the most commonly used method for representing the 128-bit IPv6 address in text format, it is also important to be familiar with the other two methods of IPv6 address representation. These methods are described in the following sections.
The Preferred Form
The preferred representation for an IPv6 address is the longest format, also referred to as the complete form of an IPv6 address. This format represents all 32 hexadecimal characters that are used to form an IPv6 address. This is performed by writing the address as a series of eight 16-bit hexadecimal fields, separated by a colon (e.g., 3FFF:1234:ABCD:5678:020C:CEFF:FEA7:F3A0).
Each 16-bit field is represented by four hexadecimal characters and each character represents 4 bits. Each 16-bit hexadecimal field can have a value of between 0x0000 and 0xFFFF, although, as will be described later in this module, different values have been reserved for use in the first 16 bits, so all possible values are not used. When writing IPv6 addresses, hexadecimal characters are not case sensitive. In other words, 2001:ABCD:0000 and 2001:abcd:0000 are the exact same thing. The complete form for IPv6 address representation is illustrated in Figure 7.4 below:
Figure 7.4 – The Preferred Form for IPv6 Address Representation
The following IPv6 addresses are examples of valid IPv6 addresses in the preferred form:
- 0000:0000:0000:0000:0000:0000:0000:0001
- 2001:0000:0000:1234:0000:5678:af23:bcd5
- 3FFF:0000:0000:1010:1A2B:5000:0B00:DE0F
- fec0:2004:ab10:00cd:1234:0000:0000:6789
- 0000:0000:0000:0000:0000:0000:0000:0000
Compressed Representation
Compressed representation allows for IPv6 addresses to be compressed in one of two ways. The first method allows a double colon (::) to be used to compress consecutive zero values in a valid IPv6 address for successive 16-bit fields comprised of zeros or for leading zeros in the IPv6 address. When using this method, it is important to remember that the double colon can be used only once in an IPv6 address.
When the compressed format is used, each node and router is responsible for counting the number of bits on either side of the double colon to determine the exact number of zeros it represents. Table 7.1 below shows IPv6 addresses in the preferred form and the compressed representation of those addresses:
Table 7.1 – Complete IPv6 Addresses in the Preferred Compressed Form
|
Complete IPv6 Address Representation |
Compressed IPv6 Address Representation |
| 0000:0000:0000:0000:0000:0000:0000:0001 | ::0001 |
| 2001:0000:0000:1234:0000:5678:af23:bcd5 | 2001::1234:0000:5678:af23:bcd5 |
| 3FFF:0000:0000:1010:1A2B:5000:0B00:DE0F | 3FFF::1010:1A2B:5000:0B00:DE0F |
| FEC0:2004:AB10:00CD:1234:0000:0000:6789 | FEC0:2004:AB10:00CD:1234::6789 |
| 0000:0000:0000:0000:0000:FFFF:172.16.255.1 | ::FFFF:172.16.255.1 |
| 0000:0000:0000:0000:0000:0000:172.16.255.1 | ::172.16.255.1 |
| 0000:0000:0000:0000:0000:0000:0000:0000 | :: |
As previously stated, the double colon cannot be used more than once in a single IPv6 address. If, for example, you wanted to represent the complete IPv6 address for 2001:0000:0000:1234:0000:0000:af23:bcd5 in compressed form, you could use the double colon only once, even though there are two consecutive strings of zeros within the address. Therefore, attempting to compress the address to 2001::1234::af23:bcd5 would be considered illegal; however, the same IPv6 address could be compressed to either 2001::1234:0000:0000:af23:bcd5 or 2001:0000:0000:1234::af23:bcd5, depending upon preference.
The second method of IPv6 compressed address representation is applicable to each 16-bit field and allows leading zeros to be omitted from the IPv6 address. When using this method, if every bit in the 16-bit field is set to 0, then one zero must be used to represent this field. In this case, not all of the zero values can be omitted. Table 7.2 below shows IPv6 addresses in the preferred form and how they can be compressed using the second method of IPv6 compressed form representation.
Table 7.2 – Complete IPv6 Addresses in the Alternative Compressed Form
|
Complete IPv6 Address Representation |
Compressed IPv6 Address Representation |
| 0000:0123:0abc:0000:04b0:0678:f000:0001 | 0:123:abc:0:4b0:678:f000:1 |
| 2001:0000:0000:1234:0000:5678:af23:bcd5 | 2001:0:0:1234:0:5678:af23:bcd5 |
| 3FFF:0000:0000:1010:1A2B:5000:0B00:DE0F | 3FFF:0:0:1010:1A2B:5000:B00:DE0F |
| fec0:2004:ab10:00cd:1234:0000:0000:6789 | fec0:2004:ab10:cd:1234:0:0:6789 |
| 0000:0000:0000:0000:0000:FFFF:172.16.255.1 | 0:0:0:0:0:FFFF:172.16.255.1 |
| 0000:0000:0000:0000:0000:0000:172.16.255.1 | 0:0:0:0:0:0:172.16.255.1 |
| 0000:0000:0000:0000:0000:0000:0000:0000 | 0:0:0:0:0:0:0:0 |
While there are two methods of representing the complete IPv6 address in compressed form, it is important to remember that both methods are not mutually exclusive. In other words, these methods can be used at the same time to represent the same IPv6 address. This is commonly used when the complete IPv6 address contains both consecutive strings of zeros and leading zeros in other fields within the address. Table 7.3 below shows IPv6 addresses in the complete form that include both consecutive strings of zeros and leading zeros, and how these addresses are represented in the compressed form:
Table 7.3 –Complete IPv6 Addresses Using Both Compressed Form Methods
|
Complete IPv6 Address Representation |
Compressed IPv6 Address Representation |
| 0000:0000:0000:0000:1a2b:000c:f123:4567 | ::1a2b:c:f123:4567 |
| FEC0:0004:AB10:00CD:1234:0000:0000:6789 | FEC0:4:AB10:CD:1234::6789 |
| 3FFF:0c00:0000:1010:1A2B:0000:0000:DE0F | 3FFF:c00:0:1010:1A2B::DE0F |
| 2001:0000:0000:1234:0000:5678:af23:00d5 | 2001::1234:0:5678:af23:d5 |
IPv6 Addresses with an Embedded IPv4 Address
The third representation of an IPv6 address is to use an embedded IPv4 address within the IPv6 address. While valid, it is important to keep in mind that this method is being deprecated and is considered obsolete because it is applicable only in the transition of IPv4 to IPv6.
