This tutorial explains the structures and functions of the IPv6 unicast addresses in detail. Learn how many types of unicast addresses are available in IPv6 and how each type works.
A unicast address identifies a single interface in the network. Packets sent to a unicast address are delivered to a single interface. There are five main types of unicast addresses in IPv6. These types are unspecified, loopback, link-local, site-local or unique local, and global.
Let's understand these types in detail.
Unspecified address
An unspecified address represents an interface that does not have an address. In other words, if an interface that is not configured with a valid IP address wants to send a data packet, it can use the unspecified address in the source address field of the packet.
The unspecified address in IPv4 is 0.0.0.0 while the unspecified address in IPv6 is 0.0.0.0.0.0.0.0. The unspecified address indicates the absence of an address. An interface uses the unspecified address as a source address only if a valid address is not assigned to the interface. The unspecified address is never assigned to an interface or used as a destination address. Routers never forward an IPv6 packet with a source address of unspecified. Interfaces usually use the unspecified address to learn their own unique addresses.
Loopback address
A loopback address is assigned to a loopback interface. A loopback interface is a virtual interface. It is commonly used for testing and debugging purposes. It allows the host device to send packets to itself. In IPv4, the loopback address is 127.0.0.1. In IPv6 the loopback address is 0:0:0:0:0:0:0:1 or ::1. Routers never forward packets sent on the loopback address.
Link-local addresses
In link-local addresses, the first 10 bits are always set to 1111 1110 10, and the next 54 bits are set to 0. In hexadecimal notation, these addresses always begin with FE80. The prefix for link-local addresses is always FE80::/64. The scope of the link-local addresses is the local link.
The following image shows the structure of these addresses.
These addresses are used to communicate between hosts on the same link. Routers never forward traffic sent to link-local addresses. IPv6 enabled devices automatically configure these addresses if other Unicast addresses are absent. In IPv4 these addresses are known as APIPA (Automatic Private IP addressing) addresses and use the 169.254.0.0/16 prefix.
Site-local addresses
In site-local addresses, the first 10 bits are always set to 1111 1110 11. In hexadecimal notation, these addresses start with FEC0::/10. After the first 10 bits, the next 54-bits are available for local subnets. Administrators can use subnet bits to create subnets within the organization. They can use a flat topology or can create a hierarchical topology by subnetting the subnet bits. After 54 subnet bits, the last 64-bits are available for the Interface ID. The Interface ID field identifies a specific interface on a subnet.
The following image shows the structure of 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). The scope of site-local addresses is the site. Routers of the site must not forward site-local traffic outside the site. Site-local addresses must not be reachable from outside the site.
In site-local addresses, subnet bits are configured by network administrators. There are no pre-defined rules for organizing subnet bits. Since site-local addresses are not used outside the site, the subnetting scheme adopted by administrators usually does not create any problem.
In the real world, the merging and separating of sites are very common. If two sites using the same site-local addressing scheme merge, they may end up with too many ambiguous addresses. To avoid such a situation, Site-local addresses have been deprecated in RFC 3879 and a new type of address known as the unique local addresses defined in RFC 4193.
Unique local address
Unique local addresses work the same as the site-local address but use a different format and structure. The following image shows how unique local addresses are structured.
In unique local addresses the first seven bits, are always remain 1111 110. In hexadecimal, these bits are represented FC00::/7.
The 8th bit defines how a unique local address is assigned. If the value of this field is set to 1, it means the global ID is locally assigned. If the value in this field is set to 0, it means that global ID is assigned by Internet Registries.
The next 40 bits represent a globally unique prefix or a global ID. If global ID is locally defined, it must be calculated using a pseudorandom algorithm, not sequentially. To calculate global ID, the current time reported by an NTP server in 64-bit format is concatenated with a EUI-64 interface ID of an interface on the host performing this algorithm. Since global ID is calculated by using a pseudorandom algorithm, the possibility of using two or more sites with the same global ID is rare.
The next 16 bits are known as the subnet ID. The subnet ID is available for subnetting. Administrators can use subnet bits to create subnets or organize the site in a hierarchy. The next 64 bits are available for the interface ID. Interface ID makes each address unique in the subnet.
Global Unicast Addresses
A global unicast address provides a unique identity to the interface in the global IPv6 Internet. The following image shows how the format of global unicast addresses.
The first three bits of global unicast addresses are always set to 001. The next 45 bits are allocated by the Internet Register authorities.
The next 16 bits are known as subnet bits. Subnet bits allow network administrators to create a hierarchy within the organization or the site. Network administrators may define up to 65534 subnets by uniquely assigning values in subnet bits for each subnet.
The next 64 bits are known as interface ID. Interface ID provides a unique identity to the interface. Interfaces use the modified EUI-64 algorithm to calculate the interface ID. EUI-64 algorithm uses the MAC address of the interface to calculate the interface ID of the interface. It makes two changes in the original MAC address. First, it changes the universal bit of the MAC address and then adds extra 16 bits to the MAC address.
MAC addresses are 48 bits in length. The first 24 bits identify the company while the last 24 bits identify the interface. The EUI-64 algorithm inserts the hexadecimal value FFFE (16 bits in binary) between the company identifier and the interface identifier. The seventh bit in the company identifier field is known as the universal (u) bit. The "u" bit defines the type of MAC address. The EUI-64 algorithm sets this bit to 1. The value 1 indicates that the address is locally defined.
The following image shows an example of how the EUI-64 algorithm calculates the interface ID from the MAC address.
That’s all for this tutorial. In this tutorial, we discussed the structures and functions of the IPv6 unicast addresses and learned how IPv6 unicast addresses work.