IPv6 multicast on the LAN and MLD
Decode IPv6 multicast addresses (flags and scope) and map them to Ethernet MAC addresses. List the multicast groups a normal host joins and explain why ND depends on them. Describe MLDv2 messages, the querier, and its timers, and calculate them. Explain MLD snooping and diagnose snooping problems on a Linux bridge.
Take the quiz · pass mark 70% · 10 questions
Explanation
IPv6 has no broadcast. Everything that IPv4 did with broadcast (ARP, DHCP discovery, router discovery) uses multicast in IPv6. A LAN that handles multicast badly therefore breaks basic IPv6 functions, not only video streaming. This lesson covers the addresses, the Ethernet mapping, the Multicast Listener Discovery protocol (MLDv2, RFC 9777) and switches that snoop it (RFC 4541).
Multicast address format (RFC 4291)
| 8 bits | 4 bits | 4 bits | 112 bits |
| 11111111 | flags | scope | group ID |
- Flags
0RPT: T=1 means a transient (not IANA-assigned) group, P=1 a unicast-prefix-based group, R=1 an embedded rendezvous point.ff0x::groups are well known,ff1x::transient. - Scope: 1 interface-local, 2 link-local, 4 admin-local, 5 site-local, 8 organisation-local, e global.
Groups every IPv6 LAN uses:
| Group | Meaning |
|---|---|
ff02::1 | All nodes on the link |
ff02::2 | All routers |
ff02::16 | All MLDv2-capable routers (where MLDv2 Reports go) |
ff02::1:2 | All DHCPv6 relay agents and servers |
ff02::fb | mDNS |
ff02::1:ffXX:XXXX | Solicited-node group for each unicast address (last 24 bits) |
ff05::1:3 | All DHCPv6 servers (site scope) |
Mapping to Ethernet (RFC 2464)
The destination MAC for an IPv6 multicast packet is 33:33 followed by the last 32 bits of the group address. ff02::1 maps to 33:33:00:00:00:01, and the solicited-node group ff02::1:ff00:25 to 33:33:ff:00:00:25. Because only 32 bits are used, different groups can share a MAC (for example ff02::1:ff00:25 and ff05::1:ff00:25), and the IP layer filters the rest.
Which groups does a host join?
A host joins ff02::1 (implicitly, without reports), plus a solicited-node group for each unicast and anycast address, plus whatever its services need (for example ff02::fb for mDNS). Routers also join ff02::2, and DHCPv6 servers and relays join ff02::1:2. Addresses that share their last 24 bits share a solicited-node group. A host with an EUI-64 link-local and an EUI-64 global address joins one group for both, while temporary addresses usually add a group each.
On Linux, ip -6 maddr show dev eth0 lists the groups. On Windows, netsh interface ipv6 show joins.
MLDv2 (RFC 9777)
MLD runs inside ICMPv6. Every MLD message is sent from a link-local address, with Hop Limit 1 and a Router Alert option (RFC 2711) in a Hop-by-Hop header, so routers inspect it.
| Type | Message | Sent to |
|---|---|---|
| 130 | Multicast Listener Query | ff02::1 (General Query) or the group (specific queries) |
| 143 | Version 2 Multicast Listener Report | ff02::16 |
| 131 / 132 | MLDv1 Report / Done | Only for MLDv1 compatibility |
MLDv2 Reports can say "I want group G from any source except these" (EXCLUDE mode) or "only from these sources" (INCLUDE mode). INCLUDE mode is what Source-Specific Multicast needs.
The Querier. One router per link sends periodic General Queries. All routers start as Querier and the one with the lowest link-local address (compared by interface identifier) wins. The others stay quiet until no query has been heard for the Other Querier Present Interval.
| Timer (RFC 9777) | Default or formula |
|---|---|
| Robustness Variable (RV) | 2 |
| Query Interval (QI) | 125 s |
| Query Response Interval (QRI) | 10 s |
| Multicast Address Listening Interval (MALI) | RV × QI + 2 × QRI |
| Other Querier Present Interval | RV × QI + 0.5 × QRI |
| Startup Query Interval | QI / 4 |
| Last Listener Query Interval | 1 s, sent RV times |
| Unsolicited Report Interval | 1 s |
Hosts answer a General Query after a random delay up to QRI. When a host joins a group it sends an unsolicited Report immediately and repeats it.
MLD snooping (RFC 4541)
Without snooping, a switch floods all multicast to all ports in the VLAN. An MLD snooping switch listens to Reports and Queries and forwards each group only to ports with listeners, plus ports towards multicast routers (the port where the Querier is). RFC 4541 says packets to ff02::1 must still go to all ports, because hosts never report it.
The risk: snooping switches build their tables from Reports, and hosts only repeat Reports when asked by a Query. If there is no Querier on the VLAN, memberships time out on some switches, and traffic to solicited-node groups stops being forwarded. The symptom is that Neighbor Discovery fails minutes after hosts come up: new connections fail while existing ones (with cached neighbours) keep working. Fixes are:
- make sure a Querier exists: the router, or a switch with its querier function enabled
- or configure the switch to flood link-local scope (
ff02::/16) traffic, which many switches do by default
Behaviour without a querier varies between switch vendors and even firmware versions. The Linux bridge, for example, floods multicast when it has not seen a querier, so it fails safe. Test your own switches.
On the Linux bridge:
ip -d link show br0 | grep -o 'mcast_snooping [01]\|mcast_querier [01]'
ip link set br0 type bridge mcast_snooping 1 mcast_querier 1
bridge mdb show dev br0
Drawing diagram…
Worked examples
Example 1: Multicast MAC addresses
ff02::2→33:33:00:00:00:02ff02::1:ff01:12c(VPS 300's::1:12caddress) →33:33:ff:01:01:2cff05::1:3→33:33:00:01:00:03
Example 2: MALI
RV = 2, QI = 125 s, QRI = 10 s: MALI = 2 × 125 + 2 × 10 = 270 s. A router stops forwarding a group 270 s after the last Report if hosts leave silently.
Example 3: Other Querier Present Interval
2 × 125 + 0.5 × 10 = 255 s. If the Querier dies, another router takes over after about 4 minutes, and snooping switches that need a Querier can lose state in that window.
Example 4: Counting solicited-node groups
A VPS has fe80::5054:ff:fe12:3456, 3fff:a00:1003:12c:5054:ff:fe12:3456 and a temporary address 3fff:a00:1003:12c:a1b2:c3d4:e5f6:789a. The first two share their last 24 bits (12:3456), so the host joins 2 solicited-node groups: ff02::1:ff12:3456 and ff02::1:fff6:789a.
Example 5: Decoding a group
ff15::db8:1 has flags 1 (T=1, transient) and scope 5 (site-local): a transient site-scoped group, as used in this lesson's lab.
Lab
Goal: Watch MLD build a Linux bridge's multicast table, then break and fix ND by removing the Querier.
You need: The L3.01 bridge with namespaces r1, h1, h2, plus a third host h3. tcpdump, socat.
Step 1: Groups and Reports
sudo ip -n h1 -6 maddr show dev eth0
sudo tcpdump -ni br0 'ip6[6] == 0 and (ip6[48] == 130 or ip6[48] == 143)'
MLD packets carry an 8-byte Hop-by-Hop header (next header 0 in byte 6 of the IPv6 header), so the ICMPv6 type is at offset 48, not 40, and the plain icmp6 primitive does not match them because it only checks the first next header. Explain this in your notes. Record the groups h1 joins and map two of them to MAC addresses.
Step 2: Snooping with a Querier
sudo ip link set br0 type bridge mcast_snooping 1 mcast_querier 1
sudo bridge mdb show dev br0
Bring the bridge's own interface IPv6 up so it can send queries from a link-local address. Record the mdb entries and which port each group points to.
Step 3: Application multicast
In h2, join ff15::db8:1 and listen:
sudo ip netns exec h2 socat -u UDP6-RECV:5000,reuseaddr,ipv6-join-group='[ff15::db8:1]:eth0' -
From h1, send to it (socat -u - UDP6-SENDTO:[ff15::db8:1%eth0]:5000). Capture on the h3 port and show that h3 does not receive the traffic, while h2 does.
Step 4: No Querier
Turn off mcast_querier, wait longer than the membership interval, and repeat step 3 and an ND test. Record how the Linux bridge behaves (it floods when it has seen no querier). Explain how a switch that instead drops unknown groups would break ND, and what you would change on it.
What to submit
Outputs and captures for each step, the MAC mappings, and your explanation of the no-Querier case.
Summary
- Multicast addresses:
ff+ flags + scope + group ID. Scope 2 is link-local. Ethernet MAC =33:33+ last 32 bits. - Every host joins
ff02::1and a solicited-node group per address, so ND depends on multicast working. - MLDv2 (RFC 9777) uses Queries (130) and v2 Reports (143, to
ff02::16), sent from link-local, Hop Limit 1, with Router Alert. The lowest link-local address is Querier. - Defaults: RV 2, QI 125 s, QRI 10 s, MALI 270 s, Other Querier Present 255 s.
- MLD snooping without a Querier can break ND on some switches. Make sure each VLAN has a Querier.
- Next lesson (L3.06): configuring IPv6 on each operating system.
Quiz imported · 10 questions · pass mark 70%. Lab questions are not auto-marked.