处理具有未知IPv6扩展头的数据包

时间:2012-03-23 23:58:46

标签: networking network-programming network-protocols ipv6 packet

问题

是否应该丢弃具有未知IPv6扩展头的数据包?

详细

通过检查RFC,我找不到这个问题的答案。第{22}页的书IPv6 Essentials说明了这一点:

  

如果某个节点需要下一个标头,但无法识别Next Header字段中的值,则需要丢弃该数据包并将ICMPv6参数问题消息发送回数据包源。

我将其读作:除非路径上的所有 IPv6堆栈知道如何处理标头,否则不会删除带有自定义扩展标头的IPv6数据包。或者等效地,如果路径上的单个IPv6设备不知道如何处理自定义标头,则会丢弃该数据包。

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

1 个答案:

答案 0 :(得分:7)

来自RFC2460(Internet协议,版本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.