IPv6 // RFC 8200
A fixed 40-byte header, 128-bit addresses and a next-header chain that replaces IPv4 options. IPv6 dropped the header checksum, moved fragmentation to the source and separated routing, fragment and destination options into extension headers. The result is simpler to forward and harder to parse blindly.
01Header layout
fixed 40 bytes · no options in the base headerThe IPv6 header is always 40 bytes. The first 32 bits pack Version, Traffic Class and Flow Label; then come Payload Length, Next Header, Hop Limit, and the 128-bit source and destination addresses. There is no IHL, no header checksum and no base-header options field.
Payload Length counts everything after the 40-byte base header: extension headers plus the upper-layer payload. It does not include the base header and it does not include Ethernet padding or FCS. A value of zero is valid for an empty packet, or for an RFC 2675 jumbogram when a Hop-by-Hop Jumbo Payload option is present.
02Traffic class & flow label
the first 32 bits, packedVersion, Traffic Class and Flow Label share the first 32 bits. Traffic Class is the same DSCP/ECN octet used by IPv4 Differentiated Services; Flow Label is a separate 20-bit identifier intended for flow classification and load balancing. It is not a port and it does not identify a connection.
0 · 0x00
0x12345
0x60012345
The high nibble is the version (6). The next 8 bits are DSCP (6 bits) plus ECN (2 bits). The low 20 bits are the flow label. A flow label of zero means “no label”; routers must not change a non-zero label.
| Field | Bits | Use | Reference |
|---|---|---|---|
| Version | 4 | Always 6 for IPv6; a different value is not an IPv6 header. | RFC 8200 §3 |
| Traffic Class | 8 | DSCP (6 bits) + ECN (2 bits), same semantics as IPv4 Differentiated Services. | RFC 2474 · RFC 3168 |
| Flow Label | 20 | Flow identification for load balancing and classification; zero means unlabelled. | RFC 6437 |
03Addresses
128 bits · RFC 5952 text form
An IPv6 address is 128 bits, written as eight 16-bit hexadecimal groups. Leading zeros in
a group are removed and the longest run of zero groups is compressed with ::.
Only one :: is allowed. The wire format is always the full 16 bytes; the
shortened text form is only a display convention.
address parser
RFC 5952 · RFC 4291parsed address
wire + text| Prefix | Meaning | Notes | Reference |
|---|---|---|---|
::/128 | Unspecified | Never a valid destination; a source before an address is assigned. | RFC 4291 §2.5.2 |
::1/128 | Loopback | The local host, equivalent in role to 127.0.0.1 but a single address. | RFC 4291 §2.5.3 |
::ffff:0:0/96 | IPv4-mapped | An IPv4 address embedded in IPv6; displayed as ::ffff:192.0.2.1. | RFC 4291 §2.5.5 |
fe80::/10 | Link-local unicast | Valid only on one link; local tools need a zone such as %eth0. | RFC 4291 §2.5.6 |
fc00::/7 | Unique local | Private-use addresses, roughly the IPv6 counterpart of RFC 1918. | RFC 4193 |
ff00::/8 | Multicast | No broadcast. ff02::1 is all-nodes on the local link. | RFC 4291 §2.7 |
2001:db8::/32 | Documentation | Reserved for examples and documentation, never for production traffic. | RFC 3849 |
2000::/3 | Global unicast | The current global-unicast range; not every address inside it is routable. | RFC 4291 §2.4 |
fe80::1%eth0 tells the local stack which interface to use. The
%eth0 part is not encoded in the IPv6 header and does not travel across the
wire. It is scope information, not an address field.
04Extension headers
the next-header chainIPv6 moves optional processing into separate extension headers. Each one starts with a Next Header byte and a length field, then type-specific data. Only Hop-by-Hop must be first; the usual order is Hop-by-Hop, Destination Options, Routing, Fragment, AH, ESP, a final Destination Options header, then the upper-layer protocol.
fragment header
8 bytesrouting header
8+ bytes| Next Header | Header | Length rule | What it does | Reference |
|---|---|---|---|---|
0 | Hop-by-Hop Options | (Hdr Ext Len + 1) × 8 B | Must be first; Router Alert and Jumbo Payload live here. | RFC 8200 §4.3 |
43 | Routing | (Hdr Ext Len + 1) × 8 B | Type 0 source routing is deprecated; type 4 is SRH. | RFC 8200 §4.4 · RFC 8754 |
44 | Fragment | Always 8 B | Offset, M flag and 32-bit identification. | RFC 8200 §4.5 |
51 | AH | (Payload Len + 2) × 4 B | Authentication header; IPsec integrity and authentication. | RFC 4302 |
60 | Destination Options | (Hdr Ext Len + 1) × 8 B | Options for the final destination, before or after routing. | RFC 8200 §4.6 |
50 | ESP | Encrypted; stop parsing | The rest is encrypted; the next header is protected inside ESP. | RFC 4303 |
59 | No Next Header | — | Ends the packet; there is no upper-layer payload. | RFC 8200 §4.7 |
58 | ICMPv6 | Upper layer | Errors, echo and Neighbor Discovery. | RFC 4443 · RFC 4861 |
6 | TCP | Upper layer | Connection-oriented transport. | RFC 9293 |
17 | UDP | Upper layer | Datagram transport; checksum is mandatory in IPv6. | RFC 768 |
132 | SCTP | Upper layer | Message-oriented transport with multihoming. | RFC 9260 |
41 | IPv6 encapsulation | Upper layer | An inner IPv6 packet; used by tunnels. | RFC 2473 |
Common options
| Option | Type | Format | Use | Reference |
|---|---|---|---|---|
| Pad1 | 0x00 | 1 byte | Single-byte alignment padding. | RFC 8200 §4.2 |
| PadN | 0x01 | Type + length + N zeros | Multi-byte alignment padding. | RFC 8200 §4.2 |
| Router Alert | 0x05 | Type + 2 + value | Tells routers to examine the packet; value 0 is MLD. | RFC 2711 |
| Jumbo Payload | 0xC2 | Type + 4 + 32-bit length | Payloads over 65535 bytes; only with Payload Length 0. | RFC 2675 |
| Home Address | 0xC9 | Type + 16 + address | Mobile IPv6 home address option. | RFC 6275 |
| Tunnel Encapsulation Limit | 0x04 | Type + 1 + limit | Limits nested encapsulation. | RFC 2473 |
Only Hop-by-Hop must appear first, but routers and firewalls commonly enforce the recommended order and may drop unexpected combinations. IPv6 fragmentation is performed by the source, not by routers; a fragment header with offset 0 and M=0 is an atomic fragment. AH and ESP change the length accounting and the visibility of the upper layer.
05Encoder
base header · payload length autoBuild a structurally valid IPv6 base header and append a payload. Payload Length is calculated from the bytes you supply, so it includes any extension headers you paste or generate. The optional presets create a TCP, UDP, ICMPv6, Hop-by-Hop or Fragment example; transport checksums are calculated for the current source and destination when a preset is loaded.
IPv6 parameters
RFC 8200The base header has no checksum. Transport checksums use an IPv6 pseudo-header: source, destination, upper-layer length and next header. If you edit addresses after loading a preset, the preset checksum is no longer valid for the new addresses.
wire output
waitingno bytes built yet
The output includes the 40-byte IPv6 header and the payload you supplied.
It does not add Ethernet framing or an FCS, and it does not recompute transport
checksums after you edit the addresses. Use the Ethernet explorer for EtherType
0x86DD framing.
06Decoder
IPv6 packet or Ethernet frame
Paste a raw IPv6 packet or an Ethernet II frame with EtherType 0x86DD.
The decoder follows the Next Header chain through Hop-by-Hop, Routing, Fragment, AH and
Destination Options headers, reports each length and offset, and stops at the first
upper-layer protocol. It also detects RFC 2675 Jumbo Payload options.
parse bytes
RFC 8200 · extension chain07Wire notes
what changed from IPv4IPv6 removed the per-hop header checksum. Link layers and upper layers detect errors; TCP, UDP and ICMPv6 checksums include an IPv6 pseudo-header. This means a router can decrement Hop Limit without recomputing a header checksum, but it also means a corrupted base header may not be detected until the upper layer.
- Payload Length includes extension headers. It is not the length of the upper-layer payload alone. Subtract the chain lengths to find the transport payload. A zero value is meaningful: empty packet or jumbogram with a Jumbo Payload option.
- Hop Limit is not TTL. It counts hops, not seconds, and is decremented on every forwarding router. Initial values are convention, not protocol constants. Zero produces ICMPv6 Time Exceeded.
- Fragmentation belongs to the source. IPv6 routers do not fragment packets; they send ICMPv6 Packet Too Big when the packet exceeds the path MTU. The Fragment header uses a 32-bit identification and an offset in 8-byte units.
- Address text is not wire format. The wire is always 16 bytes. RFC 5952 canonical text compresses the longest zero run, lowercases hex and omits leading zeros. Zone identifiers such as
%eth0are local scope syntax. - No broadcast. IPv6 uses multicast and anycast. All-nodes multicast is
ff02::1; solicited-node multicast isff02::1:ff00:0/104. ARP is replaced by Neighbor Discovery over ICMPv6. - Extension chains need limits. A parser must bound the number of extension headers it follows, validate every length before slicing, and stop at ESP because the next header is encrypted.
- Filtering ICMPv6 breaks IPv6. Neighbor Discovery, Router Advertisement, Packet Too Big and Time Exceeded are not optional noise. Blanket ICMP drop policies are a common cause of IPv6 black holes.
- Extension headers are not IPv4 options. They are chained through Next Header values and counted in Payload Length; AH uses 4-octet length units, while Hop-by-Hop, Routing and Destination Options use 8-octet units.