How IGMP snooping works
IGMP message types include: Query, Report (Join), and Leave Group. An IGMP snooping enabled Layer 2 device performs differently depending on the message type.
A message sent from the querier (multicast router or switch) asking for a response from each host belonging to the multicast group. If a multicast router supporting IGMP is not present, then the switch must assume this function in order to elicit group membership information from the hosts on the network.
The IGMP querier periodically sends IGMP general queries to all hosts and routers on the local subnet to check for the existence of multicast group members. After receiving an IGMP general query, the snooping switch forwards the query to all ports in the VLAN except the receiving port.
A message sent by a host to the querier to indicate that the host wants to be or is a member of a given group indicated in the report message.
A host sends an IGMP report to the IGMP querier for the following purposes:
- Responds to queries if the host is a multicast group member.
- Applies for a multicast group membership.
After receiving an IGMP report from a host, the snooping switch forwards the report through all the router ports in the VLAN. It also looks up the forwarding table for a matching entry as follows:
- If no match is found, the snooping switch creates a forwarding entry with the receiving port as an outgoing interface. It also starts group membership expiry timer for the port to track the amount of time that must pass before a multicast router decides there are no more members of a group on a network.
- If a match is found but the matching forwarding entry does not contain the receiving port, the snooping switch adds the receiving port to the outgoing interface list. It also starts group membership expiry timer for the port.
- If a match is found and the matching forwarding entry contains the receiving port, the snooping switch restarts the group membership expiry timer for the port.
A message sent by a host to the querier to indicate that the host has ceased to be a member of a specific multicast group.
An IGMPv1 receiver host does not send any leave messages when it leaves a multicast group. The snooping switch cannot immediately update the status of the port that connects to the receiver host. The snooping switch does not remove the port from the outgoing interface list in the associated forwarding entry until the group membership timer expires.
An IGMPv2 or IGMPv3 host sends an IGMP leave message when it leaves a multicast group. Upon receiving leave message, the switch forwards the IGMP leave message to all router ports in the VLAN . IGMP querier then sends an IGMP group-specific query to the multicast group to identify whether the group has active receivers attached to the receiving port.
After receiving the IGMP group-specific query, the switch forwards the query through all router ports and member ports of the group in the VLAN. Then, it waits for the responding IGMP report message from the directly connected hosts. If the port does not receive an IGMP report message when the group membership timer expires, the snooping switch removes the port from the forwarding entry for the multicast group.