PROTOCOLS-FUN . PACKET ANATOMY

IPv6 Anatomy

IPv4 (RFC 791) + IPv6 (RFC 8200)
rev 2026.08
layer L3 . network
v6 header 40B fixed
v4 header 20-60B

Every packet on the internet opens with one of these two headers. IPv4's 20-byte header has carried the internet since 1981; IPv6's fixed 40-byte header, finalized in 2017, trades IPv4's variable-length options for a chain of separate extension headers and swaps a 32-bit address space for a 128-bit one. Hover a field to light its bytes, click a field marked + for its lookup table.

where this sits

The IP header is layer 3 - it hands off to a transport header above and rides inside a link-layer frame below. Hover a row for the layer's own byte layout and a code snippet.

L4 . transportTCP / UDP / ICMPv6above
L3 . networkIPv4 / IPv6 - this pagehere
L2 . data linkEthernet framebelow
the diff, at a glance
IPv4IPv6
Header size20-60 bytes, variable (options)40 bytes, fixed - extensions are separate chained headers
Address length32 bits128 bits
Header checksumyes - recomputed every hopnone - integrity pushed to upper layers
Fragmentationrouters may fragment in flightsource only, via a Fragment extension header
"next protocol" fieldProtocol (byte 9)Next Header (byte 6) - same IANA registry, same numbers
Broadcastyesnone - multicast only
Address autoconfigDHCP (or static)SLAAC or DHCPv6
Defining specRFC 791 (1981)RFC 8200 (2017)
why the source is documentation-safe. The example addresses on this page use the reserved documentation ranges - 2001:db8::/32 for IPv6 (RFC 3849) and 192.0.2.0/24 / 203.0.113.0/24 for IPv4 (RFC 5737) - so nothing here is a real routable host.
size40 bytes, fixedaddr128-bitspecRFC 8200

First word (version, traffic class, flow label) is bit-packed, so it's drawn bit by bit. Everything after it is byte-aligned - payload length, next header, hop limit, then the two 128-bit addresses drawn byte by byte.

size20-60 bytesaddr32-bitspecRFC 791

Version+IHL+DSCP+ECN pack into the first 2 bytes, so they're drawn bit by bit; Total Length and Identification are byte-aligned; Flags+Fragment Offset pack into 2 more bits; TTL, Protocol, Checksum, and both addresses are byte-aligned.