IGMP (Internet Group Management Protocol)
What it is for
Multicast means one copy of data for a group of receivers -- IPTV, for instance. But how does a router know who wants it?
★★★ IGMP is how a host raises its hand: "I want group 239.1.1.1". The router records that and only forwards where someone asked.
★★ Note it only answers who wants it; building the distribution tree is PIM's job.
★ The switch has to eavesdrop
★★★ IGMP is a conversation between hosts and routers; a switch is not a party to it.
★★★ But a switch is a layer-2 device and a multicast MAC looks much like broadcast to it -- untreated, it floods every port and multicast degenerates into broadcast.
★★★ Hence IGMP snooping: the switch peeks at the IGMP messages hosts send, records which ports asked for which group, and forwards only there.
★ Common misconceptions
★★★ "Enabling multicast stops the flooding" -- without IGMP snooping on the switch, multicast still floods every port. The most common performance problem in multicast deployments.
★★ "IGMP builds the multicast tree" -- it does not. It only reports who wants it on this subnet; the tree across routers is built by PIM.
★★ "The router knows immediately when a host leaves" -- v2 added a Leave message, but a query still confirms it; without Leave the router waits for a timeout.