IPv6 Explained
The Future of Internet Addressing
The primary driver for IPv6 was the exhaustion of IPv4 addresses. IPv4 uses 32-bit addresses, allowing for about 4.3 billion unique addresses. In the early days of the Internet, this seemed like plenty. However, with the explosion of mobile devices, IoT, and always-on servers, we ran out.
IPv6 uses 128-bit addresses, which allows for approximately 340 undecillion ($3.4 \times 10^{38}$) addresses. This is enough to assign a unique address to every atom on the surface of the Earth and still have plenty left over.
Addressing Format
IPv6 addresses are written in **hexadecimal** and separated by colons. Example: `2001:0db8:85a3:0000:0000:8a2e:0370:7334`Sorthand Rules:
- Omit Leading Zeros:
0db8becomesdb8. - Double Colon (
::): A single sequence of groups containing only zeros can be replaced by::. This can only be done once per address to avoid ambiguity.- Refined Example:
2001:db8:85a3::8a2e:370:7334
- Refined Example:
Key Features of IPv6
- No More NAT: Because addresses are so abundant, every device can have a public, globally unique IP address. This simplifies peer-to-peer communication and end-to-end security.
- Improved Header Efficiency: The IPv6 header is simpler and more streamlined than IPv4, reducing the processing load on routers.
- Autoconfiguration (SLAAC): Devices can automatically generate their own IPv6 address using the Stateless Address Autoconfiguration protocol, often based on their MAC address.
- Built-in Security: IPv6 was designed with IPsec (Internet Protocol Security) in mind, though its use is still optional in many implementations.
- Multicasting: IPv6 eliminates "broadcast" traffic (which bothers every device on a network) and replaces it with efficient multicasting (which only goes to devices that want it).
Coexistence with IPv4
Since we can't switch the whole world to IPv6 overnight, several mechanisms allow them to coexist:
- Dual Stack: Devices run both IPv4 and IPv6 protocols simultaneously.
- Tunneling: IPv6 packets are encapsulated inside IPv4 packets to travel across IPv4-only networks.
- NAT64: Allows IPv6-only devices to communicate with IPv4-only services through a translation gateway.