Why IPv6 Looks the Way It Does
An IPv4 address like 192.168.1.1 fits comfortably in memory. An IPv6 address like 2001:0db8:0000:0000:0000:8a2e:0370:7334 looks like it belongs in a cipher challenge. The jump in complexity is not arbitrary — it is a direct consequence of expanding the address space from 32 bits to 128 bits to accommodate the billions of devices that need unique global addresses.
IPv4's 32-bit format provides approximately 4.3 billion possible addresses. IPv6's 128 bits provides approximately 340 undecillion addresses (3.4 × 10³⁸) — enough to assign trillions of addresses to every person on Earth with capacity to spare. To represent 128 bits in a human-readable format, the protocol's designers chose hexadecimal notation, which is far more compact than decimal: one hex digit represents four bits, so 128 bits requires only 32 hex characters rather than the 39 decimal digits that would otherwise be needed.
The Anatomy of an IPv6 Address
A full, uncompressed IPv6 address consists of eight groups of four hexadecimal digits, separated by colons:
2001:0db8:0000:0000:0000:8a2e:0370:7334
Each group of four hex digits is called a hextet (sometimes informally called a group or quartet). Each hextet represents 16 bits, and eight hextets total give you 128 bits.
The address is divided into two functional halves:
- Network Prefix (first 64 bits / first four hextets): Identifies the network or subnet the address belongs to. Routers use this portion to make forwarding decisions. In the example above:
2001:0db8:0000:0000. - Interface Identifier (last 64 bits / last four hextets): Identifies the specific host or interface within that network. In the example:
0000:8a2e:0370:7334.
The boundary between network prefix and interface ID is indicated by a prefix length in CIDR slash notation (for example /64). A /64 prefix means the first 64 bits are the network portion, which is the standard assignment for individual network segments. ISPs typically assign /48 or /56 prefixes to customers, who then sub-divide them into /64 subnets for each network segment.
Compression Rule 1: Omitting Leading Zeros
Within each hextet, leading zeros (zeros at the start of the group) are optional and are typically removed. This applies to each group independently:
0db8becomesdb80370becomes3700000becomes0
Applying this rule to the full address:
2001:0db8:0000:0000:0000:8a2e:0370:7334
becomes2001:db8:0:0:0:8a2e:370:7334
This is a valid notation. The address is the same; the representation is shorter. Note that trailing zeros within a group cannot be omitted — only leading ones. 0100 can be compressed to 100, not to 1.
Compression Rule 2: The Double Colon (::)
The double colon notation (::) represents one or more consecutive groups of all zeros (0000). This is the most significant compression technique and can dramatically shorten addresses with long runs of zeros:
2001:db8:0:0:0:8a2e:370:7334
becomes2001:db8::8a2e:370:7334
The three consecutive :0: groups are replaced by ::. When a router or OS reads this address, it knows that the total address must be 128 bits, counts the hextets that are present, and fills in the missing groups with zeros to reach that total.
Critical rule: :: can only appear once in an address. If it appeared twice, there would be no way to determine how many zero groups each occurrence represents. The address would be ambiguous and unprocessable. This is why you will never see ::1::1 as a valid address.
Common IPv6 Address Types
| Address Type | Prefix | Example | Purpose |
|---|---|---|---|
| Global Unicast | 2000::/3 | 2001:db8::1 | Globally routable address assigned to a device; equivalent to a public IPv4 address |
| Link-Local | fe80::/10 | fe80::1 | Automatically generated, valid only on the local link segment; used for neighbor discovery |
| Loopback | ::1/128 | ::1 | Points to the local device itself; equivalent to IPv4's 127.0.0.1 |
| Unspecified | ::/128 | :: | Used as a source address before a device has a valid address; equivalent to IPv4's 0.0.0.0 |
| Unique Local | fc00::/7 | fd00::1 | Private addressing for internal networks; not routed on the public internet; similar to 192.168.x.x |
| Multicast | ff00::/8 | ff02::1 | Sent to a group of interfaces; replaces IPv4 broadcast and supports many network functions |
| Documentation | 2001:db8::/32 | 2001:db8::1 | Reserved for examples and documentation only; never used in production |
The Interface Identifier: EUI-64 and Privacy Extensions
The 64-bit interface identifier in the second half of an IPv6 address can be generated in several ways:
EUI-64 (Extended Unique Identifier): Originally, many systems generated the interface ID automatically from the device's MAC address using the EUI-64 algorithm. The MAC address is 48 bits; EUI-64 inserts ff:fe in the middle to expand it to 64 bits, then flips the seventh bit. The result is an interface ID that is globally unique because MAC addresses are unique. However, this creates a privacy issue: your MAC-derived interface ID is the same on every IPv6 network you join, making you trackable across networks.
Privacy Extensions (RFC 4941): To address the EUI-64 tracking concern, most modern operating systems implement privacy extensions that generate a random 64-bit interface ID. The ID changes periodically (typically every 24 hours for outbound connections) and does not encode any hardware identifier. This is the default behavior on Windows, macOS, iOS, and Android.
Stable Privacy Addresses (RFC 7217): A middle approach that generates a stable but opaque interface ID per-network. The same device will always use the same interface ID on a given network (preventing churn that breaks persistent connections), but the ID differs between networks (preventing cross-network tracking).
Prefix Length and Subnetting
IPv6 uses CIDR slash notation identical to IPv4 for prefix lengths. A /64 means the first 64 bits identify the network and the remaining 64 bits are available for host addressing. Common prefix lengths:
/128— A single host address (used for loopback or specific host routes)/64— Standard subnet size for a single LAN segment (4.3 billion unique addresses per subnet)/56— Typical prefix an ISP assigns to a home or small business customer (256 /64 subnets)/48— Typical prefix an ISP assigns to an enterprise customer (65,536 /64 subnets)/32— Typical allocation from a Regional Internet Registry to an ISP
Practical Examples: Reading Real Addresses
Take the address fe80::c0a8:0:1%eth0 — the %eth0 suffix is a zone ID indicating which network interface the link-local address is scoped to. Because link-local addresses are only valid on a single segment, the same fe80::1 could exist on multiple interfaces; the zone ID disambiguates which one is meant.
The address 2001:db8:abcd:12::1/64 tells you: it's a global unicast address (2001:), the network prefix is 2001:db8:abcd:0012::, the prefix length is 64 bits, and the host portion is 0000:0000:0000:0001. The network is derived by zeroing out all bits after the /64 boundary.
Common Misconceptions
The Double Colon Can Be Used Multiple Times
It cannot. RFC 5952 (the canonical text on IPv6 address representation) explicitly states that the :: notation can appear at most once in an address. If two gaps of zeros exist and neither is obviously larger, the convention is to compress the first one. Routers and network tools will reject or misparse an address containing two :: tokens.
IPv6 Addresses Are Always Long and Unreadable
Heavily compressed addresses can be surprisingly short. The loopback address is simply ::1. The unspecified address is ::. Many commonly used addresses in specific deployments, such as link-local gateway addresses, are configured to simple values like fe80::1. The long form exists but is rarely what you encounter in practice.
IPv6 Replaces IPv4 Immediately
IPv4 and IPv6 coexist through a range of transition mechanisms. Most modern networks run dual-stack, meaning both protocols are active simultaneously. A device on a dual-stack network has both an IPv4 address and an IPv6 address, and applications choose which to use based on availability and DNS record type (A for IPv4, AAAA for IPv6). IPv4 is not being retired on a fixed schedule; the two protocols will continue to run concurrently for the foreseeable future.
All IPv6 Addresses Are Globally Reachable
Addresses in the fe80::/10 (link-local), fc00::/7 (unique local), and ::1/128 (loopback) ranges are not routed on the public internet. Only global unicast addresses in the 2000::/3 range are globally routable. Having an IPv6 address does not automatically mean the device is publicly accessible; it depends on which type of address has been assigned.
Pro Tips
- Know your IPv6 subnets by prefix, not by memorizing host addresses. In IPv6 you deal with /64 subnets so large that individual host addresses are rarely the relevant unit. Think in terms of which /64 a device is in, not what its last 64 bits are.
- Use the expanded (uncompressed) form when writing firewall rules. ACLs and firewall rules that rely on compressed notation can be ambiguous or misapplied if the rule engine expands notation differently. Writing the full 32-hex-character address eliminates any parsing ambiguity.
- Check whether your ISP assigned a prefix via DHCPv6 or SLAAC. Stateless Address Autoconfiguration (SLAAC) allows devices to generate their own addresses from the advertised prefix. DHCPv6 assigns addresses from a server-managed pool. Some ISPs use only one method; others use both. Knowing which your network uses helps diagnose addressing problems.
- Verify privacy extensions are active on your devices. Run
ip addr showon Linux or check your IPv6 address in System Preferences on macOS. If the interface ID portion looks like it encodes your MAC address (check by comparing to your actual MAC), privacy extensions may not be enabled. - For DNS resolution, IPv6 addresses use AAAA records. When debugging DNS issues, remember that IPv4 forward lookups use A records and IPv6 uses AAAA (pronounced quad-A). A domain with only an A record will not be reachable via IPv6 directly.
- In URLs, IPv6 addresses are enclosed in brackets. If you need to specify an IPv6 address directly in a URL — to access a router admin interface, for example — wrap the address in brackets:
http://[fe80::1%25eth0]/. Without the brackets, the colons are misinterpreted as port number delimiters.
Curious whether your current connection is using IPv6 and what address you have been assigned? Check your IPv4 and IPv6 address details here.