IPv4 Address Space Exhaustion
IPv4 was the primary Internet protocol for decades. Its address has 32 bits, so the theoretical space contains values, or approximately 4.3 billion. Some values are reserved for special purposes, so the number available for assignment is smaller.
In the 1980s, this address space appeared sufficient. The growth of the Internet, personal computers, smartphones, servers, and the led to IPv4 address exhaustion. This shortage became one of the reasons for developing IPv6, whose larger addresses support hierarchical address planning.
Scale of the IPv6 Address Space: 128 Bits
An IPv6 address has 128 bits. Compared with the 32-bit IPv4 address, the number of bits is four times larger, while the number of possible values grows by a factor of 2^96. These are theoretical counts, not a promise that every value can be assigned publicly.
- IPv4: addresses (4.3 billion).
- IPv6: addresses.
The theoretical number of values is roughly 340 undecillion. Dividing this space by the approximate surface area of Earth gives about values per square millimeter. Comparing this number with estimates of the stars in the observable universe illustrates the scale of the space, but does not describe address allocation. The space is large enough to plan addressing for trillions of devices.
IPv6 Address Notation
IPv6 addresses use hexadecimal notation because it shortens the representation of 128 bits and makes it easier to read. The same notation is used for global, link-local, and multicast addresses.
16-bit groups 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: The eight groups are called hextets in IPv6 documentation and are separated by colons (:).
Example of a full IPv6 address
The following is a full, uncompressed IPv6 address used for documentation purposes:
2001:0db8:0000:0000:0008:0800:200c:417a
Shortening IPv6 Addresses
A full IPv6 address contains eight groups and may include many zeros. Two rules can shorten its written form.
Rule 1: omitting leading zeros
Leading zeros, meaning zeros at the beginning of a 16-bit hextet, may be removed. The operation is performed independently for each hextet.
For example: 0db8 becomes db8 0008 becomes 8 0000 becomes 0
Rule 2: double-colon compression
A contiguous block of all-zero hextets can be replaced with a double colon (::). In the canonical form from RFC 5952, the longest such block is selected, and the first one is selected when the lengths are equal. A single zero hextet is written as 0, and hexadecimal digits are written in lowercase.
A single address contains at most one double colon. Each occurrence represents at least one zero hextet, so multiple occurrences would leave the address length ambiguous.
Step-by-step shortening example
Shorten the address ff06:0000:0000:0000:0000:0000:0000:00c3:
- Original address:
ff06:0000:0000:0000:0000:0000:0000:00c3 - Apply rule 1 (omit leading zeros): Remove the leading zeros from each hextet.
ff06:0:0:0:0:0:0:c3 - Apply rule 2 (use double colon): Find the longest contiguous block of zeros and replace it with
::.ff06::c3
Structure of a Global Unicast IPv6 Address
In a typical plan, a global unicast address is divided into a 64-bit subnet prefix and a 64-bit interface identifier. RFC 4291 describes a global routing prefix, a subnet ID, and an interface ID; the boundary between these fields depends on the addressing plan.
The network prefix (first 64 bits)
The interface identifier (last 64 bits)
- 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
IPv6 defines address ranges for specific purposes. Distinguishing them is important when configuring and analyzing IPv6 networks.
- Unspecified Address (
::/128): An address consisting of all zeros. A host may use it as a source address during initialization, before it knows its own address. It must not be assigned to an interface or used as a destination address. - Loopback Address (
::1/128): The equivalent of127.0.0.1in IPv4. It lets a host send packets to its own network stack for software testing. Packets with this address do not leave the host. - Link-Local Addresses (
fe80::/10): Every IPv6 interface has an address from this range, whose scope is limited to one link. These addresses support communication within a local Ethernet segment or Wi-Fi network and procedures such as neighbor discovery. Routers do not forward packets with a link-local address beyond the link. - Unique Local Addresses (ULA) (
fc00::/7): This prefix covers the range intended for local addressing, similar to private IPv4 ranges such as192.168.x.x. Locally assigned addresses currently usefd00::/8, whilefc00::/8remains reserved. ULA addresses are intended for communication within an organization and are not meant to be routed on the public Internet. - Multicast Addresses (
ff00::/8): These addresses identify a group of interfaces. A packet sent to a multicast address is delivered to interfaces that belong to the group, enabling one-to-many communication. - Documentation Prefix (
2001:db8::/32): A range reserved by RFC 3849 for examples and documentation. It should not be used as a real globally routable address. - Transition technologies (historic 6to4,
2002::/16): This prefix was used by 6to4 to tunnel IPv6 through IPv4. 6to4 is not recommended for new IPv6 deployments, so the prefix has historical significance.