The IPv6 packet header uses a fixed 40-byte structure that streamlines routing by eliminating fields like checksums and fragmentation found in IPv4. This coverage compares the two header formats side by side and breaks down each field in the IPv6 header, including traffic class, flow label, payload length, next header, hop limit, and source and destination addresses.
IPv6 Packets
One thing that's different about an IPv6 header than an IPv4 is that the IP header is a fixed length, and so it's 40 bytes. There are some extensions which allow it to extend with some additional information, but for the most part one of the efficiencies with IPv6, and with the header in IPv6, is that it has a fixed length and it's 40 bytes.
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.
Here's what the IPv4 header looks like versus an IPv6. I've got the IP version 4 down here on the bottom versus the IP version 6. We actually see that the header of the IP version 4 is smaller, without the options, if the options are not included, than the IP version 6 header. But there are some efficiencies that come in with an IPv6 header which make it much more efficient.
Here's an example of the IP version 4 header. Just as a little refresher, each one of these boxes here is a bit, and so these eight bits make up a byte. This rectangle box right here represents a byte of information. 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.
Here's the IPv6 header. We see the same formatting that I have for each of those diagrams. In this case right here we see that there are a lot fewer fields, but the source IP address and destination IP address take up a lot more space, and that's because it takes up 128 bits. So they're much, much larger. The whole header is 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. Then we see that there are some name changes, and a little bit different and possibly some little difference in functionality. The total length has become the payload length, so 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 the concept there is the same. We have a protocol and a next header, which delivers some of the same information. Then we've eliminated some fields that are involved in IPv4 and are no longer involved in IPv6, and we have added the flow label that's on IPv6. So we see some variance in the fields that we have, and there's a lot of similarities between this.
One of the things I'll call out is that we do see that the fragmentation, so some of these fields have to deal with fragmentation, is not within IP version 6. IPv6 doesn't have the same mechanisms to fragment the packets.
Another huge call-out is that there's no checksum. If you recall what would happen, the IPv4 would go from router to router, and 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. Then it would have to decrement once again the time to live, and then it would have to recalculate that checksum. So there's a lengthy process, 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? 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 3 level. 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. One of the examples of that is that IPv4 can vary in its length depending on what options are available to it, versus IPv6 is a fixed length. There are extensions to IPv6, so there are some capabilities to add some information, it just doesn't add it to the core header.
There is a checksum with IPv4 and no checksum with IPv6, like we just talked about. There's fragmentation that can happen within IPv4; there's no fragmentation within IPv6, there's no mechanism to fragment those. What that all boils down to is that IPv4 has a longer processing time, it takes more CPU power to process it, versus IPv6 is much shorter.
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, one two three four five six seven eight, sure enough there's eight bits per a byte. Then the zero to three is the zero through third 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 4, versus an IPv6 would have a 0 1 1 0, which translates to 6. So that's what you would see, a 0 1 1 0, when you're talking about IP version 6.
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 IPv4: the first six bits are the DSCP field, or what is known as the differentiated service field, and the second two bits are the ECN. ECN is to notify of congestion. If there's any congestion on the line, then there is some signaling that can happen back and forth between two layer 3 devices to let the other device know that there's some congestion that's happening. 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 help the router or the layer 3 device be able to identify 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. An example of this is if these were all zero through here, then that means it doesn't 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 is that this packet is carrying, and this was measured in bytes, so however many bytes there are would be written in here. Since we know that the maximum transmission unit is usually 1500, then this would be only partially filled. We could actually identify a much larger packet size; in fact, since there are 16 bits, it could go up to 65 530. 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, what is found beyond the header, what it should expect beyond the header. Typically what this is is the layer 4 header. The layer 4 header is typically found after the IP version 6 header, and so it will identify, is this TCP, is this UDP, and those version numbers that it specifies in this next header are 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 IP version 6 header. 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 the IPv6 header is similar to the time to live on IPv4. 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, that's going to really bog down these routers. So we need some sort of mechanism that says, this packet has been passed off too many times, so now we need to kill this packet, we need to let this packet go.
That is what the hop limit does. Every time it goes from one layer 3 device to another layer 3 device, it will decrement that value by one, and then once it gets down to zero it will kill the packet, and that packet will no longer be allowed to progress. 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 a significant portion of what the IPv6 header is is taken up by the source IP address and destination IP address. Remember that 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 the 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 →