Chapter 1: Networking Fundamentals
1.5 IPv6
Why IPv6 is needed
- IPv4 has only ~4.3 billion addresses, and the regional registries have run out of fresh IPv4 blocks.
- IPv6 has 2^128 ≈ 3.4 × 10^38 addresses — enough to give every device its own public address, removing the need for NAT.
- Built-in features: simpler header, auto-configuration (SLAAC), better multicast, and no broadcast.
- On AWS, public IPv4 addresses are charged per hour, whereas IPv6 addresses are free — another practical reason to learn IPv6.
Format
IPv6 is 128 bits, written as 8 groups of 4 hexadecimal digits (16 bits each), separated by colons:
2001:0db8:0000:0000:0000:ff00:0042:8329
|16b| 8 groups x 16 bits = 128 bits
Shortening rules
- Leading zeros in any group may be removed:
0db8→db8,0042→42,0000→0. - One continuous run of all-zero groups may be replaced by
::— only once per address (otherwise the length would be ambiguous).
| Full form | Short form |
|---|---|
2001:0db8:0000:0000:0000:ff00:0042:8329 |
2001:db8::ff00:42:8329 |
fe80:0000:0000:0000:0202:b3ff:fe1e:8329 |
fe80::202:b3ff:fe1e:8329 |
0000:0000:0000:0000:0000:0000:0000:0001 |
::1 (loopback) |
2001:0db8:0000:0001:0000:0000:0000:0001 |
2001:db8:0:1::1 |
Important IPv6 address types
| Prefix | Type | IPv4 equivalent |
|---|---|---|
::1/128 |
Loopback | 127.0.0.1 |
fe80::/10 |
Link-local (auto on every interface) | 169.254.x.x |
fc00::/7 (fd00::/8 in practice) |
Unique local (private) | RFC1918 ranges |
2000::/3 |
Global unicast (public) | Public IPv4 |
ff00::/8 |
Multicast | 224.0.0.0/4 |
::/0 |
All IPv6 addresses | 0.0.0.0/0 |
In AWS, a VPC can get an Amazon-provided /56 IPv6 block and each subnet a /64. Remember to add ::/0 rules in security groups if you want IPv6 clients to reach your server.