One of the Linux IGMP Learning Notes IGMP protocol format __linux

Source: Internet
Author: User

I. IGMP definition and classification

Igmp:internet Group Management Protocol, the biggest difference from broadcasting is that IGMP allows each network device to decide whether to participate in a particular multicast group.

The IP address of IGMP, the range of multicast IP address is 224.0.0.0-239.255.255.255. 224.0.0.1 represents all computers on the subnet, and 224.0.0.2 represents all the routers on the subnet. In addition, multicast IP addresses can only be used as destination addresses and cannot generate error messages about multicast addresses. When the ICMP protocol is parsed in the previous sections, the code responds to the multicast address only when it receives the ICMP echo Request packet, only when it allows a reply to the multicast address's request package, and Linux does not respond to the multicast Echo request by default, only after the user forces the configuration reply, To reply to the multicast echo request.

IGMP's MAC address is 01-00-5e-xx-xx-xx, where the rear 23bits is the lower 23bits of the IP address. From this also explains that as long as you know a multicast IP address, you can convert its MAC address, do not need to obtain the MAC address through ARP request.

In the specific implementation of the function, but also divided into IGMP snooping and IGMP proxy two kinds.

For IGMP snooping This is a function of implementing multicast data restrictions on layer two. For a router or 2-tier switch, when a port on the LAN layer sends an IGMP datagram to a multicast group, if IGMP snooping is not turned on, the data is flood to all LAN side ports, which increases network load. If IGMP snooping is turned on, routers or 2-tier switch will parse the IGMP packets to establish a mapping relationship between the port and the IGMP multicast group address, so that the downlink multicast stream data will only be forwarded to the port joining the multicast group, not to all the bridge ports.

For IGMP PROXY, the main interception is the IGMP message sent by the LAN side PC, which acts as the client on the WAN side, and sends the query message on the LAN as the server.

When the multicast group joined by the LAN side does not have a corresponding multicast route on the IGMP proxy device, the multicast packet is sent to the upper layer, and when the multicast group joined by the LAN side already exists on the IGMP proxy device, no further forwarding of the packets is required. This not only can effectively restrain the two-layer multicast flooding problem, and can more effectively obtain and control user information, reduce Network load.

Ii. format of IGMP

IGMP V1

A) member relations query

Version

Type

Un used

CheckSum

Multicast IP Address

Version:1

Type:0x11

Multicast IPAddress: set to 0 because it supports only common queries

(b) Report on member relations

Version

Type

Un used

CheckSum

Multicast IP Address

Version:1

type:0x12

Multicast IP address: Multicast group addresses to join

In IGMP V1, there is no specific definition of packets leaving the multicast group, so the multicast group router is based on the time-out mechanism to discover the multicast group without members.

IGMPV2

A) member relations query

TYPE (0x11)

Max Resp Time

CheckSum

Multicast IP Address

MAXRESP time: Maximum response times, for the membership query message, you need to set the time, multicast group members received membership query, will be based on this value to determine the response time.

There are two kinds of membership Query messages: A generic member relationship query and a specific group membership query.

For a universal membership query, you need to set the Multicastip address to 0; For a specific group membership query, you need to set the multicast IP addressing value to the multicast group addresses that you want to query.

Where the destination address in the IP header is 224.0.0.1 or the multicast group address to query

(b) Report on member relations

TYPE (0x16)

Max Resp Time

CheckSum

Multicast IP Address

Maxresp time: Maximum reply times, set here to 0.

The Multicastip address value needs to be set to the joined multicast group addresses.

(c) Leaving the group message

TYPE (0x17)

Max Resp Time

CheckSum

Multicast IP Address

Maxresp time: Maximum reply times, set here to 0.

The Multicastip address value needs to be set to the set of left multicast group addresses. Where the destination address in the IP header is set to 224.0.0.2 or the multicast group address to leave

Query mechanism: The election mechanism of multicast routers on a shared network segment: when there are multiple routers on the same network segment, the multicast router with the latest IP address acts as the query device.

IGMP V3

On the basis of inheriting V1 and V2, the following features have been added:

1) Support Source Filter

2 The maximum query response time in the query message is increased

3 adds a query to a specific source group

A) member relations query

TYPE (0x11)

RESP CODE

CheckSum

Multicast IP Address

Res

S

Qrv

Qqic

Number of source addresses

Source Address 1

Source Address 2

Source Address 3

RESP CODE: Maximum response time

Multicast IP address: Group addresses

RES: Reserved

S: Disable router handling bit

QRV: The number of times the sender sent the message (QRV-1)

QQIC: Query message send interval time

Number of source addresses: Number of record source addresses, specific source group queries to increase

(b) Report on member relations

TYPE (0x22)

Keep

CheckSum

Keep

Keep

Number of group records

Group 1

Group 2

Group 3

The format of the group is as follows:

Record type

0

Number of source addresses

Multicast address

Source Address 1

Source Address 2

Source Address 3

。。。

Source Address 3

Record type:

1 mode_is_include

2 Mode_is_exclude

3 Change_to_include_mode

4 Change_to_exclude_mode

5 Allow_new_source

6 Block_old_source

The destination address in its IP header is 224.0.0.22

This completes the analysis of the IGMP protocol format, starting tomorrow to analyze the Linux IGMP snooping implementation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.