~/netref / IPv6
##

IPv6 Reference

128 bits, written as eight 16-bit hex groups. No broadcast, no NAT (mostly), and a few compression rules to learn.

// anatomy

2001:0db8:85a3:0000:0000:8a2e:0370:7334
↓ drop leading zeros · collapse one run of zeros to ::
2001:db8:85a3::8a2e:370:7334
PrefixType
::1/128Loopback
::/128Unspecified
::/0Default route
fe80::/10Link-local unicast
fc00::/7Unique local (ULA)
2000::/3Global unicast
ff00::/8Multicast
2001:db8::/32Documentation
::ffff:0:0/96IPv4-mapped
2001::/32Teredo
2002::/166to4
fec0::/10Site-local (deprecated)

// rules & facts

  • 128 bits = eight 16-bit hex groups
  • Drop leading zeros in each group
  • Replace ONE run of zero-groups with ::
  • No broadcast — uses multicast instead
  • EUI-64 builds host bits from the MAC
  • Loopback is ::1, not 127.0.0.1
// protocol header
FieldBitsPurpose
Version4Always 6
Traffic Class8DSCP value for QoS
Flow Label20Identifies a flow (optional)
Payload Length16Payload size in bytes
Next Header8Next header or upper protocol
Hop Limit8Like IPv4's TTL
Source Address128Source IP
Destination Address128Destination IP
// address types
UnicastOne-to-one
MulticastOne-to-many (no broadcast in IPv6)
AnycastNearest of many sharing one address
structure › global unicast = prefix /48 + subnet /16 + interface ID /64
// extension headers (Next Header chain)
HeaderValuePurpose
Hop-by-Hop Options0Examined by every router on the path
Routing43Source-routing functionality
Fragment44Set when the source fragments a packet
ESP50Payload encryption (IPsec)
Authentication (AH)51Packet authentication (IPsec)
Destination Options60Information for the recipient only