While PIM controls the communication between multicast routers, IGMP is the control protocol between routers and hosts. IGMP is similar with ICMP and it has IP protocol number 2. Because the intention is the communcation between hosts and routers, it is only sent as a link-local packet that has TTL of 1 in the IP packet header.
There are three versions of IGMP: IGMPv1 (RFC 1112), IGMPv2 (RFC 2236), and IGMPv3 (RFC 3376). IGMPv1 is outdated and IGMPv2 is now commonly used while IGMPv3 is used specifically for Source Specific Multicast (SSM).
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Max Resp Time | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Group Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Looking at the Type field, there are four types of IGMP messages.
- 0x11 = Membership Query. There are two sub-types of Membership Query messages:
- General Query.
- Group-Specific Query.
- 0x16 = IGMPv2 Membership Report.
- 0x17 = Leave Group.
- 0x12 = IGMPv1 Membership Report.
The steps of a host to join a multicast group are below.
- In a network with multiple multicast routers, there is only one Querier (lowest IP address) responsibles to send Query messages. If within period of time (Other Querier Present Interval) the other router does not hear the Query messages, it must assume the the role of the Querier. In Cisco IOS, the default value of Other Querier Present Interval is twice of the Query Interval (2 x 60 seconds).
- The designated Querier sends General Query message to check whether there are any member present or left in the subnet. The Multicast Address will be set to all-zeros (0.0.0.0) and Destined to 184.108.40.206 (all-systems multicast group) and has a Max Response Time of Query Response Interval. By default General Query message is sent every 60 seconds (Query Interval) and can be change with command
ip igmp query-interval <0-65535>.
The Max Response Time is the maximum amount of time the host has to respond to the query. The default value is 10 seconds and can be changed with command
ip igmp query-max-response-time <0-255>where 0-255 is value in tenth of seconds (max value is 25.5 seconds).
- When a host receives a General Query message, it sets the random delay timer between 0 and Max Response Time.
- In the absent of General Query message (or the Max Reponse Time is timed out) and if the host is the first member of that group, the host should send IGMPv2 Membership Report to a particular multicast group with IP TTL of 1. If the router does not receive within 3 times the Query Interval (3 x 60 seconds), the router declares that no active members of the group are on the subnet.
- When a host leaves a multicast group and if it was the last member of the group, it should send a Leave Group message. If it was not the last member of the group, it may send nothing.
- When the Querier receives a Leave Group message, it sends Group-Specific Query to the group. If no Reports are received, it will assume that there’s no more members for the group.
- The main differences between IGMPv1 and IGMPv2 are:
- IGMPv1 has no Leave Group message. It means that when a host leaves a group, the router may still be forwarding the group traffic.
- IGMPv1 has no Group-Specific Query.
- IGMPv1 does not specify a Max Reponse Time. Hosts have a fixed Max Response time of 10 seconds.
- IGMPv1 has no Querier election process.
IGMPv1 basically only has two IGMP messages. Membership Query (sent to 220.127.116.11) and Membership Reply (sent to the group).