IPv4 vs IPv6
IPv4 has 4.3 billion addresses; the world has more than 4.3 billion devices that want one. IPv6 is the long-running answer — with a vastly larger address space and a fundamentally different operating model.
Address format
| IPv4 | IPv6 | |
|---|---|---|
| Bits | 32 | 128 |
| Notation | Dotted decimal — 192.0.2.1 | Colon hex — 2001:db8::1 |
| Total addresses | ~4.3 × 10⁹ | ~3.4 × 10³⁸ |
| Header size | 20–60 bytes (variable) | 40 bytes (fixed) |
| Subnetting | CIDR /24 typical for LANs | /64 standard for LANs |
| NAT | Ubiquitous (RFC 1918) | Not needed; global addresses on every host |
| Autoconfig | DHCP | SLAAC (RFC 4862) or DHCPv6 |
| Broadcast | Yes | Replaced by multicast |
IPv6 shorthand rules
- Leading zeros in each group can be omitted:
2001:0db8::0001→2001:db8::1. - One run of consecutive zero groups can be replaced with
::, but only once per address. - Hex digits are case-insensitive; lowercase is conventional (RFC 5952).
Useful IPv6 ranges
| Prefix | Use |
|---|---|
::1/128 | Loopback (equivalent to IPv4 127.0.0.1) |
fe80::/10 | Link-local — every IPv6 interface has one |
fc00::/7 | Unique local addresses (the IPv6 equivalent of RFC 1918) |
2000::/3 | Global unicast addresses |
ff00::/8 | Multicast |
Practical advice
- Dual-stack is the most common migration approach — listen on both IPv4 and IPv6 and serve whichever the client uses.
- Mobile networks and large CDNs have moved aggressively to IPv6. Your
AAAArecord should be wired up. - Use
/64for any subnet that needs SLAAC. Going smaller breaks autoconfiguration. - For URLs, wrap a literal IPv6 address in brackets:
http://[2001:db8::1]:8080/.