1。IGMP 协议V1
报文格式:
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Type | Unused | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Group Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
报文类型(Type):
1 = Host Membership Query
2 = Host Membership Report
校验和(checksum):
The checksum is the 16-bit one's complement of the one's
complement sum of the 8-octet IGMP message. For computing
the checksum, the checksum field is zeroed.
组播地址(Group Address):
In a Host Membership Query message, the group address field,s zeroed when sent, ignored when received.In a Host Membership Report message, the group address field holds the IP host group address of the group being reported.
状态机:
(bs csdn 不能贴图)
2. IGMP 协议V2
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
报文类型:
0x11 = 成员关系查询
有两个成员关系查询的子类型:
- 一般查询,用于了解一个组中是否有成员在相邻的网络中。
- 特定组查询,用于了解在相邻的网络中特定的组是否有成员。
这两个消息由组地址进行区分。成员查询消息则类似于"Query"。
0x16 = 版本 2 成员关系报告。
0x17 = 离开组
比较IGMP V1 V2:
Igmp v2 比v1 多了leave 报文,而且加入了特定组查询。当组内最后一个成员离开的时候,可选特定组查询。同时也多了离开报文,同时成员报告报文的类型也是不同的.
个人认为加入查询报文,是为了适应对网络数据及时响应的需要。如:用户在组播数据切换的时候。
参考:rfc 1112,rfc2236,rfc3326
-----------------------------------------我是分割线---------------------------------------------
看着别人的文章,感觉自己很菜,就算是菜鸟学习历程吧