Rolling Thunder Security · Codex · Network Security · IPv6

IPv6 Address
Anatomy

IPv4 had room for four billion addresses. IPv6 has room for three hundred forty undecillion. The notation is hexadecimal, the rules are compression-friendly, and the address space is effectively infinite.

Per address · 128 bits Reference · 5 tables Hands-on · 4 labs
01
The Format

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.

Full
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Bits
128 total · 8 hextets × 16 bits
Base
Hexadecimal (0 to 9, a to f)
02
Reference

Compression Rules

Writing eight four-character hextets every time would be exhausting. Two rules cut typical IPv6 addresses down to a manageable size.

// Rule 1

Drop leading zeros

Within any single hextet, leading zeros may be omitted. The hextet 0db8 becomes db8. The hextet 0000 becomes 0.

// Rule 2

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.

Full
2001:0db8:0000:0000:0000:ff00:0042:8329
Step 1
2001:db8:0:0:0:ff00:42:8329
Step 2
2001:db8::ff00:42:8329
03
Reference

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.

TypePrefixPurpose
Global Unicast2000::/3Publicly routable, like IPv4 public addresses
Unique Localfc00::/7Private to an organization, not globally routed (RFC 4193)
Link-Localfe80::/10Auto-configured on every interface, single link only
Multicastff00::/8One-to-many delivery, replaces IPv4 broadcast
Loopback::1/128This machine, equivalent to IPv4 127.0.0.1
Unspecified::/128Source address before configuration (no IPv6 yet)
04
Reference

Special Prefixes

Beyond the general types, several specific prefixes have dedicated jobs. These will show up in lab traffic captures and configuration files.

PrefixDesignationReference
2001:db8::/32Documentation (reserved for examples)RFC 3849
2002::/166to4 tunneling (legacy transition mechanism)RFC 3056
64:ff9b::/96IPv4-Embedded for NAT64 translationRFC 6052
ff02::1All-nodes multicast on local linkRFC 4291
ff02::2All-routers multicast on local linkRFC 4291
::ffff:0:0/96IPv4-mapped IPv6 (dual-stack sockets)RFC 4291
05
Reference

IPv4 vs IPv6

The two protocols coexist on the modern internet. Knowing where they differ helps when reading configurations or diagnosing traffic.

AspectIPv4IPv6
Size32 bits128 bits
Addresses~4.3 billion~3.4 × 1038
NotationDotted decimalHex hextets, colon-separated
Private spaceRFC 1918 rangesUnique Local fc00::/7
Loopback127.0.0.1::1
Broadcast255.255.255.255No broadcast, uses multicast
Auto-configDHCP or APIPASLAAC or DHCPv6
Header size20 to 60 bytesFixed 40 bytes
Typical subnet/24 (254 hosts)/64 (264 hosts)
Hands-On

Interactive Labs

06
Lab 01

IPv6 Inspector

Paste any IPv6 address. The inspector identifies its type, expands it to full form, compresses it to canonical form, and splits it into network prefix and interface ID at /64.

ipv6-inspector.sh 0x0001
Live

Try the examples or type your own address. Short forms with :: are accepted.

2001:db8:85a3::8a2e:370:7334 fe80::1 fd12:3456:789a::1 ::1 ff02::1 2606:4700:4700::1111
07
Lab 02

Compression Walkthrough

Pick an address and watch the two compression rules apply step by step. Each rule highlights exactly what changed.

compress.walk 0x0002
Live

Paste any IPv6 address in full or shorthand form. The walkthrough re-derives the canonical compressed version.

2001:0db8:0000:0000:0000:ff00:0042:8329 fe80:0000:0000:0000:0202:b3ff:fe1e:8329 2001:0db8:0001:0000:0000:0000:0000:0001
08
Lab 03

Prefix Splitter

Slide the prefix length. The 128-bit ribbon splits into network bits (gold) and interface bits (red). The address below shows where the cut falls. Try /64, the typical subnet boundary.

prefix-split.calc 0x0003
Live

The slider moves the boundary in 4-bit steps so the split aligns with hextet boundaries when possible.

/64
Network bits Host / Interface bits
09
Lab 04

Address Type Quiz

Identify what kind of IPv6 address is shown. Score and streak update on the page.

classify-v6.quiz 0x0004
Live
Correct0 Attempted0 Streak0