在 IPv6 Header 中,当 Next-Header == 58 时,则对应为 ICMPv6 报文。
报文格式
Type:表明消息的类型。ICMPv6 报文载荷由 ICMPv6 报文 Type 字段决定,因报文类型的不同而不同。
Code:表示消息类型的细分。
Checksum:表示 ICMPv6 报文的校验和。
Message Body:报文内容。对于 ping 报文,其中包含随机数据;对于类型为 NS NA RS RA 的报文,其中包含结构化的数据和相关信息。
报文示例
ICMPv6 Request and ICMPv6 Reply
Request
Frame 14: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) on interface -, id 0 Ethernet II, Src: 38:39:cc:01:01:00 (38:39:cc:01:01:00), Dst: 38:39:cc:02:01:00 (38:39:cc:02:01:00) Internet Protocol Version 6, Src: 2000:12::1, Dst: 2000:12::2 0110 .... = Version: 6 .... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT) .... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0) .... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0) .... 0000 0000 0000 0000 0000 = Flow Label: 0x00000 Payload Length: 64 Next Header: ICMPv6 (58) Hop Limit: 64 Source Address: 2000:12::1 [Address Space: Global Unicast] Destination Address: 2000:12::2 [Address Space: Global Unicast] [Stream index: 0] Internet Control Message Protocol v6 Type: Echo (ping) request (128) Code: 0 Checksum: 0x82fb [correct] [Checksum Status: Good] Identifier: 0x2400 Sequence: 256 [Response In: 15] Data (56 bytes) Data: 001100000101ff01504e47000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [Length: 56]
Reply
Frame 15: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) on interface -, id 0 Ethernet II, Src: 38:39:cc:02:01:00 (38:39:cc:02:01:00), Dst: 38:39:cc:01:01:00 (38:39:cc:01:01:00) Internet Protocol Version 6, Src: 2000:12::2, Dst: 2000:12::1 0110 .... = Version: 6 .... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT) .... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0) .... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0) .... 0000 0000 0000 0000 0000 = Flow Label: 0x00000 Payload Length: 64 Next Header: ICMPv6 (58) Hop Limit: 64 Source Address: 2000:12::2 [Address Space: Global Unicast] Destination Address: 2000:12::1 [Address Space: Global Unicast] [Stream index: 0] Internet Control Message Protocol v6 Type: Echo (ping) reply (129) Code: 0 Checksum: 0x81fb [correct] [Checksum Status: Good] Identifier: 0x2400 Sequence: 256 [Response To: 14] [Response Time: 0.000 ms] Data (56 bytes) Data: 001100000101ff01504e47000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [Length: 56]