IPv6 is quite the departure from IPv4 addressing. In this video, you’ll learn about the structure of an IPv6 address, how to compress the address, and how to calculate the EUI-64 used for IPv6 locally administered addresses.
IP version 4 deals with 32-bit addresses, and we found out very quickly that we had a limited number of addresses, given the number of people who wanted to communicate on the internet. So we created a new type of addressing called IP version 6. This is a 128-bit address, and if you look at how that translates back to decimal, you can see that there are a large number of addresses available with IPv6. If you were to divide up the IPv6 address space and hand it out to 6.8 billion people, every person would be able to have this many addresses each, meaning that we have enough IPv6 addresses for our foreseeable future.
IPv6, though, looks a lot different than an IPv4 address. This is the IPv6 address in binary. You can see there are 128 binary values in an address, and we tend to show IPv6 addresses written as hexadecimal values. You can also see that we’ve separated the address into different groups. There are eight groups, and in each group, there are 16 bits.
This might also be referred to as 2 bytes or 2 octets in a single group. If you were to write out an entire IPv6 address, it would look like this value here of fe80:0000:0000:0000:fd18:0652:cffd:8f52. That is obviously a very large address to write down. There are some ways to use shortcuts to write these values a little bit smaller, and we’ll talk more about those abbreviations in just a moment.
But if you were to abbreviate this IPv6 address, it would be fe80::5d18:652:cffd:8f52. Still a lot of values and a lot of writing for IPv6, but the abbreviation process makes it a little bit easier to view, read, and keep track of these addresses. With IPv4, we could almost memorize certain IP addresses or at least tell other people what that IP address might be, but since these IPv6 addresses are so large, we don’t tend to memorize these large values. Instead, we would use a domain name server to be able to reference these IP addresses as the name of the device rather than writing out all of those hexadecimal values.
Fortunately, there are many ways to abbreviate, or what we call compress, an IPv6 address. If there are groups of 0s, you can abbreviate all of those groups and replace them with a double colon. Only one single set of double colons is allowed in any particular IPv6 address, but it is a very easy way to remove a lot of 0s from those addresses. You can also remove any leading 0s in a group, which very often can decrease the number of characters you have to keep track of in an IPv6 address.
Let’s try a compression of this address, 2600::DDDD:1111:0001, lots of 0s, and it ends with 0001. Well, we know that we can remove leading 0s from any of these groups, so let’s remove one of the leading 0s. We have 0s in front of this 1. We’ll remove those. All of these 0s can be removed, and you can see that we’re left with 2600:DDDD:1111:1:0:0:0:1.
That certainly simplifies things quite a bit. Now we can start removing groups of 0s. If we have 0s that occur one after the other, we can replace any of those groups with a double colon. So in this particular example, we can remove this 0, this 0, and this 0 and replace all three of those with a double colon. That means that our final compression for this IPv6 address is 2600:DDDD:1111:1::1. Makes it a lot easier to write the compressed address rather than the long hexadecimal value you can see here at the top.
Let’s do another compression. We’ll take this IPv6 address of 2601:04C3:4002:BE00, three groups of 0s, and then 0066. The first thing we can do is remove those leading 0s, so we’re able to remove the leading 0s in all of those groups of 0, and there’s two 0s in this last set of octets. So we can remove that so that is just 66.
Now we can look at what groups of 0s we might have and replace those groups with a double colon. And in this IPv6 address, we do have three groups of 0. We can remove all those 0s and replace them with a double colon. That means that this IPv6 address is converted into the format of 2601:4C3:4002:BE00::66.
Just as we use DHCP with IPv4, we could use DHCP with IPv6, but we’ve also created methods within IPv6 that allows us to statically assign an IPv6 address without using a DHCP server. We do this by modifying the MAC address of our device to create what’s called an EUI-64. This MAC address, we know, never changes on our computer, so it would be the perfect example to expand out and make an Extended Unique Identifier, or EUI, and this will be a 64-bit EUI that we will be able to use to make an IPv6 address.
We’re going to effectively convert an IPv6 prefix with a MAC address that’s on our system to create one single IPv6 address. One of the problems you may notice with that is that the MAC address is only 48 bits long, but we need 64 bits in order to perform this conversion. That means that we’re going to add a few bits into the middle of this address and make one minor change to the MAC address.
Here’s a typical MAC address from a computer. The MAC address here stands for Media Access Control address, and you can think of this as the physical address that’s associated with this network interface card. This is also referred to as an EUI-48 address, which is extended unique identifier that is 48 bits long.
The MAC address itself is split into two different pieces. The first three bytes of the MAC address are called an OUI, or an Organizationally Unique Identifier. You can think of this as the manufacturer ID for the MAC address. The last three bytes are assigned by the manufacturer as the serial number, or the network interface controller-specific value. No other network interface card should share this same MAC address, making it a unique value for your particular piece of hardware.
The way that we would take those 48 bits of the MAC address and turn them into a 64-bit value is you split the MAC address apart into two separate three-byte halves. You would add the values FFFE in the middle of that MAC address, which extends it now from 48 bits to the 64 bits that we need for our IPv6 address. When we do this, we have to make a slight change to the existing MAC address. That’s because we’re changing this address from something that is globally unique or universal into something that we’ve created ourselves. You’re effectively changing the Burned-In Address, or the BIA, into something that is locally administered. This is sometimes referred to as the U/L bit, which converts between the universal bit and the local bit.
To be able to convert between a universal address and somehow define that this address is something that we have configured as a local address, we change a single bit within the MAC address. That single bit is that seventh bit inside of the MAC address. So something like 8c, if we were to write out 8c as binary, it would be 10001100. If we wanted to specify that this is a locally assigned address, then we need to change that seventh bit, and this turns into 10001110. And if you converted that back to hexadecimal, that would be the value 8e.
With IPv6, the first half of the IPv6 address is usually associated with your IPv6 subnet. This is an EUI-64-bit address, and I have written out the 64-bit subnet prefix for my IPv6 network. Now we need an additional 64 bits to finish the IPv6 address. We need the first section of the MAC address, those first three bytes, and we write them out in that IPv6 format, and in the example we just gave, it would be 8e2d:aa.
Then we add the two additional bytes in the middle, of ff:fe. And then lastly, we include the last three bytes of the MAC address, which in this case was 4b:98a7. Now that we’ve completed that process, we have a unique IPv6 address that can’t be duplicated on another device because this IPv6 address has been created based on your physical MAC address.
That process of flipping the seventh bit of that first byte of the MAC address can be complicated. You don’t want to have to convert to binary and then reconvert back to decimal while you’re trying to take one of these certification exams. There is a shortcut, though, that you could use to easily convert the seventh bit without having to perform that conversion process.
You would first create a chart that lists out all of the hexadecimal characters. So this would be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. It’s easiest if you group these together in two columns as a group of four. So your first group is 0, 1, 2, 3, the second group is 4, 5, 6, 7, and so on.
If you need to convert that second character of the hex byte, you would convert it to the other value that’s associated in this chart. For example, if the second character was a 0, you would change the second character to a 2. If the second character was a B you would convert it to a 9, and you would simply use this chart to know very quickly what you change that value to.
So if we take our earlier example that started with 8c, we would simply look at our chart, find the letter C, we would see that we would change that to the letter E, and then we would just change that character in the MAC address. Now we’ve changed that seventh bit, but we didn’t have to convert it to binary and then convert it back to decimal again. We simply referenced our chart and made the change immediately.
Let’s do some conversions ourselves between the MAC address and our EUI-64 address that we would then use for our IPv6 address. I’ve already written out our conversion chart here to make things go a little bit faster. Here’s the MAC address that starts with 8c, and we just performed this between the C and the E, which means that we would change that C to an E. In the middle of the address, we would add ff:fe, and so on the left and right sides, you would have the remainder of that MAC address.
Let’s do the same thing with another MAC address. This one starts with 18, and you can see that we’ve separated these out into two halves. We need to change that 8 value, that second character, so we go to our chart. We can see that 8 converts to an A. We’ll put ff:fe in the middle, and you can see that this starts with 1a, has our ff:fe, and completes that EUI-64 address.
Let’s do a third one. Starts with a0. Our second character is a 0. The conversion for that one should convert to a 2. We’ll put the ff:fe in the middle, and there’s our EUI-64 address.
Here’s another address. Starts with 34. 4 is our second character. The 4 should convert to a 6, and we will put the ff:fe in the middle. You can see that this is a very quick process, and you can either memorize this chart or very quickly write down the values that are in this chart so that you’re able to convert from a MAC address to an e EUI-64 address.