The leave group message is new to IGMPv2 and is the most
meaningful improvement to the protocol.
The leave message is an unsolicited message that the client sends whenever it no
longer wants to receive multicast traffic on a given group.
The source address is the client's IP address and
the destination is 224.0 .0 .2, so that all multicast routers hear it.
This ensures that even those that may not have processed its previous
membership reports get the message that it wants multicast to stop.
Because this is a completely new message,
it has its own IGMP type of 17 in hex or 23 in decimal.
The maximum response time remains 0, as it makes no sense in this context.
Just like an IGMP membership report,
it contains the group address that the client wishes to leave.
The message effectively says I previously joined 239.1 .1 .1,
but now I'm finished; please stop sending.
Some of you might be thinking about the problem this leave message can create.
What happens if there are other hosts on the LAN segment
that still want multicast for 239.1 .1 .1?
If the router blindly obeys this leave message,
the other receivers will be starved.
Fortunately for us,
the designers of IGMPv2 wisely created a mechanism
to protect against such a case.
Recycling the IGMP membership query once again,
IGMPv2 capable routers can respond to the leave message by checking to see if
any other clients still want multicast for a given group.
If at least one receiver responds with a membership report answering yes,
I still want multicast on group 239.1 .1 .1,
then the router will continue to send it.
This query is a little different.
First,
the destination address targets the specific group address
identified in the leave message that signaled it.
In this case,
the group-specific query is sent to 239.1 .1 .1 so as not to disturb other
multicast clients not listening on this group at all.
The packet details vary slight from a general query.
The type remains 11 in hex or 17 in decimal, so let's move on.
The maximum response time has been reduced from 2.5 seconds to 1 second,
giving any interested receivers less time to respond.
This makes sense because the router doesn't want to pump multicast
onto a LAN when there are no interested clients.
This forces clients to quickly say please keep sending it.
The multicast address is set to the group address that is being queried against.
So far,
the membership queries have always carried multicast addresses set to 0.0 .0 .0.
This query is special, since it is triggered by client actions and is generally not sent periodically.