IPv6 Addressing
Applies To: Windows 7, Windows Server 2008 R2
This topic describes some of the basics of Internet Protocol version 6 (IPv6) addressing.
IPv6 address syntax
IPv6 addresses are 128 bits in length. The 128-bit address is divided along 16-bit boundaries. Each 16-bit block is converted to a 4-digit hexadecimal number and separated by colons. The resulting representation is known as colon-hexadecimal.
The following is a sample IPv6 address in binary form:
0010000111011010000000001101001100000000000000000010111100111011
0000001010101010000000001111111111111110001010001001110001011010
The 128-bit address is divided along 16-bit boundaries:
0010000111011010 0000000011010011 0000000000000000 0010111100111011 0000001010101010 0000000011111111 1111111000101000 1001110001011010
Each 16-bit block is converted to hexadecimal and delimited with colons. The result is:
21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A
IPv6 representation 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 representation becomes:
21DA:D3:0:2F3B:2AA:FF:FE28:9C5A
Compressing zeros
Some types of addresses contain long sequences of zeros. To further simplify the representation of IPv6 addresses, a contiguous sequence of 16-bit blocks set to 0 in the colon-hexadecimal format can be compressed to “::”, known as double-colon.
For example, the link-local address of FE80:0:0:0:2AA:FF:FE9A:4CA2 can be compressed to FE80::2AA:FF:FE9A:4CA2. The multicast address FF02:0:0:0:0:0:0:2 can be compressed to FF02::2.
Zero compression can be used to compress only one contiguous series of 16-bit blocks expressed in colon-hexadecimal notation. You cannot use zero compression to include part of a 16-bit block. For example, you cannot express FF02:30:0:0:0:0:0:5 as FF02:3::5.
To determine how many 0 blocks are represented by the double colon, you can count the number of blocks in the compressed address, and then subtract this number from 8. To determine the number of bits, multiply the result by 16. For example, the address FF02::2 has two blocks (the “FF02” block and the “2” block.) The number of 0 blocks represented by the double colon is 6 (8 – 2). The number of 0 bits represented by the double colon is 96 (96 = (8 – 2)×16).
Zero compression can be used only once in a given address. Otherwise, you could not determine the number of 0 bits represented by each double colon.
IPv6 prefixes
The prefix is the part of the address that indicates the bits that have fixed values or reflect the subnet identifier. The prefix is always the left-most part of the IPv6 address. Prefixes for IPv6 subnet identifiers and routes are expressed in the same way as Classless Inter-Domain Routing (CIDR) notation for IPv4, that is, in address/prefix-length notation. For example, 21DA:D3::/48 is a route prefix and 21DA:D3:0:2F3B::/64 is a subnet prefix.
Note
IPv4 implementations commonly use a dotted decimal representation of the network prefix known as the subnet mask. IPv6 does not use subnet masks. Instead, IPv6 uses only the prefix-length notation.
Types of IPv6 addresses
IPv6 supports three types of addresses:
Unicast IPv6 addresses
A unicast address identifies a single interface within the scope of the type of unicast address. With the appropriate unicast routing topology, packets addressed to a unicast address are delivered to a single interface. To accommodate load-balancing systems, RFC 3513 allows multiple interfaces to use the same address as long as they appear as a single interface to the IPv6 implementation on the host.
Multicast IPv6 addresses
A multicast address identifies multiple interfaces. With the appropriate multicast routing topology, packets addressed to a multicast address are delivered to all interfaces that are identified by the address. A multicast address is used for one-to-many communication, with delivery to multiple interfaces.
Anycast IPv6 addresses
An anycast address identifies multiple interfaces. With the appropriate routing topology, packets addressed to an anycast address are delivered to a single interface, the nearest interface that is identified by the address. The nearest interface is defined as being closest in terms of routing distance. An anycast address is used for one-to-one-of-many communication, with delivery to a single interface.
IPv6 addresses always identify interfaces, not hosts. A host is identified by any unicast address that is assigned to one of its interfaces.
Note
The RFCs for IPv6 do not define a broadcast address. All types of IPv4 broadcast addressing are performed in IPv6 by using multicast addresses. For example, the subnet and limited broadcast addresses from IPv4 are replaced with the link-local scope all-nodes multicast address of FF02::1.
Unicast IPv6 addresses
Unicast IPv6 addresses fall into one of five types:
Global unicast addresses
Link-local addresses
Site-local addresses (deprecated)
Special IPv6 addresses
Compatibility addresses
Global unicast addresses
Global unicast addresses are the IPv6 equivalent to public IPv4 addresses. They are globally routable and reachable on the IPv6 Internet.
Unlike the current IPv4-based Internet, which is a mixture of both flat and hierarchical routing, the IPv6-based Internet has been designed from its foundation to support efficient, hierarchical addressing and routing. The scope (that is, the region of the IPv6 network over which the address is unique) of a global unicast address is the entire IPv6 Internet.
The following figure shows the structure of a global unicast address as defined in RFC 3587.
Global unicast address
Global unicast addresses contain four fields:
The three high-order bits are set to 001. The address prefix for currently assigned global addresses is 2000::/3.
The Global Routing Prefix indicates the global routing prefix for an organization’s site. The combination of the three fixed bits and the 45-bit Global Routing Prefix creates a 48-bit site prefix, which is assigned to an individual site of an organization. After this prefix is assigned, routers on the IPv6 Internet forward IPv6 traffic matching the 48-bit prefix to the routers of the organization’s site.
The Subnet ID is used within an organization’s site to identify subnets. This field is 16 bits long. The organization’s site can use these 16 bits within its site to create 65,536 subnets or multiple levels of addressing hierarchy and an efficient routing infrastructure.
The Interface ID indicates the interface on a specific subnet within the site. This field is 64 bits long.
The following figure shows how fields within the global unicast address create a three-level structure.
Three-level structure of the global unicast address
The public topology is the collection of larger and smaller Internet service providers (ISPs) that provide access to the IPv6 Internet. The site topology is the collection of subnets within an organization’s site. The interface identifier identifies an interface on a subnet within an organization’s site. For more information about global unicast addresses, see RFC 3587 in the IETF RFC Database (https://go.microsoft.com/fwlink/?linkid=3952).
Local-use unicast addresses
Local-use unicast addresses fall into one of two types:
Link-local addresses are used between on-link neighbors and for Neighbor Discovery processes.
Site-local addresses are used between nodes in the same site.
Link-local addresses
Nodes use link-local addresses when communicating with neighboring nodes on the same link. For example, on a single-link IPv6 network with no router, hosts use link-local addresses to communicate with other hosts on the link. Link-local addresses are equivalent to Automatic Private IP Addressing (APIPA) IPv4 addresses autoconfigured on computers that are running Windows. APIPA addresses use the 169.254.0.0/16 prefix. The scope of a link-local address is the local link.
A link-local address is required for Neighbor Discovery processes and is always automatically configured, even in the absence of all other unicast addresses.
The following figure shows the structure of the link-local address.
Link-local address
Link-local addresses always begin with FE80. With the 64-bit interface identifier, the prefix for link-local addresses is always FE80::/64. An IPv6 router never forwards link-local traffic beyond the link.
Site-local addresses
Site-local addresses are equivalent to the IPv4 private address space (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16). For example, private intranets that do not have a direct, routed connection to the IPv6 Internet can use site-local addresses without conflicting with global addresses. Site-local addresses are not reachable from other sites, and routers must not forward site-local traffic outside the site. Site-local addresses can be used in addition to global addresses. The scope of a site-local address is the site.
Unlike link-local addresses, site-local addresses are not automatically configured and must be assigned through either stateless or stateful address configuration.
The following figure shows the structure of the site-local address.
Site-local address
The first 10 bits are always fixed for site-local addresses, beginning with FEC0::/10. After the 10 fixed bits is a 54-bit subnet identifier (Subnet ID field) that provides 54 bits with which you can create a hierarchical and summarizable routing infrastructure within the site. After the Subnet ID field is a 64-bit Interface ID field that identifies an interface on a subnet.
Note
RFC 3879 formally deprecates the use of site-local addresses for future IPv6 implementations. Existing implementations of IPv6 can continue to use site-local addresses until a replacement has been standardized. A new version of the "Internet Protocol Version 6 (IPv6) Addressing Architecture" standard is now published as an Internet draft and includes the deprecation of site-local addresses. This new Internet draft of the standard for IPv6 addressing will make RFC 3513 obsolete.
Special IPv6 addresses
The following are special IPv6 addresses:
Unspecified address
The unspecified address (0:0:0:0:0:0:0:0 or ::) indicates the absence of an address. It is equivalent to the IPv4 unspecified address of 0.0.0.0. The unspecified address is typically used as a source address for packets attempting to verify the uniqueness of a tentative address. The unspecified address is never assigned to an interface or used as a destination address.
Loopback address
The loopback address (0:0:0:0:0:0:0:1 or ::1) is used to identify a loopback interface, enabling a node to send packets to itself. It is equivalent to the IPv4 loopback address of 127.0.0.1. Packets addressed to the loopback address must never be sent on a link or forwarded by a router.
Compatibility addresses
To aid in the migration from IPv4 to IPv6 and the coexistence of both types of hosts, the following addresses are defined:
IPv4-compatible address
The IPv4-compatible address, 0:0:0:0:0:0:w.x.y.z or ::w.x.y.z (where w.x.y.z is the dotted decimal representation of a public IPv4 address), is used by IPv6/IPv4 nodes that are communicating using IPv6. IPv6/IPv4 nodes support both IPv4 and IPv6 protocols. When an IPv4-compatible address is used as an IPv6 destination, the IPv6 traffic is automatically encapsulated with an IPv4 header and sent to the destination using the IPv4 infrastructure.
IPv4-mapped address
The IPv4-mapped address, 0:0:0:0:0:FFFF:w.x.y.z or ::FFFF:w.x.y.z, is used to represent an IPv4-only node to an IPv6 node. It is used only for internal representation. The IPv4-mapped address is never used as a source or destination address of an IPv6 packet.
6to4 address
The 6to4 address is used for communicating between two nodes running both IPv4 and IPv6 over an IPv4 routing infrastructure. The 6to4 address is formed by combining the prefix 2002::/16 with the 32 bits of a public IPv4 address of the node, forming a 48-bit prefix. 6to4 is a tunneling technique described in RFC 3056.
ISATAP address
The Internet draft titled “Intra-Site Automatic Tunnel Addressing Protocol (ISATAP)” defines ISATAP addresses used between two nodes running both IPv4 and IPv6 over an IPv4 routing infrastructure. ISATAP addresses use the locally administered interface ID ::0:5EFE:w.x.y.z where w.x.y.z is any unicast IPv4 address, which includes both public and private addresses.
The ISATAP interface ID can be combined with any 64-bit prefix that is valid for IPv6 unicast addresses. This includes the link-local address prefix (FE80::/64), site-local prefixes, and global prefixes.
Teredo address
Teredo addresses use the prefix 3FFE:831F::/32. Beyond the first 32 bits, Teredo addresses are used to encode the IPv4 address of a Teredo server, flags, and the encoded version of the external address and port of a Teredo client. An example of a Teredo address is 3FFE:831F:CE49:7601:8000:EFFF:62C3:FFFE. Teredo addresses are used to represent a host when using the automatic tunneling mechanism defined in the Internet draft titled “Teredo: Tunneling IPv6 over UDP through NATs.”
Multicast IPv6 addresses
In IPv6, multicast traffic operates in the same way that it does in IPv4. Arbitrarily located IPv6 nodes can listen for multicast traffic on arbitrary IPv6 multicast addresses. IPv6 nodes can listen to multiple multicast addresses at the same time. Nodes can join or leave a multicast group at any time.
IPv6 multicast addresses have the first 8 bits set to 1111 1111. An IPv6 address is easy to identify as multicast because it always begins with “FF.” Multicast addresses cannot be used as source addresses or as intermediate destinations in a Routing header.
Beyond the first 8 bits, multicast addresses include additional structure to identify their flags, scope, and multicast group. The following figure shows the structure of the IPv6 multicast address.
IPv6 multicast address
The fields in the multicast address are:
Flags
Indicates flags set on the multicast address. The size of this field is 4 bits. As of RFC 3513, the only flag defined is the Transient (T) flag. The T flag uses the low-order bit of the Flags field. When set to 0, the T flag indicates that the multicast address is a well-known multicast address that has been permanently assigned by the Internet Assigned Numbers Authority (IANA). When set to 1, the T flag indicates that the multicast address is a transient multicast address that IANA has not permanently assigned.
Scope
Indicates the scope of the IPv6 network for which the multicast traffic is intended. The size of this field is 4 bits. In addition to using information provided by multicast routing protocols, routers use the multicast scope to determine whether they can forward multicast traffic. The most prevalent values for the Scope field are 1 (interface-local scope), 2 (link-local scope), and 5 (site-local scope).
For example, traffic with the multicast address of FF02::2 has a link-local scope. An IPv6 router never forwards this traffic beyond the local link.
Group ID
Identifies the multicast group and is unique within the scope. The size of this field is 112 bits. Permanently assigned group IDs are independent of the scope. Transient group IDs are relevant only to a specific scope. Multicast addresses from FF01:: through FF0F:: are reserved, well-known addresses.
To identify all nodes for the interface-local and link-local scopes, the following addresses are defined:
FF01::1 (interface-local scope all-nodes multicast address)
FF02::1 (link-local scope all-nodes multicast address)
To identify all routers for the interface-local, link-local, and site-local scopes, the following addresses are defined:
FF01::2 (interface-local scope all-routers multicast address)
FF02::2 (link-local scope all-routers multicast address)
FF05::2 (site-local scope all-routers multicast address)
With 112 bits for the group ID, it is possible to have 2112 group IDs. However, because of the way in which IPv6 multicast addresses are mapped to Ethernet multicast media access control (MAC) addresses, RFC 3513 recommends assigning the group ID from the low-order 32 bits of the IPv6 multicast address and setting the remaining original group ID bits to 0. By using only the low-order 32 bits, each group ID maps to a unique Ethernet multicast MAC address. The following figure shows the recommended IPv6 multicast address.
Recommended IPv6 multicast address using a 32-bit group ID
Solicited-node multicast addresses
The solicited-node address facilitates the efficient querying of network nodes during address resolution. In IPv4, the ARP Request frame is sent to the MAC-level broadcast, disturbing all nodes on the network segment, including those that are not running IPv4. IPv6 uses the Neighbor Solicitation message to perform address resolution. However, instead of using the local-link scope all-nodes multicast address as the Neighbor Solicitation message destination, which would disturb all IPv6 nodes on the local link, the solicited-node multicast address is used. The following figure shows how the solicited-node multicast address includes the prefix FF02::1:FF00:0/104 and the last 24-bits of the IPv6 address that is being resolved.
Mapping unicast IPv6 addresses to solicited node IPv6 addresses
For example, for the node with the link-local IPv6 address of FE80::2AA:FF:FE28:9C5A, the corresponding solicited-node address is FF02::1:FF28:9C5A. This node is listening for multicast traffic at the solicited-node address of FF02::1:FF28:9C5A and, for interfaces that correspond to a physical network adapter, has registered the corresponding multicast address with the network adapter. To resolve the address of FE80::2AA:FF:FE28:9C5A to its link-layer address, a neighboring node sends a Neighbor Solicitation to the solicited-node address of FF02::1:FF28:9C5A.
The result of using the solicited-node multicast address is that address resolutions, a common occurrence on a link, are not required to use a mechanism that disturbs all network nodes. By using the solicited-node address, address resolution disturbs very few nodes. In practice, due to the relationship between the Ethernet MAC address, the IPv6 interface ID, and the solicited-node address, the solicited-node address acts as a pseudo-unicast address for very efficient address resolution.
Anycast IPv6 addresses
An anycast address is assigned to multiple interfaces. The routing infrastructure forwards packets that are addressed to an anycast address to the nearest interface to which the anycast address is assigned. To facilitate delivery, the routing infrastructure must track the interfaces that have been assigned anycast addresses and their distance in terms of routing metrics. At present, anycast addresses are used only as destination addresses and are assigned only to routers. Anycast addresses are assigned out of the unicast address space, and the scope of an anycast address is the scope of the type of unicast address from which the anycast address is assigned.
The Subnet-Router anycast address is predefined and required. It is created from the subnet prefix for a given interface. To construct the Subnet-Router anycast address, the bits in the subnet prefix are fixed at their appropriate values, and the remaining bits are set to 0. All router interfaces attached to a subnet are assigned the Subnet-Router anycast address for that subnet. The Subnet-Router anycast address is used to communicate with one of multiple routers attached to a remote subnet.
IPv6 addresses for a host
An IPv4 host with a single network adapter typically has a single IPv4 address assigned to that adapter. An IPv6 host, however, typically has multiple IPv6 addresses — even with a single interface. An IPv6 host is assigned the following unicast addresses:
A link-local address for each interface.
Unicast addresses for each interface (which can be a site-local address and one or multiple global unicast addresses).
The loopback address (::1) for the loopback interface.
Typical IPv6 hosts are logically multi-homed because they have at least two addresses with which they can receive packets — a link-local address for local link traffic and a routable site-local or global address.
Additionally, each host is listening for traffic on the following multicast addresses:
The interface-local scope all-nodes multicast address (FF01::1).
The link-local scope all-nodes multicast address (FF02::1).
The solicited-node address for each unicast address on each interface.
The multicast addresses of joined groups on each interface.
IPv6 addresses for a router
An IPv6 router is assigned the following unicast addresses:
A link-local address for each interface.
Unicast addresses for each interface (which can be a site-local address and one or multiple global unicast addresses).
A Subnet-Router anycast address.
Additional anycast addresses (optional).
The loopback address (::1) for the loopback interface.
Additionally, each router is listening for traffic on the following multicast addresses:
The interface-local scope all-nodes multicast address (FF01::1).
The interface-local scope all-routers multicast address (FF01::2).
The link-local scope all-nodes multicast address (FF02::1).
The link-local scope all-routers multicast address (FF02::2).
The site-local scope all-routers multicast address (FF05::2).
The solicited-node address for each unicast address on each interface.
The multicast addresses of joined groups on each interface.