Multicast Listener Discovery Version 2 (MLDv2) for IPv6
obsoleted by
- rfc-9777 — Multicast Listener Discovery Version 2 (MLDv2) for IPv6
updated by
- rfc-4604 — Using Internet Group Management Protocol Version 3 (IGMPv3) and Multicast Listener Discovery Protocol Version 2 (MLDv2) for Source-Specific Multicast
updates
- rfc-2710 — Multicast Listener Discovery (MLD) for IPv6
Extracted elements (28)
A router in EXCLUDE mode maintains a Requested List (tracking INCLUDE-mode listener interests) in addition to the Exclude List, enabling a seamless transition to INCLUDE mode when all EXCLUDE-mode listeners depart. Without the Requested List, the transition would interrupt traffic to nodes that had been using INCLUDE-mode source filtering.
The distinction between Current State Reports and State Change Reports is required so routers only trigger the fast-leave mechanism (sending Multicast Address Specific Queries) in response to State Change Reports. Treating all reports as potential state changes would cause fast leave to fail when a State Change Report is lost and only the subsequent Current State Report is received.
MLDv2 interoperates with MLDv1 (RFC 2710) via a per-interface Host Compatibility Mode variable. When MLDv1 routers are detected on a link, nodes switch to MLDv1 compatibility mode. MLDv2 implementations must support Version 1 Multicast Listener Report (Type 131) and Version 1 Multicast Listener Done (Type 132).
A node MUST accept and process any Query whose IP Destination Address contains any address (unicast or multicast) assigned to the receiving interface, even if the address differs from the standard query destination. Similarly for version 1 Reports.
All MLDv2 messages MUST be sent with a link-local IPv6 Source Address, an IPv6 Hop Limit of 1, and an IPv6 Router Alert option in a Hop-by-Hop Options header. MLDv2 Reports may additionally use the unspecified address (::) as source if no valid link-local address has been acquired.
All MLDv2 Queries MUST be sent with a valid IPv6 link-local source address. If a node receives a Query with the source address set to the unspecified address (::) or any non-link-local address, it MUST silently discard the message and SHOULD log a warning.
An implementation MUST NOT use an EXCLUDE interface record for a multicast address if all sockets for that address are in INCLUDE state. If system resource limits are exceeded when computing per-interface source lists, an error MUST be returned to the requesting application.
If additional octets beyond the defined fields are present in a received Query or Report, implementations MUST include those octets in checksum verification but MUST otherwise ignore them. When sending, implementations MUST NOT include additional octets beyond the defined fields.
MLDv2 implementations MUST NOT include auxiliary data in transmitted Multicast Address Records (Aux Data Len MUST be set to zero), and MUST ignore any auxiliary data present in received records. Auxiliary data semantics are reserved for future MLD versions or extensions.
Unrecognized MLDv2 message types MUST be silently ignored. Multicast Address Records with unrecognized Record Type values MUST be silently ignored, with the rest of the report continuing to be processed.
Upon reception of a Query, the node MUST verify: the source address is a valid link-local address, the Hop Limit is 1, and the Router Alert option is present in the Hop-by-Hop Options header. If any check fails, the packet is dropped without further processing.
Version 2 Multicast Listener Reports MUST be sent to the all-MLDv2-capable-routers address FF02::16. Routers MUST silently discard Reports not sent with a valid link-local source address, preventing unidentified nodes from influencing MLDv2 router state.
When a packet is received, the ICMPv6 checksum MUST be verified before processing. The checksum covers the entire MLDv2 message plus a pseudo-header of IPv6 header fields; the Checksum field is set to zero for computation.
MLDv2 defines six Multicast Address Record types in Reports: Current State Records MODE_IS_INCLUDE (1) and MODE_IS_EXCLUDE (2); Filter Mode Change Records CHANGE_TO_INCLUDE_MODE (3) and CHANGE_TO_EXCLUDE_MODE (4); Source List Change Records ALLOW_NEW_SOURCES (5) and BLOCK_OLD_SOURCES (6).
MLDv2 extends MLDv1 by adding source filtering: nodes can express interest in a multicast address only from specific sources (INCLUDE mode) or from all sources except specific ones (EXCLUDE mode). This enables Source-Specific Multicast (SSM) as required by RFC 3569.
Per-interface multicast listening state is derived from per-socket state: if any socket for a (interface, multicast address) pair is in EXCLUDE mode, the interface record is EXCLUDE with the intersection of all EXCLUDE source lists minus sources in any INCLUDE socket. If all sockets are INCLUDE, the interface record is INCLUDE with the union of all source lists.
State Change Reports are retransmitted [Robustness Variable] times total to ensure delivery despite packet loss. If further state changes occur before all retransmissions complete, a new merged State Change Report is immediately transmitted and supersedes pending retransmissions. The default Robustness Variable is 2, making MLD robust to [Robustness Variable]-1 packet losses.
The IPv6MulticastListen(socket, interface, IPv6 multicast address, filter mode, source list) service interface enables upper-layer protocols to request multicast reception with source filtering. EXCLUDE with empty source list is equivalent to MLDv1 Start Listening; INCLUDE with empty source list is equivalent to Stop Listening.
The QRV (Querier's Robustness Variable) field in a Query carries the Querier's Robustness Variable value (capped at 7; set to 0 if it exceeds 7). Non-querier routers adopt the QRV value from the most recently received Query as their own Robustness Variable, falling back to the default if QRV was zero.
The S Flag (Suppress Router-Side Processing) in a Query instructs receiving multicast routers to suppress normal timer updates upon receiving the Query, without suppressing querier election or host-side processing. It is set in subsequent query retransmissions to avoid re-lowering timers that were already updated by a valid host response.
Three Query variants exist: a General Query (Multicast Address field = 0, N = 0) sent to FF02::1 to discover all multicast listeners; a Multicast Address Specific Query (specific address, N = 0); and a Multicast Address and Source Specific Query (specific address, N > 0 source addresses), both sent to the queried multicast address.
IANA assigned ICMPv6 Type 143 for the Version 2 Multicast Listener Report message type. The all-MLDv2-capable-routers IPv6 multicast address FF02::16 was assigned by IANA as the mandatory destination for MLDv2 Reports.
MLD is vulnerable to attacks by on-link nodes: a malicious node can forge membership reports to cause routers to forward unwanted multicast traffic, or forge leave messages to stop delivery of wanted traffic. Use of IPsec Authentication Header is recommended to authenticate MLD messages, though it is complicated by MLD's link-local addressing requirements.
A multicast router's per-address filter mode transitions between INCLUDE(A) and EXCLUDE(X,Y) states. INCLUDE→EXCLUDE triggers when the first EXCLUDE-mode listener report is received (Filter Timer set). EXCLUDE→INCLUDE triggers when the Filter Timer expires (no more EXCLUDE-mode listeners), whereupon the Requested List X becomes the new Include List and Exclude List Y is deleted.
The Maximum Response Code field uses floating-point encoding for values >= 32768: the 16-bit field is split into a 1-bit flag, 3-bit exponent, and 12-bit mantissa, yielding Maximum Response Delay = (mant | 0x1000) << (exp+3) milliseconds. Values below 32768 are used directly in milliseconds.
The Multicast Listener Query message (ICMPv6 Type 130) contains: Type (8 bits), Code (8 bits), Checksum (16 bits), Maximum Response Code (16 bits), Reserved (16 bits), Multicast Address (128 bits), Resv/S/QRV (8 bits), QQIC (8 bits), Number of Sources N (16 bits), followed by N 128-bit Source Address fields.
The QQIC (Querier's Query Interval Code) field uses floating-point encoding for values >= 128: the 8-bit field is split into a 1-bit flag, 3-bit exponent, and 4-bit mantissa, yielding QQI = (mant | 0x10) << (exp+3) seconds. Values below 128 are used directly in seconds.
The Version 2 Multicast Listener Report (ICMPv6 Type 143) contains: Type (8 bits), Reserved (8 bits), Checksum (16 bits), Reserved (16 bits), Nr of Mcast Address Records M (16 bits), followed by M variable-length Multicast Address Records each containing Record Type, Aux Data Len, Number of Sources N, Multicast Address (128 bits), N source addresses, and optional Auxiliary Data.