IPv6
The 128-bit successor to IPv4 — and why it barely needs NAT
Back in Chapter 2 we noted that IPv4’s 32 bits ran out. IPv6 is the fix — a vastly larger address space with a cleaner design. This extra chapter gives you enough to read and reason about IPv6 when you meet it.
Why IPv6?
IPv4’s ~4.3 billion addresses were exhausted years ago — there are far more devices than addresses. IPv6 was designed to solve this permanently, with an address space so large it is effectively unlimited (about 3.4 × 10³⁸ addresses).
128 bits, in hex
An IPv6 address is 128 bits — four times the length of IPv4. It is written as eight groups of four hexadecimal digits separated by colons, e.g. 2001:0db8:0000:0000:0000:ff00:0042:8329. Eight groups × 16 bits = 128 bits.
Shortening rules
Those addresses look intimidating but compress nicely. Two rules: drop leading zeros in each group, and replace one run of all-zero groups with ::. So the example becomes 2001:db8::ff00:42:8329. The :: can appear only once (otherwise it would be ambiguous).
No NAT needed
Because addresses are so plentiful, every device can have its own globally unique public address — there is no need to share one via NAT. This restores true end-to-end connectivity, though firewalls still control what is actually reachable.
Address types
- Global unicast
- A public, internet-routable address.
- Link-local (fe80::)
- Valid only on the local link; auto-configured on every interface.
- Multicast (ff00::)
- Delivered to a group of interfaces. (IPv6 has no broadcast — multicast replaces it.)
Dual stack
The internet is mid-migration, so most devices run dual stack — both IPv4 and IPv6 at once — using IPv6 when the other end supports it and falling back to IPv4 otherwise. This lets the two coexist smoothly during the long transition.