IPv6 Addressing

The 128-bit addressing scheme, notation, special addresses, and address shortening.

Why Do We Need a New IP Address? The Problem of IPv4 Exhaustion

Before diving into what an IPv6 address is, it's essential to understand why it was created. Its predecessor, IPv4, was the backbone of the internet for decades. However, it had a fundamental flaw: a limited supply of addresses. An IPv4 address is a 32-bit number, which allows for 2322^{32}, or approximately 4.3 billion, unique addresses.

In the 1980s, this seemed like an enormous number. But with the explosive growth of the internet, the proliferation of personal computers, smartphones, servers, and now the , the world quickly ran out of available IPv4 addresses. This shortage, known as IPv4 address exhaustion, created a critical need for a new protocol with a much larger address space. IPv6 is the long-term solution to this problem.

The Colossal Scale of IPv6: A 128-Bit Address Space

The most significant feature of IPv6 is its immense address length. An IPv6 address is a 128-bit number. This increase from 32 bits to 128 bits is not just a fourfold increase; it is an exponential leap in capacity.

  • IPv4: 232≈4.3×1092^{32} \approx 4.3 \times 10^9 addresses (4.3 billion).
  • IPv6: 2128≈3.4×10382^{128} \approx 3.4 \times 10^{38} addresses.

This number (roughly 340 undecillion) is almost incomprehensibly large. The notes provide a stunning illustration of this scale: it translates to approximately 6.7×10176.7 \times 10^{17} addresses for every square millimeter of the Earth's surface. To put it another way, we could assign an IP address to every star in the known universe and still have virtually the entire address space left over. This vast quantity ensures that we will not run out of unique IP addresses for the foreseeable future, easily accommodating trillions of new devices.

Understanding IPv6 Address Notation

Writing out 128 bits in binary would be incredibly cumbersome and prone to error. To make IPv6 addresses manageable for humans, a new notation was created based on the hexadecimal system.

Hextets and Colons

  • Groups of 16: The 128-bit address is divided into eight groups, with each group containing 16 bits.
  • Hexadecimal Format: Each 16-bit group is written as four digits.
  • Colon Separators: These eight groups, often called "hextets" or "quartets," are separated by colons (:).

Example of a Full IPv6 Address

Here is an example of a full, uncompressed IPv6 address used for documentation purposes:

2001:0db8:0000:0000:0008:0800:200c:417a

Simplifying the Address: The Shortening Rules

Even in hexadecimal format, full IPv6 addresses can be long and contain many zeros. To improve readability, two simple rules can be applied to shorten them.

Rule 1: Omitting Leading Zeros

Within any 16-bit hextet, any leading zeros (zeros at the beginning of the group) can be removed. This must be done for each hextet individually.

For example:
0db8 becomes db8
0008 becomes 8
0000 becomes 0

Rule 2: The Double Colon Compression

A single, contiguous block of all-zero hextets can be compressed and replaced with a double colon (::).

Crucial limitation: The double colon can only be used once within a single address. Using it more than once would make the address ambiguous, as it would be impossible to determine how many zero-hextets each :: represents.

Step-by-Step Shortening Example

Let's shorten the address ff06:0000:0000:0000:0000:0000:0000:00c3:

  1. Original Address: ff06:0000:0000:0000:0000:0000:0000:00c3
  2. Apply Rule 1 (Omit leading zeros): We remove the leading zeros from each hextet.
    ff06:0:0:0:0:0:0:c3
  3. Apply Rule 2 (Use double colon): We find the longest contiguous block of zeros and replace it with ::.
    ff06::c3

Anatomy of a Unicast IPv6 Address

A standard global IPv6 address is typically split into two main parts: a 64-bit network prefix and a 64-bit interface identifier. The network prefix itself is hierarchical, reflecting how addresses are distributed across the globe.

IPv6 address structure playground

Adjust how the fixed /48 global routing prefix is carved between registry, provider and site space to see what remains for subnet IDs and interface identifiers.

Registry allocation (bits)12 b
Provider allocation (bits)20 b

Quick site presets

Global routing prefix
/48

First 48 bits (registry → provider → site).

Registry12 b
Provider20 b
Site/customer16 b
Subnet ID16 b
Interface ID64 b
128-bit layout
20 b
16 b
16 b
Interface

The interface identifier stays at 64 bits for SLAAC compatibility.

What these bits represent

Registry allocation
12 b

Bits managed by the Regional Internet Registry when it hands a /48 (or larger) block to a provider.

Possible values: 4.1K
Provider allocation
20 b

Bits the ISP uses internally to create customer assignments or regional aggregations.

Possible values: 1.05M
Site/customer space
16 b

Portion of the /48 that the organisation can use to separate campuses or business units before subnetting.

Possible values: 65.54K
Subnet ID
16 b

These 16 bits turn the delegated /48 into up to 65,536 routed /64 networks inside the organisation.

Possible values: 65.54K
Interface identifier
64 b

Fixed 64-bit host portion, typically derived from MAC, privacy randomisation or DHCPv6.

Possible values: 2^64

The Network Prefix (First 64 bits)

1. Global Routing Prefix (first 48 bits): This part is assigned by Internet Registries (like ARIN, RIPE, APNIC) to Internet Service Providers (ISPs). The ISP then assigns a portion of this prefix to its customers (e.g., an organization). This hierarchical structure (Registry → ISP → Site) makes internet routing much more efficient.
2. Subnet ID (next 16 bits): This part is controlled by the local network administrator of an organization. The 16 bits provide 216=65,5362^{16} = 65,536 possible subnets, which is an enormous number for creating internal network segments for different departments, functions, or locations.

The Interface Identifier (Last 64 bits)

This part uniquely identifies a specific device (its network interface, like a network card) on a particular subnet. The 64 bits allow for a massive number of unique hosts within a single subnet (264)(2^{64}). It can be generated in several ways:
  • Automatically, based on the device's physical MAC address (using a format called EUI-64).
  • Automatically and randomly by the operating system for privacy reasons.
  • Manually configured by an administrator.

Special IPv6 Address Types

Just like IPv4, IPv6 reserves certain address ranges for specific purposes. Understanding these is key to working with IPv6 networks.

  • Unspecified Address (::/128): An address consisting of all zeros. It is used by a device during its initialization process when it doesn't yet know its own address.
  • Loopback Address (::1/128): The equivalent of 127.0.0.1 in IPv4. It allows a device to send a packet to itself for testing network software without any packet leaving the local machine.
  • Link-Local Addresses (fe80::/10): These are private, non-routable addresses that are automatically configured on every IPv6-enabled interface. They are used for communication only on the local physical link (like a single Ethernet segment or Wi-Fi network) and are essential for processes like neighbor discovery. Routers will not forward packets with link-local source or destination addresses.
  • Unique Local Addresses (ULA) (fc00::/7): These are the modern equivalent of IPv4 private addresses (like 192.168.x.x). They are meant for use within a private organization's network and are not routable on the global internet, providing an extra layer of isolation and security.
  • Multicast Addresses (ff00::/8): An address that identifies a group of interfaces. A packet sent to a multicast address is delivered to all interfaces that have joined that multicast group. This is used for efficient one-to-many communication.
  • Documentation Prefix (2001:db8::/32): A specific address range reserved exclusively for use in examples, documentation, and tutorials (like this one!). It is guaranteed never to be a real, routable address on the internet.
  • Transition Technologies (e.g., 6to4 - 2002::/16): Ranges reserved for specific technologies designed to help networks transition from IPv4 to IPv6. These mechanisms will be discussed in more detail separately.
    IPv6 Addressing | Teleinf Edu