Hi, community!
Today, I'm going to start working with you on multicast protocols. Multicast has always been considered a very difficult protocol to read. Perhaps, we can separate each multicast protocol, piece by piece to study it, this will be very helpful for our research. For multicast protocols, my suggestion is that we can start with the IGMP protocol, which is a protocol about multicast members.
What Is IGMP?
According to my understanding, the multicast protocol can be divided into two parts.
1. Multicast routing protocol (PIM-SM/PIM-DM) is used by routers on a multicast network.
2. Multicast group member protocol, used to maintain the relationship between routers and hosts. (IGMP/MLD)
IGMP is a protocol used to establish and maintain the relationship between the host and the querier. IGMP packets encapsulated in IP packets are transmitted over the link to maintain the relationship between the host and the querier. When new members of a multicast group need to join or leave the multicast group, the multicast group members send IGMP packets to the querier so that the querier knows the status of the multicast group members. IGMP has gone through three versions since its release. The latest version is IGMPv3. However, IGMPv3 is generally used in the SSM model. Let's understand the differences between IGMP versions.

Evolution of the IGMP protocol version
IGMPv1: indicates the initial version of IGMP. In IGMPv1, IGMPv1 contains only two types of packets.
The querier periodically sends query packets to the multicast group to check whether there are multicast group members. By default, the querier sends Query messages to a multicast group at an interval of 60 seconds. If the querier does not receive any response messages from a multicast group member, the querier considers that the multicast group does not have any member by default and does not forward subsequent multicast traffic to the multicast group.

IGMPV2: IGMPv2 is an evolution from IGMPv1. IGMPv2 adds a member leave packet and a group-specific query packet.
1. Member leave packet: When a member leaves, the multicast group member actively sends a leave packet to the querier, notifying the querier that the querier has left and does not need to send subsequent packets to me. The querier then sends a query packet to the group. In this way, you can check whether the multicast group still has members.
2. Group-specific query packet: The querier sends a query packet for a specific group. For example, the querier needs to check whether G2 has multicast group members. Then, the querier can send a Group-Specific Query message for the group to check whether there are multicast members in the group.

IGMPV3: IGMPv3 is generally used in our SSM model because IGMPv3 adds source-group-specific query packets. In our SSM model, source-group-specific query packets correspond to each other.
In IGMPv3, IGMPv2 discards the leave mechanism of IGMPv2 and divides packets into query packets and report packets.
1. Query packets are classified into general query packets, group-specific query packets, and source-group-specific query packets. For the last source-group-specific query packet, the querier sends the packet to the multicast group members to confirm whether the querier is willing to receive the data of a specific multicast source. The usage of the other two query packets is the same as that of IGMPv2.
2. The Report message contains the multicast groups that the host wants to join and the multicast sources that the host wants to receive. The filtering mode is added to the IGMPv3 packets, which can be used to filter multicast data packets. to select the required multicast source data.
We do not describe the IGMP packets in detail because we first need the principles, functions, and usage of the IGMP protocol. After we have mastered the basics, we can analyze the fields in IGMP packets. For example, how to identify the version of the packet.




