Sub topic 10
Multicast addresses and scopes
This chapter assumes you know IPv6 prefix notation, hexadecimal, and the difference between unicast and multicast delivery. IPv6 has no broadcast. Multicast does that job, and hosts use it for services such as neighbor discovery.
The multicast format
All multicast addresses fall inside ff00::/8. The first byte is always ff. The next 8 bits are split into two 4-bit fields:
- Flags (4 bits). The lowest flag bit,
T, is 0 for a permanent, well-known address assigned by IANA. It is 1 for a transient address that an application or administrator chose. - Scope (4 bits). This limits how far the packet may travel.
The remaining 112 bits hold the group ID.
ff 0 2 : 0000:0000:0000:0000:0000:0000:0000:0001
| | |
| | +-- scope (2 = link-local)
| +----- flags (0 = permanent)
+--------- multicast prefixSo ff02::1 is a permanent group with link-local scope.
Scopes
The scope value decides where routers may forward the packet.
| Prefix | Scope | Reach |
|---|---|---|
| `ff01::/16` | Interface-local | Only the sending interface (loopback use) |
| `ff02::/16` | Link-local | The local link. Routers do not forward it. |
| `ff05::/16` | Site-local | One site, as defined by the administrator |
| `ff0e::/16` | Global | The whole Internet |
Link-local scope is the most common. Because routers never forward ff02:: traffic, it stays on one network segment.
Well-known groups
Three groups appear constantly:
ff02::1is all nodes on the link. It is the closest equivalent to IPv4 broadcast.ff02::2is all routers on the link. Hosts send Router Solicitations here.ff02::1:ff00:0/104is the solicited-node prefix. It is used for address resolution.
Solicited-node multicast
Each unicast address has a matching solicited-node group. It is formed from ff02::1:ff plus the last 24 bits of the unicast address. Neighbor Discovery sends its address-resolution queries to this group. This replaces ARP broadcasts. Only hosts whose addresses end in the same 24 bits receive the query, so other hosts are not disturbed.
import ipaddress
def solicited_node(addr):
a = ipaddress.IPv6Address(addr)
low24 = int(a) & 0xFFFFFF
base = int(ipaddress.IPv6Address("ff02::1:ff00:0"))
return ipaddress.IPv6Address(base | low24)
print(solicited_node("2001:db8::21a:2bff:fe3c:4d5e")) # ff02::1:ff3c:4d5eThe next chapters on Neighbor Discovery build on this mechanism.
Seeing multicast groups on a host
On Linux, ip -6 maddr show lists the groups each interface has joined. You should see ff02::1 and at least one solicited-node address per interface address.
ip -6 maddr show
ping -6 -c 2 ff02::1%eth0The %eth0 suffix is a zone ID. A link-local multicast address is valid on every link, so the host needs to know which interface to send on. Replace eth0 with your interface name.
Exercise
What is the scope of the address ff05::2, and which hosts is it meant for?
Show answer
The scope nibble is 5, so it is site-local. The group ID is 2, which is the all-routers group, so it addresses all routers within the site. The flags nibble is 0, so it is a permanent, well-known address.
Exercise
A host has the address 2001:db8::1234:5678. What is its solicited-node multicast address?
Show answer
Take the last 24 bits of the address, 34:5678, written as 34:5678 (hex 345678). The result is ff02::1:ff34:5678.