Sub topic 10
Multicast addresses and scopes
IPv6 has no broadcast. Everything that IPv4 did with broadcast, such as finding a router or resolving a neighbor, uses multicast instead. This chapter covers the structure of multicast addresses, how the scope field limits how far a packet travels, and the well-known groups you will see in packet captures. It assumes you can read the address types introduced earlier, in particular that ff00::/8 marks multicast.
Why multicast replaces broadcast
An IPv4 broadcast reaches every host on the link, and every host must process it. A multicast packet is delivered only to hosts that have joined the destination group. A network card can filter on the group and drop other traffic without interrupting the operating system.
Three rules apply to every multicast address:
- A multicast address is only ever a destination. It is never a valid source address.
- A host can belong to many groups at once, and it joins and leaves groups dynamically.
- Group membership is per interface, not per host.
Anatomy of an `ff00::/8` address
The first 8 bits are always ff. The next 4 bits are flags, the next 4 are the scope, and the remaining 112 bits are the group ID.
In ff02::1, the third hex digit 0 is the flags field and the fourth digit 2 is the scope. So ff02::1 has flags 0000, link-local scope, and group ID 1.
The flags field
The four flag bits are written 0 R P T. The leftmost bit is reserved and must be 0.
| Bit | Name | Meaning when set to 1 |
|---|---|---|
| T | Transient | The group is dynamically assigned, not permanently defined by IANA. |
| P | Prefix | The group ID is derived from a unicast network prefix (RFC 3306). It requires T to be 1. |
| R | Rendezvous | The address embeds the address of a rendezvous point (RFC 3956). It requires P and T to be 1. |
Well-known groups such as all-nodes and all-routers have flags 0. An address like ff3e:40:2001:db8::1 has flags 3 (0011, so P and T are both set). It is a transient group built from the prefix 2001:db8::/64, and its scope digit e makes it global.
The scope field
The scope limits how far routers forward the packet. A router must not forward a packet beyond its scope, even if routing could carry it further.
| Scope value | Name | Reach |
|---|---|---|
| 1 | Interface-local | Only the sending interface, used for loopback-style delivery. |
| 2 | Link-local | All nodes on the same link. Routers never forward these. |
| 4 | Admin-local | The smallest area an administrator configures. |
| 5 | Site-local | A single site. |
| 8 | Organization-local | Several sites of one organization. |
| e | Global | The whole Internet. |
The same group ID can appear with several scopes. ff02::2 is all routers on the link. ff05::2 is all routers at the site. They are different addresses.
Well-known multicast groups
These are the groups you meet most often.
| Address | Group |
|---|---|
| `ff02::1` | All nodes on the link |
| `ff02::2` | All routers on the link |
| `ff01::1` | All nodes, interface-local |
| `ff05::2` | All routers at the site |
| `ff02::1:2` | All DHCPv6 relay agents and servers |
| `ff05::1:3` | All DHCPv6 servers at the site |
| `ff02::fb` | mDNS (multicast DNS) |
ff02::1 is the closest equivalent to an IPv4 broadcast. Every IPv6 node must listen on it. Routers sending Router Advertisements use ff02::1 as the destination, and hosts looking for a router send to ff02::2.
Solicited-node multicast addresses
Neighbor Discovery needs to resolve an IPv6 address to a link-layer address, the job ARP does in IPv4. ARP broadcasts to everyone. IPv6 instead sends the query to a solicited-node multicast address, so only a few hosts see it.
The address is built by appending the last 24 bits of the unicast address to the prefix ff02::1:ff00:0/104.
For fe80::21a:2bff:fe3c:4d5e, the last 24 bits are 3c:4d5e. The solicited-node address is ff02::1:ff3c:4d5e.
Every unicast address on an interface, whether link-local, global, or otherwise, gets its own solicited-node group. Different unicast addresses that share the same last 24 bits map to the same group. On a typical link, this means a query reaches the target and perhaps one or two hosts that happen to share those bits.
Mapping to Ethernet addresses
On Ethernet, a multicast IPv6 packet goes to a multicast MAC address. The mapping is simple: take 33:33 and append the last 32 bits of the IPv6 address.
ff02::1maps to33:33:00:00:00:01.ff02::1:ff3c:4d5emaps to33:33:ff:3c:4d:5e.
Because only 32 of the 112 group ID bits are used, different IPv6 groups can map to the same MAC address. The network card may then pass up a few packets that the IP layer later discards. This is why the IP layer always checks the full destination address.
Decoding multicast addresses in Python
The ipaddress module recognizes multicast with is_multicast. The script below extracts the flags and scope with bit shifts, and computes the solicited-node address and Ethernet MAC.
import ipaddress
SCOPES = {
0x1: "interface-local",
0x2: "link-local",
0x4: "admin-local",
0x5: "site-local",
0x8: "organization-local",
0xE: "global",
}
SOLICITED_BASE = int(ipaddress.IPv6Address("ff02::1:ff00:0"))
def describe(text):
addr = ipaddress.IPv6Address(text)
if not addr.is_multicast:
raise ValueError(f"{text} is not a multicast address")
value = int(addr)
flags = (value >> 116) & 0xF
scope = (value >> 112) & 0xF
name = SCOPES.get(scope, "unassigned or reserved")
print(f"{text} flags={flags:04b} scope={scope:x} ({name})")
def solicited_node(text):
low24 = int(ipaddress.IPv6Address(text)) & 0xFFFFFF
return ipaddress.IPv6Address(SOLICITED_BASE | low24)
def multicast_mac(text):
low32 = int(ipaddress.IPv6Address(text)) & 0xFFFFFFFF
octets = [(low32 >> shift) & 0xFF for shift in (24, 16, 8, 0)]
return "33:33:" + ":".join(f"{o:02x}" for o in octets)
describe("ff02::1") # flags=0000 scope=2 (link-local)
describe("ff05::2") # flags=0000 scope=5 (site-local)
describe("ff3e:40:2001:db8::1") # flags=0011 scope=e (global)
sn = solicited_node("fe80::21a:2bff:fe3c:4d5e")
print(sn) # ff02::1:ff3c:4d5e
print(multicast_mac(str(sn))) # 33:33:ff:3c:4d:5eSeeing multicast on a real host
On Linux, you can list the groups an interface has joined and ping the all-nodes group.
ip -6 maddr show
ping -6 -c 3 ff02::1%eth0Replace eth0 with your interface name. The output of ip -6 maddr show normally includes ff02::1, ff01::1, and one solicited-node address per unicast address.
Common errors
- Using a multicast address as a source. Packets with a multicast source are invalid and routers drop them.
- Expecting link-local multicast to cross a router. Scope
2is never forwarded. If a service must span subnets, it needs a wider scope or a relay. - Confusing scope with flags. In
ff02::1, the flags digit comes first (0) and the scope digit second (2). Reading them in the wrong order makesff20::1look link-local when it is not. - Blocking ICMPv6 and multicast in a firewall. Neighbor Discovery depends on solicited-node multicast. Dropping it stops address resolution, and hosts on the link lose connectivity.
- Assuming a group maps to a unique MAC. Only 32 bits go into the MAC address, so collisions are normal and harmless.
Summary of the working model
A multicast address has three parts you can read at a glance: the ff prefix, a flags digit, and a scope digit. The scope decides how far the packet can go. Well-known groups handle infrastructure tasks that IPv4 did with broadcast. Solicited-node groups let Neighbor Discovery reach one host without bothering the rest of the link.
Exercise
A host has the global address 2001:db8:1:1::abcd:1234. What is its solicited-node multicast address, and what Ethernet MAC address does a frame sent to that group use?
Show answer
The last 24 bits of the address are cd:1234 padded to 24 bits, which is cd:1234 read as the groups abcd:1234, so the low 24 bits are cd:1234. Appending them to ff02::1:ff00:0/104 gives ff02::1:ffcd:1234. The Ethernet MAC address is 33:33 followed by the last 32 bits of that IPv6 address, ff:cd:12:34, so it is 33:33:ff:cd:12:34.
Exercise
What do the flags and scope tell you about the address ff15::1:3, and would a router forward it off the local link?
Show answer
The third hex digit 1 is the flags field, giving 0001, so the T bit is set and the group is transient. The fourth digit 5 is the scope, which means site-local. A router may forward it within the site, because its scope is wider than link-local. It must not forward it beyond the site boundary.