ICMPv6协议报文通用格式
一、 ICMPv6报文通用格式
+0-------7-------15---------------31
| Type | Code | Checksum |
+----------------------------------
| Message Body(Variable length) |
+---------------------------------+
二、 ICMPv6报文通用格式解释
字段 | 长度 | 描述 |
---|---|---|
Type | 1字节 | 定义了报文的类型,该字段决定了其它部分的报文格式。 |
Code | 1字节 | 该字段依赖TYPE字段,在TYPE字段的基础上,它被用来在基本类型上创建更详细的报文等级。 |
Checksum | 2字节 | 用来在ICMPv6报文中检验数据和部分IPv6首部的完整性。 |
Message Body | 可变 | 大体上说,ICMPv6报文可以被分为2大类:差错报文与消息报文。这2类报文是依靠报文中的TYPE字段来标识的,当TYPE字段的最高位置0,即在0~127范围时(TYPE字段长度为1字节),被标识为差错报文,TYPE字段值为128~255范围时,则标识为消息报文。 |
三、 ICMPv6报文类型对应表
Type | Code | 消息名 |
---|---|---|
1 | 0 | 没有路由到达目的地 |
1 | 1 | 与目的地的通信由于管理被禁止 |
1 | 2 | 超过了源地址的范围 |
1 | 3 | 地址不可达 |
1 | 4 | 端口不可达 |
1 | 5 | 源地址的入口/出口策略失败 |
1 | 6 | 拒绝路由到达目的地 |
2 | 0 | 包太大 |
3 | 0 | 传输过程中“hop-limit”超时 |
3 | 1 | 分片重组超时 |
4 | 0 | 参数错误 |
4 | 1 | 错误的首部字段 |
4 | 2 | 不可识别的Next Header类型 |
4 | 3 | 不可识别的IPv6选项 |
100 | x | 私有实验用 |
101 | x | 私有实验用 |
127 | x | ICMPv6差错报文扩展保留 |
128 | 0 | 回显请求 |
129 | 0 | 回显应答 |
133 | x | 路由请求 |
134 | x | 路由通告 |
135 | x | 邻居请求 |
136 | x | 邻居通告 |
137 | x | 重定向 |
143 | x | 组播MLDv2 (Multicast Listener Report Message v2)消息 |
200 | x | 私有实验用 |
201 | x | 私有实验用 |
255 | x | ICMPv6消息报文扩展保留 |
四、ICMPv6消息报文示例
Frame 1: 122 bytes on wire (976 bits), 122 bytes captured (976 bits)
Arrival Time: Jan 1, 1970 08:00:00.072927000
Epoch Time: 0.072927000 seconds
[Time delta from previous captured frame: 0.000000000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.000000000 seconds]
Frame Number: 1
Frame Length: 122 bytes (976 bits)
Capture Length: 122 bytes (976 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ipv6:icmpv6:data]
[Coloring Rule Name: ICMP]
[Coloring Rule String: icmp || icmpv6]
Ethernet II, Src: HuaweiTe_57:28:ca (00:18:82:57:28:ca), Dst: Spv_2b:cb:8e (38:c8:5c:2b:cb:8e)
Destination: Spv_2b:cb:8e (38:c8:5c:2b:cb:8e)
Address: Spv_2b:cb:8e (38:c8:5c:2b:cb:8e)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Source: HuaweiTe_57:28:ca (00:18:82:57:28:ca)
Address: HuaweiTe_57:28:ca (00:18:82:57:28:ca)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Type: IPv6 (0x86dd)
Trailer: a15b641f
Internet Protocol Version 6, Src: 2001::1 (2001::1), Dst: 2001::2 (2001::2)
0110 .... = Version: 6
[0110 .... = This field makes the filter "ip.version == 6" possible: 6]
.... 0000 0000 .... .... .... .... .... = Traffic class: 0x00000000
.... 0000 00.. .... .... .... .... .... = Differentiated Services Field: Default (0x00000000)
.... .... ..0. .... .... .... .... .... = ECN-Capable Transport (ECT): Not set
.... .... ...0 .... .... .... .... .... = ECN-CE: Not set
.... .... .... 0000 0000 0000 0000 0000 = Flowlabel: 0x00000000
Payload length: 64
Next header: ICMPv6 (0x3a)
Hop limit: 64
Source: 2001::1 (2001::1)
[Source Teredo Server IPv4: 0.0.0.0 (0.0.0.0)]
[Source Teredo Port: 65535]
[Source Teredo Client IPv4: 255.255.255.254 (255.255.255.254)]
Destination: 2001::2 (2001::2)
[Destination Teredo Server IPv4: 0.0.0.0 (0.0.0.0)]
[Destination Teredo Port: 65535]
[Destination Teredo Client IPv4: 255.255.255.253 (255.255.255.253)]
Internet Control Message Protocol v6
Type: Echo (ping) request (128)
Code: 0
Checksum: 0xb01b [correct]
Identifier: 0xabce
Sequence: 1
Data (56 bytes)
Data: 23f432fa000102030405060708090a0b0c0d0e0f10111213...
[Length: 56]
五、ICMPv6消息封装格式
+-------------------------------+
| ICMPv6 |
+-------------------------------+
| IP (Protocol = 0x02) |
+-------------------------------+
| L2 |
+-------------------------------+
| L1 |
+-------------------------------+
ICMPv6消息封装在IPv6报文中,IPv6首部携带了一个或多个IPv6扩展头,扩展头中的Next Header字段值为58(0x3a)。
发表评论