Computer Networks
IPv6: The Future Is Already Here
In 2011, IPv4 addresses ran out. Today they're bought on the secondary market for $50+ each. Meanwhile, every smartphone could be assigned as many IPv6 addresses as there are atoms in the universe - with plenty left over.
- **Mobile networks:** LTE/5G operators are massively switching to IPv6-only with NAT64. iPhone and Android have supported it for years
- **Cloud providers:** AWS, GCP give IPv6 for free, and are starting to charge for IPv4 (~$4/month per address)
- **Home IoT:** Smart devices get global addresses - you can connect directly without complex NAT configurations
Предварительные знания
IPv6 Address Format
**IPv6** solves the main problem of IPv4 - address exhaustion. IPv4's 32 bits give 4.3 billion addresses. IPv6's 128 bits give **340 undecillion** (3.4×10³⁸) - more than the number of atoms in a human body.
**Scale:** If IPv6 addresses were handed out at 1 billion per second, the supply would run out in 10⁷ TRILLION years. The universe is ~14 billion years old.
IPv6 addresses can be **abbreviated** using two rules:
Which abbreviation of 2001:0db8:0000:0000:0001:0000:0000:0001 is correct?
IPv6 Address Types
IPv6 has three address types: **Unicast** (one recipient), **Multicast** (group of recipients), **Anycast** (nearest in a group). **Broadcast is absent** - replaced by multicast.
**Fun fact:** In IPv6, every interface has **multiple addresses** simultaneously: link-local (mandatory), global (usually), temporary (for privacy).
Key IPv6 ranges:
A company was assigned /48 by their provider. How many /64 subnets can it create?
Link-Local Addresses
**Link-Local** (fe80::/10) - addresses that work only within a single network segment. They are **automatically** created on every IPv6 interface without any configuration.
**Privacy:** EUI-64 allows tracking a device by its MAC. Modern OSes use **Privacy Extensions** - a random Interface ID that changes periodically.
Link-Local is used for service protocols:
When specifying a link-local address in commands, a **zone ID** (interface index) is required, because the same address can exist on different interfaces:
Why must you specify the interface (zone ID) when pinging a link-local address?
Global Unicast and Address Assignment
**Global Unicast Address (GUA)** - routable internet addresses (2000::/3). In IPv6, there are three ways to obtain a GUA: **SLAAC**, **DHCPv6**, and **manual configuration**.
**SLAAC vs DHCP:** SLAAC doesn't provide DNS and other options. The O (Other) flag in RA tells the host to use DHCPv6 for DNS. The M (Managed) flag tells the host to get its address via DHCPv6.
Before using an address, the host verifies its uniqueness:
IPv6 adoption: Google sees ~45% of traffic over IPv6, in some countries (India, Germany) - over 60%. Mobile networks (LTE/5G) are often IPv6-only with NAT64.
IPv6 is too complex, easier to stay on IPv4 with NAT
IPv6 removes NAT complexity: end-to-end connectivity, no issues with VoIP/WebRTC/P2P
NAT is a workaround for address shortage. With IPv6, every device has a public address. No port forwarding issues, no STUN/TURN for WebRTC, no complex ALG for SIP. A host firewall solves security better than 'hiding behind NAT'.
In SLAAC, the host receives from the router:
Key Ideas
- **128 bits** vs IPv4's 32. Address written in hex, 8 groups of 4 characters. Abbreviated via :: and omitting leading zeros
- **Link-local (fe80::/10)** is created automatically on every interface. Used for NDP, Router Discovery, as default gateway
- **SLAAC** - getting an address without a DHCP server. Router announces prefix, host generates Interface ID itself
- **Dual-stack** and **Happy Eyeballs** ensure smooth transition. IPv6 preferred, IPv4 as fallback
Related Topics
IPv6 changes familiar concepts:
- IP Addressing — IPv6 extends IPv4 concepts: more addresses, but same subnetting principles
- NAT — IPv6 makes NAT unnecessary - every device gets a global address
Вопросы для размышления
- Why is the transition to IPv6 taking decades, even though the protocol has existed since 1998?
- How will application architecture change when NAT becomes a thing of the past?
- Why do some consider EUI-64 a privacy threat?