Crash Crouse in IPv6 (Part 2)

by [Published on 7 Dec. 2006 / Last Updated on 7 Dec. 2006]

IPv6 address formatting and the various types of IPv6 addresses.

If you would like to read the other parts in this article series please go to:

This article will continue the introduction to the IPv6 protocol by discussing IPv6 address formatting and the various types of IPv6 addresses.

In the first part of this article series, I talked about some of the differences in the way that IP addresses are expressed in IPv6 as opposed to the way that addresses are expressed in IPv4. In this article, I want to continue the discussion by talking about the anatomy of an IPv6 address, the way that IPv6 addresses are subnetted, and about the various types of IPv6 addresses.

If you’re familiar with IPv4, then you know that an IPv4 address consists of four different octets of data, each separated by a period. Part of this address is the network number and the remaining bits identify a specific host on the network. The actual number of bits that are dedicated to the network number and to the host number vary depending on the subnet mask.

Just as an IPv4 address is broken into different parts, so is an IPv6 address. In the previous article, you learned that IPv6 addresses are 128 bytes in length. When an IPv6 address is written in its full form, it is expressed as eight different sets of four numbers, each set separated by a colon. Each of these four digit sets represents 16 bits of data. Each of these 16 bit fields has its own specific purpose.

An IPv6 address is broken into three different parts; the site prefix, the subnet ID, and the interface ID. These three components are identified by the position of the bits within the address. The first three fields in an IPv6 address make up the site prefix. The next field represents the subnet ID, and the last four fields are used for the interface ID. 

The site prefix is similar to an IPv4 network number. It is the number that is assigned to your site by an ISP. Typically, all of the computers within a site would share the same site prefix. The site prefix tends to the public in nature since that uniquely identifies your network and allows your network to be accessible from the Internet.

Unlike the site prefix, the subnet ID is private because it is internal to your network. The subnet ID describes the network’s site topology. The subnet ID works very similarly to the way that subnetting works in the IPv4 protocol. The biggest differences are that these subnets can be 16 bytes in length, and is expressed in hexadecimal format rather than in dotted decimal notation. An IPv6 subnet typically corresponds to a single network branch (site) just as an IPv4 subnet does.

The interface ID works similarly to an IPv4 host ID. This number uniquely identifies an individual host on your network. The interface ID (which is sometimes referred to as a token) is typically configured automatically based on the network interface’s MAC address. The interface ID can be manually configured in EUI-64 format.

To see how an IPv6 address is divided into its various subcomponents, take a look at the following address:

2001:0f68:0000:0000:0000:0000:1986:69af

The site prefix portion of this address would be: 2001:0f68:0000. The next field, 0000, represents the subnet ID. The remaining bytes (0000:0000:1986:69af) compose the interface ID.

Typically when a prefix is expressed, it is written in a special format. Zeros are suppressed in the manner explained in the previous article, and the prefixes followed by a slash and another number. The number after the slash indicates the number of bits included in the prefix. In my earlier example, I mentioned that the site prefix for the address 2001:0f68:0000:0000:0000:0000:1986:69af was 2001:0f68:0000. Since this prefix is 48 bits in length, we would add a /48 to the end of it to express it properly. With the zeros suppressed, a prefix looks like this: 2001:f68::/48

Types of IPv6 Addresses

Another thing that is unique about the IPv6 protocol is that there are actually three different types of IPv6 addresses; unicast, multicast, and anycast.

Unicast addresses are used to identify an individual host on a network. Multicast addresses, on the other hand, identify a group of network interfaces that typically reside on multiple computers. When a packet of data is sent to a multicast address, that packet is sent to all network interfaces in the multicast group.

Like multicast addresses, anycast addresses identify a specific group of network interfaces that usually reside on multiple computers. So what makes an anycast route different from a multicast group? When packets are sent to a multicast address, they are sent to all of the network interfaces in the group. In contrast, when packets of data are sent to an anycast address, the packets are not sent to the entire group. Instead, they are only sent to the member that is in the closest physical proximity to the sender.

Unicast Addresses

Earlier, when I showed you the format of an IPv6 address and what the various bit positions were used for, I was showing you an example of a unicast address. There are actually two different types of unicast addresses; global unicast addresses and link local unicast addresses. As the names imply, a global unicast address is globally accessible, while a link local unicast address is accessible only to other computers that share the link. The IP address format that I showed you earlier was that of a global unicast address. I chose to talk about this type of address because it is the most common.

Link local unicast addresses used a different address format from global unicast addresses. Like global unicast addresses, link local unicast addresses are also 128 bytes in length. The difference is that the bytes are distributed differently and the address uses a special site prefix.

In a link local unicast address, a site prefix occupies the first 10 bits of the address rather than the first 48 bits, as is the case with a global unicast address. The site prefix used by a link local unicast address is: fe80.

Since the site prefix space has been shortened (compared with a global unicast address), you may not be surprised to learn that the amount of space allocated to the subnet ID has been extended from 16 bits to 64 bits. What might surprise you is that these 64 bits are not actually used. Keep in mind that a link local IP address is only valid for machines sharing a common link. As such, there is no reason to have a subnet ID. The 64 bits of the address space that are reserved for the subnet ID are therefore expressed as zeros.

The interface ID for a link local unicast address is 54 bits in length. The interface ID is almost always derived from the 48 bit MAC address assigned to the network interface card to which the protocol is bound. Below is an example of a link local unicast address:

Fe80:0000:0000:0000:0000:0000:23a1:b152

Of course when IPv6 addresses are written out they are usually expressed with leading zeros suppressed. Therefore, the more technically correct expression of this address is:

Fe80::23a1:b152

When the addresses expressed are with zeros suppressed, the address might at first look like any other IPv6 address. Remember that you can tell the difference between a link local unicast address and other types of addresses because a link local unicast address will always began with fe80.

Conclusion

In this article, I explained the significance of the various bits in an IPv6 address. I then went on to discuss the differences between the various types of IPv6 addresses. In Part 3, I will continue the discussion by talking about multicast and anycast addresses.

If you would like to read the other parts in this article series please go to:

Featured Links