The difference between IP4 and IP6 Addressing.
This post will go over the similarities and differences between IP4 addressing and IP6 Addressing. Let me know if you have any questions.
The most obvious difference between the two protocols is the length of their source and destination addresses. The whole point of making the switch to IPv6 is to compensate for a global shortage of IP addresses. It only makes sense that the IPv6 protocol has a larger address space than the IPv4 protocol does.
The IPv4 protocol uses a 32-bit source and destination address. These addresses are typically represented as a series of four octets. As I’m sure you know, a typical IPv4 address looks something like this: 192.168.0.1.
In contrast, an IPv6 address is 128 bits in length. This allows for a total of 3.4×1038 (or 340,000,000,000,000,000,000,000,000,000,000,000,000) addresses. There are several different ways of representing an IPv6 address. An IPv6 address is normally written as eight groups of four hexadecimal digits, each separated by colons. For example, an IPv6 address looks like this: 2001:0f68:0000:0000:0000:0000:1986:69af.
You might be looking at the sample address listed above and thinking that typing an IPv6 address involves a lot of effort. Fortunately, IPv6 addresses can be shortened by eliminating zeros. There are two rules that must be followed when condensing an IPv6 address. First, a series of four consecutive zeros can be replaced by two colons, so long as there is only one set of double colons in the resulting address. Using this rule alone, our sample address from above could be condensed to look like this: 2001:0f68::0000:0000:0000:1986:69af
In the example above, we were only able to eliminate one block of zeros because the rule says that there can only be a single set of double colons in an address. Obviously, the sample address above is still a lot to type. Fortunately, the second rule will allow us to make this address a lot shorter. The second rule states that leading zeros in a group can be omitted. What this means is that if a block of four numbers starts with a zero, zero can be removed leaving three numbers in the block. If that three digit block of numbers happens to start with a zero, then the zero can be removed again. The process goes on and on so long as there is a zero in the left-hand position in a block. It’s a little tricky to try to explain the process, so I will demonstrate it below. I will start with our original sample address and then work toward condensing that address.
Notice that in each line, I simply stripped away the leading zero from each section. Since there were several sections containing all zeros, I was able to completely remove the sections and replace them with a double colon. This was only possible because the sections containing all zeros were found in a row. If the sections of zeros had been scattered, then only one set of zeros could have been completely eliminated (because you are only allowed a single set of double colons). All the other sets of zeros would have to be represented as a single zero.
Using IPv6 Addresses in URLs
Although DNS servers make it possible to access a website by using a fully qualified domain name rather than an IP address, it is still a somewhat standard practice to enter an IP address as a part of a URL. For example, my personal website uses the URL www.brienposey.com, which corresponds to the IP address 188.8.131.52. It would be possible to access my website by entering the following URL: http://184.108.40.206
Most casual Web surfers do not make a habit of entering IP addresses in place of fully qualified domain names. Even so, the practice does exist. This is especially true for private Web applications. Not associating a fully qualified domain name with an application makes it a lot less likely for an unauthorized person to stumble onto the application accidentally.
When an IP address is used in place of a fully qualified domain name, a port number is sometimes specified as part of the address. If you simply enter HTTP:// followed by an address, then your Web browser assumes that you want to use port number 80. However, you can specify any port that you want by appending a colon and the port number to the end of the address. For example, if you wanted to access the www.brienposey.com website by IP address, and specifically require a port 80 to be used, then the command would look like this: http://220.127.116.11:80
The IPv6 protocol can also be used as a part of a URL. If you pay attention to the IPv6 format, you’ll notice that an IPv6 address contains a lot of colons. This poses a bit of a problem since your Web browser typically treats anything after a colon as a port number. That being the case, IPv6 addresses are enclosed in brackets when they are used as a part of a URL. For example, if you were to use our sample IPv6 address in a URL, it would look something like this:
Just as you can specify a port number alongside an IPv4 address, you can also specify a port number when using an IPv6 address. The port number follows the exact same format as it does when IPv4 is being used, and falls outside of the brackets. For example, if you were wanting to access the website at our sample IPv6 address over port 80, the URL would look something like this:
Notice that the port number, in this case 80, falls between the close bracket and the ending slash. A colon is also used to designate the port number, just as it is in the IPv4 protocol.
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:
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.
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:
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:
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.
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. The difference is that 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.
As you can see, there are at least some similarities between multicast and anycast addresses. In this article, I will conclude this series by discussing multicast and anycast addresses in more detail.
As I explained earlier, multicast addresses are used to identify a group of network interfaces, known as a multicast group. These network interfaces are typically located on multiple computers, but this isn’t an absolute requirement. Multicast addresses are used to send information to any network interface that is defined as belonging to the multicast group.
One of the most interesting things about multicast addresses is that they are not mutually exclusive. Just because a network interface has a multicast address does not mean that the machine can not also have a unicast address or belong to other multicast groups. It is actually very common for a network interface to have a unicast address and to also be a member of multiple multicast groups. In fact, some operating systems add a computer’s network adapter to various multicast groups at the time that the network adapter’s unicast address is defined. For example, the Solaris operating system automatically adds network adapters to the Solicited Node and the All Nodes (or All Routers) multicast groups. In case you are unfamiliar with Solaris, the Solicited Node group is used for discovering other IPv6 enabled devices on the network. Windows Vista relies on a similar function.
Now that I have explained what multicast addresses are used for, I want to talk about what a multicast address looks like. Although an IPv6 address is 128 bits in length, it’s the first eight bits of the address that define an address as being a multicast address. Every multicast address uses a format prefix of 1111 1111. When expressed in colon hexadecimal notation a multicast address will always begin with FF.
The next four bits in a multicast address are known as flag bits. At the present time, the first three of these four bits are unused (and are therefore set to 0). The fourth flag bit is known as the transient bit. Its job is to express whether the address is a permanent or a temporary address. If the address is permanently assigned, this bit is set to 0, otherwise it is set to 1 to indicate that the address is transient (temporary).
The next four bits in a multicast address are known as the Scope ID bits. The amount of space reserved for the scope ID bits is 4 bits in length, which means that there are 16 different possible values. Although not all 16 available values are used at the present time, seven of these values are used to determine the address’ scope. For example, if an address has a global scope, then the address is valid across the entire Internet. The currently used scope ID bits are:
Decimal value Binary Value Address Scope
0 0000 Reserved
1 0001 Node-Local Scope
2 0010 Link Local Scope
5 0101 Site Local Scope
8 1000 Organization Local Scope
14 1110 Global Scope
15 1111 Reserved
The remaining 112 bits make up the group ID. The group ID’s size allows multicast addresses to consume 1/256th of the total IPv6 address space.
To put this addressing scheme into prospective, I want to show you a few commonly used multicast addresses:
This is a multicast to all nodes. You might have noticed the X in the address, which is not a valid hexadecimal character. The X is a placeholder for the scope. This particular address can use the node local scope (FF01:0:0:0:0:0:1) or the link local scope (FF02:0:0:0:0:0:1).
This multicast address is assigned to all routers within the defined scope. Again, the X in the address acts as a placeholder for the scope. Valid scopes are node local (FF01:0:0:0:0:0:2), Link Local (FF02:0:0:0:0:0:2), and site local (FF05:0:0:0:0:0:2).
If you have some experience working with the IPv4 protocol, then you probably know that the concepts of unicast and multicast exist with the IPv4 protocol, although they are implemented differently. Anycast however, is unique to IPv6. Anycast works like a combination of unicast and multicast addresses. A unicast address is used to send data to one specific recipient, a multicast address is used to send data to a group of recipients, but an anycast address is used to send data to one specific recipient out of a group of recipients.
In case you are wondering, anycast was created as a way of making load balancing easier. Imagine a situation in which you need to provide a large number of users with access to either a service or to a router. In a situation like this, it often makes sense to use multiple servers to host the service that is being provided, or to use multiple routers, whichever the case may be. The reason is because doing so allows you to distribute the heavy workload among multiple devices so that no one single device is overwhelmed.
This type of load balancing is difficult to achieve using IPv4 (although it has been done). Using anycast addresses with IPv6 is an absolutely perfect solution to the need for load balancing. Think about it for a minute. You need to send a user request to one of many devices. You don’t really care which of the designated devices handles the request, as long as the request is taken care of. By using anycast addresses, each request is automatically sent to the device that is in the closest geographic proximity to the computer that is making the request. In certain situations, anycast can even be used to provide fault tolerance should a router fail. The failure can be detected, and requests can be redirected to the next closest router.
The most bizarre thing about anycast addresses is that there is no special addressing scheme. So far in this article series, you have seen that there are all sorts of rules governing the use and structure of unicast and multicast addresses. This simply isn’t the case with an anycast address. All you have to do to create an anycast address is to assign the same unicast address to multiple hosts. In doing so, the unicast address becomes an anycast address.
In this article series, I have tried to skim the basics of the IPv6 protocol. Most administrators probably won’t need to become IPv6 experts any time soon, but IPv6 is a required component in Windows Vista and Longhorn Server. As such, it makes sense to learn at least a little bit about it.