In this series, we have been looking at IPv6; so far, we have gone through an introduction to IPv6, its address types and, most recently, we looked at the IPv6 scoped address architecture. In this article, we will continue with our discussion of IPv6 addresses by looking at the interface identifier in the IPv6 unicast address format.
If you go back to the second article in this series (IPv6: Addressing), you will notice that a common field in the unicast address formats (link-local, global, etc.) is the interface ID. The interface ID uniquely identifies (within a subnet prefix) an interface on a link.
Let me explain using IPv4. Remember that an IPv4 address can be divided into two parts: Network ID (or network address) and Host ID (or host address), as shown below:
For example, in the subnet 192.168.10.0/24, there are usable IP addresses in the range of 192.168.10.1 and 192.168.10.254. If we take 192.168.10.1 as a focus, we can break it down as shown below:
Therefore, even if multiple hosts on that subnet have the same network ID, the host ID must be unique to each host within that subnet. Let’s now extend this to IPv6. The generic format of an IPv6 unicast address is:
Note: Generally, the Subnet Prefix = Prefix + Subnet ID. For example, for a global unicast address, the subnet prefix is made up of the global routing prefix and the subnet ID. For a link-local address, the subnet prefix is fe80::/10 + 54 bits of zeroes.
Comparing the IPv4 and IPv6 unicast address formats, we can say that the Host ID portion in IPv4 is equivalent to the Interface ID portion in IPv6. Interface ID more accurately reflects this portion of an address, since one host may have multiple interfaces.
Now that we understand what interface identifiers are, let’s move on to what the RFC has to say about them. According to RFC 4291, interface identifiers for all unicast addresses, except those that begin with binary 000, should be 64 bits long. These interface IDs should also be constructed using the modified EUI-64 format.
If you are familiar with 48-bit MAC addresses, then you are not far off from the EUI-64 format. MAC addresses are made up of two portions: The first (leftmost) 24 bits are organization-unique [i.e., organizationally unique identifier (OUI)] and the last 24 bits are device-specific [i.e., specific to the network interface controller (NIC)]. The EUI-64 format, which is 64 bits long, also has 24 bits in the OUI field but assigns the remaining 40 bits to the NIC portion, thus allowing a larger space for device identifiers. The general format of a EUI-64 address is as shown below:
The “u” bit is the universal/local (U/L) bit, which specifies whether the address is universally administered (u=0) or locally administered (u=1). The “g” bit is the individual/group (I/G), bit which specifies whether the address is a unicast address (g=0) or multicast address (g=1).
Modified EUI-64 Format
We have seen the EUI-64 format, but what is the modified EUI-64 format? It is actually very simple. The modified EUI-64 format is the EUI-64 format with the U/L bit inverted. Therefore, if the U/L bit is 0 in a EUI-64 address, it will be 1 in the modified EUI-64 format. Conversely, if the U/L bit is 1 in a EUI-64 address, it will be 0 in the modified EUI-64 format.
Let’s take an example. Consider a EUI-64 address of 00:43:78:E3:F4:52:13:6C. The U/L bit is the seventh bit (not hexadecimal character) counting from the left, i.e.:
00000000 01000011 01111000 …
To convert this address to the modified EUI-64 format, all we do is to invert that U/L bit, i.e.:
00000010 01000011 01111000 …
Therefore, the modified EUI-64 address will be 02:43:78:E3:F4:52:13:6C. That was simple enough, right?
Modified EUI-64 Format as IPv6 Unicast Address Interface ID
What does all this have to do with IPv6? Well, one of the benefits of IPv6 is automatic address configuration and, by using the modified EUI-64 format, nodes can configure unique addresses for themselves without requiring DHCP or manual assignment. Therefore, using our example above, the link-local address from that modified EUI-64 address will be fe80::243:78e3:f452:136c.
Note: This can be applied to all unicast addresses (with the exception already noted), given a subnet prefix. For example, given the global subnet prefix of 2001:db8::/64, the address from our example will be 2001:db8:: 243:78e3:f452:136c.
IEEE 802 48-Bit MAC Address to EUI-64 Format
The EUI-64 format is a newer format compared to the more familiar 48-bit IEEE 802 addresses and we still see these 48-bit addresses in use today. For example, my laptop’s LAN interface shown below has the 48-bit address:
Luckily, there is a way to convert from the IEEE 802 address format to the EUI-64 format. We do this by inserting hexadecimal characters “0xFF” and “0xFE” in the middle of the IEEE 802 addresses. Let’s use my LAN interface’s MAC address as an example. The diagram below shows the steps:
IEEE 802 48-Bit MAC Address to Modified EUI-64 Format
Now that we have converted our 48-bit address to EUI-64 format, we can easily convert it to modified EUI-64 format by inverting the U/L bit. Thus, we can say converting from IEEE 802 address to modified EUI-64 format is a two-step process:
Insert bits 11111111 11111110 (“FF:FE”) in the middle of the 48-bit address to convert it to EUI-64 format.
Invert the U/L bit in the new EUI-64 format address to convert it to Modified EUI-64 format.
Therefore, the modified EUI-64 format of my LAN’s 48-bit MAC address will be 76:86:7A:FF:FE:12:9F:D5.
Let’s see a real example of the interface ID of the link-local address of a Windows XP machine being generated from the IEEE 802 address.
Notice that the IEEE 802 address is 08:00:27:02:1C:88. By inserting “FF:FE” in the middle of that address, the EUI-64 format address becomes 08:00:27:FF:FE:02:1C:88. Now we will invert the U/L bit in this new EUI-64 format address to produce 0A:00:27:FF:FE:02:1C:88, which is the modified EUI-64 format. Therefore, the link-local address will be fe80::a00:27ff:fe02:1c88. As you can see, that is the address the node also derived.
Other Options for Determining Interface IDs
There are other ways to determine the interface IDs of unicast IPv6 addresses, two of which are:
Manual configuration—As we saw in the last article, I manually configured the link-local addresses for the interfaces on my GNS3 routers.
Randomly generated interface identifier—This can either be a temporary randomly generated interface ID, as defined in RFC 4941, or a permanent randomly generated interface ID, as used in newer versions of Windows, including Windows Server 2008, Windows 7, and so on.
My laptop is running Windows 8, so it uses the permanent randomly generated interface identifier method. Notice in the screenshot below that the link-local unicast address of my Wi-Fi interface is not derived from its MAC address.
You can disable this feature by using the netsh interface ipv6 set global randomizeidentifiers=disabled command from the command prompt.
This brings us to the end of this article, where we have seen how the interface ID portion of IPv6 unicast addresses are generated using the Modified EUI-64 format. We also highlighted other options for configuring these interface IDs.
In the next article, we will move on to the IPv6 packet and header format. I hope this article has been helpful.
References and Further Reading
RFC 4291: IP Version 6 Addressing Architecture: http://tools.ietf.org/html/rfc4291
Introduction to IPv6: http://technet.microsoft.com/library/bb726944.aspx
IPv6 for IPv4 Experts: https://sites.google.com/site/yartikhiy/home/ipv6book
EUI-64 Guidelines: http://standards.ieee.org/develop/regauth/tut/eui64.pdf