How MLD snooping works
A switch that is running MLD snooping performs different actions when it receives different MLD messages.
NOTE: The description about adding or deleting a port in this section is only for a dynamic port. Static ports can be added or deleted only through the corresponding configurations. For more information, see "Configuring static ports." | ||
General queries
The MLD querier periodically sends MLD general queries to all hosts and routers—FF02::1—on the local subnet to determine whether IPv6 multicast group members exist on the subnet.
After receiving an MLD general query, the switch forwards it through all ports in the VLAN except the port that received the MLD query. The switch performs the following judgment:
If the port that received the MLD query is a dynamic router port in its router port list, the switch resets the aging timer for this dynamic router port.
If the port is not included in its router port list, the switch adds it into its router port list as a dynamic router port and sets an aging timer for it.
Membership reports
A host sends an MLD report to the MLD querier in the following circumstances:
If the host has been a member of an IPv6 multicast group, after receiving an MLD query, the host responds with an MLD report.
If the host wants to join an IPv6 multicast group, the host sends an MLD report to the MLD querier to announce that it is interested in the multicast information addressed to that IPv6 multicast group.
After receiving an MLD report, the switch forwards it through all the router ports in the VLAN, resolves the address of the reported IPv6 multicast group, and performs the following to the receiving port:
If no forwarding table entry exists for the reported IPv6 multicast group, the switch creates an entry, adds the port as a dynamic member port to the outgoing port list, and starts a member port aging timer for that port.
If a forwarding table entry exists for the reported IPv6 multicast group, but the port is not included in the outgoing port list for that group, the switch adds the port as a dynamic member port to the outgoing port list, and starts a member port aging timer for that port.
If a forwarding table entry exists for the reported IPv6 multicast group and the port is included in the outgoing port list, which means that this port is already a dynamic member port, the switch resets the member port aging timer for that port.
NOTE: A switch does not forward an MLD report through a non-router port. This is because if the switch forwards a report message through a member port, all the attached hosts listening to the reported IPv6 multicast address will suppress their own reports upon receiving this report according to the MLD report suppression mechanism for hosts, and this will prevent the switch from knowing whether the reported multicast group still has active members attached to that port. | ||
Done messages
When a host leaves an IPv6 multicast group, the host sends an MLD done message to the multicast router.
When the switch receives an MLD done message on a dynamic member port, the switch first determines whether a forwarding table entry for the IPv6 multicast group address in the message exists, and, if one exists, whether the outgoing port list contains the port.
If the forwarding table entry does not exist or if the outgoing port list does not contain the port, the switch discards the MLD done message instead of forwarding it to any port.
If the forwarding table entry exists and the outgoing port list contains the port, the switch forwards the MLD done message to all router ports in the native VLAN. Because the switch has not determined whether any other hosts attached to the port are still monitoring that IPv6 multicast group address, the switch does not immediately remove the port from the outgoing port list of the forwarding table entry for that group. Instead, it resets the aging timer for the port.
After receiving an MLD done message from a host, the MLD querier resolves the IPv6 multicast group address in the message and sends an MLD multicast-address-specific query to that IPv6 multicast group address through the port that received the MLD done message. After receiving the MLD multicast-address-specific query, the switch forwards it through all the router ports in the VLAN and all member ports for that IPv6 multicast group, and performs the following to the receiving port:
If any MLD report in response to the MLD multicast-address-specific query is received on the port—suppose it is a dynamic member port—before its aging timer expires, this means that some host attached to the port is receiving or expecting to receive IPv6 multicast data for that IPv6 multicast group. The switch resets the aging timer for the port.
If no MLD report in response to the MLD multicast-address-specific query is received on the port before its aging timer expires, this means that no hosts attached to the port are still monitoring that IPv6 multicast group address. The switch removes the port from the outgoing port list of the forwarding table entry for that IPv6 multicast group when the aging timer expires.