IPv6 Addressing Basics
You'll learn how IPv6 uses 128-bit addresses written in hexadecimal to solve IPv4's address exhaustion problem.
Why IPv6?
As we saw with NAT in the previous lesson, IPv4's 32-bit address space (~4.3 billion addresses) ran out. IPv6 expands addressing to 128 bits, providing approximately 340 undecillion (3.4 × 10³⁸) unique addresses—enough for every grain of sand on Earth to have trillions of addresses!
Structure and Notation
An IPv6 address consists of eight 16-bit groups written in hexadecimal, separated by colons:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Unlike IPv4's dotted decimal (192.168.1.1), IPv6 uses hex digits 0-9 and a-f.
Address Compression Rules
IPv6 addresses often contain many zeros. Two rules simplify notation:
Rule 1: Leading Zero Suppression
Drop leading zeros within each group:
2001:0db8:0042:0000:0000:0000:0000:0001
becomes
2001:db8:42:0:0:0:0:1
Rule 2: Zero Compression
Replace one consecutive sequence of all-zero groups with :::
2001:db8:42:0:0:0:0:1
becomes
2001:db8:42::1
⚠️ You can only use :: once per address (otherwise the original address would be ambiguous).
Analogy
Think of IPv6 like an expanded phone numbering system. IPv4 was like 10-digit phone numbers—we ran out. IPv6 is like switching to 39-digit numbers with smart abbreviations so you don't have to say all those zeros.
Key Takeaway: IPv6 uses 128-bit addresses written in hexadecimal with colon separators, and applies compression rules (leading zero suppression and :: for consecutive zeros) to make addresses more readable.