Comparing Address Formats
Applies To: Windows Server 2003, Windows Server 2003 with SP1
IPv4 addresses are represented in a dotted-decimal format, in which the 32-bit address is divided into four 8-bit sections. Each set of 8 bits is converted into its decimal equivalent and is separated from adjacent 8-bit decimal equivalents by periods. The following is an example of an IPv4 address:
131.107.16.200
In IPv6, the 128-bit address is divided into eight 16-bit blocks, each of which is converted to a 4-digit hexadecimal number that is separated from adjacent blocks by colons. The resulting representation is called colon-hexadecimal format.
The following is an IPv6 address in binary form:
0010000111011010000000001101001100000000000000000010111100111011
0000001010101010000000001111111111111110001010001001110001011010
First, the 128-bit address is divided into eight 16-bit blocks, as follows:
0010000111011010 0000000011010011 0000000000000000 0010111100111011
0000001010101010 0000000011111111 1111111000101000 1001110001011010
Then, each of the eight 16-bit blocks is converted to hexadecimal and delimited with colons. The result is the following:
21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A
An IPv6 address can be further simplified by removing the leading zeros within each 16-bit block. However, each block must have at least a single digit. With leading zero suppression, the address used in this example becomes the following:
21DA:D3:0:2F3B:2AA:FF:FE28:9C5A
Compressing Zeros in IPv6 Addresses to the Double-Colon Format
IPv6 addressing conventions also allow you to simplify an address that contains long sequences of zeros. If an address contains consecutive groups of 16-bit blocks that are set to 0 in the colon-hexadecimal format, you can compress the consecutive blocks to :: (known as double-colon) to simplify the address. To avoid ambiguity, use zero compression only once within any one address. Otherwise, you cannot determine the number of 0 bits represented by each instance of a double-colon (::).
Table G.2 provides two examples of IP addresses and shows how zero compression changes each address.
Table G.2 Effect of Zero Compression on Sample IP Addresses
Address Before Zero Compression | Address After Zero Compression |
---|---|
FE80:0:0:0:2AA:FF:FE9A:4CA2 |
FE80::2AA:FF:FE9A:4CA2 |
FF02:0:0:0:0:0:0:2 |
FF02::2 |
To determine how many 0 bits are represented by the double-colon in a compressed address, count the number of blocks in the address, subtract this number from 8, and then multiply the result by 16. For example, the address FF02::2 contains two blocks (the FF02 block and the 2 block). Therefore, the number of bits expressed by the double-colon is 96 (96 = (8 - 2) 16).
Understanding Prefixes
IPv4 implementations commonly use a dotted-decimal representation of the network prefix length, which is called the subnet mask. IPv6 does not use subnet masks; it supports only prefix length notation.
The prefix is the part of an IP address where the bits have fixed values or are the bits of a route or subnet identifier. Prefixes for IPv6 routes and subnet identifiers are expressed in the same way as classless inter-domain routing (CIDR) notation is expressed for IPv4, that is, address/prefix length. The prefix length specifies the number of left-most bits that make up the subnet prefix. For example, an IPv6 prefix can be represented as follows:
3FFE:2900:D005:F28B::/64
In this example, the first 64 bits of the global unicast address are the prefix, and the remaining 64 bits (128 - 64 = 64) are the interface ID.
For more information about the architecture of IPv6 addresses, see RFC 2373, IP Version 6 Addressing Architecture.