The Address Space That Built the Internet

Every packet that crosses the internet carries a source and destination IP address. These addresses are how routers know where to send traffic, and how hosts know where it came from. The story of the internet is, in large part, the story of running out of them.

IPv4

An IPv4 address is a 32-bit number written as four decimal octets (192.168.0.1). That gives about 4.3 billion possible addresses—generous in 1981, hopelessly insufficient today. IPv4 addresses are split into the network portion and the host portion by a subnet mask (covered in the subnetting lesson).

The original design used classful addressing (Class A = /8, Class B = /16, Class C = /24), which wasted enormous blocks. CIDR (Classless Inter-Domain Routing) replaced it with arbitrary prefix lengths, and NAT stretched the remaining public space by letting whole private networks share one public address.

IPv6

IPv6 uses 128-bit addresses, written as eight groups of four hex digits (2001:0db8:85a3::8a2e:0370:7334). That is roughly 3.4×10³⁸ addresses—enough to give every atom on Earth's surface its own network. The :: shorthand collapses one run of zero groups.

IPv6 changes more than size: - No NAT required (though firewalls still exist). - Stateless autoconfiguration (SLAAC): hosts can generate their own addresses from router advertisements. - Simpler header format designed for fast router processing. - Built-in multicast replacing broadcast. - Mandatory IPsec support (in the original spec).

Dual Stack and Transition

The internet runs on both protocols simultaneously via dual stack: hosts hold an IPv4 and an IPv6 address and prefer IPv6 when available. Transition mechanisms (NAT64, DNS64, Teredo) let IPv6-only networks reach legacy IPv4 resources. As of today, a significant share of global traffic is IPv6, and mobile networks are frequently IPv6-first.

Special Address Ranges

Both protocols reserve ranges for special purposes: - IPv4 private: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. - IPv4 loopback: 127.0.0.0/8. IPv6 loopback: ::1. - IPv4 link-local: 169.254.0.0/16. IPv6 link-local: fe80::/10. - IPv4 multicast: 224.0.0.0/4. IPv6 multicast: ff00::/8.

Recognizing these ranges is essential for reading firewall rules and debugging: a 169.254.x.x address almost always means DHCP failed, and a fe80:: address cannot reach the internet.

Privacy and Addressing

IPv4 addresses are scarce and valuable, so tracking individuals by address is coarse. IPv6's huge space allows per-device addresses, so the IETF added temporary/privacy addresses (RFC 4941) that rotate to prevent long-term tracking. This is one reason a device appears to use many IPv6 addresses over time—it is a privacy feature, not a misconfiguration.

Reading and Writing Addresses

Both formats have conventions worth internalizing. In IPv4, octets are 0–255 and leading zeros are usually omitted. In IPv6, each group is a 16-bit hexadecimal number; the :: shorthand may appear only once, collapsing the longest run of zero groups. The final 64 bits are typically the interface identifier, traditionally derived from the MAC address (EUI-64) but now usually randomized for privacy. When you see an address like 2001:db8::1/64, you know the first 64 bits are the network (the 2001:db8 portion plus zeros) and the rest identifies the host.

Subnet Size at a Glance

Prefix length determines capacity on both protocols: - IPv4 /24 ≈ 254 hosts, /16 ≈ 65k hosts, /8 ≈ 16.7M hosts. - IPv6 /64 = 2^64 hosts per subnet (the standard LAN size), /48 = 65k subnets per site.

Because address space is not the constraint in IPv6, the design question shifts from "how few addresses can I get away with?" to "how cleanly can I aggregate routes?" A typical enterprise is assigned a /48, subdivides into /56s per site, and carves each site into /64 subnets.

Diagnosing Addressing Problems

Two symptoms dominate: - A 169.254.x.x address: the host tried and failed to get a DHCP lease. It self-assigned a link-local address that cannot reach the internet. - An IPv6 address but no IPv4 connectivity (or vice versa): the network may be single-stack or have a broken transition path. Test both protocols explicitly with ping and ping6 rather than assuming one implies the other.