ICMPv6

IPv6使用Internet Control Message Protocol(简称ICMP),稍作一些改变,称为ICMPv6 IPv6 nodes利用ICMPv6来报告处理封包时遇到的错误,也可执行其它internet层功能,如诊断功能“ping”。ICMPv6属于IPv6的一部分,每个IPv6 node必须支持ICMPv6
ICMPv6 message2种类型:
l   Error messages(错误讯息)  用于报告目的node或中间router传送封包时遇到的错误。ICMPv6错误讯息包括Destination UnreachablePacket Too BigTime ExceedParameter Problem
l   Informational messages(信息讯息)  用于提供诊断功能以及其它功能 (例如MLDMLDv2Neighbor Discovery)。诊断功能包括Echo RequestEcho Reply
ICMP是为了弥补IP层某些功能上的不足而特别添增的重要信息和机制,因此必须尽可能保障ICMPv6信息可安全的送达目的地的。由于linkMTU值不得低于1280 bytesICMPv6 messages被限制不得超过1280 bytes,可确保不会因为ICMPv6封包过大而无法送达目的地。
当未来发现IP层一些功能上的不足时,ICMPv6可能会跟着更改或者新增某些功能,并且不需要更动IPv6


ICMPv6 讯息格式






Type  表示 ICMPv6 讯息的类型。此字段内容决定其它字段的格式。
Code  其内容取决于Type域值。
Checksum  ICMP讯息的检验值。
Message Body  包含ICMPv6讯息特有的数据。

ICMPv6 Error Messages


ICMPv6 error messages用于报告router或目的主机处理封包时发生错误。它们包含下列讯息:
Destination Unreachable (ICMPv6 Type 1)
Packet Too Big (ICMPv6 Type 2)
Time Exceeded (ICMPv6 Type 3)
Parameter Problem (ICMPv6 Type 4)

Destination Unreachable

当中间router无法转送封包到其目的或者目的节点无法将封包内容传送给上层处理时,就会发出 ICMPv6 Destination Unreachable 讯息。






Type  固定设为1
Code  设定值0~6
设定值
信息含义
说明
0
No route to destination
Fail to deliver is lack of a matching entry in the forwarding node's routing table.
1
Communication with destination administratively prohibited
afirewall filter
2
Beyond scope of source address
This condition can occur only when the scope of the source address is smaller than the scope of the destination address
3
Address unreachable
If the reason for the failure to deliver cannot be mapped to any of other codes, the Code field is set to 3.
4
Port unreachable
A destination node SHOULD originate a Destination Unreachable message with Code 4 in response to a packet for which the transport protocol (e.g., UDP) has no listener.
5
Source address failed ingress/egress policy
Fail to deliver is that the packet with this source address is not allowed due to ingress or egress filtering.
6
Reject route to destination
The failure to deliver is that the route to the destination is a reject route.
Unused  固定设为0。接收端忽略其内容。
Message Body  原始封包内容。ICMPv6 message不超过1280 bytes的前提下,尽可能包含整个原始封包内容。

Packet Too Big

当中间router遇到转送link上的link MTU小于IPv6封包大小,由于该封包无法转送,router就会发送ICMPv6 Packet Too Big message






Type  固定设为2
Code  固定设为0
MTU  转送封包失败时的link MTU值。
Message Body  原始封包内容。ICMPv6 message不超过1280 bytes的前提下,尽可能包含整个原始封包内容。

Time Exceeded

router接收到封包的Hop Limit字段为0,或者该字段减1后为0时,必须发送ICMPv6 Time Exceeded message给原始封包发送者,且舍弃原始封包。这代表此封包转送的路径发生回路,或者此封包的Hop Limit字段设定值不够大。

当封包接收端完成重组分段过的封包前,相关的定时器到期,也会发送ICMPv6 Time Exceeded message给原始封包发送者,且丢弃封包。






Type  固定设为3
Code  设定值01
设定值
信息含义
0
Hop limit exceeded in transit.
1
Fragment reassembly time exceeded.
Unused  固定设为0。接收端忽略其内容。
Message Body  原始封包内容。ICMPv6 message不超过1280 bytes的前提下,尽可能包含整个原始封包内容。

Parameter Problem

IPv6表头或者扩展表头发生错误时,router或封包的目的节点就会发送ICMPv6 Parameter Problem message






Type  固定设为4
Code  设定值012
设定值
信息含义
0
Erroneous header field encountered.
1
Unrecognized Next Header type encountered.
2
Unrecognized IPv6 option encountered
Pointer  指明封包发生错误的相对位置。
Message Body  原始封包内容。ICMPv6 message不超过1280 bytes的前提下,尽可能包含整个原始封包内容。

ICMPv6 Informational Messages

ICMPv6 Informational Messages提供诊断功能,包含以下messages
Echo Request (ICMPv6 Type 128)
Echo Reply (ICMPv6 Type 129)

Echo Request

ICMPv6 Echo Request message传送到目的地,并要求立即回应 Echo Reply message Echo Request/Echo Reply messages提供一种简单的诊断方法,有助于解决各种“可达性”以及“路由”问题。





Type  固定设为128
Code  固定设为0
Identifier  识别值。Echo Request message发送端利用此字段与响应的Echo ReplyIdentify域值相配合。响应的Echo Reply message必须填入相同的Identifier域值。
Sequence Number  序号。 类似Identifier字段的用法, Echo Request message发送端利用此字段与响应的Echo ReplyIdentify域值相配合。Identify字段及Sequence Number字段的用法,由Echo Request message发送端自行定义。
Data  可为0或多个bytes的资料。内容取决于Echo Request message发送端。响应的Echo Reply message必须填入相同的的Data域值。

Echo Reply

ICMPv6 Echo Reply message的格式与Echo Request完全相同。每个node收到Echo Request message时,会立即回应Echo Reply message。(当发送多个Echo Request封包后,未收到对方响应Echo Reply,即可判定对方为不可达。)





Type  固定设为129
Code  固定设为0
Identifier  识别值。 响应的Echo Reply message必须填入接收到的Echo Request message相同的Identifier域值。
Sequence Number  序号。响应的Echo Reply message必须填入接收到的Echo Request message相同的Sequence Number域值。

Data  响应的Echo Reply message必须填入接收到的Echo Request message相同的Data域值。

参考文献

RFC 4443  ICMPv6 (ICMP for IPv6)

评论

此博客中的热门博文

IPv6 簡介以及地址介紹

DHCPv6 简介

Neighbor Discovery 简介

Multicast Listener Discovery (MLD) 简介

MLDv2 简介

Mobile IPv6 简介

IP Security 簡介