This is the most comprehensive summary of the IGMP protocol, bar none!

This is the most comprehensive summary of the IGMP protocol, bar none!

1. Introduction to IGMP

IGMP (Internet Group Management Protocol) is a protocol in the TCP/IP protocol suite responsible for IP multicast member management. It is used to establish and maintain multicast group membership between an IP host and its directly adjacent multicast routers.

[[255918]]

So far, there are three versions of IGMP:

  • IGMPv1 (defined by RFC 1112)
  • IGMPv2 (defined by RFC 2236)
  • IGMPv3 (defined by RFC 3376)

All versions of IGMP support the ASM (Any-Source Multicast) model; IGMPv3 can be directly applied to the SSM (Source-Specific Multicast) model, while IGMPv1 and IGMPv2 require the support of IGMP SSM Mapping technology to be applied to the SSM model.

IGMP Working Mechanism

1. IGMPv1 working mechanism

IGMPv1 mainly manages multicast group members based on the query and response mechanism. When there are multiple multicast routers in a network segment, they can all receive IGMP membership report messages from the host.

Therefore, it is sufficient for only one router to send an IGMP query message. At this time, a querier election mechanism is required to determine which router will serve as the IGMP querier.

For IGMPv1, the multicast routing protocol (such as PIM) elects a unique multicast information forwarder DR (Designated Router) as the IGMP querier.

IGMP query response diagram

As shown in the figure above, assuming that Host B and Host C want to receive multicast data sent to multicast group G1, and Host A wants to receive multicast data sent to multicast group G2, the basic process of hosts joining multicast groups and IGMP querier (Router B) maintaining multicast group membership is as follows:

1) The host will actively send an IGMP membership report message to the multicast group it wants to join to declare joining without having to wait for the IGMP query message sent by the IGMP querier;

2) The IGMP querier periodically sends IGMP query messages (destination address is 224.0.0.1) to all hosts and routers in the local network segment in multicast mode;

3) After receiving the query message, one of Host B and Host C that pays attention to G1 (depending on whose delay timer times out first), for example, Host B will first send an IGMP membership report message to G1 in multicast mode to declare that it belongs to G1.

Since all hosts and routers in the local network segment can receive the report message sent by Host B to G1, when Host C receives the report message, it will no longer send the same report message to G1, because the IGMP routers (Router A and Router B) already know that there are hosts interested in G1 in the local network segment.

This mechanism is called IGMP membership report suppression on hosts, which helps reduce the amount of information traffic on the local network segment;

4) At the same time, since Host A is concerned about G2, it will still send a report message to G2 in multicast mode to declare that it belongs to G2;

5) After the above query and response process, the IGMP router learns that there are members of G1 and G2 in the local network segment, so the multicast routing protocol (such as PIM) generates (*, G1) and (*, G2) multicast forwarding items as the basis for forwarding multicast data, where "*" represents any multicast source;

6) When the multicast data sent by the multicast source to G1 or G2 reaches the IGMP router through the multicast routing, since there are (*, G1) and (*, G2) multicast forwarding items on the IGMP router, the multicast data is forwarded to the local network segment, and the receiving host can receive the multicast data.

IGMPv1 does not specifically define messages for leaving a multicast group. When a host running IGMPv1 leaves a multicast group, it will not send a report message to the multicast group it is leaving. When there are no more members of the multicast group in the network segment, the IGMP router will not receive any report messages sent to the multicast group, so the IGMP router will delete the multicast forwarding item corresponding to the multicast group after a period of time.

2. Improvements to IGMPv2

Compared with IGMPv1, IGMPv2 adds the querier election mechanism and the leave group mechanism.

(1) Querier election mechanism

In IGMPv1, when there are multiple multicast routers on a shared network segment, the designated router elected by the multicast routing protocol (such as PIM) acts as the querier.

In IGMPv2, an independent querier election mechanism is added, and the election process is as follows:

  • All IGMPv2 routers initially consider themselves as queriers and send IGMP general query messages (destination address is 224.0.0.1) to all hosts and routers in the local network segment.
  • After receiving the message, other IGMPv2 routers in the local network segment compare the source IP address of the message with their own interface address. Through comparison, the router with the smallest IP address will become the querier, and the other routers will become non-queriers.
  • A timer (Other Querier Present Timer) is started on all non-queriers. If an IGMP query message is received from a querier before the timer expires, the timer is reset; otherwise, the original querier is considered invalid and a new querier election process is initiated.

(2) Leaving Group Mechanism

In IGMPv1, when a host leaves a multicast group, no notification is sent to the multicast router. As a result, the multicast router can only learn about the departure of a multicast group member by the timeout of the response to the multicast group member query.

In IGMPv2, when a host leaves a multicast group:

  • The host sends a Leave Group message to all multicast routers in the local network segment (destination address is 224.0.0.2);
  • When the querier receives the message, it sends a Group-Specific Query message to the multicast group that the host declares to leave (the destination address field and the group address field are both filled with the multicast group address to be queried);
  • If there are other members of the multicast group in the network segment, after receiving the specific group query message, these members will send a membership report message within the maximum response time (Max Response Time) set in the message;
  • If the querier receives membership report messages from other members of the multicast group within the maximum response time, it will continue to maintain the membership of the multicast group; otherwise, the querier will assume that there are no members of the multicast group in the network segment and will no longer maintain the membership of the multicast group.

3. Improvements to IGMPv3

IGMPv3 is compatible with and inherits IGMPv1 and IGMPv2, and further enhances the control capability of the host and the functions of query and report messages.

(1) Enhanced host control capabilities

IGMPv3 adds filtering modes (INCLUDE/EXCLUDE) for multicast sources, so that when a host joins a multicast group G, it can explicitly request to receive or reject multicast information from a specific multicast source S. When a host joins a multicast group:

  • If you want to receive only multicast information from specified multicast sources such as S1, S2, ..., then the report message can be marked as INCLUDE Sources (S1, S2, ...);
  • If the multicast information from a specified multicast source such as S1, S2, ... is refused to be received, the report message may be marked as EXCLUDE Sources (S1, S2, ...).

Specify the multicast stream path of the source group

As shown in the figure above, there are two multicast sources, Source 1 (S1) and Source 2 (S2), in the network, both sending multicast messages to multicast group G. Host B is only interested in the information sent from Source 1 to G, but not in the information from Source 2.

If IGMPv1 or IGMPv2 is running between the host and the router, Host B cannot select a multicast source when joining multicast group G. Therefore, multicast information from Source 1 and Source 2 will be delivered to Host B regardless of whether Host B needs it or not.

After IGMPv3 is running between the host and the router, Host B can request to receive only the multicast information from Source 1 and sent to G (S1, G), or request to reject the multicast information from Source 2 and sent to G (S2, G). In this way, only the multicast information from Source 1 can be delivered to Host B.

(2) Enhanced query and report functions

a. Query message carrying source address

IGMPv3 not only supports the general group query of IGMPv1 and the specific group query of IGMPv2, but also adds support for specific source group query:

  • The general group query message carries neither the group address nor the source address;
  • The specific group query message carries the group address but not the source address;
  • The specific source group query message carries both the group address and one or more source addresses.

b. Report message containing multiple sets of records

The destination address of the IGMPv3 report message is 224.0.0.22, and it can carry one or more group records. Each group record contains a list of multicast group addresses and multicast source addresses. Group records can be divided into multiple types, as follows:

  • IS_IN: Indicates that the filtering mode between the multicast group and the multicast source list is INCLUDE, that is, only multicast data sent to the multicast group from the specified multicast source list is received.
  • IS_EX: Indicates that the filtering mode between the multicast group and the multicast source list is EXCLUDE. That is, only multicast data sent to the multicast group from multicast sources other than those in the specified multicast source list is received.
  • TO_IN: Indicates that the filtering mode between the multicast group and the multicast source list is changed from EXCLUDE to INCLUDE.
  • TO_EX: Indicates that the filtering mode between the multicast group and the multicast source list is changed from INCLUDE to EXCLUDE.
  • ALLOW: Indicates that on the basis of the current status, you also want to receive multicast data from some multicast sources. If the current corresponding relationship is INCLUDE, these multicast sources are added to the existing multicast source list; if the current corresponding relationship is EXCLUDE, these multicast sources are deleted from the existing multicast source list.
  • BLOCK: Indicates that based on the current status, you no longer want to receive multicast data from certain multicast sources. If the current correspondence is INCLUDE, these multicast sources are deleted from the existing multicast source list; if the current correspondence is EXCLUDE, these multicast sources are added to the existing multicast source list.

4. Classification of multicast models

Based on how receivers process multicast sources, multicast models are classified into the following three categories:

(1) ASM model: Any-Source Multicast

In the ASM model, any sender can act as a multicast source to send information to a multicast group address. Many receivers join the multicast group identified by the multicast group address to obtain the multicast information sent to the multicast group.

In the ASM model, receivers cannot know the location of the multicast source in advance, but can join or leave the multicast group at any time.

(2) SFM model: Source-Filtered Multicast

This model inherits the ASM model. From the sender's perspective, the multicast group membership of the two models is exactly the same. The SFM model extends the ASM model in terms of functionality.

In the SFM model, the upper-layer software checks the source address of the received multicast messages and allows or prohibits the messages from certain multicast sources from passing.

Therefore, the receiver can only receive multicast data from some multicast sources. From the receiver's point of view, only some multicast sources are valid, and the multicast sources have been filtered.

(3) SSM model: Source-Specific Multicast

In real life, users may only be interested in multicast information sent by certain multicast sources, and may not want to receive information sent by other sources. This model provides users with a transmission service that allows them to specify multicast sources on the client.

The fundamental difference between the SSM model and the ASM model is that the receivers in the SSM model already know the specific location of the multicast source through other means. The SSM model uses a multicast address range different from the ASM/SFM model to directly establish a dedicated multicast forwarding path between the receiver and its designated multicast source.

5. IP Multicast

(1) For IP multicast, the following issues need to be considered:

  • Where does the multicast source transmit the multicast information? That is, the multicast addressing mechanism;
  • What are the receivers in the network? That is, host registration;
  • From which multicast source do these receivers need to receive information? That is, multicast source discovery;
  • How is multicast information transmitted? That is, multicast routing.

(2) IP multicast is an end-to-end service. The multicast mechanism consists of the following four parts:

  • Addressing mechanism: With the help of multicast addresses, information is sent from a multicast source to a group of receivers;
  • Host registration: allows the receiver host to dynamically join and leave a multicast group, thus managing the multicast members;
  • Multicast routing: Construct a multicast message distribution tree (i.e., a tree-like forwarding path for multicast data in the network) and transmit messages from the multicast source to the receiver through the distribution tree;
  • Multicast applications: Multicast sources and receivers must install software that supports multicast applications such as video conferencing, and the TCP/IP protocol stack must support the sending and receiving of multicast information.

In order for the multicast source and multicast group members to communicate, a network layer multicast address, namely an IP multicast address, needs to be provided. At the same time, there must be a technology to map the IP multicast address to a link layer multicast MAC address.

(3) IP multicast address

IANA (Internet Assigned Numbers Authority) allocates Class D address space for IPv4 multicast use, ranging from 224.0.0.0 to 239.255.255.255. The specific classification and its meaning are shown in the following table.

Scope and meaning of IPv4 multicast addresses

illustrate:

  • The membership of a multicast group is dynamic, and hosts can join or leave the multicast group at any time.
  • GLOP is a multicast address allocation mechanism between ASs (Autonomous Systems). The AS number is filled into the middle two bytes of the multicast address within the range, and each AS can get 255 multicast addresses. For a detailed introduction to GLOP, please refer to RFC 2770.

(4) Ethernet multicast MAC address

  • When Ethernet transmits unicast IP packets, the destination MAC address uses the MAC address of the receiver. However, when transmitting multicast packets, the destination is no longer a specific receiver, but a group with uncertain members, so the multicast MAC address must be used.
  • IANA stipulates that the upper 24 bits of the IPv4 multicast MAC address are 0x01005E, the 25th bit is 0, and the lower 23 bits are the lower 23 bits of the IPv4 multicast address. The mapping relationship between the IPv4 multicast address and the MAC address is shown in the figure below.

Mapping relationship between IPv4 multicast address and MAC address

  • Since the upper 4 bits of the IPv4 multicast address are 1110, representing the multicast identifier, and only 23 bits of the lower 28 bits are mapped to the IPv4 multicast MAC address, 5 bits of information in the IPv4 multicast address are lost.

Therefore, 32 IPv4 multicast addresses are mapped to the same IPv4 multicast MAC address. Therefore, during the Layer 2 processing, the device may need to receive some multicast data outside the IPv4 multicast group, and these redundant multicast data need to be filtered by the upper layer of the device.

6. Multicast Protocol

Usually, we call IP multicast working at the network layer "Layer 3 multicast", and the corresponding multicast protocols are called "Layer 3 multicast protocols", including IGMP, PIM, MSDP, MBGP, etc.; IP multicast working at the data link layer is called "Layer 2 multicast", and the corresponding multicast protocols are called "Layer 2 multicast protocols", including IGMP Snooping, multicast VLAN, etc.

(1) Layer 3 multicast protocol

The three-layer multicast protocol includes two types: multicast group management protocol and multicast routing protocol. Their application locations in the network are shown in the following figure.

Application location of Layer 3 multicast protocol

a. Multicast Group Management Protocol

The multicast group management protocol IGMP is usually used between the host and the three-layer multicast device directly connected to it. This protocol specifies the mechanism for establishing and maintaining multicast group membership between the host and the three-layer multicast device.

b. Multicast routing protocol

The multicast routing protocol runs between Layer 3 multicast devices to establish and maintain multicast routes and to forward multicast data packets correctly and efficiently.

Multicast routing establishes a loop-free data transmission path from one data source to multiple receivers, namely, a multicast distribution tree.

For the ASM model, multicast routing can be divided into two categories: intra-domain and inter-domain:

  • Intra-domain multicast routing is used to discover multicast sources within an AS and build a multicast distribution tree, thereby delivering multicast information to receivers. Among the many intra-domain multicast routing protocols, PIM (Protocol Independent Multicast) is currently a typical one. According to the different forwarding mechanisms, PIM can be divided into two modes: DM (Dense Mode) and SM (Sparse Mode).
  • Inter-domain multicast routing is used to realize the transmission of multicast information between ASs. Currently, the more mature solutions are: MSDP (Multicast Source Discovery Protocol) can propagate multicast source information across ASs; and the multicast extension of MP-BGP (MultiProtocol Border Gateway Protocol) MBGP (Multicast BGP) can propagate multicast routes across ASs.

For the SSM model, there is no intra-domain and inter-domain division. Since the receiver knows the specific location of the multicast source in advance, it only needs to use the channel built by PIM-SM to realize the transmission of multicast information.

(2) Layer 2 multicast protocol

Layer 2 multicast protocols include IGMP Snooping and multicast VLAN, and their application locations in the network are shown in the following figure.

Application location of Layer 2 multicast protocol

a. IGMP Snooping

IGMP Snooping (Internet Group Management Protocol Snooping) is a multicast restriction mechanism running on Layer 2 devices. It manages and controls multicast groups by snooping and analyzing IGMP messages exchanged between hosts and Layer 3 multicast devices, thereby effectively suppressing the spread of multicast data in the Layer 2 network.

b. Multicast VLAN

In the traditional multicast on-demand mode, when users connected to a Layer 2 device and belonging to different VLANs perform multicast on-demand respectively, the Layer 3 multicast device needs to send a copy of the multicast data to each VLAN of the Layer 2 device; and when the Layer 2 device runs multicast VLAN.

<<:  +See the future with intelligence! In 2019, Huawei Cloud will let you see a different intelligent cloud

>>:  Where can I find the IP address of my router?

Recommend

Top 10 technology trends governments should watch in 2021

[[391593]] The pandemic has forced government age...

my country's backbone network construction will be initially completed in 2020

According to the latest report released by the In...

Finding edge applications on 5G

5G is considered a key part of delivering edge co...

Is it impossible for non-middlemen to hijack TCP?

TCP initial sequence number Hi, my name is Robert...

Interview blitz: Is TCP reliable? Why?

Author | Lei Ge Source | Java interview questions...

What is OSI model?

Today I tweeted some thoughts about how the OSI m...

5G modem and processor shipments surge

[[389359]] Data from the Global Mobile Suppliers ...

Voice message application series——Unlimited message listening assistant

who I am Hello everyone, my name is NGCSS (Next G...

LowEndTalk (LEB) 2020 Low-End VPS Voting Ranking

A few years ago, LET often carried out voting act...