首页 文章

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

提问于
浏览
7

问题

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

详情

我通过检查RFC找不到这个问题的答案 . 第22页的书IPv6 Essentials说明:

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

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

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

1 回答

  • 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.
    

相关问题