IPv6 addresses represent the next generation of internet addressing, designed to solve the address exhaustion problem of IPv4. Understanding their structure is essential for network administrators, developers, and anyone working with modern internet infrastructure. This article provides a comprehensive breakdown of IPv6 address architecture, notation rules, and practical examples.
At its core, an IPv6 address is a 128-bit identifier used to uniquely identify network interfaces. This is a massive expansion from IPv4's 32-bit addresses, providing approximately 340 undecillion (3.4 × 10³⁸) unique addresses—enough to assign billions of addresses to every person on Earth.
The 128-bit structure is organized into eight 16-bit segments, each represented in hexadecimal notation. This design provides both the enormous address space needed for the modern internet and a hierarchical structure that enables efficient routing.
IPv6 addresses use hexadecimal (base-16) notation to make the 128-bit addresses more manageable for humans. According to RFC 4291, the standard format is:
x:x:x:x:x:x:x:x
Where each x represents a 16-bit segment (called a "hextet" or "field") written using 1 to 4 hexadecimal digits. The eight segments are separated by colons.
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Let's break this down:
In binary, each hexadecimal digit represents 4 bits, so each segment contains 16 bits of information. The full address above contains 32 hexadecimal characters representing the complete 128-bit address.
Because IPv6 addresses are long and often contain many zeros, RFC 4291 defines compression rules to make them more readable and manageable.
You can omit leading zeros in any 16-bit segment. However, you must not remove trailing zeros, as this would change the address value.
Example:
Original: 2001:0db8:0000:000b:02aa:00ff:fe28:9c5a
Compressed: 2001:db8:0:b:2aa:ff:fe28:9c5a
Notice how 0db8 becomes db8, 0000 becomes 0, and 02aa becomes 2aa. Each segment must contain at least one digit, so segments of all zeros become a single 0.
The most powerful compression technique uses a double colon (::) to represent one or more consecutive segments of zeros. This dramatically shortens addresses that contain long sequences of zeros.
Critical limitation: The double colon can only be used once in an address. Using it multiple times would create ambiguity, making it impossible to determine how many zero segments each :: represents.
Examples:
Loopback Address:
Full: 0000:0000:0000:0000:0000:0000:0000:0001
Compressed: ::1
All-Zeros Address (Unspecified):
Full: 0000:0000:0000:0000:0000:0000:0000:0000
Compressed: ::
Link-Local Address:
Full: fe80:0000:0000:0000:0f19:1faf:0008:5010
Compressed: fe80::f19:1faf:8:5010
Applying Both Rules:
Original: 2001:0db8:0000:000b:0000:0000:0000:001a
Remove leading 0s: 2001:db8:0:b:0:0:0:1a
Apply double colon: 2001:db8:0:b::1a
While IPv6 addresses are fundamentally 128 contiguous bits, they are logically divided into two main components for most unicast and anycast addresses:
The network prefix identifies the network or subnet and is used for routing. It typically subdivides into:
Global Routing Prefix (typically 48 bits)
2001:0db8:85a3 (first 48 bits)Subnet ID (typically 16 bits)
0000 (bits 49-64)This gives organizations tremendous flexibility for internal network design without requiring additional address space from their ISP.
The interface identifier (IID) uniquely identifies a network interface within a subnet. The standard 64-bit size provides over 18 quintillion unique device addresses per subnet.
Example breakdown:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
└──────┬──────┘ └─┬─┘ └─────────┬─────────┘
Global Subnet Interface
Routing ID Identifier
Prefix (IID)
(48 bits) (16 bits) (64 bits)
Interface identifiers can be generated through several methods:
IPv6 defines several special address types identifiable by their prefixes:
::1
Equivalent to IPv4's 127.0.0.1, used for local testing. See IPv6 Loopback Address for more details.
::
Equivalent to IPv4's 0.0.0.0, indicates an absence of an address.
fe80::/10 (prefix)
Example: fe80::1ff:fe23:4567:890a
Used for communication within a single network segment, similar to IPv4's 169.254.0.0/16. Learn more about Link-Local Addresses.
2000::/3 (prefix range)
Example: 2001:db8:85a3::8a2e:370:7334
Globally routable addresses, equivalent to IPv4 public addresses. See the comparison with Global Unicast vs Link-Local.
fc00::/7 (prefix)
Example: fd12:3456:789a:1::1
Similar to IPv4 private addresses (10.0.0.0/8, 192.168.0.0/16), used for local communications. See Unique Local Addresses (ULA) for details.
Let's examine several real-world IPv6 addresses:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Binary breakdown (first 64 bits):
2001:0db8:85a3:0000
0010 0000 0000 0001 : 0000 1101 1011 1000 : 1000 0101 1010 0011 : 0000 0000 0000 0000
Compressed form:
2001:db8:85a3::8a2e:370:7334
Components:
- Global Routing Prefix: 2001:0db8:85a3 (48 bits)
- Subnet ID: 0000 (16 bits)
- Interface ID: 0000:8a2e:0370:7334 (64 bits)
Full: 2001:0db8:0000:0000:0000:0000:0000:0001
Compressed: 2001:db8::1
This is from the reserved documentation range (2001:db8::/32)
used in examples and documentation, similar to IPv4's 192.0.2.0/24
Full: fe80:0000:0000:0000:0202:b3ff:fe1e:8329
Compressed: fe80::202:b3ff:fe1e:8329
Components:
- Prefix: fe80:0000:0000:0000 (64 bits, all link-local start with fe80)
- Interface ID: 0202:b3ff:fe1e:8329 (64 bits, often EUI-64 derived)
The type of IPv6 address can be determined by examining its high-order bits:
| Address Type | Binary Prefix | Hex Prefix | Example |
|---|---|---|---|
| Unspecified | 00...0 (128 bits) | :: | :: |
| Loopback | 00...01 (128 bits) | ::1 | ::1 |
| Multicast | 11111111 | ff | ff02::1 |
| Link-Local | 1111111010 | fe80 | fe80::1 |
| Global Unicast | 001 | 2000-3fff | 2001:db8::1 |
| Unique Local | 1111110 | fc00-fdff | fd00::1 |
Understanding IPv6 address structure is just the first step. To verify your network's IPv6 readiness and connectivity, you need to test whether your devices can properly communicate using these addresses.
Tools like test-ipv6.run provide comprehensive IPv6 connectivity testing directly in your browser. These tests verify:
Such testing is crucial because simply having an IPv6 address doesn't guarantee proper connectivity. Issues like broken IPv6 configurations (where IPv6 is present but timing out) can actually degrade your internet experience.
When working with IPv6 addresses, watch out for these common errors:
Multiple double colons: Never use :: more than once in an address
2001::85a3::73342001:0:0:0:0:85a3:0:7334 or 2001::85a3:0:7334Removing trailing zeros: Only leading zeros can be omitted
2001:db8:0:1:10::1 (if the segment was 0100)2001:db8:0:1:100::1Case sensitivity: While hex digits a-f can be uppercase or lowercase, be consistent
2001:DB8::1 or 2001:db8::12001:Db8::1Forgetting brackets in URLs: When using IPv6 addresses in URLs, enclose them in brackets
http://2001:db8::1:80/http://[2001:db8::1]:80/IPv6 addresses, with their 128-bit structure and hexadecimal notation, provide the vast address space necessary for the continued growth of the internet. The logical division into network prefix and interface identifier enables efficient routing and simplified network configuration.
Understanding the compression rules—omitting leading zeros and using the double colon for consecutive zero segments—makes these addresses more manageable while maintaining their uniqueness. The standardized 64/64 split between network prefix and interface identifier provides both routing scalability and enormous per-subnet address capacity.
As the internet continues its transition from IPv4 to IPv6, familiarity with IPv6 address structure becomes increasingly important. Whether you're configuring servers, debugging network issues, or simply curious about how modern internet addressing works, mastering IPv6 address structure is an essential skill for anyone working with networked systems.