The IPv6 header uses a fixed 40-byte structure with fewer fields than IPv4, making it more efficient to process at each network hop. Key differences include the removal of checksums and fragmentation support, the addition of a flow label field, and 128-bit source and destination addresses.
IPv6 Packet Header
One thing that's different about an IPv6 header than an IPv4 header is that the IP header is a fixed length, and so it's 40 bytes. Although there are some extensions which allow it to extend with some additional information, for the most part one of the efficiencies with IPv6 and the header in IPv6 is that it has a fixed length with it, and it's 40 bytes.
And so then we see that the payload could be anywhere from 0 to 460, which makes sense. If our maximum transmission unit is 1500, then 460 plus our 40 bytes adds up to our 1500. So there you have our header right there. If we had jumbo frames turned on, because of the field that allows us to specify the size of the packet, we could actually go up to 65,536 bytes. And so it could be much larger, but typically we have a maximum transmission unit of 1500.
Here's what the IPv4 header looks like versus an IPv6 header. I've got the IPv4 down here on the bottom versus the IPv6. So we actually see that the header of the IPv4 is smaller, without the options, if the options are not included, than the IPv6 header. But there are some efficiencies that come in with an IPv6 header, which makes it much more efficient.
Here's an example of the IPv4 header. And just as a real little refresher, each one of these boxes here is a bit. And so these eight bits make up a byte. So the rectangle box right here represents a byte of information. So the version would then be four bits. We have four bits that are in here, so those are the four bits for version. And then we have the IHL. I'm not going to go into all of these, but these are the zero through third byte, the fourth through the seventh byte. So each line is four bytes long.
So here's an IPv6 header. We see the same formatting that I have for each of those diagrams. In this case right here, we see that there's a lot fewer fields in here, but the source IP address and destination IP address take up a lot more space on there. And that's because it takes up 128 bits, so they're much, much larger. The whole header is much larger, but because it's a fixed length and because it eliminates some of the unnecessary fields in here, it's actually much more efficient in the way it operates.
Here's a side-by-side example of what the difference is between those IPv4 headers and those IPv6 headers. Some of the fields are the same: the version field and the source and destination addresses are the same. And then we see that there are some name changes and a little bit different, and possibly some little difference in functionality.
So the total length has become the payload length. Total length would include the header, versus the payload length is just the payload that it's carrying. We see the DSCP and the ECN is now the traffic class, although the functionality between these bits and these bits is pretty much the same. We see a time to live and a hop limit, and same thing, the concept there is the same. We have a protocol and a next header, which delivers some of the same information. And then we've eliminated some fields: these are fields involved in IPv4 that are no longer involved in IPv6. And then we have added the flow label, that's on IPv6.
So we see some variance in the fields that we have. There's a lot of similarities between this. One of the things I'll call out is that we do see that some of these have to deal with fragmentation, and that is not within IPv6. So IPv6 doesn't have the same mechanisms to fragment the packets.
Another huge call-out is that there's no checksum that happens. If you recall what would happen, as the IPv4 packet would go from router to router, then the time to live would decrement and the checksum would have to be recalculated, and then it would be sent to the next location, and the checksum would verify that the packet is still good, and then it would have to decrement once again the time to live and then recalculate that checksum. So there's a lot of processing that happened every time it hit one of these routers.
Well, you don't have that in IPv6. You still have the hop limit, so it still counts down, but you don't have the checksum that happens to verify that it's okay. So what happens, and how do we know that the packet is good? Well, once it's delivered to wherever it's going, then at that point in time there would be some sort of verification that the data is still good. So that still happens. It just doesn't happen at the layer three level. And really, our communication is not riddled with as many errors and issues as it used to be. Our equipment is able to process things much cleaner as we've progressed and as we've developed these technologies and these protocols.
In summary, we would say IPv4 is shorter versus IPv6 is longer. However, that's compensated by the fact that IPv4 is more complex, and so there is more processing involved, and IPv6 is much simpler.
Just a quick recap of how these headers are set up. This is the IPv6 header. Each one of these squares represents the bits. The top represents the bytes. If we were to count 1, 2, 3, 4, 5, 6, 7, 8, sure enough, there's eight bits per byte. And then the 0 through 3 is the 0 through 3 byte. This is the fourth through the seventh byte. And then here are the bytes associated with the source IP, and here are the bytes associated with the destination IP.
The first field that we run across is the version. This is the same in IPv4 and IPv6, although IPv4 would have a 0 1 0 0, which translates to four, versus an IPv6 would have a 0 1 1 0, which translates to six. So that's what you would see, a 0 1 1 0, when you're talking about IPv6.
The next field that we have is the traffic class field, and this is broken into two different parts. Even though it's been renamed, essentially the first part is just like an IPv4. So the first six bits are the DSCP field, or what is known as the differentiated service field. And the second two bits then is the ECN. ECN is to notify of congestion. If there's any congestion on the line, then it is some signaling that can happen back and forth between two layer three devices to let the other device know that there's some congestion that's happening. Versus the differentiated service field allows it to identify things like quality of service or management traffic. So it can identify some of the traffic, and what it will help essentially the router or the layer 3 device be able to identify is what the priority of this packet is.
The next 20 bits in this header is what's called the flow label field. What the flow label does is identify a group of packets that belong together. So an example of this is if these were all zero through here, then that means that it doesn't actually correspond with any other packets that are associated with this. So it can associate different packets with each other.
The next field that we see is the payload length. The payload length is going to identify how big the payload that this packet is carrying. And so this is measured in bytes, so however many bytes there are would be written in here. And since we know that the maximum transmission unit is usually 1,500, then this would be only partially filled. We actually could go - this could identify a much larger packet size. In fact, since there's 16 bits, it could go up to 65,536. So this just identifies how big of a payload this packet is carrying.
The next field that we find is the next header field. What the next header field is going to do is tell each device, each router, each stop of the way - it's going to tell it what is found beyond the header, what it should expect beyond the header. So typically what this is is the layer 4 header. The layer 4 header is typically found after the IPv6 header, and so it will identify: is this TCP, is this UDP? And those version numbers that it specifies in this next header is the same as you would see in the IPv4 packet header. However, one exception to this is if you have any kind of extensions. IPv6 does allow you to have some extensions, which gives some additional functionality. And so if there is an extension down there, then this next header would identify that there's an extension to this IPv6 header. So for the most part, just think of this as identifying the layer 4 protocol, but there are a few exceptions to that.
The next field that we have is the hop limit. The hop limit in an IPv6 header is similar to the time to live on IPv4. Now, if you recall, there are times when you have a router that will forward a packet on to another router, but that router can then mistakenly think that that packet needs to be forwarded back to the original router. This happens when not all the routers on a network have the same routing information, and it creates this loop, and that packet could be sent back and forth indefinitely. Obviously that's going to cause a problem if you consistently get packets in there, and that's going to really bog down these routers. So we need some sort of mechanism that says, oh, this packet has been passed off too many times, so now we need to kill this packet, we need to let this packet go.
And so that is what the hop limit does. Every time it goes from one layer three device to another layer three device, it will decrement that value by one. And then once it gets down to zero, then it will kill the packet, and that packet will no longer be allowed to progress on. So therefore it would stop any loops from happening - or at least it won't stop the loop from happening, but it'll stop a packet from bringing that circuit down because it continually gets looped within that network.
Then we have the source IP address and destination IP address. Each of these take up 128 bits, so this is a significant portion of what the IPv6 header is taken up through the source IP address and destination IP address. And remember, within layer 2 our MAC addresses, our source and destination MAC addresses or layer 2 addresses, will change as it goes from one location to the next. But when it comes to an IPv6 header right here, these source IP addresses and destination IP addresses do not change. That means if you're communicating to the rest of the world, you're using your GUA, your global unicast address. And that global unicast address that is in here will not change. The global unicast address that's on your machine is the same thing that will be seen on the other location. When this packet gets to its final destination, it will see your global unicast address.
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 →