使用未知IPv6扩展头处理数据包

7

问题

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

详情

通过查看RFC,我找不到这个问题的答案。在第22页上,IPv6 Essentials一书中写道:

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

我的理解是:除非路径上所有IPv6堆栈都知道如何处理自定义扩展头,否则将丢弃带有自定义扩展头的IPv6数据包。或者等价地,如果路径上的任何一个IPv6设备不知道如何处理自定义头,则会丢弃数据包。

这似乎与扩展的一般思想相矛盾:即使自定义扩展不影响通用IPv6堆栈,我也不能引入新的扩展而不升级整个网络。


+1 对于你的模板。我刚刚成为了Question-Details方法的超级粉丝。 - puk
4
如果“问题”部分可以放在标题里,就无需再加进正文中。 - Blorgbeard
1个回答

7

来自RFC2460(Internet Protocol,Version 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.

作为扩展报头使用“下一个报头”字段,我认为你应该将其解释为需要丢弃该数据包并发送 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
哦,关键的洞见是路由器会忽略扩展头部,这使得可以在端主机或中间箱部署自定义扩展。谢谢! - mavam
1
路由器会忽略所有的扩展报头,除非该扩展报头的编号为0,即逐跳扩展报头。 - X-Istence

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接