##
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
| Prefix | Type |
| ::1/128 | Loopback |
| ::/128 | Unspecified |
| ::/0 | Default route |
| fe80::/10 | Link-local unicast |
| fc00::/7 | Unique local (ULA) |
| 2000::/3 | Global unicast |
| ff00::/8 | Multicast |
| 2001:db8::/32 | Documentation |
| ::ffff:0:0/96 | IPv4-mapped |
| 2001::/32 | Teredo |
| 2002::/16 | 6to4 |
| fec0::/10 | Site-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
| Field | Bits | Purpose |
|---|
| Version | 4 | Always 6 |
| Traffic Class | 8 | DSCP value for QoS |
| Flow Label | 20 | Identifies a flow (optional) |
| Payload Length | 16 | Payload size in bytes |
| Next Header | 8 | Next header or upper protocol |
| Hop Limit | 8 | Like IPv4's TTL |
| Source Address | 128 | Source IP |
| Destination Address | 128 | Destination IP |
// address types
| Unicast | One-to-one |
| Multicast | One-to-many (no broadcast in IPv6) |
| Anycast | Nearest of many sharing one address |
structure › global unicast = prefix /48 + subnet /16 + interface ID /64
// extension headers (Next Header chain)
| Header | Value | Purpose |
|---|
| Hop-by-Hop Options | 0 | Examined by every router on the path |
| Routing | 43 | Source-routing functionality |
| Fragment | 44 | Set when the source fragments a packet |
| ESP | 50 | Payload encryption (IPsec) |
| Authentication (AH) | 51 | Packet authentication (IPsec) |
| Destination Options | 60 | Information for the recipient only |