Free — no signup required

Introduction: The 128-bit Expansion

3 min read

We Ran Out of Numbers

Think of IP addresses like phone numbers. When a city runs out of phone numbers, you add an area code — but eventually even that system runs out. IPv4 is in exactly that situation. It uses 32-bit addresses, which provides roughly 4.3 billion unique values. That sounds enormous until you consider that there are over 8 billion people on Earth, each with multiple devices, plus billions of servers, IoT sensors, and cloud instances.

We ran out of IPv4 addresses in 2011. Since then, the internet has survived on NAT (Network Address Translation) — a workaround that lets many devices share a single public IP by hiding them behind a router. NAT works, but it breaks the end-to-end connectivity model the internet was designed around, complicates peer-to-peer applications, and adds latency through stateful translation tables.

IPv6 uses 128-bit addresses. The difference is not linear — it is exponential:

Property IPv4 IPv6
Address size 32 bits 128 bits
Total addresses ~4.3 billion (2³²) ~340 undecillion (2¹²⁸)
Notation 192.168.1.1 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Header size 20 bytes (variable) 40 bytes (fixed)
Broadcast Yes No (replaced by multicast)
NAT required Yes (in practice) No

340 undecillion is 3.4 × 10³⁸. To put that in perspective, it is enough to assign billions of addresses to every grain of sand on Earth. We will not run out.

But IPv6 is not merely "more addresses." It is a deliberate redesign of the IP protocol. The IPv4 header accumulated decades of cruft — options fields, fragmentation flags, checksum fields that duplicated work done at Layer 4. IPv6 strips all of that out. The header is fixed at 40 bytes, routers no longer fragment packets mid-path (only the sender does), and broadcast traffic is eliminated entirely in favor of multicast.

IPv6 address notation rules:
- Eight groups of four hexadecimal digits, separated by colons: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
- Leading zeros in each group can be omitted: 2001:db8:85a3:0:0:8a2e:370:7334
- One consecutive run of all-zero groups can be replaced with ::: 2001:db8:85a3::8a2e:370:7334
- The :: shorthand can only appear once per address

Common address types:
- ::1 — Loopback (equivalent to 127.0.0.1)
- fe80::/10 — Link-local (auto-assigned, non-routable, like 169.254.x.x)
- 2000::/3 — Global unicast (publicly routable)
- fc00::/7 — Unique local (private, like 10.0.0.0/8)
- ff00::/8 — Multicast

Interview Tip

Interviewers often ask: "Why can't we just keep using NAT instead of moving to IPv6?" The correct answer acknowledges that NAT solves address exhaustion but breaks the internet's fundamental design principle: every host should be directly reachable. NAT breaks peer-to-peer protocols, complicates VoIP, requires stateful middleboxes that become single points of failure, and makes network debugging significantly harder. IPv6 restores true end-to-end connectivity. NAT is a workaround, not a solution.

Key Point: IPv6 is not merely an extension of IPv4 — it is a ground-up redesign that eliminates broadcast, simplifies routing with a fixed-length header, removes the need for NAT, and provides an address space so large it will not be exhausted in any foreseeable future.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free