IPv6 addresses use 128 bits organized into eight 16-bit hextets expressed in hexadecimal notation, with prefix lengths defining network boundaries and two shorthand rules available to simplify address representation.
IPv6 Address Format
We've seen how IP version 6 addresses are quite huge, and how do you deal with such big numbers? There are some ways that we can break this down, and there are components that go into this IP version 6 address format.
IPv4 addresses have 32 bits, and IP version 4 addresses are broken down into four sections. We call each one of those sections an octet, and that octet has eight bits for each one of those sections. That's fine for IP addresses that have 32 bits total, but when you're talking about IP version 6 you have 128 bits that need to be represented.
So this is broken down, first of all, into eight different sections, and each one of these sections is called a hextet. It goes by a couple of different names, but these are hextets, and each one of these hextets has 16 bits per hextet and is represented in a hexadecimal form. Each one of these is hexadecimal, which means that it is a 0, 1, 2, 3, 4, 5, 6, 7, 8, but it's representing 16 total, so 10 is actually a, 11 is b, then c, d, e and f. So each one of these bits would be one of these digits here. That goes into each one of these spots and represents, once again, four bits each. We'll talk a little more about that in a second.
Here they're divided by semicolon, so that's one of the differences between this and an IPv4 address. Also notice that we have a, b, c, d, e and f. Here I have them represented as lower case. Technically they should be lower case, but you'll see equipment out there that does have them in upper case, so both is, I guess, generally accepted out there, but officially they probably should use the lowercase.
Just to note that this IP address is huge. With 128 bits, and each bit can represent a zero or one, it'd be two to the 128th power, and you're talking about a huge number of address capabilities. It utilizes much of this, and when we get into the protocol you'll see that the way we break this down and utilize this really makes it a lot easier for ourselves than we did with IPv4.
So let's take a look at those hextets, or officially they're hexadect tests — it's hard for me to even say, so we just shorten it to hextets. It can also be known as a quibble or a quad nibble, so they can go by a few different names.
I'm only showing you four hextets here, and we know already that IP version 6 has eight of these. I just couldn't fit them across my screen and still have it at a decent size that we could look at it, so I have broken this down into just the first four. We're just going to say this is the first four that is right here.
What does this look like? Each one of these hextets is 16 bits total. You'll count this up and there's 16 bits total, and it's broken into fours here, so each one of those is four bits. Four bits is something we can represent in hexadecimal, so I've got the hexadecimal ranges right here.
We could actually translate this. If we were to translate zero zero one zero, we see right here it is a two, so this would be a two. And then zero zero zero zero is a zero, so zero zero. And this zero zero zero one is a one, so we've got one, and then colon. I can go all the way through this, so we've got two zero, three zero, two two, two. All ones right here is an f, f. Zero one zero one — look that up and that is a five, so five. And one zero one zero is an a, so this would be a; there's another a. One zero one one is a b.
So that is representing the first 64 bits right there, and then we'd have to do this for the following 64 bits to totally figure out what this address is. But this is what happens when you actually are translating bits of these IP addresses to have the hexadecimal form of this.
With IPv4 we had a subnet mask. The subnet mask would identify how many of the bits were designated towards the network side and how many of the bits were designated towards the host side. IPv6 has something similar. In IPv4, even towards the later part of it, we started using CIDR notation to identify the count of bits rather than having a subnet mask that said 255.255.0.0, or whatever the subnet mask was. So we made a transition with IPv4. IPv6 just uses the prefix length, and it identifies what is the network portion and what is the interface portion of this address.
When we see an example and we see a slash 16, that is saying that there are 16 bits that are designated towards the network side of this, and so 16 bits would be this first hextet right here. Or we would see a slash 32, and that would be up into this point right here. Or we'd see a slash 48, and that would be up to this point. So it designates how many bits the network is assigned to, and that is the prefix length.
For most of our networks, our network is going to be the first 64. So most of your networks, you're going to see a lot of slash 64, and that's designated as the network address for a lot of our networks. Then the last 64 bits are designated towards the interface. So this is the prefix length when you're talking about IPv6.
A quick note about subnetting. When you're talking about subnetting and IPv6 addresses, a lot of times we do it right within this hextet right here, and this hextet has digits to it — 2 to the 16th power is 65,536 — so we've got a lot of subnets that we can work with. We could just count up zero, one, two, three, four. We have a lot of subnets that we can work with, and not all the time is this what we're given, but a lot of the time we have a lot of freedom with how many subnets that we can create on our networks.
These IPv6 addresses are very long, but there are some ways that we can cut down on the size of these addresses and make them simpler to type out and to write out.
Here I have the rule of no leading zeros. At one point in time — and you'll still see sometimes where they'll put zeros in there — but for the most part we can cut down on a lot of the zeros that you have. The address space is so huge that we still use a lot of zeros. This says that we can cut out leading zeros. Leading zeros are the ones that are up front, and this has to deal with it on a per hextet basis.
So we look at each hextet. There are no leading zeros in here. There are leading zeros in here, so we could actually cut this down to just zero there, cutting out the leading zeros. Once again, there's three leading zeros here, so we can cut this down to zero as well. There's three leading zeros, we can cut that down to zero as well. This one does not have any leading zeros. If we were to cut out this zero right here and it said d e f, then what the machine would do is assume that the zero is up front, and so this would not be something we could shrink. This hextet right here, that would not be something that we could do. This we could cut down to just the zero again, and then this we could cut down to just a 7 8. And then we couldn't reduce this last one because there's no zeros in there. So that is the rule of cutting any of those leading zeros out.
Another thing that we do with IP version 6 addresses is we cut out a series of zeros in a row, where hextets have a series of zeros. In this example right here we have one right here and we have one right here. Well, in this IP version 6 address we can put one set of double colons. In this case right here we're going to choose what is the largest set. In this case we have a three here and only one here, so I'm going to choose this three, and I'm going to write this out as two zero one, colon colon, d e f zero, colon zero, colon seventy eight, colon, nine a b c.
Now, the reason why I can only do it once within this range right here: if I ended up doing the same thing right here and had a double colon right here, the problem with that is it doesn't know whether I have one hextet set of zeros here and three over here, or if I have two sets of hextets over here and two over here, or three sets of hextets here and one over here. It knows that in total there has to be eight sets of hextets. So we've got one, two, three, four, five defined, so now it knows that this representation of the double colons right here — it knows that's where it needs to put in three hextets. So that's how you figure out how to reduce it, and how the machine figures out how to add those back in when it's doing its calculation to figure out what its address actually is.
So this is what we end up with — this address right here, which is quite a bit different than that address that we started with with all of those zeros involved in it. Removing these not only helps you in identifying these addresses much easier, but it also is something that should be done. It's just part of the RFCs that you do eliminate these — not that it's optional to eliminate these.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →