IPv6 Addressing & RFC 5952 Compression Explained: From /48 Site Prefixes to /64 SLAAC & Reverse DNS
IPv6 looks intimidating at first glance only because 128 bits written in hexadecimal produce strings like 2001:0db8:0000:0000:0000:0000:0370:7334. In reality, IPv6 subnetting is far simpler than IPv4: once you memorize the two compression rules of RFC 5952 and understand why every end-user LAN defaults to /64, IPv6 planning becomes clean hexadecimal counting.
1. The Two Canonical Compression Rules of RFC 5952
An IPv6 address consists of eight 16-bit groups (hextets) separated by colons, with each hexadecimal character representing 4 bits (one nibble). RFC 5952 defines the exact canonical text representation so logs, firewalls, and certificates always format addresses identically.
Rule 1 (Leading Zeros): Strip every leading zero inside each 4-character hextet, leaving at least one zero if the entire group is 0000 (for instance, 0db8 becomes db8, and 0000 becomes 0). Never remove trailing zerosβ0370 compresses to 370, not 37! Rule 2 (Double Colon ::): Replace the single longest contiguous run of two or more all-zero hextets with ::. You may use :: at most once per address; if two zero runs tie in length, compress the leftmost run and always write hex digits aβf in lowercase.
Full 128-bit: 2001:0db8:0000:0000:0000:ff00:0042:8329
Step 1 (strip): 2001:db8:0:0:0:ff00:42:8329
Step 2 (::): 2001:db8::ff00:42:8329
# Invalid compression example (two '::' is ambiguous and illegal!):
# 2001:db8::1::5 <-- WRONG (router cannot know how many zero blocks sit in each ::)
2. Why Almost Every IPv6 LAN Uses /64 (and How /48 & /56 Subdivide)
Unlike IPv4, where engineers squeeze VLANs into tight /27 or /28 blocks to conserve scarce addresses, IPv6 reserves the final 64 bits for the Interface Identifier (IID). Stateless Address Autoconfiguration (SLAAC, RFC 4862) relies on a fixed /64 subnet boundaryβassigning a longer prefix like /80 or /96 to a client VLAN breaks Android and macOS autoconfiguration.
Because every nibble (single hex digit) equals 4 bits, subnetting along /48, /52, /56, /60, and /64 boundaries requires zero binary bit-splitting. An enterprise /48 allocation provides 16 subnet bits (2^16 = 65,536 distinct /64 LANs, numbered :0000::/64 through :ffff::/64), while a residential or branch-office /56 allocation provides 8 subnet bits (256 distinct /64 LANs, numbered :xx00::/64 through :xxff::/64).
| Prefix Length | Subnet Scope | Number of /64 LANs | Standard Usage |
|---|---|---|---|
| /32 | Regional ISP / LIR block | 4,294,967,296 | ISP allocation from ARIN/RIPE/APNIC |
| /48 | Enterprise / Campus site | 65,536 | Standard corporate site or datacenter |
| /56 | Small business / Home ISP | 256 | Branch office or residential PD delegation |
| /64 | Single LAN / VLAN / VPC subnet | 1 | Mandatory floor for SLAAC & Neighbor Discovery |
| /127 | Point-to-Point router link | N/A (2 IPs) | RFC 6164 inter-router transit link |
| /128 | Single host / Loopback | N/A (1 IP) | Loopback (::1) or host firewall allowlist |
3. Key Reserved IPv6 Prefix Types You Must Recognize
E
v
e
r
y
I
P
v
6
e
n
g
i
n
e
e
r
a
n
d
e
x
a
m
c
a
n
d
i
d
a
t
e
s
h
o
u
l
d
s
p
o
t
f
i
v
e
p
r
e
f
i
x
e
s
i
m
m
e
d
i
a
t
e
l
y
:
2
0
0
0
:
:
/
3
m
a
r
k
s
G
l
o
b
a
l
U
n
i
c
a
s
t
A
d
d
r
e
s
s
e
s
(
r
o
u
t
a
b
l
e
o
n
t
h
e
p
u
b
l
i
c
i
n
t
e
r
n
e
t
)
,
f
e
8
0
:
:
/
1
0
i
d
e
n
t
i
f
i
e
s
L
i
n
k
-
L
o
c
a
l
a
d
d
r
e
s
s
e
s
a
u
t
o
-
c
o
n
f
i
g
u
r
e
d
o
n
e
v
e
r
y
i
n
t
e
r
f
a
c
e
f
o
r
N
e
i
g
h
b
o
r
D
i
s
c
o
v
e
r
y
a
n
d
r
o
u
t
i
n
g
n
e
x
t
-
h
o
p
s
,
f
c
0
0
:
:
/
7
(
p
r
a
c
t
i
c
a
l
l
y
f
d
0
0
:
:
/
8
)
d
e
n
o
t
e
s
U
n
i
q
u
e
L
o
c
a
l
A
d
d
r
e
s
s
e
s
(
U
L
A
,
r
o
u
g
h
l
y
t
h
e
I
P
v
6
c
o
u
n
t
e
r
p
a
r
t
t
o
R
F
C
1
9
1
8
p
r
i
v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