Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 1 of 6 · Concept · 20 min · revision 1

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

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:

  1. Use lowercase hex digits: Write a–f, not A–F (2001:db8:..., not 2001:DB8:...).
  2. Drop leading zeros in each group: Shorten 0db8 to db8, 001f to 1f, and 0000 to 0. Keep trailing zeros (a000 stays a000, 0090 becomes 90), and never leave a group empty unless :: replaces it.
  3. Compress the single longest run of all-zero groups with ::: Replace two or more consecutive 0 groups with ::, once only per address. Writing :: twice (such as 2001:db8::a::1f) is invalid because the parser cannot tell how many zero groups each :: absorbed. Do not replace a single isolated 0 group with ::.
  4. Break equal-length ties to the left: When two runs of consecutive 0 groups have the exact same length, compress the leftmost run with :: and keep the other zero groups as 0.

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:

Text · Applying RFC 5952 canonical compression step by step
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 ---->|
Python · Checking RFC 5952 form and solicited-node multicast in ipaddress
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)
Expected output
compressed: 2001:db8::a:0:0:1f
exploded  : 2001:0db8:0000:0000:000a:0000:0000:001f
solicited : ff02::1:ff4a:19

03. 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 digit 2 or 3, such as 2001:... or 2606:...) 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 as fd00::/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 with fd followed by a pseudo-random 40-bit Global ID (for example fd72:4b0e:1190:20::14/64) so two merged companies almost never collide like 192.168.1.0/24 does. (fc00::/8 remains unallocated for centrally assigned prefixes.)
  • Link-Local Address (fe80::/10, formatted as fe80::/64 on 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 use fe80:: addresses because they stay constant even when an ISP renumbers your global prefix. Because every interface on a multi-homed host shares fe80::/64, tools require a zone index such as ping -6 fe80::1%eth0 so the kernel knows which physical or virtual link to transmit on.
  • Loopback (::1/128) and Unspecified (::/128): ::1 equals IPv4 127.0.0.1 for 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 %eth0 when 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

Practice check · 3 questions

IPv6 solicited-node groups, scopes and zone indices

Apply IPv6 address scopes, solicited-node mapping and zone index rules to interface diagnostics.

Q1. A host configures `2001:db8:20::4a:19/64` on `eth0`. Which solicited-node multicast group does its NIC join to receive address resolution queries for that address?
Q2. An engineer sees `fe80::1` as the client's default gateway in `ip -6 route`, while the interface itself holds `2001:db8:20::14/64`. Why is a link-local gateway valid for global traffic?
Q3. On a Linux router with both `eth0` and `eth1` up, running `ping -6 fe80::1` without an interface suffix fails with `Invalid argument`. Why does the kernel reject it?
Practice only: not graded, not saved, not evidence.

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.

Sign in to mark reading complete

Prove this skill

8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check