IPv6

[!NOTE] This module explores the core principles of IPv6, deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.

1. Why IPv6?

IPv4 has ≈ 4.3 billion addresses. With billions of people and IoT devices, we ran out of space. IPv6 provides 2128 addresses (3.4 × 1038), enough to give every atom on Earth its own IP address.

2. Structure (128-bits)

Represented in Hexadecimal, divided into 8 groups of 16-bits. Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Address Compression Rules

  1. Omit Leading Zeros: 0db8db8.
  2. Double Colon (::): Replace a consecutive group of zero-segments with ::.
    • Example: 2001:db8:85a3::8a2e:370:7334
    • Note: You can only do this ONCE per address.

3. Key Improvements over IPv4

  • No NAT: With so many addresses, every device can have a global, uniquely routable IP.
  • Simple Header: Fixed size of 40 bytes. Routers don’t have to calculate checksums (faster routing).
  • SLAAC (Stateless Address Autoconfiguration): Devices can generate their own unique IP using their MAC address and the network prefix. No DHCP server required!
  • Built-in Security: IPSec was designed as a core part of IPv6.

4. Interactive: IPv6 Compressor

Practice the compression rules.

Expand Format
2001 : 0db8 : 0000 : 0000 : 0000 : 0000 : 0000 : 0001
Compressed Output
2001:db8::1

5. The Multicast Shift

IPv6 has NO Broadcast. It uses Multicast for everything. Even “Neighbor Discovery” (the IPv6 version of ARP) uses a specific multicast group to find MAC addresses.

  • Broadcasting is inefficient because every device must wake up its CPU to read the packet.
  • Multicasting is efficient because only interested devices listen.