7

问题

应该丢弃一个未知IPv6扩展头的数据包吗?处理未知IPv6扩展头的数据包

详细

我无法通过检查RFC找到这个问题的答案。第22页的书IPv6 Essentials状态:

如果一个节点所需要的下一个首部,但不能识别所述下一个首部字段中的值,就需要丢弃该数据包,并发送ICMPv6参数问题消息发送回包的来源。

我看这是:与自定义扩展头的IPv6一个数据包不能被丢弃,除非所有 IPv6双协议栈沿着小路知道如何处理与头。或者等价地,如果路径上的单个IPv6设备不知道如何处理自定义报头,则会丢弃该报文。

这似乎与扩展的一般想法不一致:即使自定义扩展不影响通用IPv6堆栈,我也无法在不升级整个网络的情况下引入新扩展。

+0

+1为您的模板。我已经成为问题细节方法的巨大粉丝 – puk 2012-03-24 00:08:35

+4

不是当“问题”部分适合标题! – Blorgbeard 2013-07-08 05:53:50

回答

7

从RFC2460(互联网协议版本6(IPv6)):

If, as a result of processing a header, a node is required to proceed 
to the next header but the Next Header value in the current header is 
unrecognized by the node, it should discard the packet and send an 
ICMP Parameter Problem message to the source of the packet, with an 
ICMP Code value of 1 ("unrecognized Next Header type encountered") 
and the ICMP Pointer field containing the offset of the unrecognized 
value within the original packet. The same action should be taken if 
a node encounters a Next Header value of zero in any header other 
than an IPv6 header. 

作为扩展报头使用Next Header字段我会将此解释为你预计丢弃该数据包并发送一个意思ICMP错误返回。 请注意,他只适用于目标主机。路由器应忽略所有扩展标头:

With one exception, extension headers are not examined or processed 
by any node along a packet's delivery path, until the packet reaches 
the node (or each of the set of nodes, in the case of multicast) 
identified in the Destination Address field of the IPv6 header. 
+3

啊,所以关键的洞察是路由器*忽略*扩展头,它允许在endhosts或middleboxes上部署自定义扩展。谢谢! – mavam 2012-03-24 17:35:58

+1

路由器忽略所有扩展头,除非扩展头是数字0,即逐跳扩展头。 – 2013-07-08 15:06:35