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
-----------------------------------------我是分割線---------------------------------------------
看着別人的文章,感覺自己很菜,就算是菜鳥學習歷程吧