Metadata Card
| Attribute | Content |
|---|---|
| Volume | Vol 4 — Computer Networking |
| Chapter | Chapter 13: IPv6 Basics |
| Prerequisites | Chapter 9 (Network Layer: IPv4 header, CIDR, NAT, ICMP) |
| Next | Chapter 14: Network Performance & Optimization |
| Theory Depth | (3/5) |
| Python Relevance | ≈60%; socket programming, scapy ICMPv6 packet construction |
| Core Concepts | 128-bit address space, NDP, SLAAC, AAAA records, dual stack, NAT64 |
| Code | ~120 lines |
Your Progress
"The post road faces a fundamental problem: there aren't enough post road coordinates. IPv4's 32-bit spell coordinates ran out long ago; portal address translation (NAT) is just a temporary workaround. IPv6 uses 128-bit array coordinates to give every grain of magic sand a unique post road address."
IPv4 Address Exhaustion Timeline
2011 Feb: IANA allocated last 5 /8 blocks to five RIRs
2011 Apr: APNIC (Asia-Pacific) exhausted
2012 Sep: RIPE NCC (Europe) exhausted
2014 Jun: LACNIC (Latin America) exhausted
2015 Sep: ARIN (North America) exhausted
2019 Nov: RIPE completely exhaustedNAT — a temporary workaround: 1 public IP can serve hundreds of internal devices via port translation + state table. But at a cost: breaks end-to-end model, external can't initiate connections, complex NAT traversal.
IPv6's core philosophy: Restore the internet's original design — every device gets a globally reachable IP.
IPv6 Header — What Was Removed, What Was Added
IPv6 header: Fixed 40 bytes (no IHL, no checksum, no router fragmentation).
| Feature | IPv4 | IPv6 |
|---|---|---|
| Header size | 20-60 bytes (IHL + Options) | Fixed 40 bytes |
| Address length | 32 bits | 128 bits |
| Checksum | Recalculated per hop | Removed (relies on upper layers) |
| Fragmentation | Routers can do it | Sender does it (Path MTU Discovery) |
| Options | Inside header, variable length | Moved to extension headers (Next Header chain) |
| IHL | Needed | Removed (fixed length) |
| Flow Label | Added (QoS marking) |
Design philosophy:
- Removed checksum: Link layer has CRC, upper layers have checksums. IP recalculating is redundant.
- No router fragmentation: Sender must do Path MTU Discovery. If larger packets are needed, use extension headers.
- Extension header chain: Optional features in extension headers, linked by
Next Header. Routers don't need to parse them.
IPv6 Address Representation
128 bits, written as colon hexadecimal:
Full: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Simplified: 2001:db8::8a2e:370:7334Three simplification rules:
- Leading zeros in each 16-bit segment can be omitted
- One contiguous block of zero segments can be replaced with
::(only once!) - IPv4-mapped addresses:
::ffff:192.168.1.1
Address Types
| Type | Prefix | Purpose |
|---|---|---|
| Global Unicast | 2000::/3 | Internet-routable |
| Unique Local | fc00::/7 | Private (like 10.0.0.0/8) |
| Link-Local | fe80::/10 | Single subnet, auto-configured |
| Loopback | ::1 | Like 127.0.0.1 |
| Unspecified | :: | Like 0.0.0.0 |
| Multicast | ff00::/8 | One-to-many |
NDP — Neighbor Discovery Protocol
Replaces ARP in IPv6. Uses ICMPv6 (types 133-137):
- Neighbor Solicitation/Advertisement (like ARP)
- Router Solicitation/Advertisement (network configuration)
- Redirect (better path notification)
SLAAC — Stateless Address Autoconfiguration
Routers advertise prefixes; hosts generate their own interface identifier (EUI-64 from MAC, or privacy extensions). No DHCP server needed.
Transition Technologies
| Technology | How It Works | Best For |
|---|---|---|
| Dual Stack | Both IPv4 and IPv6 stacks | Gradual transition |
| Tunneling | IPv6 packets inside IPv4 (6to4, Teredo) | When only IPv4 infrastructure exists |
| NAT64/DNS64 | Translate IPv6 → IPv4 at gateway | IPv6-only clients accessing IPv4-only servers |
Traveler's Notes
IPv6 was designed in 1998 but took over 20 years for large-scale deployment. Not because IPv6 is bad, but because NAT + CIDR extended IPv4's lifespan and global hardware/software upgrades require economic as well as technical decisions. Today, major ISPs and cloud providers are all IPv6-ready. The transition isn't "if" but "when" — and for many networks, it's already happening.