MLD Snooping
Fundamentals
MLD snooping is a basic IPv6 Layer 2 multicast function that forwards and controls multicast traffic at Layer 2. MLD snooping runs on a Layer 2 device and analyzes MLD messages exchanged between a Layer 3 device and hosts to set up and maintain a Layer 2 multicast forwarding table. The Layer 2 device forwards multicast packets based on the Layer 2 multicast forwarding table.
On an IPv6 multicast network shown in Figure 10-2, after receiving multicast packets from Router, Switch at the edge of the access layer forwards the multicast packets to receiver hosts. If Switch does not run MLD snooping, it broadcasts multicast packets at Layer 2. After MLD snooping is configured, Switch forwards multicast packets only to specified hosts.
With MLD snooping configured, Switch listens on MLD messages exchanged between Router and hosts. It analyzes packet information (such as packet type, group address, and receiving interface) to set up and maintain a Layer 2 multicast forwarding table, and forwards multicast packets based on the Layer 2 multicast forwarding table.
Concepts
As shown in Figure 10-3, Router connects to the multicast source. MLD snooping is configured on SwitchA and SwitchB. HostA, HostB, and HostC are receiver hosts.
Figure 10-3 shows MLD snooping ports. The following table describes these ports.
Port Role |
Function |
Generation |
---|---|---|
Router port Ports marked as blue points on SwitchA and SwitchB. NOTE:
A router port is a port on a Layer 2 multicast device and connects to an upstream multicast router. |
A router port receives multicast packets from a Layer 3 multicast device such as a designated router (DR) or MLD querier. |
|
Member port Ports marked as yellow points on SwitchA and SwitchB. |
A member port is a member of a multicast group. A Layer 2 multicast device sends multicast data to the receiver hosts through member ports. |
|
The router port and member port are outbound interfaces in Layer 2 multicast forwarding entries. A router port functions as an upstream interface, while a member port functions as a downstream interface. Port information learned through protocol packets is saved as dynamic entries, and port information manually configured is saved as static entries.
Besides the outbound interfaces, each entry includes multicast group addresses and VLAN IDs.
Implementation
After MLD snooping is configured, the Layer 2 multicast device processes the received MLD protocol packets in different ways and sets up Layer 2 multicast forwarding entries.
MLD Working Phase |
MLD Message Received on a Layer 2 Device |
Processing Method |
---|---|---|
General query The MLD querier periodically sends General Query messages to all hosts and the router (FF02::1) on the local network segment, to check which multicast groups have members on the network segment. |
MLD General Query message |
A Layer 2 device forwards MLD General Query messages to all ports excluding the port receiving the messages. The Layer 2 device processes the receiving port as follows:
NOTE:
By default, the Layer 2 device sets the aging time to 180 seconds when the router port receives an MLD General Query message. You can set the aging time using a command. |
Membership report Membership Report messages are used in two scenarios:
|
MLD Report message |
A Layer 2 device forwards an MLD Report message to all router ports in a VLAN. The Layer 2 device obtains the multicast group address from the Report message and performs the following operations on the port receiving the message:
NOTE:
Aging time of a dynamic router port = Robustness variable x General query interval + Maximum response time for General Query messages |
Leave of multicast members There are two phases:
|
MLD Leave message |
The Layer 2 device determines whether the multicast group matches a forwarding entry and whether the port that receives the message is in the outbound interface list.
The following assumes that the port receiving an MLD Leave message is a dynamic member port. Within the aging time of the member port:
|
Multicast-Address-Specific Query/Multicast-Address-and-Source-Specific Query message |
A Multicast-Address-Specific Query/Multicast-Address-and-Source-Specific Query message is forwarded to the ports connected to members of specific groups. A Multicast-Address-Specific Query/Multicast-Address-and-Source-Specific Query message is forwarded to the ports connected to members of specific groups. |
- If the port is included in the router port list, the device resets the aging timer of the router port.
- If the port is not in the router port list, the device adds it to the list and starts the aging timer.
When the Layer 2 device receives an IPv6 PIM Hello message, it sets the aging time of the router port to the Holdtime value in the Hello message.
If a static router port is configured, the Layer 2 device forwards received MLD Report and Done messages to the static router port. If a static member port is configured for a multicast group, the Layer 2 device adds the port to the outbound interface list for the multicast group.
After a Layer 2 multicast forwarding table is set up, the Layer 2 device searches the multicast forwarding table for outbound interfaces of multicast data packets according to the VLAN IDs and destination addresses (IPv6 group addresses) of the packets. If outbound interfaces are found for a packet, the Layer 2 device forwards the packet to all the member ports of the multicast group. If no outbound interface is found, the Layer 2 device drops the packet or broadcasts the packet in the VLAN.