IGMP标准的演进:
RFC1112 - Host Extensions for IP Multicasting
http://www.ietf.org/rfc/rfc1112.txt?number=1112
RFC2236 - Internet Group Management Protocol, Version 2
http://www.ietf.org/rfc/rfc2236.txt?number=2236
RFC3376 - Internet Group Management Protocol, Version 3
http://www.ietf.org/rfc/rfc3376.txt?number=3376
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
其他一些相关标准:
/* IGMP proxy-routing function */
RFC4605 - Internet Group Management Protocol (IGMP) / Multicast Listener Discovery (MLD)-Based Multicast Forwarding ("IGMP/MLD Proxying")
http://www.ietf.org/rfc/rfc4605.txt?number=4605
/* SSM(source-specific multicast) */
RFC3569 - An Overview of Source-Specific Multicast (SSM)
http://www.ietf.org/rfc/rfc3569.txt?number=3569
RFC4604 - Using Internet Group Management Protocol Version 3 (IGMPv3) and Multicast Listener Discovery Protocol Version 2 (MLDv2) for Source-Specific Multicast
http://www.ietf.org/rfc/rfc4604.txt?number=4604
/* MLD */
RFC2710 -Multicast Listener Discovery (MLD) for IPv6
http://www.ietf.org/rfc/rfc2710.txt?number=2710
RFC3590 - Source Address Selection for the Multicast Listener Discovery (MLD) Protocol
http://www.ietf.org/rfc/rfc3590.txt?number=3590
RFC3810 - Multicast Listener Discovery Version 2 (MLDv2) for IPv6
http://www.ietf.org/rfc/rfc3810.txt?number=3810
/* IGMP snooping */
RFC4541 - Considerations for Internet Group Management Protocol (IGMP) and Multicast Listener Discovery (MLD) Snooping Switches
http://www.ietf.org/rfc/rfc4541.txt?number=4541
/* PIM-SM */
RFC2362 - Protocol Independent Multicast-Sparse Mode (PIM-SM): Protocol Specification
http://www.ietf.org/rfc/rfc2362.txt?number=2362
/* MBGP */
RFC2283 - Multiprotocol Extensions for BGP-4
http://www.ietf.org/rfc/rfc2283.txt?number=2283
/* MADCAP */
RFC2730 - Multicast Address Dynamic Client Allocation Protocol
http://www.ietf.org/rfc/rfc2730.txt?number=2730
/* MZAP */
RFC2776 - Multicast-Scope Zone Announcement Protocol
http://www.ietf.org/rfc/rfc2776.txt?number=2776
/* IP Router Alert Option */
RFC2113 -IP Router Alert Option
http://www.ietf.org/rfc/rfc2113.txt?number=2113
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
IGMP协议是IP协议的组成部分,被封装在IPv4数据包里进行传输。包含IGMP协议的IP包的TTL值被置为1,限定IGMP只会在本子网内传播。组播路由器和实现组播的主机必须使用IGMP来进行群组成员信息的通信。
IGMP的工作分为两个阶段:
- 当主机加入一个新的组播群组时,他把一个IGMP报文发送给群组的组播地址,宣布其成员。本地组播路由器接收到这个报文之后,向互联网上其他组播路由器传播这个群组成员信息,以建立必要的路由。
- 为适应动态的成员,本地组播路由器周期性地轮询本地网络上的主机,以便确定现在各个群组中有哪些主机。如果若干次轮询后,某个群组中始终没有成员,组播路由器就认为该群组中不再有本地网络中的主机,于是停止向其他组播路由器通告该群组的成员信息。
- 主机与组播路由器之间的所有通信都使用IP组播。当IGMP报文封装到IP数据报中进行传输时,IP目的地址是个组播地址(路由器把通用的IGMP查询发送到全主机组播地址,主机把一些IGMP报文发送给所有路由器地址,主机和路由器都把特定于一个群组的IGMP报文发送到该群组的地址)。因此携带IGMP报文的数据报在传输过程中尽量利用硬件的组播能力。其结果是在支持硬件组播的网络上,不参与IP组播的主机就不会收到IGMP报文。【IGMP Snooping的功能】
- 当轮询确定群组成员时,组播路由器不会为每个群组发送单独报文,而是发送单个查询请求得到关于所有群组的信息。
- 如果多个组播路由器连接到同一个网络,他们会迅速而有效地选用一个路由器来轮询主机成员。因此当网络中添加其他组播路由器时,网络上的IGMP通信量总量不会增加。
- 主机不会同时响应路由器的IGMP查询,每个查询包含一个N值,指定了最大响应时间。当查询到达时,主机选择0到N之间的一个随机时延,在这个时延之后发送响应报文。
- 每台主机监听群组中其他主机的响应,并抑制那些不必要的响应通信量。时延最小的主机首先发送自己的响应,该响应发送给群组的组播地址,所有其他成员都会和组播路由器一样收到副本。其他成员就会取消自己的定时器并抑制传输。因此,实践中每个群组中只有一台主机对请求报文做出响应。
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
IGMPv3 详解:
/*
IGMP is the protocol used by IPv4 systems to report their IP multicast group memberships to neighboring multicast routers.
Version 2 added support for "low leave latency";
Version 3 adds support for "source filtering"
*/
1. The Service Interface for Requesting IP Multicast Reception (support source filters)
IPMulticastListen (socket, interface, multicast-address,filter-mode, source-list)
2. IGMP messages are encapsulated in IPv4 datagrams, with an IP protocol number of 2.
Every IGMP message described in this document is sent with an IP Time-to-Live of 1,
IP Precedence of Internetwork Control (e.g., Type of Service 0xc0),
and carries an IP Router Alert option [RFC-2113] in its IP header.
3. IGMPv3 支持的消息
0x11 Membership Query
0x22 Version 3 Membership Report
0x12 Version 1 Membership Report
0x16 Version 2 Membership Report
0x17 Version 2 Leave Group
4. Membership Query 消息的IP目的地址
In IGMPv3, General Queries are sent with an IP destination address of
224.0.0.1, the all-systems multicast address. Group-Specific and
Group-and-Source-Specific Queries are sent with an IP destination
address equal to the multicast address of interest. *However*, a
system MUST accept and process any Query whose IP Destination
Address field contains *any* of the addresses (unicast or multicast)
assigned to the interface on which the Query arrives.
5. V3 Membership Report 消息的IP源地址
An IGMP report is sent with a valid IP source address for the
destination subnet. The 0.0.0.0 source address may be used by a
system that has not yet acquired an IP address. Note that the
0.0.0.0 source address may simultaneously be used by multiple systems
on a LAN. Routers MUST accept a report with a source address of 0.0.0.0
6. V3 Membership Report 消息的IP目的地址
Version 3 Reports are sent with an IP destination address of
224.0.0.22, to which all IGMPv3-capable multicast routers listen.
A system that is operating in version 1 or version 2 compatibility
modes sends version 1 or version 2 Reports to the multicast group
specified in the Group Address field of the Report. In addition, a
system MUST accept and process any version 1 or version 2 Report
whose IP Destination Address field contains *any* of the addresses
(unicast or multicast) assigned to the interface on which the Report
arrives.
7. IGMP is an asymmetric protocol, specifying separate behaviors for
group members -- that is, hosts or routers that wish to receive
multicast packets -- and multicast routers.
8. The all-systems multicast address, 224.0.0.1, is handled as a special
case. On all systems -- that is all hosts and routers, including
multicast routers -- reception of packets destined to the all-systems
multicast address, from all sources, is permanently enabled on all
interfaces on which multicast reception is supported. No IGMP
messages are ever sent regarding the all-systems multicast address.
9. The purpose of IGMP is to enable each multicast router to learn, for
each of its directly attached networks, which multicast addresses are
of interest to the systems attached to those networks. IGMP version
3 adds the capability for a multicast router to also learn which
*sources* are of interest to neighboring systems, for packets sent to
any particular multicast address. The information gathered by IGMP
is provided to whichever multicast routing protocol is being used by
the router, in order to ensure that multicast packets are delivered
to all networks where there are interested receivers.
10. IGMPv3 specifies two types of Membership Reports: Current-State and State Change.
"Current-State" Reports are sent in response to Queries; while "State Change" Reports
are sent as a result of a change in interface state.
// To be continue
没有评论:
发表评论