The 128-bit Address
An IPv6 address is 128 bits. To stay readable, those bits are grouped into eight 16-bit chunks called hextets, written in hexadecimal and separated by colons.
The example below uses the IETF documentation prefix (2001:db8::/32), which is reserved precisely so that examples in books and slide decks never collide with real routable addresses. Every other address in this page uses the same prefix.
Compression Rules
Writing eight four-character hextets every time would be exhausting. Two rules cut typical IPv6 addresses down to a manageable size.
Drop leading zeros
Within any single hextet, leading zeros may be omitted. The hextet 0db8 becomes db8. The hextet 0000 becomes 0.
Collapse zero runs
One contiguous run of all-zero hextets may be replaced by a double colon (::). Only one double colon per address is allowed, otherwise the address is ambiguous.
Address Types
IPv6 does not have a single private RFC 1918 range. Instead, addresses are classified by purpose, and the leading bits of the address declare what kind it is.
| Type | Prefix | Purpose |
|---|---|---|
| Global Unicast | 2000::/3 | Publicly routable, like IPv4 public addresses |
| Unique Local | fc00::/7 | Private to an organization, not globally routed (RFC 4193) |
| Link-Local | fe80::/10 | Auto-configured on every interface, single link only |
| Multicast | ff00::/8 | One-to-many delivery, replaces IPv4 broadcast |
| Loopback | ::1/128 | This machine, equivalent to IPv4 127.0.0.1 |
| Unspecified | ::/128 | Source address before configuration (no IPv6 yet) |
Special Prefixes
Beyond the general types, several specific prefixes have dedicated jobs. These will show up in lab traffic captures and configuration files.
| Prefix | Designation | Reference |
|---|---|---|
| 2001:db8::/32 | Documentation (reserved for examples) | RFC 3849 |
| 2002::/16 | 6to4 tunneling (legacy transition mechanism) | RFC 3056 |
| 64:ff9b::/96 | IPv4-Embedded for NAT64 translation | RFC 6052 |
| ff02::1 | All-nodes multicast on local link | RFC 4291 |
| ff02::2 | All-routers multicast on local link | RFC 4291 |
| ::ffff:0:0/96 | IPv4-mapped IPv6 (dual-stack sockets) | RFC 4291 |
IPv4 vs IPv6
The two protocols coexist on the modern internet. Knowing where they differ helps when reading configurations or diagnosing traffic.
| Aspect | IPv4 | IPv6 |
|---|---|---|
| Size | 32 bits | 128 bits |
| Addresses | ~4.3 billion | ~3.4 × 1038 |
| Notation | Dotted decimal | Hex hextets, colon-separated |
| Private space | RFC 1918 ranges | Unique Local fc00::/7 |
| Loopback | 127.0.0.1 | ::1 |
| Broadcast | 255.255.255.255 | No broadcast, uses multicast |
| Auto-config | DHCP or APIPA | SLAAC or DHCPv6 |
| Header size | 20 to 60 bytes | Fixed 40 bytes |
| Typical subnet | /24 (254 hosts) | /64 (264 hosts) |