Address types and scopes
Distinguish unicast, multicast and anycast addresses, and explain why IPv6 has no broadcast. Identify global unicast, link-local, unique local, loopback, unspecified and IPv4-mapped addresses by their prefix. Explain address scope and why link-local addresses need a zone ID when used. Look up a prefix in the IANA special-purpose address registry and decode a multicast address's scope.
Take the quiz · pass mark 70% · 9 questions
Explanation
Three kinds of address, and no broadcast
RFC 4291 defines three types of IPv6 address:
| Type | Delivered to | Example |
|---|---|---|
| Unicast | One interface | 2001:db8:10:1::25 |
| Multicast | Every interface that has joined the group | ff02::1 (all nodes on the link) |
| Anycast | The nearest of several interfaces sharing the address (as routing measures "nearest") | the Subnet-Router anycast address of a subnet |
There is no broadcast in IPv6. Things that used broadcast in IPv4 (ARP, DHCP discovery) use multicast groups instead, so only the hosts that care have to process the packet.
A normal IPv6 interface has several addresses at once: always a link-local address, usually one or more global addresses, sometimes a unique local address. It also listens on several multicast groups. Getting used to "many addresses per interface" is one of the biggest mental shifts from IPv4.
The address map
The leading bits of an address tell you its type:
| Prefix | Name | Scope | Notes |
|---|---|---|---|
::/128 | Unspecified | n/a | "No address yet". Used as a source during autoconfiguration; never as a destination |
::1/128 | Loopback | Host | Like IPv4 127.0.0.1, but just one address |
::ffff:0:0/96 | IPv4-mapped | n/a | Represents an IPv4 address inside the IPv6 socket API, e.g. ::ffff:192.0.2.1 |
fe80::/10 | Link-local unicast | Link | Every IPv6 interface has one; never routed |
fc00::/7 | Unique local (ULA) | Global by definition, used privately | fd00::/8 is the half in use (locally assigned, random 40-bit Global ID) |
ff00::/8 | Multicast | Set by the scope field | See below |
2000::/3 | Global unicast (GUA) | Global | All of today's Internet unicast space is allocated from here |
| everything else | Mostly reserved or unassigned |
fec0::/10 ("site-local") appears in old books and some old software. It was deprecated by RFC 3879 because "site" was never clearly defined. Do not use it.
Drawing diagram…
Global unicast addresses (GUA)
A global unicast address has three parts (RFC 4291, section 2.5.4):
| global routing prefix | subnet ID | interface ID (IID) |
|<------ n bits ------->|<- m bits->|<-------- 128-n-m bits ------>|
In practice an ISP or RIR gives a site a /48 or /56 (the global routing prefix). The site uses the bits up to /64 as the subnet ID, and the last 64 bits are the interface ID. RFC 4291 requires 64-bit IIDs for all unicast addresses except those starting with binary 000. You will see why that matters for autoconfiguration in L1.06 and for planning in L2.03.
Link-local addresses
- Every IPv6-enabled interface automatically configures a link-local address in
fe80::/10. In practice the format isfe80::/64followed by a 64-bit IID. - Link-local addresses are only valid on one link. Routers never forward packets with a link-local source or destination to another link.
- Neighbor Discovery, router advertisements and routing protocols (OSPFv3, BGP next hops) depend on them. A router's default-gateway address, as seen by hosts, is usually its link-local address.
- Because every interface has an address in
fe80::/64, the address alone is ambiguous on a host with several interfaces. You must add a zone ID (RFC 4007), usually the interface name or index after a%:
ping fe80::1%eth0 (Linux/macOS)
ping fe80::1%12 (Windows: interface index 12)
RFC 9844 covers how users should enter zone IDs in user interfaces.
Unique local addresses (ULA)
ULAs (RFC 4193) are for addressing inside a site or between cooperating sites, without being routed on the Internet:
| 7 bits |1| 40 bits | 16 bits | 64 bits |
| 1111110 |L| Global ID | Subnet ID | Interface ID |
L = 1means locally assigned. So in practice ULAs start withfd, followed by a 40-bit pseudo-random Global ID, which gives a /48 such asfdXX:XXXX:XXXX::/48.- The randomness makes collisions unlikely when two organisations merge networks. Never pick an easy prefix like
fd00::/48. - ULAs are not "private addresses with NAT" in the IPv4 sense. A host normally has a GUA as well, and source address selection (L1.07) decides which one to use.
Multicast addresses and scope
A multicast address starts with ff, followed by a 4-bit flags field and a 4-bit scope field (RFC 4291, updated by RFC 7346):
| 11111111 | flags | scope | group ID (112 bits) |
| Scope (hex) | Meaning |
|---|---|
| 1 | Interface-local (loopback-style) |
| 2 | Link-local |
| 3 | Realm-local |
| 4 | Admin-local |
| 5 | Site-local |
| 8 | Organization-local |
| e | Global |
So ff02::1 is "all nodes, link scope" and ff05::… is site scope. Well-known link-scope groups you will see constantly:
| Address | Group |
|---|---|
ff02::1 | All nodes on the link |
ff02::2 | All routers on the link |
ff02::1:2 | All DHCPv6 relay agents and servers |
ff02::1:ffXX:XXXX | Solicited-node multicast for an address ending in XX:XXXX (L1.05) |
Anycast
Anycast addresses come from unicast space and look exactly like unicast addresses. What makes them anycast is that several interfaces are configured with the same address. RFC 4291 reserves one in every subnet: the Subnet-Router anycast address, which is the subnet prefix with an all-zero interface ID (for example 2001:db8:10:1:: for 2001:db8:10:1::/64). Every router on that subnet answers to it. Anycast is used heavily for DNS (L8.05).
Scope in one picture
Drawing diagram…
The special-purpose registry
IANA keeps an authoritative list of special IPv6 prefixes (RFC 6890 defines the registry and its fields, such as whether a prefix is forwardable or globally reachable). Check it whenever you meet an unfamiliar prefix. Entries you will use in this course include 2001:db8::/32 (documentation, RFC 3849) and 3fff::/20 (documentation, RFC 9637).
Worked examples
Example 1: Classify addresses
| Address | Type | Why |
|---|---|---|
2001:db8:10:1::25 | Global unicast (documentation) | Inside 2000::/3; specifically 2001:db8::/32 |
fe80::3c2a:9ff:fe4b:1d02 | Link-local | fe80::/10 |
fd3c:5a71:9e04:10::25 | Unique local | Starts with fd |
ff02::2 | Multicast, link scope | ff + flags 0 + scope 2 |
ff0e::101 | Multicast, global scope | scope e |
:: | Unspecified | All zeros |
::ffff:198.51.100.7 | IPv4-mapped | ::ffff:0:0/96 |
Example 2: The Subnet-Router anycast address
Question: What is the Subnet-Router anycast address for 2001:db8:4a00:20::/64?
Working: Keep the 64-bit prefix and set the interface ID to zero: 2001:db8:4a00:20::.
Example 3: Build a ULA /48 from a Global ID
Question: Your randomly generated 40-bit Global ID is 0x5a719e04c3 (hex). Write the ULA /48.
Working: Start with the 8 bits fd, then add the 40-bit Global ID (10 hex digits): fd 5a71 9e04 c3 → fd5a:719e:04c3::/48. (This is a worked example only. In real use you generate your own Global ID, as in L2.06.)
Example 4: Why the zone ID matters
A router with interfaces eth0 and eth1 can have the neighbour fe80::1 on both links. ping fe80::1 is ambiguous, but ping fe80::1%eth1 is not. Many tools refuse a link-local destination without a zone ID, and some guess. Always give one.
Lab
Goal: Classify every address and multicast group on a host, and use link-local addressing across a link.
You need: A Linux machine or VM with iproute2 and root access (namespaces do not affect your real network).
Step 1: Build two hosts on one link
sudo ip netns add hostA
sudo ip netns add hostB
sudo ip link add vethA netns hostA type veth peer name vethB netns hostB
for n in hostA hostB; do sudo ip -n $n link set lo up; done
sudo ip -n hostA link set vethA up
sudo ip -n hostB link set vethB up
sudo ip -n hostA -6 addr add 2001:db8:10:1::a/64 dev vethA
sudo ip -n hostB -6 addr add 2001:db8:10:1::b/64 dev vethB
Step 2: List and classify addresses
sudo ip -n hostA -6 addr show
sudo ip -n hostA -6 maddr show dev vethA
Make a table of every unicast address (::1, the fe80:: address, 2001:db8:10:1::a) and every multicast group (ff02::1, ff02::1:ff…, and so on), with its type and scope. For each ff02::1:ffXX:XXXX group, note which unicast address it belongs to.
Step 3: Use link-local addressing
B_LL=$(sudo ip -n hostB -6 addr show dev vethB scope link | awk '/inet6/{print $2}' | cut -d/ -f1)
sudo ip netns exec hostA ping -c 2 "$B_LL" # observe what happens without a zone ID
sudo ip netns exec hostA ping -c 2 "$B_LL%vethA" # with zone ID
sudo ip netns exec hostA ping -c 2 ff02::1%vethA # all nodes on the link
Explain the difference between the first two pings. Explain why the third returns replies from both hosts' link-local addresses.
Step 4: Add a ULA and check the registry
Generate a random 40-bit Global ID (openssl rand -hex 5), build your ULA /48, and add a /64 from it to both hosts. Then open the IANA "IPv6 Special-Purpose Address Registry" and record the Forwardable and Globally Reachable values for fc00::/7, 2001:db8::/32 and 3fff::/20.
Clean up
sudo ip netns del hostA; sudo ip netns del hostB
Summary
- IPv6 has unicast, multicast and anycast addresses, and no broadcast. Multicast replaces it.
- Every interface has several addresses: always a link-local address (
fe80::/10), usually a global unicast address (2000::/3), and possibly a unique local address (fd00::/8with a random 40-bit Global ID). ::is unspecified,::1is loopback,::ffff:0:0/96is IPv4-mapped, andfec0::/10site-local is deprecated (RFC 3879).- Link-local addresses never leave the link and need a zone ID (
%eth0) when you use them. - Multicast addresses start
ff. The 4th hex digit is the scope (2 = link, 5 = site, e = global). - Anycast addresses look like unicast. The Subnet-Router anycast address is the prefix with an all-zero IID.
- Next lesson (L1.04): the IPv6 header and extension headers.
Quiz imported · 9 questions · pass mark 70%. Lab questions are not auto-marked.