Course contents

Chapter 3: IPv6 ConfigurationLesson 2 of 6

IPv4 and IPv6 headers

The IPv4 header fields and the fixed 40-byte IPv6 header: what was removed, renamed or added, and extension headers.

Intermediate · 9 min read

Technical definition

IPv6 header is the fixed 40-byte header at the front of every IPv6 packet. It has eight fields: version, traffic class, flow label, payload length, next header, hop limit, source address and destination address.

Two headers, side by side

IPv4 header (20+ bytes) and IPv6 header (fixed 40 bytes)
IPv4 header (20+ bytes) and IPv6 header (fixed 40 bytes)The IPv4 header has fields for header length, fragmentation, a header checksum and options that IPv6 removed. IPv6 renames TTL to hop limit, protocol to next header, total length to payload length and adds a flow label. The IPv6 header is a fixed 40 bytes with 128-bit addresses.IPv4IPv6VerIHLDSCP/ECNTotal lengthIdentificationFlFrag offsetTTLProtocolHeader checksumSource address (32 bits)Destination address (32 bits)Options (0 to 40 bytes)VerTraffic classFlow label (20 bits)Payload lengthNext headerHop limitSource address (128 bits)(address continues)Destination address (128 bits)(address continues)Variable length: IHL gives the sizeAlways 40 bytes, extras in extension headersSame width = 32 bits per row. IPv6 addresses take four rows each in a real header.
Green fields continue (often renamed), red fields were removed in IPv6, and blue is new. Fragmentation and options moved into optional extension headers, so routers process a simpler, fixed-size header.

The IPv4 header is at least 20 bytes and can grow to 60 with options, so its length is stored in the IHL field. The IPv6 header is always 40 bytes, so there is no length field to maintain. Fixed layouts are easier for hardware to parse.

Field by field

What happened to each IPv4 field
What happened to each IPv4 fieldIPv4 field; IPv6 equivalent; Change. Version (4): Version (6) Same size, new value IHL: None Removed: the header length is fixed DSCP / ECN: Traffic class Same purpose: QoS marking Total length: Payload length Now counts only the payload, not the 40-byte header Identification, flags, fragment offset: Fragment extension header Moved out of the base header; only the source fragments TTL: Hop limit Renamed; still decremented at each router, dropped at 0 Protocol: Next header Renamed; it can also point to an extension header Header checksum: None Removed Source / destination address: Source / destination address 32 bits become 128 bits Options: Extension headers Optional, chained after the base header None: Flow label New: 20 bits to identify a flowIPv4 fieldIPv6 equivalentChangeVersion (4)Version (6)Same size, new valueIHLNoneRemoved: the header length is fixedDSCP / ECNTraffic classSame purpose: QoS markingTotal lengthPayload lengthNow counts only the payload, not the40-byte headerIdentification, flags,fragment offsetFragment extension headerMoved out of the base header; onlythe source fragmentsTTLHop limitRenamed; still decremented at eachrouter, dropped at 0ProtocolNext headerRenamed; it can also point to anextension headerHeader checksumNoneRemovedSource / destinationaddressSource / destination address32 bits become 128 bitsOptionsExtension headersOptional, chained after the baseheaderNoneFlow labelNew: 20 bits to identify a flow

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: where an IPv4 field went in IPv6.

Next header and extension headers

The next header field names what follows the 40-byte header: a transport protocol or an extension header. Extension headers chain together, each pointing to the next, until the upper-layer data.

Common next-header values
Common next-header valuesValue; Meaning. 6: TCP 17: UDP 58: ICMPv6 0: Hop-by-hop options header 43: Routing header 44: Fragment header 50 / 51: ESP / AH (IPsec) 60: Destination options headerValueMeaning6TCP17UDP58ICMPv60Hop-by-hop options header43Routing header44Fragment header50 / 51ESP / AH (IPsec)60Destination options header

On small screens, swipe sideways or focus the diagram and use the arrow keys.

IPv4 uses the same numbers in its Protocol field, so 6 and 17 are already familiar. 58 is new.

Why simpler matters

  • Routers read one fixed layout and skip most options, so forwarding is faster.
  • No fragmentation work in routers: an oversized packet gets an ICMPv6 Packet Too Big back to the source.
  • No checksum to recalculate when the hop limit changes.

Test yourself

Predict · scenario 1

A router receives an IPv6 packet with a hop limit of 1. What does it do?

Predict · scenario 2

Which IPv4 field has no equivalent in the IPv6 base header at all?

Predict · scenario 3

In an IPv6 header, the next header field contains 58. What follows?

FAQ

Why does IPv6 have no header checksum?
Link layers and the transport layer already check for errors, and recalculating a checksum at every router because the hop limit changes costs time. Removing it makes forwarding simpler. UDP over IPv6 therefore requires its own checksum.
What is the flow label for?
A 20-bit field that lets a source tag packets belonging to one flow so routers can treat them alike, for example to keep them on one path. It is rarely used in practice today.
What is the minimum IPv6 MTU?
1280 bytes. Every link must carry at least that, and a sender that cannot find the path MTU should not send larger packets than 1280.