IPv6 addresses without fear: notation, scopes and types
Read and canonicalise 128-bit IPv6 addresses using RFC 5952 rules, distinguish global unicast, unique local, link-local and multicast scopes, compute solicited-node multicast groups and use zone indices on local links.
Contentsand lesson path
On this page
- Why it matters
- Reading 128 bits and normalising notation under RFC 5952
- Address types, scopes and why interfaces hold several at once
- Check your understanding
- Apply it
- Review prompt
Lessons of IPv6 Addressing & Operation
- IPv6 addresses without fear: notation, scopes and types Concept · 20 min
- Neighbor Discovery replaces ARP: NS/NA, RS/RA and duplicate address detection Concept · 20 min
- Lab: SLAAC and DHCPv6 side by side, watched in Wireshark Lab · 30 min
- Worked example: a /48 site plan and the ICMPv6 you must allow Worked example · 25 min
- Living with IPv4: dual stack, NAT64/DNS64 and 464XLAT Concept · 15 min
- Check: IPv6 addressing and troubleshooting scenarios Knowledge check · 8 questions
What you will learn
- Read and compress IPv6 addresses and identify global unicast, unique local, link-local and multicast addresses.
01. Why it matters
Suppose you run ip -6 addr on a Linux server and see three distinct addresses on one interface: fe80::ff:fe00:6010/64, fd72:4b0e:1190:20::14/64, and 2001:db8:20::4a:19/64. At the same time, an inventory script alerts that 2001:0db8:0000:0000:000a:0000:0000:001f does not match 2001:db8::a:0:0:1f in a string check even though both point to the exact same host.
IPv4 taught you to expect one main address per interface written in decimal octets. IPv6 expands addresses to 128 bits written in hexadecimal, assigns multiple addresses with different scopes (how far a packet may be routed) to the same interface at once, and defines strict text formatting rules so logs, firewalls, and automation scripts compare addresses reliably.
02. Reading 128 bits and normalising notation under RFC 5952
Why did IPv6 expand from 32 bits to 128 bits rather than 48 or 64 bits? As covered in special-purpose IPv4 ranges, 32-bit IPv4 holds roughly 4.3 billion addresses, forcing Carrier-Grade NAT and tight subnetting. Expanding to 128 bits yields 2^128 addresses—large enough to reserve a full 64-bit Interface Identifier (IID) for every local LAN while still giving organisations tens of thousands of /64 subnets.
To keep 128 bits readable, RFC 4291 writes an IPv6 address as eight 16-bit groups (hextets) separated by colons (:), with four hexadecimal digits (0–9, a–f) per group. Typing 32 hex digits every time invites mistakes, so IPv6 allows shortening zero-heavy blocks—yet unstructured shortening creates text mismatches. If one config file stores 2001:0DB8:0:0:A::1F and another stores 2001:db8::a:0:0:1f, naive string comparisons in firewall audits or allowlists fail.
RFC 5952 defines four deterministic canonicalisation rules that every modern stack follows when emitting text:
- Use lowercase hex digits: Write
a–f, notA–F(2001:db8:..., not2001:DB8:...). - Drop leading zeros in each group: Shorten
0db8todb8,001fto1f, and0000to0. Keep trailing zeros (a000staysa000,0090becomes90), and never leave a group empty unless::replaces it. - Compress the single longest run of all-zero groups with
::: Replace two or more consecutive0groups with::, once only per address. Writing::twice (such as2001:db8::a::1f) is invalid because the parser cannot tell how many zero groups each::absorbed. Do not replace a single isolated0group with::. - Break equal-length ties to the left: When two runs of consecutive
0groups have the exact same length, compress the leftmost run with::and keep the other zero groups as0.
What if an address has one isolated zero group on the left and three zero groups on the right? For 2001:0db8:0000:000c:0000:0000:0000:0090, rule 3 compresses the three-group run on the right (2001:db8:0:c::90) rather than the single zero on the left, because longest-run compression always wins before tie-breaking runs.
Let us also check how solicited-node multicast (ff02::1:ff00:0/104) maps any unicast address into a link-local multicast group. Take the last 24 bits (six hex digits) of the unicast address and append them after ff02::1:ff. For 2001:db8:20::4a:19 (whose trailing two hextets expand to 004a:0019), the last 24 bits are 4a:0019, producing ff02::1:ff4a:19. Both ::4a:19 and fe80::ff:fe4a:19 share those same 24 trailing bits, so their NIC multicast filters listen on ff02::1:ff4a:19 while ignoring traffic for unrelated hosts. Verify both RFC 5952 normalisation and solicited-node calculation with Python:
Full 128-bit form : 2001:0db8:0000:0000:000a:0000:0000:001f (8 hextets x 16 bits)
Drop leading zeros: 2001:db8 :0 :0 :a :0 :0 :1f
Compress first tie: 2001:db8::a:0:0:1f (two 2-group runs -> leftmost gets ::)
Prefix /64 split : |<-- 64-bit network prefix -->|<---- 64-bit interface ID ---->|import ipaddress
addr = ipaddress.IPv6Address("2001:0db8:0000:0000:000a:0000:0000:001f")
host = ipaddress.IPv6Address("2001:db8:20::4a:19")
last24 = int(host) & 0xFFFFFF
sn_mcast = ipaddress.IPv6Address(int(ipaddress.IPv6Address("ff02::1:ff00:0")) | last24)
print("compressed:", addr.compressed)
print("exploded :", addr.exploded)
print("solicited :", sn_mcast)compressed: 2001:db8::a:0:0:1f
exploded : 2001:0db8:0000:0000:000a:0000:0000:001f
solicited : ff02::1:ff4a:1903. Address types, scopes and why interfaces hold several at once
In binary masks and prefixes, a host interface typically holds one IPv4 address. In IPv6, scope (whether an address is valid on one link, one organisation, or the public Internet) is encoded into the leading bits of the address:
- Global Unicast Address (GUA,
2000::/3): Publicly routable across the Internet (first hex digit2or3, such as2001:...or2606:...) unless restricted by policy. Unlike IPv4, internal hosts commonly hold GUAs without NAT, relying on stateful firewalls to block unsolicited inbound connections. - Unique Local Address (ULA,
fc00::/7, deployed asfd00::/8): Defined in RFC 4193 for private site-to-site or lab communication that must not be routed on the public Internet. Valid ULAs start withfdfollowed by a pseudo-random 40-bit Global ID (for examplefd72:4b0e:1190:20::14/64) so two merged companies almost never collide like192.168.1.0/24does. (fc00::/8remains unallocated for centrally assigned prefixes.) - Link-Local Address (
fe80::/10, formatted asfe80::/64on Ethernet links): Automatically generated on every IPv6 interface as soon as the link comes up, before any router or DHCPv6 server responds. Link-local packets stay on the attached Layer 2 segment—routers never forward them off-link. Routing protocols such as OSPFv3 (and directly connected or unnumbered BGP sessions configured with link-local next hops, whereas standard BGP uses global next hops by default) and Neighbor Discovery usefe80::addresses because they stay constant even when an ISP renumbers your global prefix. Because every interface on a multi-homed host sharesfe80::/64, tools require a zone index such asping -6 fe80::1%eth0so the kernel knows which physical or virtual link to transmit on. - Loopback (
::1/128) and Unspecified (::/128):::1equals IPv4127.0.0.1for host-local traffic;::(all zeros) acts as a placeholder source address when a booting host has not yet confirmed an IP. - Documentation (
2001:db8::/32): Reserved by RFC 3849 strictly for examples, documentation, and labs—just like IPv4 RFC 5737.
Multicast (ff00::/8) replaces broadcast: IPv6 has no broadcast address (255.255.255.255 does not exist). Instead, multicast addresses start with ff, followed by a 4-bit flags nibble and a 4-bit scope nibble (2 = link-local, 5 = site-local):
ff02::1: All IPv6 nodes on the attached link (also needs%eth0when pinging from a host).ff02::2: All IPv6 routers on the attached link.ff02::1:2: All DHCPv6 servers and relay agents on the local link.ff05::2/ff05::1:3: Site-local all-routers and all-DHCP-servers multicast groups routed within one site rather than stopping at one link.ff02::1:ff00:0/104: Solicited-node multicast, built from the target address's trailing 24 bits.
When not to deploy ULAs (fd00::/8) alongside IPv4 for Internet-facing clients: Avoid assigning ULAs on workstation VLANs expecting clients to prefer IPv6 toward dual-stack public destinations. Under RFC 6724 destination address selection, Rule 5 ("Prefer matching label") runs before precedence is compared: a ULA source (fc00::/7, label 13) does not match a global IPv6 destination (::/0, label 1), whereas the host's IPv4 source and destination both share label 4, so ULA + IPv4 hosts fall back to IPv4 (while fc00::/7's low precedence of 3 ranks ULA destinations below global IPv6 40 and IPv4 35).
04. Check your understanding
05. Apply it
Run ip -6 addr on your workstation or a container and classify every address by type (GUA, ULA, Link-Local, or Loopback) and scope. Next, take 2001:0db8:0000:0000:0000:0007:0000:0000, canonicalise it by hand under RFC 5952, derive its solicited-node multicast address, and verify both with Python ipaddress.
Once address notation and scopes feel clear, move to the next lesson on Neighbor Discovery to see how fe80::/10 and ff02:: multicast addresses replace IPv4 ARP completely.
06. Review prompt
State the four RFC 5952 canonicalisation rules from memory, explain how to build a solicited-node multicast address from any unicast IPv6 address, and compare fd00::/8, fe80::/10, and 2000::/3 in routing scope and RFC 6724 label/precedence selection.
References
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.