The format of IGMPv2 messages is shown in
Figure
. Notice that the Type field has been merged with the IGMPv1
Version field and now occupies a full octet. The values assigned to
the various message types have been chosen carefully to provide
backward compatibility with IGMPv1. Another field not used in IGMP Version 1 is the Maximum Response Time.
IGMP Version 2 adds two messages not found in
IGMP Version 1 to streamline the join and leave process. RFC 2236
added a Version 2 membership report and a leave group message. The
complete list of messages now consists of the following:
0x11-Membership query
0x12-Version 1 membership report
0x16-Version 2 membership report
0x17-Leave group
The membership query and Version 1 membership
report carry over from IGMP Version 1. However, the membership query
can now target specific multicast groups. In Version 1, the query
message is a general query with the group address set to 0.0.0.0.
All active groups respond to the general query. Version 2 allows a
multicast query router to target a specific multicast group. When it
sends this type of message, a multicast host running
Version 2 responds with a Version 2 membership report. Other
multicast groups ignore the group specific queries not
directed to their group. The group specific membership query works
only for Version 2 systems.
If a Version 2 host leaves a multicast
group, it sends an unsolicited leave group message to inform the
query router that it no longer desires to receive the multicast
stream. The router maintains a table of all hosts in the multicast
group on the segment. If other hosts still want to receive the
multicast stream, the router continues to send the multicast frames
onto the segment. If, however, the membership report arrives from
the last host on the segment for the multicast group, the router
terminates the multicast stream for that group.
Consider the
multicast group shown in Figure
. Hosts H2 and H3 are currently
members of multicast group 224.1.10.10, although Host H2 wants to
leave the group.
The sequence of events for Host H2 to leave the
group is as follows:
- Host H2 multicasts an IGMPv2 leave group
message to the All-Routes (224.0.0.2) multicast group to inform all
routers on the subnet that it is leaving the group.
- Router A
hears the leave group message from Host H2. However, because routers
keep a list only of the group memberships that are active on a
subnet, not individual hosts that are members, Router A sends a
group-specific query to determine whether any hosts remain for Group
224.1.1.1. Since this is a group-specific query, only hosts that are
members of the group will respond.
- Host H3 is still a member of
Group 224.1.1.1 and responds to the query with an IGMPv2 membership
report to inform the routers on the subnet that a member of this
group is still present. Host H3 is now the last remaining member of
the group.
- If Host H3 decides to leave, Steps 1 and 2 will be
repeated. However, when Router A issues a group-specific query, no
hosts will respond. As a result, Router A will time out the group
and stop forwarding packets for the group onto the subnet.
If at any
time the router wants to confirm its need to send the stream, it can
transmit a general or group-specific query onto the segment. If it
does not receive any responses to a couple of query messages, the
router assumes no more hosts want to receive the multicast stream.
Another feature of IGMP Version 2 affects the method for selecting
the query router. In Version 1, the query router is selected by the
multicast routing protocol. The designated router for the protocol
becomes the querying router. In Version 2, the IP address determines the
query router. The multicast router with the lowest IP address
becomes the query router. All routers initially assume that they are
the query router and send a query message. If a router hears a query
message from another multicast router with a lower IP address, the
router becomes a nonquerying router.
A final feature added to IGMP
Version 2 is the capability for the multicast router to specify the
response timer range of the hosts. Remember that when a host
receives a membership query, the host starts a random timer. The
timer value is in the range of 0 to maximum response time, with the
maximum response time specified in the router query message. Version
2 allows you to configure the upper range of the timer to a maximum
of 25 seconds. The default in a router is 10 seconds.