Internet Engineering Task Force (IETF)                            C. Bao
Request for Comments: 7915                                         X. Li
Obsoletes: 6145                        CERNET Center/Tsinghua University
Category: Standards Track                                       F. Baker
ISSN: 2070-1721                                            Cisco Systems
                                                             T. Anderson
                                                          Redpill Linpro
                                                                 F. Gont
                                                     Huawei Technologies
                                                               June 2016
        
Internet Engineering Task Force (IETF)                            C. Bao
Request for Comments: 7915                                         X. Li
Obsoletes: 6145                        CERNET Center/Tsinghua University
Category: Standards Track                                       F. Baker
ISSN: 2070-1721                                            Cisco Systems
                                                             T. Anderson
                                                          Redpill Linpro
                                                                 F. Gont
                                                     Huawei Technologies
                                                               June 2016
        

IP/ICMP Translation Algorithm

IP/ICMP转换算法

Abstract

摘要

This document describes the Stateless IP/ICMP Translation Algorithm (SIIT), which translates between IPv4 and IPv6 packet headers (including ICMP headers). This document obsoletes RFC 6145.

本文档描述了无状态IP/ICMP转换算法(SIIT),该算法在IPv4和IPv6数据包头(包括ICMP头)之间进行转换。本文件淘汰RFC 6145。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 7841第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7915.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc7915.

Copyright Notice

版权公告

Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2016 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

Table of Contents

目录

   1.  Introduction and Motivation . . . . . . . . . . . . . . . . .   3
     1.1.  IPv4-IPv6 Translation Model . . . . . . . . . . . . . . .   3
     1.2.  Applicability and Limitations . . . . . . . . . . . . . .   3
     1.3.  Stateless vs. Stateful Mode . . . . . . . . . . . . . . .   4
     1.4.  Path MTU Discovery and Fragmentation  . . . . . . . . . .   5
   2.  Changes from RFC 6145 . . . . . . . . . . . . . . . . . . . .   5
   3.  Conventions . . . . . . . . . . . . . . . . . . . . . . . . .   5
   4.  Translating from IPv4 to IPv6 . . . . . . . . . . . . . . . .   6
     4.1.  Translating IPv4 Headers into IPv6 Headers  . . . . . . .   7
     4.2.  Translating ICMPv4 Headers into ICMPv6 Headers  . . . . .   9
     4.3.  Translating ICMPv4 Error Messages into ICMPv6 . . . . . .  13
     4.4.  Generation of ICMPv4 Error Message  . . . . . . . . . . .  14
     4.5.  Transport-Layer Header Translation  . . . . . . . . . . .  14
     4.6.  Knowing When to Translate . . . . . . . . . . . . . . . .  15
   5.  Translating from IPv6 to IPv4 . . . . . . . . . . . . . . . .  15
     5.1.  Translating IPv6 Headers into IPv4 Headers  . . . . . . .  17
       5.1.1.  IPv6 Fragment Processing  . . . . . . . . . . . . . .  19
     5.2.  Translating ICMPv6 Headers into ICMPv4 Headers  . . . . .  19
     5.3.  Translating ICMPv6 Error Messages into ICMPv4 . . . . . .  22
     5.4.  Generation of ICMPv6 Error Messages . . . . . . . . . . .  23
     5.5.  Transport-Layer Header Translation  . . . . . . . . . . .  23
     5.6.  Knowing When to Translate . . . . . . . . . . . . . . . .  24
   6.  Mapping of IP Addresses . . . . . . . . . . . . . . . . . . .  24
   7.  Special Considerations for ICMPv6 Packet Too Big  . . . . . .  24
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  24
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  25
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .  25
     9.2.  Informative References  . . . . . . . . . . . . . . . . .  27
   Appendix A.  Stateless Translation Workflow Example . . . . . . .  30
     A.1.  H6 Establishes Communication with H4  . . . . . . . . . .  30
     A.2.  H4 Establishes Communication with H6  . . . . . . . . . .  32
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  33
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  33
        
   1.  Introduction and Motivation . . . . . . . . . . . . . . . . .   3
     1.1.  IPv4-IPv6 Translation Model . . . . . . . . . . . . . . .   3
     1.2.  Applicability and Limitations . . . . . . . . . . . . . .   3
     1.3.  Stateless vs. Stateful Mode . . . . . . . . . . . . . . .   4
     1.4.  Path MTU Discovery and Fragmentation  . . . . . . . . . .   5
   2.  Changes from RFC 6145 . . . . . . . . . . . . . . . . . . . .   5
   3.  Conventions . . . . . . . . . . . . . . . . . . . . . . . . .   5
   4.  Translating from IPv4 to IPv6 . . . . . . . . . . . . . . . .   6
     4.1.  Translating IPv4 Headers into IPv6 Headers  . . . . . . .   7
     4.2.  Translating ICMPv4 Headers into ICMPv6 Headers  . . . . .   9
     4.3.  Translating ICMPv4 Error Messages into ICMPv6 . . . . . .  13
     4.4.  Generation of ICMPv4 Error Message  . . . . . . . . . . .  14
     4.5.  Transport-Layer Header Translation  . . . . . . . . . . .  14
     4.6.  Knowing When to Translate . . . . . . . . . . . . . . . .  15
   5.  Translating from IPv6 to IPv4 . . . . . . . . . . . . . . . .  15
     5.1.  Translating IPv6 Headers into IPv4 Headers  . . . . . . .  17
       5.1.1.  IPv6 Fragment Processing  . . . . . . . . . . . . . .  19
     5.2.  Translating ICMPv6 Headers into ICMPv4 Headers  . . . . .  19
     5.3.  Translating ICMPv6 Error Messages into ICMPv4 . . . . . .  22
     5.4.  Generation of ICMPv6 Error Messages . . . . . . . . . . .  23
     5.5.  Transport-Layer Header Translation  . . . . . . . . . . .  23
     5.6.  Knowing When to Translate . . . . . . . . . . . . . . . .  24
   6.  Mapping of IP Addresses . . . . . . . . . . . . . . . . . . .  24
   7.  Special Considerations for ICMPv6 Packet Too Big  . . . . . .  24
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  24
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  25
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .  25
     9.2.  Informative References  . . . . . . . . . . . . . . . . .  27
   Appendix A.  Stateless Translation Workflow Example . . . . . . .  30
     A.1.  H6 Establishes Communication with H4  . . . . . . . . . .  30
     A.2.  H4 Establishes Communication with H6  . . . . . . . . . .  32
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  33
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  33
        
1. Introduction and Motivation
1. 介绍和动机

This document obsoletes [RFC6145].

本文件废除了[RFC6145]。

Readers of this document are expected to have read and understood the framework described in [RFC6144]. Implementations of this IPv4/IPv6 translation specification MUST support one or more address mapping algorithms, which are defined in Section 6.

本文件的读者应已阅读并理解[RFC6144]中所述的框架。此IPv4/IPv6转换规范的实现必须支持第6节中定义的一个或多个地址映射算法。

1.1. IPv4-IPv6 Translation Model
1.1. IPv4-IPv6转换模型

The translation model consists of two or more network domains connected by one or more IP/ICMP translators (XLATs) as shown in Figure 1.

翻译模型由一个或多个IP/ICMP转换器(XLAT)连接的两个或多个网络域组成,如图1所示。

               ---------          ---------
             //        \\       //         \\
           /             +----+              \
          |              |XLAT|               | XLAT: IP/ICMP
          |   IPv4       +----+   IPv6        |       Translator
          |   Domain     |    |   Domain      |
          |              |    |               |
           \             |    |              /
            \\         //      \\          //
               --------          ---------
        
               ---------          ---------
             //        \\       //         \\
           /             +----+              \
          |              |XLAT|               | XLAT: IP/ICMP
          |   IPv4       +----+   IPv6        |       Translator
          |   Domain     |    |   Domain      |
          |              |    |               |
           \             |    |              /
            \\         //      \\          //
               --------          ---------
        

Figure 1: IPv4-IPv6 Translation Model

图1:IPv4-IPv6转换模型

The scenarios of the translation model are discussed in [RFC6144].

翻译模型的场景在[RFC6144]中讨论。

1.2. Applicability and Limitations
1.2. 适用性和局限性

This document specifies the translation algorithms between IPv4 packets and IPv6 packets.

本文档指定IPv4数据包和IPv6数据包之间的转换算法。

As with [RFC6145], the translating function specified in this document does not translate any IPv4 options, and it does not translate IPv6 extension headers except the Fragment Header.

与[RFC6145]一样,本文档中指定的转换函数不会转换任何IPv4选项,也不会转换除片段头之外的IPv6扩展头。

The issues and algorithms in the translation of datagrams containing TCP segments are described in [RFC5382].

[RFC5382]中描述了包含TCP段的数据报翻译中的问题和算法。

Fragmented IPv4 UDP packets that do not contain a UDP checksum (i.e., the UDP checksum field is zero) are not of significant use on the Internet, and in general will not be translated by the IP/ICMP translator (Section 4.5). However, when the translator is configured to forward the packet without a UDP checksum, the fragmented IPv4 UDP packets will be translated.

不包含UDP校验和的分段IPv4 UDP数据包(即UDP校验和字段为零)在Internet上没有重要用途,通常不会由IP/ICMP转换器翻译(第4.5节)。但是,当转换器配置为转发不带UDP校验和的数据包时,将转换分段的IPv4 UDP数据包。

Fragmented ICMP/ICMPv6 packets will not be translated by IP/ICMP translators.

IP/ICMP转换器不会翻译零碎的ICMP/ICMPv6数据包。

The IP/ICMP header translation specified in this document is consistent with requirements of multicast IP/ICMP headers. However, IPv4 multicast addresses [RFC5771] cannot be mapped to IPv6 multicast addresses [RFC3307] based on the unicast mapping rule [RFC6052]. An example of experiments of the multicast address mapping can be found in [RFC6219].

本文档中指定的IP/ICMP标头翻译与多播IP/ICMP标头的要求一致。但是,无法根据单播映射规则[RFC6052]将IPv4多播地址[RFC5771]映射到IPv6多播地址[RFC3307]。在[RFC6219]中可以找到多播地址映射的实验示例。

1.3. Stateless vs. Stateful Mode
1.3. 无状态与有状态模式

An IP/ICMP translator has two possible modes of operation: stateless and stateful [RFC6144]. In both cases, we assume that a system (a node or an application) that has an IPv4 address but not an IPv6 address is communicating with a system that has an IPv6 address but no IPv4 address, or that the two systems do not have contiguous routing connectivity, or they might have contiguous routing connectivity but are interacting via masking addresses (i.e., hairpinning) [RFC4787], and hence are forced to have their communications translated.

IP/ICMP转换器有两种可能的操作模式:无状态和有状态[RFC6144]。在这两种情况下,我们假设具有IPv4地址但没有IPv6地址的系统(节点或应用程序)正在与具有IPv6地址但没有IPv4地址的系统通信,或者这两个系统没有连续的路由连接,或者,它们可能具有连续的路由连接,但通过屏蔽地址(即发夹)进行交互[RFC4787],因此被迫转换它们的通信。

In the stateless mode, an IP/ICMP translator will convert IPv4 addresses to IPv6 and vice versa solely based on the configuration of the stateless IP/ICMP translator and information contained within the packet being translated. For example, for the default behavior defined in [RFC6052], a specific IPv6 address range will represent IPv4 systems (IPv4-converted addresses), and the IPv6 systems have addresses (IPv4-translatable addresses) that can be algorithmically mapped to a subset of the service provider's IPv4 addresses. Other stateless translation algorithms are defined in Section 6. The stateless translator does not keep any dynamic session or binding state, thus there is no requirement that the packets in a single session or flow traverse a single translator.

在无状态模式下,IP/ICMP转换器将仅根据无状态IP/ICMP转换器的配置和正在翻译的数据包中包含的信息,将IPv4地址转换为IPv6地址,反之亦然。例如,对于[RFC6052]中定义的默认行为,特定的IPv6地址范围将表示IPv4系统(IPv4转换的地址),IPv6系统具有可以通过算法映射到服务提供商IPv4地址子集的地址(IPv4可翻译地址)。第6节定义了其他无状态翻译算法。无状态转换器不保持任何动态会话或绑定状态,因此不要求单个会话或流中的数据包遍历单个转换器。

In the stateful mode, a specific IPv6 address range (consisting of IPv4-converted IPv6 addresses) will typically represent IPv4 systems. The IPv6 nodes may use any IPv6 addresses [RFC4291] except in that range. A stateful IP/ICMP translator continuously maintains a dynamic translation table containing bindings between the IPv4 and IPv6 addresses, and likely also the Layer-4 identifiers, that are used in the translated packets. The exact address translations of any given packet thus become dependent on how packets belonging to the same session or flow have been translated. For this reason, stateful translation generally requires that all packets belonging to a single flow must traverse the same translator.

在有状态模式下,特定的IPv6地址范围(由IPv4转换的IPv6地址组成)通常表示IPv4系统。IPv6节点可以使用除该范围外的任何IPv6地址[RFC4291]。有状态IP/ICMP转换器持续维护一个动态转换表,其中包含IPv4和IPv6地址之间的绑定,也可能包含转换数据包中使用的第4层标识符。因此,任何给定数据包的确切地址转换取决于属于同一会话或流的数据包如何被转换。因此,有状态转换通常要求属于单个流的所有数据包必须遍历同一个转换器。

In order to be able to successfully translate a packet from IPv4 to IPv6 or vice versa, the translator must implement an address mapping algorithm. This document does not specify any such algorithms, instead these are referenced from Section 6.

为了能够成功地将数据包从IPv4转换为IPv6,或者反之亦然,转换器必须实现地址映射算法。本文件未规定任何此类算法,而是参考第6节。

1.4. Path MTU Discovery and Fragmentation
1.4. 路径MTU发现和分段

Due to the different sizes of the IPv4 and IPv6 header, which are 20+ octets and 40 octets respectively, handling the maximum packet size is critical for the operation of the IPv4/IPv6 translator. There are three mechanisms to handle this issue: path MTU discovery (PMTUD), fragmentation, and transport-layer negotiation such as the TCP Maximum Segment Size (MSS) option [RFC6691]. Note that the translator MUST behave as a router, i.e., the translator MUST send a Packet Too Big error message or fragment the packet when the packet size exceeds the MTU of the next-hop interface.

由于IPv4和IPv6报头的大小不同,分别为20+个八位字节和40个八位字节,因此处理最大数据包大小对于IPv4/IPv6转换器的操作至关重要。有三种机制来处理此问题:路径MTU发现(PMTUD)、分段和传输层协商,如TCP最大段大小(MSS)选项[RFC6691]。请注意,转换器必须充当路由器,即当数据包大小超过下一跳接口的MTU时,转换器必须发送数据包过大错误消息或对数据包进行分段。

Don't Fragment, ICMP Packet Too Big, and packet fragmentation are discussed in Sections 4 and 5 of this document. The reassembling of fragmented packets in the stateful translator is discussed in [RFC6146], since it requires state maintenance in the translator.

本文档第4节和第5节讨论了不要分段、ICMP数据包太大和数据包分段。[RFC6146]中讨论了有状态转换器中碎片数据包的重新组装,因为它需要转换器中的状态维护。

2. Changes from RFC 6145
2. RFC 6145的变更

The changes from RFC 6145 are the following:

RFC 6145的变化如下:

1. Inserted the notes about IPv6 extension header handling: [Err3059], [Err3060], [Err3061], and [Err4090].

1. 插入了有关IPv6扩展标头处理的说明:[Err3059]、[Err3060]、[Err3061]和[Err4090]。

2. Deprecated the algorithm that generates the IPv6 atomic fragments, as a result of the analysis in [ATOMIC] and the specification in [IPv6].

2. 由于[atomic]中的分析和[IPv6]中的规范,不推荐使用生成IPv6原子片段的算法。

3. Inserted the notes for stateless source address mapping for ICMPv6 packets [RFC6791].

3. 插入了ICMPv6数据包的无状态源地址映射说明[RFC6791]。

4. Supported new address mapping algorithms and moved the discussion of these algorithms to Section 6.

4. 支持新的地址映射算法,并将对这些算法的讨论移至第6节。

3. Conventions
3. 习俗

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[RFC2119]中所述进行解释。

4. Translating from IPv4 to IPv6
4. 从IPv4到IPv6的转换

When an IP/ICMP translator receives an IPv4 datagram addressed to a destination towards the IPv6 domain, it translates the IPv4 header of that packet into an IPv6 header. The original IPv4 header on the packet is removed and replaced by an IPv6 header, and the transport checksum is updated as needed, if that transport is supported by the translator. The data portion of the packet is left unchanged. The IP/ICMP translator then forwards the packet based on the IPv6 destination address.

当IP/ICMP转换器接收到发往IPv6域的目标的IPv4数据报时,它会将该数据包的IPv4报头转换为IPv6报头。数据包上的原始IPv4标头将被删除并替换为IPv6标头,并且传输校验和将根据需要更新(如果转换器支持该传输)。数据包的数据部分保持不变。然后,IP/ICMP转换器根据IPv6目标地址转发数据包。

              +-------------+                 +-------------+
              |    IPv4     |                 |    IPv6     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |  Transport- |                 |  Fragment   |
              |   Layer     |      ===>       |   Header    |
              |   Header    |                 | (if needed) |
              +-------------+                 +-------------+
              |             |                 |  Transport- |
              ~    Data     ~                 |   Layer     |
              |             |                 |   Header    |
              +-------------+                 +-------------+
                                              |             |
                                              ~    Data     ~
                                              |             |
                                              +-------------+
        
              +-------------+                 +-------------+
              |    IPv4     |                 |    IPv6     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |  Transport- |                 |  Fragment   |
              |   Layer     |      ===>       |   Header    |
              |   Header    |                 | (if needed) |
              +-------------+                 +-------------+
              |             |                 |  Transport- |
              ~    Data     ~                 |   Layer     |
              |             |                 |   Header    |
              +-------------+                 +-------------+
                                              |             |
                                              ~    Data     ~
                                              |             |
                                              +-------------+
        

Figure 2: IPv4-to-IPv6 Translation

图2:IPv4到IPv6的转换

Path MTU discovery is mandatory in IPv6, but it is optional in IPv4. IPv6 routers never fragment a packet -- only the sender can do fragmentation.

路径MTU发现在IPv6中是必需的,但在IPv4中是可选的。IPv6路由器从不对数据包进行碎片化——只有发送方可以进行碎片化。

When an IPv4 node performs path MTU discovery (by setting the Don't Fragment (DF) bit in the header), path MTU discovery can operate end-to-end, i.e., across the translator. In this case, either IPv4 or IPv6 routers (including the translator) might send back ICMP Packet Too Big messages to the sender. When the IPv6 routers send these ICMPv6 errors, they will pass through a translator that will translate the ICMPv6 error to a form that the IPv4 sender can understand. As a result, an IPv6 Fragment Header is only included if the IPv4 packet is already fragmented.

当IPv4节点执行路径MTU发现时(通过在标头中设置不分段(DF)位),路径MTU发现可以端到端操作,即跨转换器。在这种情况下,IPv4或IPv6路由器(包括转换器)可能会向发送方发回过大的ICMP数据包消息。当IPv6路由器发送这些ICMPv6错误时,它们将通过一个转换器,该转换器将ICMPv6错误转换为IPv4发送者可以理解的形式。因此,仅当IPv4数据包已被分段时,才会包含IPv6片段头。

However, when the IPv4 sender does not set the DF bit, the translator MUST ensure that the packet does not exceed the path MTU on the IPv6 side. This is done by fragmenting the IPv4 packet (with Fragment Headers) so that it fits in 1280-byte IPv6 packets, since that is the

但是,当IPv4发送方未设置DF位时,转换器必须确保数据包不超过IPv6端的路径MTU。这是通过对IPv4数据包(带有片段头)进行分段来完成的,以便它适合1280字节的IPv6数据包,因为这是

minimum IPv6 MTU. The IPv6 Fragment Header has been shown to cause operational difficulties in practice due to limited firewall fragmentation support, etc. In an environment where the network owned/operated by the same entity that owns/operates the translator, the translator MUST provide a configuration function for the network administrator to adjust the threshold of the minimum IPv6 MTU to a value that reflects the real value of the minimum IPv6 MTU in the network (greater than 1280 bytes). This will help reduce the chance of including the Fragment Header in the packets.

最小IPv6 MTU。由于防火墙碎片支持有限等原因,IPv6碎片头在实践中会导致操作困难。在网络由拥有/操作转换器的同一实体拥有/操作的环境中,转换器必须为网络管理员提供配置功能,以将最小IPv6 MTU的阈值调整为反映网络中最小IPv6 MTU实际值的值(大于1280字节)。这将有助于减少在数据包中包含片段头的机会。

When the IPv4 sender does not set the DF bit, the translator MUST NOT include the Fragment Header for the non-fragmented IPv6 packets.

当IPv4发送方未设置DF位时,转换器不得包含非分段IPv6数据包的分段标头。

The rules in Section 4.1 ensure that when packets are fragmented, either by the sender or by IPv4 routers, the low-order 16 bits of the fragment identification are carried end-to-end, ensuring that packets are correctly reassembled.

第4.1节中的规则确保当数据包被发送方或IPv4路由器分割时,片段标识的低阶16位被端到端地传送,确保数据包被正确地重新组装。

Other than the special rules for handling fragments and path MTU discovery, the actual translation of the packet header consists of a simple translation as defined below. Note that ICMPv4 packets require special handling in order to translate the content of ICMPv4 error messages and also to add the ICMPv6 pseudo-header checksum.

除了处理片段和路径MTU发现的特殊规则外,数据包头的实际翻译包括以下定义的简单翻译。请注意,为了翻译ICMPv4错误消息的内容并添加ICMPv6伪报头校验和,ICMPv4数据包需要特殊处理。

The translator SHOULD make sure that the packets belonging to the same flow leave the translator in the same order in which they arrived.

翻译器应确保属于同一流的数据包以它们到达的相同顺序离开翻译器。

4.1. Translating IPv4 Headers into IPv6 Headers
4.1. 将IPv4标头转换为IPv6标头

If the DF flag is not set and the IPv4 packet will result in an IPv6 packet larger than a user-defined length (hereinafter referred to as "lowest-ipv6-mtu", and which defaults to 1280 bytes), the packet SHOULD be fragmented so that the resulting IPv6 packet (with Fragment Header added to each fragment) will be less than or equal to lowest-ipv6-mtu, For example, if the packet is fragmented prior to the translation, the IPv4 packets should be fragmented so that their length, excluding the IPv4 header, is at most 1232 bytes (1280 minus 40 for the IPv6 header and 8 for the Fragment Header). The translator MUST provide a configuration function for the network administrator to adjust the threshold of the minimum IPv6 MTU to a value greater than 1280 bytes if the real value of the minimum IPv6 MTU in the network is known to the administrator. The resulting fragments are then translated independently using the logic described below.

如果未设置DF标志,并且IPv4数据包将导致IPv6数据包大于用户定义的长度(以下称为“最低IPv6-mtu”,默认为1280字节),则应对数据包进行分段,以使生成的IPv6数据包(每个分段添加分段头)小于或等于最低IPv6-mtu,例如,如果数据包在转换之前被分段,则IPv4数据包应分段,以便其长度(不包括IPv4标头)最多为1232字节(IPv6标头为1280减去40,片段标头为8)。如果管理员知道网络中最小IPv6 MTU的实际值,转换器必须为网络管理员提供配置功能,以将最小IPv6 MTU的阈值调整为大于1280字节的值。然后使用下面描述的逻辑独立地翻译生成的片段。

If the DF bit is set and the MTU of the next-hop interface is less than the total length value of the IPv4 packet plus 20, the translator MUST send an ICMPv4 "Fragmentation Needed" error message to the IPv4 source address.

如果设置了DF位且下一跳接口的MTU小于IPv4数据包的总长度值加20,则转换器必须向IPv4源地址发送ICMPv4“需要碎片”错误消息。

The IPv6 header fields are set as follows:

IPv6标头字段设置如下:

Version: 6

版本:6

Traffic Class: By default, copied from the IP Type Of Service (TOS) octet. According to [RFC2474], the semantics of the bits are identical in IPv4 and IPv6. However, in some IPv4 environments these fields might be used with the old semantics of "Type Of Service and Precedence". An implementation of a translator SHOULD support an administratively configurable option to ignore the IPv4 TOS and always set the IPv6 traffic class (TC) to zero. In addition, if the translator is at an administrative boundary, the filtering and update considerations of [RFC2475] may be applicable.

流量类别:默认情况下,从IP服务类型(TOS)八位字节复制。根据[RFC2474],在IPv4和IPv6中,位的语义是相同的。但是,在某些IPv4环境中,这些字段可能与“服务类型和优先级”的旧语义一起使用。转换器的实现应支持一个管理上可配置的选项,以忽略IPv4 TOS,并始终将IPv6流量类(TC)设置为零。此外,如果翻译人员处于管理边界,则[RFC2475]的过滤和更新注意事项可能适用。

Flow Label: 0 (all zero bits)

流标签:0(所有零位)

Payload Length: Total length value from the IPv4 header, minus the size of the IPv4 header and IPv4 options, if present.

有效负载长度:IPv4标头的总长度值减去IPv4标头和IPv4选项(如果存在)的大小。

Next Header: For ICMPv4 (1), it is changed to ICMPv6 (58); otherwise, the protocol field MUST be copied from the IPv4 header.

下一个标题:对于ICMPv4(1),它更改为ICMPv6(58);否则,必须从IPv4标头复制协议字段。

Hop Limit: The hop limit is derived from the TTL value in the IPv4 header. Since the translator is a router, as part of forwarding the packet it needs to decrement either the IPv4 TTL (before the translation) or the IPv6 Hop Limit (after the translation). As part of decrementing the TTL or Hop Limit, the translator (as any router) MUST check for zero and send the ICMPv4 "TTL Exceeded" or ICMPv6 "Hop Limit Exceeded" error.

跃点限制:跃点限制源自IPv4标头中的TTL值。由于转换器是路由器,作为转发数据包的一部分,它需要减少IPv4 TTL(转换前)或IPv6跃点限制(转换后)。作为减少TTL或跃点限制的一部分,转换器(作为任何路由器)必须检查零并发送ICMPv4“TTL超出”或ICMPv6“跃点限制超出”错误。

Source Address: Mapped to an IPv6 address based on the algorithms presented in Section 6.

源地址:根据第6节介绍的算法映射到IPv6地址。

If the translator gets an illegal source address (e.g., 0.0.0.0, 127.0.0.1, etc.), the translator SHOULD silently discard the packet (as discussed in Section 5.3.7 of [RFC1812]). Note when translating ICMPv4 Error Messages into ICMPv6, the "illegal" source address will be translated for the purpose of trouble shooting.

如果翻译器获得非法源地址(例如,0.0.0.0、127.0.0.1等),翻译器应自动丢弃数据包(如[RFC1812]第5.3.7节所述)。注意:在将ICMPv4错误消息转换为ICMPv6时,将转换“非法”源地址以排除故障。

Destination Address: Mapped to an IPv6 address based on the algorithms presented in Section 6.

目标地址:根据第6节介绍的算法映射到IPv6地址。

If any IPv4 options are present in the IPv4 packet, they MUST be ignored and the packet translated normally; there is no attempt to translate the options. However, if an unexpired source route option is present, then the packet MUST instead be discarded, and an ICMPv4 "Destination Unreachable, Source Route Failed" (Type 3, Code 5) error message SHOULD be returned to the sender.

如果IPv4数据包中存在任何IPv4选项,则必须忽略这些选项并正常转换数据包;没有人试图转换这些选项。但是,如果存在未过期的源路由选项,则必须丢弃数据包,并且应将ICMPv4“目的地不可访问,源路由失败”(类型3,代码5)错误消息返回给发送方。

If there is a need to add a Fragment Header (the packet is a fragment or the DF bit is not set and the packet size is greater than the minimum IPv6 MTU in the network set by the translator configuration function), the header fields are set as above with the following exceptions:

如果需要添加片段头(数据包为片段或未设置DF位,且数据包大小大于网络中由转换器配置功能设置的最小IPv6 MTU),则头字段的设置如上所述,但以下情况除外:

IPv6 fields:

IPv6字段:

Payload Length: Total length value from the IPv4 header, plus 8 for the Fragment Header, minus the size of the IPv4 header and IPv4 options, if present.

有效负载长度:IPv4标头的总长度值,加上片段标头的8,减去IPv4标头的大小和IPv4选项(如果存在)。

Next Header: Fragment Header (44).

下一个标题:片段标题(44)。

Fragment Header fields:

片段头字段:

Next Header: For ICMPv4 (1), it is changed to ICMPv6 (58); otherwise, the protocol field MUST be copied from the IPv4 header.

下一个标题:对于ICMPv4(1),它更改为ICMPv6(58);否则,必须从IPv4标头复制协议字段。

Fragment Offset: Fragment Offset copied from the IPv4 header.

片段偏移量:从IPv4标头复制的片段偏移量。

M flag: More Fragments bit copied from the IPv4 header.

M标志:从IPv4标头复制了更多位碎片。

Identification: The low-order 16 bits copied from the Identification field in the IPv4 header. The high-order 16 bits set to zero.

标识:从IPv4报头中的标识字段复制的低阶16位。将高阶16位设置为零。

4.2. Translating ICMPv4 Headers into ICMPv6 Headers
4.2. 将ICMPv4标头转换为ICMPv6标头

All ICMPv4 messages that are to be translated require that the ICMPv6 checksum field be calculated as part of the translation since ICMPv6, unlike ICMPv4, has a pseudo-header checksum just like UDP and TCP.

所有要翻译的ICMPv4消息都要求ICMPv6校验和字段作为翻译的一部分进行计算,因为ICMPv6与ICMPv4不同,它与UDP和TCP一样具有伪报头校验和。

In addition, all ICMPv4 packets MUST have the Type translated and, for ICMPv4 error messages, the included IP header also MUST be translated.

此外,所有ICMPv4数据包必须转换类型,对于ICMPv4错误消息,还必须转换包含的IP头。

The actions needed to translate various ICMPv4 messages are as follows:

翻译各种ICMPv4消息所需的操作如下:

ICMPv4 query messages:

ICMPv4查询消息:

Echo and Echo Reply (Type 8 and Type 0): Adjust the Type values to 128 and 129, respectively, and adjust the ICMP checksum both to take the type change into account and to include the ICMPv6 pseudo-header.

Echo和Echo Reply(类型8和类型0):分别将类型值调整为128和129,并调整ICMP校验和,以考虑类型更改并包括ICMPv6伪头。

Information Request/Reply (Type 15 and Type 16): Obsoleted in ICMPv6. Silently drop.

信息请求/回复(类型15和类型16):在ICMPv6中被淘汰。静静地落下。

Timestamp and Timestamp Reply (Type 13 and Type 14): Obsoleted in ICMPv6. Silently drop.

时间戳和时间戳回复(类型13和类型14):在ICMPv6中被淘汰。静静地落下。

Address Mask Request/Reply (Type 17 and Type 18): Obsoleted in ICMPv6. Silently drop.

地址掩码请求/应答(类型17和类型18):在ICMPv6中被淘汰。静静地落下。

ICMP Router Advertisement (Type 9): Single-hop message. Silently drop.

ICMP路由器广告(类型9):单跳消息。静静地落下。

ICMP Router Solicitation (Type 10): Single-hop message. Silently drop.

ICMP路由器请求(类型10):单跳消息。静静地落下。

Unknown ICMPv4 types: Silently drop.

未知的ICMPv4类型:静默删除。

IGMP messages: While the Multicast Listener Discovery (MLD) messages specified in [RFC2710], [RFC3590], and [RFC3810] are the logical IPv6 counterparts for the IPv4 IGMP messages, all the "normal" IGMP messages are single-hop messages and SHOULD be silently dropped by the translator. Other IGMP messages might be used by multicast routing protocols and, since it would be a configuration error to try to have router adjacencies across IP/ICMP translators, those packets SHOULD also be silently dropped.

IGMP消息:虽然[RFC2710]、[RFC3590]和[RFC3810]中指定的多播侦听器发现(MLD)消息是IPv4 IGMP消息的逻辑IPv6对应项,但所有“正常”IGMP消息都是单跳消息,应该由转换器无声地丢弃。多播路由协议可能会使用其他IGMP消息,并且,由于试图在IP/ICMP转换器之间建立路由器邻接可能是一种配置错误,因此这些数据包也应该被静默丢弃。

ICMPv4 error messages:

ICMPv4错误消息:

Destination Unreachable (Type 3): Translate the Code as described below, set the Type to 1, and adjust the ICMP checksum both to take the type/code change into account and to include the ICMPv6 pseudo-header.

无法到达目的地(类型3):按如下所述翻译代码,将类型设置为1,并调整ICMP校验和,以考虑类型/代码更改并包括ICMPv6伪标头。

Translate the Code as follows:

将代码翻译如下:

Code 0, 1 (Net Unreachable, Host Unreachable): Set the Code to 0 (No route to destination).

代码0,1(无法访问网络,无法访问主机):将代码设置为0(没有到目标的路由)。

Code 2 (Protocol Unreachable): Translate to an ICMPv6 Parameter Problem (Type 4, Code 1) and make the Pointer point to the IPv6 Next Header field.

代码2(无法访问协议):转换为ICMPv6参数问题(类型4,代码1),并使指针指向IPv6下一个标头字段。

Code 3 (Port Unreachable): Set the Code to 4 (Port unreachable).

代码3(端口不可访问):将代码设置为4(端口不可访问)。

Code 4 (Fragmentation Needed and DF was Set): Translate to an ICMPv6 Packet Too Big message (Type 2) with Code set to 0. The MTU field MUST be adjusted for the difference between the IPv4 and IPv6 header sizes, but MUST NOT be set to a value smaller than the minimum IPv6 MTU (1280 bytes). That is, it should be set to

代码4(需要分段且已设置DF):转换为代码设置为0的ICMPv6数据包太大消息(类型2)。MTU字段必须根据IPv4和IPv6标头大小之间的差异进行调整,但不得设置为小于最小IPv6 MTU(1280字节)的值。也就是说,它应该设置为

maximum(1280, minimum((MTU value in the Packet Too Big Message) + 20, MTU_of_IPv6_nexthop, (MTU_of_IPv4_nexthop) + 20)).

最大值(1280,最小值((数据包中的MTU值太大消息)+20,IPv6的MTU\u nexthop,(IPv4的MTU\u nexthop)+20))。

Note that if the IPv4 router set the MTU field to zero, i.e., the router does not implement [RFC1191], then the translator MUST use the plateau values specified in [RFC1191] to determine a likely path MTU and include that path MTU in the ICMPv6 packet. (Use the greatest plateau value that is less than the returned Total Length field, but that is larger than or equal to 1280.)

请注意,如果IPv4路由器将MTU字段设置为零,即路由器未实现[RFC1191],则转换器必须使用[RFC1191]中指定的平台值来确定可能的路径MTU,并将该路径MTU包括在ICMPv6数据包中。(使用小于返回的总长度字段但大于或等于1280的最大平台值。)

See also the requirements in Section 7.

另见第7节中的要求。

Code 5 (Source Route Failed): Set the Code to 0 (No route to destination). Note that this error is unlikely since source routes are not translated.

代码5(源路由失败):将代码设置为0(没有到目标的路由)。请注意,由于未转换源路由,因此不太可能出现此错误。

Code 6, 7, 8: Set the Code to 0 (No route to destination).

代码6、7、8:将代码设置为0(没有到目的地的路线)。

Code 9, 10 (Communication with Destination Host Administratively Prohibited): Set the Code to 1 (Communication with destination administratively prohibited).

代码9、10(与目标主机的通信被行政禁止):将代码设置为1(与目标主机的通信被行政禁止)。

Code 11, 12: Set the Code to 0 (No route to destination).

代码11、12:将代码设置为0(没有到目的地的路线)。

Code 13 (Communication Administratively Prohibited): Set the Code to 1 (Communication with destination administratively prohibited).

代码13(通信管理禁止):将代码设置为1(与目标通信管理禁止)。

Code 14 (Host Precedence Violation): Silently drop.

代码14(主机优先级冲突):自动删除。

Code 15 (Precedence cutoff in effect): Set the Code to 1 (Communication with destination administratively prohibited).

代码15(生效的优先切断):将代码设置为1(与目标的通信被行政禁止)。

Other Code values: Silently drop.

其他代码值:静默删除。

Redirect (Type 5): Single-hop message. Silently drop.

重定向(类型5):单跳消息。静静地落下。

Alternative Host Address (Type 6): Silently drop.

备用主机地址(类型6):自动删除。

Source Quench (Type 4): Obsoleted in ICMPv6. Silently drop.

源淬火(类型4):在ICMPv6中被淘汰。静静地落下。

Time Exceeded (Type 11): Set the Type to 3, and adjust the ICMP checksum both to take the type change into account and to include the ICMPv6 pseudo-header. The Code is unchanged.

超出时间(类型11):将类型设置为3,并调整ICMP校验和,以考虑类型更改并包括ICMPv6伪标头。代码保持不变。

Parameter Problem (Type 12): Set the Type to 4, and adjust the ICMP checksum both to take the type/code change into account and to include the ICMPv6 pseudo-header.

参数问题(类型12):将类型设置为4,并调整ICMP校验和,以考虑类型/代码更改并包括ICMPv6伪标头。

Translate the Code as follows:

将代码翻译如下:

Code 0 (Pointer indicates the error): Set the Code to 0 (Erroneous header field encountered) and update the pointer as defined in Figure 3. (If the Original IPv4 Pointer Value is not listed or the Translated IPv6 Pointer Value is listed as "n/a", silently drop the packet.)

代码0(指针指示错误):将代码设置为0(遇到错误的头字段),并按照图3中的定义更新指针。(如果原始IPv4指针值未列出,或转换后的IPv6指针值列为“n/a”,则以静默方式丢弃数据包。)

Code 1 (Missing a required option): Silently drop.

代码1(缺少必需的选项):自动删除。

Code 2 (Bad length): Set the Code to 0 (Erroneous header field encountered) and update the pointer as defined in Figure 3. (If the Original IPv4 Pointer Value is not listed or the Translated IPv6 Pointer Value is listed as "n/a", silently drop the packet.)

代码2(错误长度):将代码设置为0(遇到错误的头字段),并按照图3中的定义更新指针。(如果原始IPv4指针值未列出,或转换后的IPv6指针值列为“n/a”,则以静默方式丢弃数据包。)

Other Code values: Silently drop.

其他代码值:静默删除。

Unknown ICMPv4 types: Silently drop.

未知的ICMPv4类型:静默删除。

    +--------------------------------+--------------------------------+
    |   Original IPv4 Pointer Value  | Translated IPv6 Pointer Value  |
    +--------------------------------+--------------------------------+
    |  0  | Version/IHL              |  0  | Version/Traffic Class    |
    |  1  | Type Of Service          |  1  | Traffic Class/Flow Label |
    | 2,3 | Total Length             |  4  | Payload Length           |
    | 4,5 | Identification           | n/a |                          |
    |  6  | Flags/Fragment Offset    | n/a |                          |
    |  7  | Fragment Offset          | n/a |                          |
    |  8  | Time to Live             |  7  | Hop Limit                |
    |  9  | Protocol                 |  6  | Next Header              |
    |10,11| Header Checksum          | n/a |                          |
    |12-15| Source Address           |  8  | Source Address           |
    |16-19| Destination Address      | 24  | Destination Address      |
    +--------------------------------+--------------------------------+
        
    +--------------------------------+--------------------------------+
    |   Original IPv4 Pointer Value  | Translated IPv6 Pointer Value  |
    +--------------------------------+--------------------------------+
    |  0  | Version/IHL              |  0  | Version/Traffic Class    |
    |  1  | Type Of Service          |  1  | Traffic Class/Flow Label |
    | 2,3 | Total Length             |  4  | Payload Length           |
    | 4,5 | Identification           | n/a |                          |
    |  6  | Flags/Fragment Offset    | n/a |                          |
    |  7  | Fragment Offset          | n/a |                          |
    |  8  | Time to Live             |  7  | Hop Limit                |
    |  9  | Protocol                 |  6  | Next Header              |
    |10,11| Header Checksum          | n/a |                          |
    |12-15| Source Address           |  8  | Source Address           |
    |16-19| Destination Address      | 24  | Destination Address      |
    +--------------------------------+--------------------------------+
        

Figure 3: Pointer Value for Translating from IPv4 to IPv6

图3:用于从IPv4转换到IPv6的指针值

ICMP Error Payload: If the received ICMPv4 packet contains an ICMPv4 Extension [RFC4884], the translation of the ICMPv4 packet will cause the ICMPv6 packet to change length. When this occurs, the ICMPv6 Extension length attribute MUST be adjusted accordingly (e.g., longer due to the translation from IPv4 to IPv6). If the ICMPv4 Extension exceeds the maximum size of an ICMPv6 message on the outgoing interface, the ICMPv4 extension SHOULD be simply truncated. For extensions not defined in [RFC4884], the translator passes the extensions as opaque bit strings, and those containing IPv4 address literals will not have their included addresses translated to IPv6 address literals; this may cause problems with processing of those ICMP extensions.

ICMP错误有效负载:如果收到的ICMPv4数据包包含ICMPv4扩展[RFC4884],ICMPv4数据包的转换将导致ICMPv6数据包更改长度。出现这种情况时,必须相应地调整ICMPv6扩展长度属性(例如,由于从IPv4到IPv6的转换而变长)。如果ICMPv4扩展超出传出接口上ICMPv6消息的最大大小,则只需截断ICMPv4扩展。对于[RFC4884]中未定义的扩展,转换器将扩展作为不透明位字符串传递,而包含IPv4地址文本的扩展将不会将其包含的地址转换为IPv6地址文本;这可能会导致处理这些ICMP扩展时出现问题。

4.3. Translating ICMPv4 Error Messages into ICMPv6
4.3. 将ICMPv4错误消息转换为ICMPv6

There are some differences between the ICMPv4 and the ICMPv6 error message formats as detailed above. The ICMP error messages containing the packet in error MUST be translated just like a normal IP packet (except the TTL value of the inner IPv4/IPv6 packet). If the translation of this "packet in error" changes the length of the datagram, the Total Length field in the outer IPv6 header MUST be updated.

如上所述,ICMPv4和ICMPv6错误消息格式之间存在一些差异。包含出错数据包的ICMP错误消息必须像普通IP数据包一样进行翻译(内部IPv4/IPv6数据包的TTL值除外)。如果此“错误数据包”的翻译更改了数据报的长度,则必须更新外部IPv6报头中的总长度字段。

              +-------------+                 +-------------+
              |    IPv4     |                 |    IPv6     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |   ICMPv4    |                 |   ICMPv6    |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |    IPv4     |      ===>       |    IPv6     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |   Partial   |                 |   Partial   |
              |  Transport- |                 |  Transport- |
              |   Layer     |                 |   Layer     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
        
              +-------------+                 +-------------+
              |    IPv4     |                 |    IPv6     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |   ICMPv4    |                 |   ICMPv6    |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |    IPv4     |      ===>       |    IPv6     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |   Partial   |                 |   Partial   |
              |  Transport- |                 |  Transport- |
              |   Layer     |                 |   Layer     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
        

Figure 4: IPv4-to-IPv6 ICMP Error Translation

图4:IPv4到IPv6 ICMP错误转换

The translation of the inner IP header can be done by invoking the function that translated the outer IP headers. This process MUST stop at the first embedded header and drop the packet if it contains more embedded headers.

内部IP头的转换可以通过调用转换外部IP头的函数来完成。此进程必须在第一个嵌入头处停止,如果数据包包含更多嵌入头,则丢弃该数据包。

4.4. Generation of ICMPv4 Error Message
4.4. 生成ICMPv4错误消息

If the IPv4 packet is discarded, then the translator SHOULD be able to send back an ICMPv4 error message to the original sender of the packet, unless the discarded packet is itself an ICMPv4 error message. The ICMPv4 message, if sent, has a Type of 3 (Destination Unreachable) and a Code of 13 (Communication Administratively Prohibited), unless otherwise specified in this document or in [RFC6146]. The translator SHOULD allow an administrator to configure whether the ICMPv4 error messages are sent, rate-limited, or not sent.

如果IPv4数据包被丢弃,那么转换器应该能够将ICMPv4错误消息发送回数据包的原始发送者,除非丢弃的数据包本身是ICMPv4错误消息。除非本文件或[RFC6146]中另有规定,否则ICMPv4消息(如果发送)的类型为3(无法到达目的地),代码为13(行政禁止通信)。转换器应允许管理员配置ICMPv4错误消息是已发送、速率受限还是未发送。

4.5. Transport-Layer Header Translation
4.5. 传输层标头转换

If the address translation algorithm is not checksum neutral (see Section 4.1 of [RFC6052]), the recalculation and updating of the transport-layer headers that contain pseudo-headers need to be performed. Translators MUST do this for TCP and ICMP packets and for UDP packets that contain a UDP checksum (i.e., the UDP checksum field is not zero).

如果地址转换算法不是校验和中性的(参见[RFC6052]第4.1节),则需要重新计算和更新包含伪报头的传输层报头。对于TCP和ICMP数据包以及包含UDP校验和的UDP数据包(即UDP校验和字段不为零),转换器必须执行此操作。

For UDP packets that do not contain a UDP checksum (i.e., the UDP checksum field is zero), the translator SHOULD provide a configuration function to allow:

对于不包含UDP校验和的UDP数据包(即UDP校验和字段为零),转换器应提供配置功能,以允许:

1. Dropping the packet and generating a system management event that specifies at least the IP addresses and port numbers of the packet.

1. 丢弃数据包并生成系统管理事件,该事件至少指定数据包的IP地址和端口号。

2. Calculating an IPv6 checksum and forwarding the packet (which has performance implications).

2. 计算IPv6校验和并转发数据包(这会影响性能)。

A stateless translator cannot compute the UDP checksum of fragmented packets, so when a stateless translator receives the first fragment of a fragmented UDP IPv4 packet and the checksum field is zero, the translator SHOULD drop the packet and generate a system management event that specifies at least the IP addresses and port numbers in the packet.

无状态转换器无法计算分段数据包的UDP校验和,因此当无状态转换器接收到分段UDP IPv4数据包的第一个片段且校验和字段为零时,转换器应丢弃数据包并生成一个系统管理事件,该事件至少指定数据包中的IP地址和端口号。

For a stateful translator, the handling of fragmented UDP IPv4 packets with a zero checksum is discussed in [RFC6146], Section 3.4.

对于有状态转换器,[RFC6146]第3.4节讨论了使用零校验和处理分段UDP IPv4数据包的方法。

Other transport protocols (e.g., the Datagram Congestion Control Protocol (DCCP)) are OPTIONAL to support. In order to ease debugging and troubleshooting, translators MUST forward all transport protocols as described in the "Next Header" step of Section 4.1.

其他传输协议(例如,数据报拥塞控制协议(DCCP))是可选的。为了简化调试和故障排除,翻译人员必须转发第4.1节“下一个标题”步骤中描述的所有传输协议。

4.6. Knowing When to Translate
4.6. 知道何时翻译

If the IP/ICMP translator also provides a normal forwarding function, and the destination IPv4 address is reachable by a more specific route without translation, the translator MUST forward it without translating it. Otherwise, when an IP/ICMP translator receives an IPv4 datagram addressed to an IPv4 destination representing a host in the IPv6 domain, the packet MUST be translated to IPv6.

如果IP/ICMP转换器还提供正常的转发功能,并且目标IPv4地址可以通过更具体的路由访问而无需翻译,则转换器必须转发而无需翻译。否则,当IP/ICMP转换器接收到一个IPv4数据报,该数据报发往表示IPv6域中主机的IPv4目标时,该数据包必须转换为IPv6。

5. Translating from IPv6 to IPv4
5. 从IPv6到IPv4的转换

When an IP/ICMP translator receives an IPv6 datagram addressed to a destination towards the IPv4 domain, it translates the IPv6 header of the received IPv6 packet into an IPv4 header. The original IPv6 header on the packet is removed and replaced by an IPv4 header. Since the ICMPv6 [RFC4443], TCP [RFC793], UDP [RFC768], and DCCP [RFC4340] headers contain checksums that cover the IP header, if the address mapping algorithm is not checksum neutral, the checksum MUST be evaluated before translation and the ICMP and transport-layer headers MUST be updated. The data portion of the packet is left unchanged. The IP/ICMP translator then forwards the packet based on the IPv4 destination address.

当IP/ICMP转换器接收到指向IPv4域的目标的IPv6数据报时,它将接收到的IPv6数据包的IPv6报头转换为IPv4报头。数据包上的原始IPv6标头将被删除并替换为IPv4标头。由于ICMPv6[RFC4443]、TCP[RFC793]、UDP[RFC768]和DCCP[RFC4340]报头包含覆盖IP报头的校验和,因此如果地址映射算法不是校验和中性的,则必须在转换之前评估校验和,并且必须更新ICMP和传输层报头。数据包的数据部分保持不变。然后,IP/ICMP转换器根据IPv4目标地址转发数据包。

              +-------------+                 +-------------+
              |    IPv6     |                 |    IPv4     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |  Fragment   |                 |  Transport  |
              |   Header    |      ===>       |   Layer     |
              |(if present) |                 |   Header    |
              +-------------+                 +-------------+
              |  Transport  |                 |             |
              |   Layer     |                 ~    Data     ~
              |   Header    |                 |             |
              +-------------+                 +-------------+
              |             |
              ~    Data     ~
              |             |
              +-------------+
        
              +-------------+                 +-------------+
              |    IPv6     |                 |    IPv4     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |  Fragment   |                 |  Transport  |
              |   Header    |      ===>       |   Layer     |
              |(if present) |                 |   Header    |
              +-------------+                 +-------------+
              |  Transport  |                 |             |
              |   Layer     |                 ~    Data     ~
              |   Header    |                 |             |
              +-------------+                 +-------------+
              |             |
              ~    Data     ~
              |             |
              +-------------+
        

Figure 5: IPv6-to-IPv4 Translation

图5:IPv6到IPv4的转换

There are some differences between IPv6 and IPv4 (in the areas of fragmentation and the minimum link MTU) that affect the translation. An IPv6 link has to have an MTU of 1280 bytes or greater. The corresponding limit for IPv4 is 68 bytes. Path MTU discovery across a translator relies on ICMP Packet Too Big messages being received and processed by IPv6 hosts.

IPv6和IPv4之间存在一些影响转换的差异(在碎片和最小链路MTU方面)。IPv6链路的MTU必须为1280字节或更大。IPv4的相应限制为68字节。跨转换器的路径MTU发现依赖于IPv6主机接收和处理的ICMP数据包太大的消息。

The difference in the minimum MTUs of IPv4 and IPv6 is accommodated as follows:

IPv4和IPv6的最小MTU之间的差异如下所示:

o When translating an ICMPv4 "Fragmentation Needed" packet, the indicated MTU in the resulting ICMPv6 "Packet Too Big" will never be set to a value lower than 1280. This ensures that the IPv6 nodes will never have to encounter or handle Path MTU values lower than the minimum IPv6 link MTU of 1280. See Section 4.2.

o 翻译ICMPv4“需要分段”数据包时,生成的ICMPv6“数据包太大”中指示的MTU将永远不会设置为低于1280的值。这确保IPv6节点永远不会遇到或处理低于最小IPv6链路MTU 1280的路径MTU值。见第4.2节。

o When the resulting IPv4 packet is smaller than or equal to 1260 bytes, the translator MUST send the packet with a cleared Don't Fragment bit. Otherwise, the packet MUST be sent with the Don't Fragment bit set. See Section 5.1.

o 当生成的IPv4数据包小于或等于1260字节时,转换器必须发送带有清除的不分段位的数据包。否则,数据包必须使用“不分段”位集发送。见第5.1节。

This approach allows Path MTU Discovery to operate end-to-end for paths whose MTU are not smaller than the minimum IPv6 MTU of 1280 (which corresponds to an MTU of 1260 in the IPv4 domain). On paths that have IPv4 links with MTU < 1260, the IPv4 router(s) connected to those links will fragment the packets in accordance with Section 2.3 of [RFC791].

此方法允许路径MTU发现对MTU不小于最小IPv6 MTU 1280(对应于IPv4域中的MTU 1260)的路径进行端到端操作。在具有MTU<1260的IPv4链路的路径上,连接到这些链路的IPv4路由器将根据[RFC791]第2.3节对数据包进行分段。

Other than the special rules for handling fragments and path MTU discovery, the actual translation of the packet header consists of a simple translation as defined below. Note that ICMPv6 packets require special handling in order to translate the contents of ICMPv6 error messages and also to remove the ICMPv6 pseudo-header checksum.

除了处理片段和路径MTU发现的特殊规则外,数据包头的实际翻译包括以下定义的简单翻译。请注意,ICMPv6数据包需要特殊处理,以便转换ICMPv6错误消息的内容,并删除ICMPv6伪报头校验和。

The translator SHOULD make sure that the packets belonging to the same flow leave the translator in the same order in which they arrived.

翻译器应确保属于同一流的数据包以它们到达的相同顺序离开翻译器。

5.1. Translating IPv6 Headers into IPv4 Headers
5.1. 将IPv6标头转换为IPv4标头

If there is no IPv6 Fragment Header, the IPv4 header fields are set as follows:

如果没有IPv6片段头,则IPv4头字段设置如下:

Version: 4

版本:4

Internet Header Length: 5 (no IPv4 options)

Internet标头长度:5(无IPv4选项)

Type of Service (TOS) Octet: By default, copied from the IPv6 Traffic Class (all 8 bits). According to [RFC2474], the semantics of the bits are identical in IPv4 and IPv6. However, in some IPv4 environments, these bits might be used with the old semantics of "Type Of Service and Precedence". An implementation of a translator SHOULD provide the ability to ignore the IPv6 traffic class and always set the IPv4 TOS Octet to a specified value. In addition, if the translator is at an administrative boundary, the filtering and update considerations of [RFC2475] may be applicable.

服务类型(TOS)八位字节:默认情况下,从IPv6流量类复制(全部8位)。根据[RFC2474],在IPv4和IPv6中,位的语义是相同的。但是,在某些IPv4环境中,这些位可能与“服务类型和优先级”的旧语义一起使用。转换器的实现应提供忽略IPv6流量类的能力,并始终将IPv4 TOS八位字节设置为指定值。此外,如果翻译人员处于管理边界,则[RFC2475]的过滤和更新注意事项可能适用。

Total Length: Payload length value from the IPv6 header, plus the size of the IPv4 header.

总长度:IPv6标头的有效负载长度值加上IPv4标头的大小。

Identification: Set according to a Fragment Identification generator at the translator.

标识:根据翻译器上的片段标识生成器设置。

Flags: The More Fragments flag is set to zero. The Don't Fragment (DF) flag is set as follows: If the size of the translated IPv4 packet is less than or equal to 1260 bytes, it is set to zero; otherwise, it is set to one.

标志:更多碎片标志设置为零。不分段(DF)标志设置如下:如果转换后的IPv4数据包大小小于或等于1260字节,则将其设置为零;否则,将其设置为1。

Fragment Offset: All zeros.

片段偏移:全部为零。

Time to Live: Time to Live is derived from the Hop Limit value in the IPv6 header. Since the translator is a router, as part of forwarding the packet it needs to decrement either the IPv6 Hop Limit (before the translation) or the IPv4 TTL (after the

生存时间:生存时间源自IPv6标头中的跃点限制值。由于转换器是路由器,作为转发数据包的一部分,它需要减少IPv6跃点限制(转换之前)或IPv4 TTL(转换之后)

translation). As part of decrementing the TTL or Hop Limit, the translator (as any router) MUST check for zero and send the ICMPv4 "TTL Exceeded" or ICMPv6 "Hop Limit Exceeded" error.

翻译)。作为减少TTL或跃点限制的一部分,转换器(作为任何路由器)必须检查零并发送ICMPv4“TTL超出”或ICMPv6“跃点限制超出”错误。

Protocol: The IPv6-Frag (44) header is handled as discussed in Section 5.1.1. ICMPv6 (58) is changed to ICMPv4 (1), and the payload is translated as discussed in Section 5.2. The IPv6 headers HOPOPT (0), IPv6-Route (43), and IPv6-Opts (60) are skipped over during processing as they have no meaning in IPv4. For the first 'next header' that does not match one of the cases above, its Next Header value (which contains the transport protocol number) is copied to the protocol field in the IPv4 header. This means that all transport protocols are translated.

协议:IPv6 Frag(44)头的处理如第5.1.1节所述。将ICMPv6(58)更改为ICMPv4(1),并按照第5.2节中的讨论转换有效负载。IPv6头HOPOPT(0)、IPv6路由(43)和IPv6选项(60)在处理过程中被跳过,因为它们在IPv4中没有任何意义。对于与上述情况之一不匹配的第一个“下一个标头”,其下一个标头值(包含传输协议编号)将复制到IPv4标头中的协议字段。这意味着所有传输协议都被转换。

Note: Some translated protocols will fail at the receiver for various reasons: some are known to fail when translated (e.g., IPsec Authentication Header (51)), and others will fail checksum validation if the address translation is not checksum neutral [RFC6052] and the translator does not update the transport protocol's checksum (because the translator doesn't support recalculating the checksum for that transport protocol; see Section 5.5).

注意:一些翻译后的协议在接收器处会因各种原因而失败:一些协议在翻译时会失败(例如,IPsec身份验证头(51)),如果地址翻译不是校验和中立的[RFC6052],并且转换器不会更新传输协议的校验和,则其他协议的校验和验证会失败(因为转换器不支持重新计算该传输协议的校验和;请参阅第5.5节)。

Header Checksum: Computed once the IPv4 header has been created.

标头校验和:创建IPv4标头后计算。

Source Address: Mapped to an IPv4 address based on the algorithms presented in Section 6.

源地址:根据第6节介绍的算法映射到IPv4地址。

If the translator gets an illegal source address (e.g., ::1, etc.), the translator SHOULD silently drop the packet.

如果翻译器获得非法的源地址(例如::1等),翻译器应该默默地丢弃数据包。

Destination Address: Mapped to an IPv4 address based on the algorithms presented in Section 6.

目标地址:根据第6节介绍的算法映射到IPv4地址。

If any of an IPv6 Hop-by-Hop Options header, Destination Options header, or Routing header with the Segments Left field equal to zero are present in the IPv6 packet, those IPv6 extension headers MUST be ignored (i.e., there is no attempt to translate the extension headers) and the packet translated normally. However, the Total Length field and the Protocol field are adjusted to "skip" these extension headers.

如果IPv6数据包中存在段左字段等于零的IPv6逐跳选项头、目的地选项头或路由头中的任何一个,则必须忽略这些IPv6扩展头(即,没有尝试转换扩展头),并正常转换数据包。但是,总长度字段和协议字段被调整为“跳过”这些扩展头。

If a Routing header with a non-zero Segments Left field is present, then the packet MUST NOT be translated, and an ICMPv6 "parameter problem/erroneous header field encountered" (Type 4, Code 0) error message, with the Pointer field indicating the first byte of the Segments Left field, SHOULD be returned to the sender.

如果存在具有非零段左字段的路由报头,则不得翻译数据包,并且应将ICMPv6“遇到参数问题/错误报头字段”(类型4,代码0)错误消息(指针字段指示段左字段的第一个字节)返回给发送方。

5.1.1. IPv6 Fragment Processing
5.1.1. IPv6片段处理

If the IPv6 packet contains a Fragment Header, the header fields are set as above with the following exceptions:

如果IPv6数据包包含片段标头,则标头字段的设置如上所述,但以下例外情况除外:

Total Length: If the Next Header field of the Fragment Header is an extension header (except ESP, but including the Authentication Header (AH)), then the packet SHOULD be dropped and logged. For other cases, the Total Length MUST be set to Payload Length value from IPv6 header, minus the length of the extension headers up to the Fragmentation Header, minus 8 for the Fragment Header, plus the size of the IPv4 header.

总长度:如果片段头的下一个头字段是扩展头(ESP除外,但包括身份验证头(AH)),则应丢弃并记录数据包。对于其他情况,总长度必须设置为IPv6标头的有效负载长度值,减去扩展标头到碎片标头的长度,减去片段标头的8,再加上IPv4标头的大小。

Identification: Copied from the low-order 16 bits in the Identification field in the Fragment Header.

标识:从片段头中标识字段的低位16位复制。

Flags: The IPv4 More Fragments (MF) flag is copied from the M flag in the IPv6 Fragment Header. The IPv4 Don't Fragment (DF) flag is cleared (set to zero), allowing this packet to be further fragmented by IPv4 routers.

标志:IPv4更多片段(MF)标志从IPv6片段头中的M标志复制而来。IPv4不分段(DF)标志被清除(设置为零),允许IPv4路由器进一步分段此数据包。

Fragment Offset: If the Next Header field of the Fragment Header is not an extension header (except ESP), then Fragment Offset MUST be copied from the Fragment Offset field of the IPv6 Fragment Header. If the Next Header field of the Fragment Header is an extension header (except ESP), then the packet SHOULD be dropped and logged.

片段偏移量:如果片段标头的下一个标头字段不是扩展标头(ESP除外),则必须从IPv6片段标头的片段偏移量字段复制片段偏移量。如果片段头的下一个头字段是扩展头(ESP除外),则应丢弃并记录数据包。

Protocol: For ICMPv6 (58), it is changed to ICMPv4 (1); otherwise, extension headers are skipped, and the Next Header field is copied from the last IPv6 header.

协议:对于ICMPv6(58),将其更改为ICMPv4(1);否则,将跳过扩展标头,并从上一个IPv6标头复制下一个标头字段。

If an IPv6 packet that is smaller than or equal to 1280 bytes results (after translation) in an IPv4 packet that is larger than the MTU of the next-hop interface, then the translator MUST perform IPv4 fragmentation on that packet such that it can be transferred over the constricting link.

如果小于或等于1280字节的IPv6数据包导致(转换后)IPv4数据包大于下一跳接口的MTU,则转换器必须对该数据包执行IPv4分段,以便可以通过压缩链路传输该数据包。

5.2. Translating ICMPv6 Headers into ICMPv4 Headers
5.2. 将ICMPv6头转换为ICMPv4头

If a non-checksum-neutral translation address is being used, ICMPv6 messages MUST have their ICMPv4 checksum field be updated as part of the translation since ICMPv6 (unlike ICMPv4) includes a pseudo-header in the checksum just like UDP and TCP.

如果使用非校验和中性转换地址,则ICMPv6消息的ICMPv4校验和字段必须作为转换的一部分进行更新,因为ICMPv6(与ICMPv4不同)在校验和中包含伪头,就像UDP和TCP一样。

In addition, all ICMP packets MUST have the Type translated and, for ICMP error messages, the included IP header MUST also be translated.

此外,所有ICMP数据包都必须转换类型,对于ICMP错误消息,还必须转换包含的IP头。

The actions needed to translate various ICMPv6 messages are:

翻译各种ICMPv6消息所需的操作包括:

ICMPv6 informational messages:

ICMPv6信息性消息:

Echo Request and Echo Reply (Type 128 and 129): Adjust the Type values to 8 and 0, respectively, and adjust the ICMP checksum both to take the type change into account and to exclude the ICMPv6 pseudo-header.

Echo Request和Echo Reply(类型128和129):分别将类型值调整为8和0,并调整ICMP校验和,以考虑类型更改并排除ICMPv6伪头。

MLD Multicast Listener Query/Report/Done (Type 130, 131, 132): Single-hop message. Silently drop.

MLD多播侦听器查询/报告/完成(类型130、131、132):单跳消息。静静地落下。

Neighbor Discover messages (Type 133 through 137): Single-hop message. Silently drop.

邻居发现消息(类型133到137):单跳消息。静静地落下。

Unknown informational messages: Silently drop.

未知信息消息:静默删除。

ICMPv6 error messages:

ICMPv6错误消息:

Destination Unreachable (Type 1) Set the Type to 3, and adjust the ICMP checksum both to take the type/code change into account and to exclude the ICMPv6 pseudo-header.

目标不可到达(类型1)将类型设置为3,并调整ICMP校验和,以考虑类型/代码更改并排除ICMPv6伪标头。

Translate the Code as follows:

将代码翻译如下:

Code 0 (No route to destination): Set the Code to 1 (Host unreachable).

代码0(没有到目的地的路由):将代码设置为1(无法访问主机)。

Code 1 (Communication with destination administratively prohibited): Set the Code to 10 (Communication with destination host administratively prohibited).

代码1(与目标主机的通信被行政禁止):将代码设置为10(与目标主机的通信被行政禁止)。

Code 2 (Beyond scope of source address): Set the Code to 1 (Host unreachable). Note that this error is very unlikely since an IPv4-translatable source address is typically considered to have global scope.

代码2(超出源地址范围):将代码设置为1(无法访问主机)。请注意,由于IPv4可翻译源地址通常被视为具有全局作用域,因此此错误不太可能发生。

Code 3 (Address unreachable): Set the Code to 1 (Host unreachable).

代码3(地址不可访问):将代码设置为1(主机不可访问)。

Code 4 (Port unreachable): Set the Code to 3 (Port unreachable).

代码4(端口不可访问):将代码设置为3(端口不可访问)。

Other Code values: Silently drop.

其他代码值:静默删除。

Packet Too Big (Type 2): Translate to an ICMPv4 Destination Unreachable (Type 3) with Code 4, and adjust the ICMPv4 checksum both to take the type change into account and to exclude the ICMPv6 pseudo-header. The MTU field MUST be adjusted for the difference between the IPv4 and IPv6 header sizes, taking into account whether or not the packet in error includes a Fragment Header, i.e., minimum((MTU value in the Packet Too Big Message)-20, MTU_of_IPv4_nexthop, (MTU_of_IPv6_nexthop)-20).

数据包太大(类型2):转换为代码为4的ICMPv4目标不可访问(类型3),并调整ICMPv4校验和,以考虑类型更改并排除ICMPv6伪标头。必须针对IPv4和IPv6报头大小之间的差异调整MTU字段,同时考虑出错的数据包是否包含片段报头,即最小值((数据包中的MTU值太大消息)-20,MTU_of_IPv4_nexthop,(MTU of_IPv6_nexthop)-20)。

See also the requirements in Section 7.

另见第7节中的要求。

Time Exceeded (Type 3): Set the Type to 11, and adjust the ICMPv4 checksum both to take the type change into account and to exclude the ICMPv6 pseudo-header. The Code is unchanged.

超出时间(类型3):将类型设置为11,并调整ICMPv4校验和,以考虑类型更改并排除ICMPv6伪标头。代码保持不变。

Parameter Problem (Type 4): Translate the Type and Code as follows, and adjust the ICMPv4 checksum both to take the type/ code change into account and to exclude the ICMPv6 pseudo-header.

参数问题(类型4):按如下方式转换类型和代码,并调整ICMPv4校验和,以考虑类型/代码更改并排除ICMPv6伪头。

Translate the Code as follows:

将代码翻译如下:

Code 0 (Erroneous header field encountered): Set to Type 12, Code 0, and update the pointer as defined in Figure 6. (If the Original IPv6 Pointer Value is not listed or the Translated IPv4 Pointer Value is listed as "n/a", silently drop the packet.)

代码0(遇到错误的标题字段):设置为类型12,代码0,并按照图6中的定义更新指针。(如果原始IPv6指针值未列出,或转换后的IPv4指针值列为“n/a”,则以静默方式丢弃数据包。)

Code 1 (Unrecognized Next Header type encountered): Translate this to an ICMPv4 protocol unreachable (Type 3, Code 2).

代码1(遇到无法识别的下一个标头类型):将其转换为无法访问的ICMPv4协议(类型3,代码2)。

Code 2 (Unrecognized IPv6 option encountered): Silently drop.

代码2(遇到无法识别的IPv6选项):自动删除。

Unknown error messages: Silently drop.

未知错误消息:自动删除。

    +--------------------------------+--------------------------------+
    |   Original IPv6 Pointer Value  | Translated IPv4 Pointer Value  |
    +--------------------------------+--------------------------------+
    |  0  | Version/Traffic Class    |  0  | Version/IHL, Type Of Ser |
    |  1  | Traffic Class/Flow Label |  1  | Type Of Service          |
    | 2,3 | Flow Label               | n/a |                          |
    | 4,5 | Payload Length           |  2  | Total Length             |
    |  6  | Next Header              |  9  | Protocol                 |
    |  7  | Hop Limit                |  8  | Time to Live             |
    | 8-23| Source Address           | 12  | Source Address           |
    |24-39| Destination Address      | 16  | Destination Address      |
    +--------------------------------+--------------------------------+
        
    +--------------------------------+--------------------------------+
    |   Original IPv6 Pointer Value  | Translated IPv4 Pointer Value  |
    +--------------------------------+--------------------------------+
    |  0  | Version/Traffic Class    |  0  | Version/IHL, Type Of Ser |
    |  1  | Traffic Class/Flow Label |  1  | Type Of Service          |
    | 2,3 | Flow Label               | n/a |                          |
    | 4,5 | Payload Length           |  2  | Total Length             |
    |  6  | Next Header              |  9  | Protocol                 |
    |  7  | Hop Limit                |  8  | Time to Live             |
    | 8-23| Source Address           | 12  | Source Address           |
    |24-39| Destination Address      | 16  | Destination Address      |
    +--------------------------------+--------------------------------+
        

Figure 6: Pointer Value for Translating from IPv6 to IPv4

图6:用于从IPv6转换到IPv4的指针值

ICMP Error Payload: If the received ICMPv6 packet contains an ICMPv6 Extension [RFC4884], the translation of the ICMPv6 packet will cause the ICMPv4 packet to change length. When this occurs, the ICMPv6 Extension length attribute MUST be adjusted accordingly (e.g., shorter due to the translation from IPv6 to IPv4). For extensions not defined in [RFC4884], the translator passes the extensions as opaque bit strings and any IPv6 address literals contained therein will not be translated to IPv4 address literals; this may cause problems with processing of those ICMP extensions.

ICMP错误有效负载:如果收到的ICMPv6数据包包含ICMPv6扩展[RFC4884],ICMPv6数据包的转换将导致ICMPv4数据包更改长度。出现这种情况时,必须相应地调整ICMPv6扩展长度属性(例如,由于从IPv6转换为IPv4而缩短)。对于[RFC4884]中未定义的扩展,转换器将扩展作为不透明位字符串传递,其中包含的任何IPv6地址文字将不会转换为IPv4地址文字;这可能会导致处理这些ICMP扩展时出现问题。

5.3. Translating ICMPv6 Error Messages into ICMPv4
5.3. 将ICMPv6错误消息转换为ICMPv4

There are some differences between the ICMPv4 and the ICMPv6 error message formats as detailed above. The ICMP error messages containing the packet in error MUST be translated just like a normal IP packet (except that the TTL/Hop Limit value of the inner IPv4/IPv6 packet are not decremented). The translation of this "packet in error" is likely to change the length of the datagram; thus, the Total Length field in the outer IPv4 header MUST be updated.

如上所述,ICMPv4和ICMPv6错误消息格式之间存在一些差异。包含出错数据包的ICMP错误消息必须像普通IP数据包一样进行翻译(内部IPv4/IPv6数据包的TTL/Hop限制值未递减除外)。这种“错误数据包”的翻译可能会改变数据报的长度;因此,必须更新外部IPv4标头中的总长度字段。

              +-------------+                 +-------------+
              |    IPv6     |                 |    IPv4     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |   ICMPv6    |                 |   ICMPv4    |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |    IPv6     |      ===>       |    IPv4     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |   Partial   |                 |   Partial   |
              |  Transport- |                 |  Transport- |
              |   Layer     |                 |   Layer     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
        
              +-------------+                 +-------------+
              |    IPv6     |                 |    IPv4     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |   ICMPv6    |                 |   ICMPv4    |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |    IPv6     |      ===>       |    IPv4     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
              |   Partial   |                 |   Partial   |
              |  Transport- |                 |  Transport- |
              |   Layer     |                 |   Layer     |
              |   Header    |                 |   Header    |
              +-------------+                 +-------------+
        

Figure 7: IPv6-to-IPv4 ICMP Error Translation

图7:IPv6到IPv4 ICMP错误转换

The translation of the inner IP header can be done by invoking the function that translated the outer IP headers. This process MUST stop at the first embedded header and drop the packet if it contains more embedded headers.

内部IP头的转换可以通过调用转换外部IP头的函数来完成。此进程必须在第一个嵌入头处停止,如果数据包包含更多嵌入头,则丢弃该数据包。

5.4. Generation of ICMPv6 Error Messages
5.4. 生成ICMPv6错误消息

If the IPv6 packet is discarded, then the translator SHOULD send back an ICMPv6 error message to the original sender of the packet, unless the discarded packet is itself an ICMPv6 message.

如果IPv6数据包被丢弃,则转换器应向数据包的原始发送者发回ICMPv6错误消息,除非丢弃的数据包本身是ICMPv6消息。

The ICMPv6 message MUST have Type 1 (Destination Unreachable) and Code 1 (Communication with destination administratively prohibited), unless otherwise specified in this document or [RFC6146]. The translator SHOULD allow an administrator to configure whether the ICMPv6 error messages are sent, rate-limited, or not sent.

除非本文档或[RFC6146]中另有规定,否则ICMPv6消息必须具有类型1(无法到达目的地)和代码1(禁止与目的地通信)。转换器应允许管理员配置ICMPv6错误消息是否已发送、速率受限或未发送。

5.5. Transport-Layer Header Translation
5.5. 传输层标头转换

If the address translation algorithm is not checksum neutral (see Section 4.1 of [RFC6052]), the recalculation and updating of the transport-layer headers that contain pseudo-headers need to be performed. Translators MUST do this for TCP, UDP, and ICMP.

如果地址转换算法不是校验和中性的(参见[RFC6052]第4.1节),则需要重新计算和更新包含伪报头的传输层报头。对于TCP、UDP和ICMP,转换器必须这样做。

Other transport protocols (e.g., DCCP) are OPTIONAL to support. In order to ease debugging and troubleshooting, translators MUST forward all transport protocols as described in the "Protocol" step of Section 5.1.

其他传输协议(如DCCP)是可选的。为了简化调试和故障排除,翻译人员必须转发第5.1节“协议”步骤中所述的所有传输协议。

5.6. Knowing When to Translate
5.6. 知道何时翻译

If the IP/ICMP translator also provides a normal forwarding function, and the destination address is reachable by a more specific route without translation, the router MUST forward it without translating it. When an IP/ICMP translator receives an IPv6 datagram addressed to an IPv6 address representing a host in the IPv4 domain, the IPv6 packet MUST be translated to IPv4.

如果IP/ICMP转换器也提供正常的转发功能,并且目标地址可以通过更具体的路由访问而无需翻译,则路由器必须转发而无需翻译。当IP/ICMP转换器接收到一个IPv6数据报,该数据报的地址为表示IPv4域中主机的IPv6地址时,IPv6数据包必须转换为IPv4。

6. Mapping of IP Addresses
6. IP地址映射

The translator MUST support the stateless address mapping algorithm defined in [RFC6052], which is the default behavior. A workflow example is shown in Appendix A of this document. Note that [RFC7136] updates [RFC4291], which allows the use of unicast addresses without u-bit, as long as they're not derived from an IEEE MAC-layer address. Therefore, the address mapping algorithm defined in [RFC6219] also complies with the IPv6 address architecture.

转换器必须支持[RFC6052]中定义的无状态地址映射算法,这是默认行为。工作流示例如本文档附录A所示。请注意,[RFC7136]更新了[RFC4291],允许使用不带u位的单播地址,只要它们不是从IEEE MAC层地址派生的。因此,[RFC6219]中定义的地址映射算法也符合IPv6地址体系结构。

The stateless translator SHOULD support the explicit address mapping algorithm defined in [RFC7757].

无状态转换器应支持[RFC7757]中定义的显式地址映射算法。

The stateless translator SHOULD support [RFC6791] for handling ICMP/ ICMPv6 packets.

无状态转换器应支持[RFC6791]处理ICMP/ICMPv6数据包。

Implementations may support both stateless and stateful translation modes (e.g., Network Address and Protocol Translation from IPv6 Clients to IPv4 Servers (NAT64) [RFC6146]).

实现可能支持无状态和有状态转换模式(例如,从IPv6客户端到IPv4服务器(NAT64)[RFC6146]的网络地址和协议转换)。

Implementations may support stateless NAT64 function, e.g., MAP-T Customer Edge (CE) or MAP-T Border Relay (BR) [RFC7599].

实现可能支持无状态NAT64功能,例如MAP-T客户边缘(CE)或MAP-T边界中继(BR)[RFC7599]。

7. Special Considerations for ICMPv6 Packet Too Big
7. ICMPv6数据包过大的特殊注意事项

A number of studies [ATOMIC] indicate that it not unusual for networks to drop ICMPv6 Packet Too Big error messages. Such packet drops will result in PMTUD black holes [RFC2923], which can only be overcome with Packetization Layer Path MTU Discovery (PLPMTUD) [RFC4821].

许多研究[ATOMIC]表明,网络丢弃ICMPv6数据包太大的错误消息并不罕见。这种丢包将导致PMTUD黑洞[RFC2923],这只能通过包化层路径MTU发现(PLPMTUD)[RFC4821]来克服。

8. Security Considerations
8. 安全考虑

The use of stateless IP/ICMP translators does not introduce any new security issues beyond the security issues that are already present in the IPv4 and IPv6 protocols and in the routing protocols that are used to make the packets reach the translator.

除了IPv4和IPv6协议以及用于使数据包到达转换器的路由协议中已经存在的安全问题外,使用无状态IP/ICMP转换器不会带来任何新的安全问题。

There are potential issues that might arise by deriving an IPv4 address from an IPv6 address -- particularly addresses like broadcast or loopback addresses and the non-IPv4-translatable IPv6 addresses, etc. [RFC6052] addresses these issues.

从IPv6地址派生IPv4地址可能会出现一些潜在问题,特别是广播或环回地址以及非IPv4可翻译IPv6地址等地址。[RFC6052]解决了这些问题。

The IPsec Authentication Header [RFC4302] cannot be used for NAT44 or NAT64.

IPsec身份验证标头[RFC4302]不能用于NAT44或NAT64。

As with the network address translation of IPv4 to IPv4, packets with tunnel mode Encapsulating Security Payload (ESP) can be translated since tunnel mode ESP does not depend on header fields prior to the ESP header. Similarly, transport mode ESP will fail with IPv6-to-IPv4 translation unless checksum-neutral addresses are used. In both cases, the IPsec ESP endpoints will normally detect the presence of the translator and encapsulate ESP in UDP packets [RFC3948].

与IPv4到IPv4的网络地址转换一样,可以转换具有隧道模式封装安全有效负载(ESP)的数据包,因为隧道模式ESP不依赖于ESP报头之前的报头字段。类似地,除非使用校验和中性地址,否则传输模式ESP将在IPv6到IPv4转换时失败。在这两种情况下,IPsec ESP端点通常会检测到转换器的存在,并将ESP封装在UDP数据包中[RFC3948]。

9. References
9. 工具书类
9.1. Normative References
9.1. 规范性引用文件

[RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, DOI 10.17487/RFC0768, August 1980, <http://www.rfc-editor.org/info/rfc768>.

[RFC768]Postel,J.,“用户数据报协议”,STD 6,RFC 768,DOI 10.17487/RFC0768,1980年8月<http://www.rfc-editor.org/info/rfc768>.

[RFC791] Postel, J., "Internet Protocol", STD 5, RFC 791, DOI 10.17487/RFC0791, September 1981, <http://www.rfc-editor.org/info/rfc791>.

[RFC791]Postel,J.,“互联网协议”,STD 5,RFC 791,DOI 10.17487/RFC07911981年9月<http://www.rfc-editor.org/info/rfc791>.

[RFC793] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, DOI 10.17487/RFC0793, September 1981, <http://www.rfc-editor.org/info/rfc793>.

[RFC793]Postel,J.,“传输控制协议”,标准7,RFC 793,DOI 10.17487/RFC0793,1981年9月<http://www.rfc-editor.org/info/rfc793>.

[RFC1812] Baker, F., Ed., "Requirements for IP Version 4 Routers", RFC 1812, DOI 10.17487/RFC1812, June 1995, <http://www.rfc-editor.org/info/rfc1812>.

[RFC1812]Baker,F.,Ed.,“IP版本4路由器的要求”,RFC 1812,DOI 10.17487/RFC1812,1995年6月<http://www.rfc-editor.org/info/rfc1812>.

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,DOI 10.17487/RFC2119,1997年3月<http://www.rfc-editor.org/info/rfc2119>.

[RFC3948] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M. Stenberg, "UDP Encapsulation of IPsec ESP Packets", RFC 3948, DOI 10.17487/RFC3948, January 2005, <http://www.rfc-editor.org/info/rfc3948>.

[RFC3948]Huttunen,A.,Swander,B.,Volpe,V.,DiBurro,L.,和M.Stenberg,“IPsec ESP数据包的UDP封装”,RFC 3948,DOI 10.17487/RFC3948,2005年1月<http://www.rfc-editor.org/info/rfc3948>.

[RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 4291, DOI 10.17487/RFC4291, February 2006, <http://www.rfc-editor.org/info/rfc4291>.

[RFC4291]Hinden,R.和S.Deering,“IP版本6寻址体系结构”,RFC 4291,DOI 10.17487/RFC42912006年2月<http://www.rfc-editor.org/info/rfc4291>.

[RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram Congestion Control Protocol (DCCP)", RFC 4340, DOI 10.17487/RFC4340, March 2006, <http://www.rfc-editor.org/info/rfc4340>.

[RFC4340]Kohler,E.,Handley,M.和S.Floyd,“数据报拥塞控制协议(DCCP)”,RFC 4340,DOI 10.17487/RFC4340,2006年3月<http://www.rfc-editor.org/info/rfc4340>.

[RFC4443] Conta, A., Deering, S., and M. Gupta, Ed., "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification", RFC 4443, DOI 10.17487/RFC4443, March 2006, <http://www.rfc-editor.org/info/rfc4443>.

[RFC4443]Conta,A.,Deering,S.,和M.Gupta,Ed.,“互联网协议版本6(IPv6)规范的互联网控制消息协议(ICMPv6)”,RFC 4443,DOI 10.17487/RFC4443,2006年3月<http://www.rfc-editor.org/info/rfc4443>.

[RFC4884] Bonica, R., Gan, D., Tappan, D., and C. Pignataro, "Extended ICMP to Support Multi-Part Messages", RFC 4884, DOI 10.17487/RFC4884, April 2007, <http://www.rfc-editor.org/info/rfc4884>.

[RFC4884]Bonica,R.,Gan,D.,Tappan,D.,和C.Pignataro,“扩展ICMP以支持多部分消息”,RFC 4884,DOI 10.17487/RFC4884,2007年4月<http://www.rfc-editor.org/info/rfc4884>.

[RFC5382] Guha, S., Ed., Biswas, K., Ford, B., Sivakumar, S., and P. Srisuresh, "NAT Behavioral Requirements for TCP", BCP 142, RFC 5382, DOI 10.17487/RFC5382, October 2008, <http://www.rfc-editor.org/info/rfc5382>.

[RFC5382]Guha,S.,Ed.,Biswas,K.,Ford,B.,Sivakumar,S.,和P.Srisuresh,“TCP的NAT行为要求”,BCP 142,RFC 5382,DOI 10.17487/RFC5382,2008年10月<http://www.rfc-editor.org/info/rfc5382>.

[RFC5771] Cotton, M., Vegoda, L., and D. Meyer, "IANA Guidelines for IPv4 Multicast Address Assignments", BCP 51, RFC 5771, DOI 10.17487/RFC5771, March 2010, <http://www.rfc-editor.org/info/rfc5771>.

[RFC5771]Cotton,M.,Vegoda,L.,和D.Meyer,“IPv4多播地址分配的IANA指南”,BCP 51,RFC 5771,DOI 10.17487/RFC5771,2010年3月<http://www.rfc-editor.org/info/rfc5771>.

[RFC6052] Bao, C., Huitema, C., Bagnulo, M., Boucadair, M., and X. Li, "IPv6 Addressing of IPv4/IPv6 Translators", RFC 6052, DOI 10.17487/RFC6052, October 2010, <http://www.rfc-editor.org/info/rfc6052>.

[RFC6052]Bao,C.,Huitema,C.,Bagnulo,M.,Boucadair,M.,和X.Li,“IPv4/IPv6转换器的IPv6寻址”,RFC 6052,DOI 10.17487/RFC6052,2010年10月<http://www.rfc-editor.org/info/rfc6052>.

[RFC6145] Li, X., Bao, C., and F. Baker, "IP/ICMP Translation Algorithm", RFC 6145, DOI 10.17487/RFC6145, April 2011, <http://www.rfc-editor.org/info/rfc6145>.

[RFC6145]Li,X.,Bao,C.,和F.Baker,“IP/ICMP翻译算法”,RFC 6145DOI 10.17487/RFC6145,2011年4月<http://www.rfc-editor.org/info/rfc6145>.

[RFC6146] Bagnulo, M., Matthews, P., and I. van Beijnum, "Stateful NAT64: Network Address and Protocol Translation from IPv6 Clients to IPv4 Servers", RFC 6146, DOI 10.17487/RFC6146, April 2011, <http://www.rfc-editor.org/info/rfc6146>.

[RFC6146]Bagnulo,M.,Matthews,P.,和I.van Beijnum,“有状态NAT64:从IPv6客户端到IPv4服务器的网络地址和协议转换”,RFC 6146,DOI 10.17487/RFC6146,2011年4月<http://www.rfc-editor.org/info/rfc6146>.

[RFC6791] Li, X., Bao, C., Wing, D., Vaithianathan, R., and G. Huston, "Stateless Source Address Mapping for ICMPv6 Packets", RFC 6791, DOI 10.17487/RFC6791, November 2012, <http://www.rfc-editor.org/info/rfc6791>.

[RFC6791]Li,X.,Bao,C.,Wing,D.,Vaitianathan,R.,和G.Huston,“ICMPv6数据包的无状态源地址映射”,RFC 6791,DOI 10.17487/RFC6791192012年11月<http://www.rfc-editor.org/info/rfc6791>.

[RFC7757] Anderson, T. and A. Leiva Popper, "Explicit Address Mappings for Stateless IP/ICMP Translation", RFC 7757, DOI 10.17487/RFC7757, February 2016, <http://www.rfc-editor.org/info/rfc7757>.

[RFC7757]Anderson,T.和A.Leiva Popper,“无状态IP/ICMP转换的显式地址映射”,RFC 7757,DOI 10.17487/RFC7757,2016年2月<http://www.rfc-editor.org/info/rfc7757>.

9.2. Informative References
9.2. 资料性引用

[ATOMIC] Gont, F., LIU, S., and T. Anderson, "Generation of IPv6 Atomic Fragments Considered Harmful", Work in Progress, draft-ietf-6man-deprecate-atomfrag-generation-06, April 2016.

[ATOMIC]Gont,F.,LIU,S.,和T.Anderson,“被认为有害的IPv6原子碎片的生成”,正在进行的工作,草稿-ietf-6man-deprecate-atomfrag-Generation-062016年4月。

[Err3059] RFC Errata, Erratum ID 3059, RFC 6145.

[Err3059]RFC勘误表,勘误表ID 3059,RFC 6145。

[Err3060] RFC Errata, Erratum ID 3060, RFC 6145.

[Err3060]RFC勘误表,勘误表ID 3060,RFC 6145。

[Err3061] RFC Errata, Erratum ID 3061, RFC 6145.

[Err3061]RFC勘误表,勘误表ID 3061,RFC 6145。

[Err4090] RFC Errata, Erratum ID 4090, RFC 6145.

[Err4090]RFC勘误表,勘误表ID 4090,RFC 6145。

[IPv6] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", Work in Progress, draft-ietf-6man-rfc2460bis-04, March 2016.

[IPv6]Deering,S.和R.Hinden,“互联网协议,第6版(IPv6)规范”,正在进行的工作,草案-ietf-6man-rfc2460bis-042016年3月。

[RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, DOI 10.17487/RFC1191, November 1990, <http://www.rfc-editor.org/info/rfc1191>.

[RFC1191]Mogul,J.和S.Deering,“MTU发现路径”,RFC 1191,DOI 10.17487/RFC1191,1990年11月<http://www.rfc-editor.org/info/rfc1191>.

[RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black, "Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers", RFC 2474, DOI 10.17487/RFC2474, December 1998, <http://www.rfc-editor.org/info/rfc2474>.

[RFC2474]Nichols,K.,Blake,S.,Baker,F.,和D.Black,“IPv4和IPv6报头中区分服务字段(DS字段)的定义”,RFC 2474,DOI 10.17487/RFC2474,1998年12月<http://www.rfc-editor.org/info/rfc2474>.

[RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., and W. Weiss, "An Architecture for Differentiated Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, <http://www.rfc-editor.org/info/rfc2475>.

[RFC2475]Blake,S.,Black,D.,Carlson,M.,Davies,E.,Wang,Z.,和W.Weiss,“差异化服务架构”,RFC 2475,DOI 10.17487/RFC2475,1998年12月<http://www.rfc-editor.org/info/rfc2475>.

[RFC2710] Deering, S., Fenner, W., and B. Haberman, "Multicast Listener Discovery (MLD) for IPv6", RFC 2710, DOI 10.17487/RFC2710, October 1999, <http://www.rfc-editor.org/info/rfc2710>.

[RFC2710]Deering,S.,Fenner,W.,和B.Haberman,“IPv6的多播侦听器发现(MLD)”,RFC 2710,DOI 10.17487/RFC2710,1999年10月<http://www.rfc-editor.org/info/rfc2710>.

[RFC2923] Lahey, K., "TCP Problems with Path MTU Discovery", RFC 2923, DOI 10.17487/RFC2923, September 2000, <http://www.rfc-editor.org/info/rfc2923>.

[RFC2923]Lahey,K.,“路径MTU发现的TCP问题”,RFC 2923,DOI 10.17487/RFC2923,2000年9月<http://www.rfc-editor.org/info/rfc2923>.

[RFC3307] Haberman, B., "Allocation Guidelines for IPv6 Multicast Addresses", RFC 3307, DOI 10.17487/RFC3307, August 2002, <http://www.rfc-editor.org/info/rfc3307>.

[RFC3307]Haberman,B.,“IPv6多播地址分配指南”,RFC 3307,DOI 10.17487/RFC3307,2002年8月<http://www.rfc-editor.org/info/rfc3307>.

[RFC3590] Haberman, B., "Source Address Selection for the Multicast Listener Discovery (MLD) Protocol", RFC 3590, DOI 10.17487/RFC3590, September 2003, <http://www.rfc-editor.org/info/rfc3590>.

[RFC3590]Haberman,B,“多播侦听器发现(MLD)协议的源地址选择”,RFC 3590,DOI 10.17487/RFC3590,2003年9月<http://www.rfc-editor.org/info/rfc3590>.

[RFC3810] Vida, R., Ed. and L. Costa, Ed., "Multicast Listener Discovery Version 2 (MLDv2) for IPv6", RFC 3810, DOI 10.17487/RFC3810, June 2004, <http://www.rfc-editor.org/info/rfc3810>.

[RFC3810]Vida,R.,Ed.和L.Costa,Ed.,“IPv6的多播侦听器发现版本2(MLDv2)”,RFC 3810,DOI 10.17487/RFC3810,2004年6月<http://www.rfc-editor.org/info/rfc3810>.

[RFC3849] Huston, G., Lord, A., and P. Smith, "IPv6 Address Prefix Reserved for Documentation", RFC 3849, DOI 10.17487/RFC3849, July 2004, <http://www.rfc-editor.org/info/rfc3849>.

[RFC3849]Huston,G.,Lord,A.,和P.Smith,“保留用于文档的IPv6地址前缀”,RFC 3849,DOI 10.17487/RFC3849,2004年7月<http://www.rfc-editor.org/info/rfc3849>.

[RFC4302] Kent, S., "IP Authentication Header", RFC 4302, DOI 10.17487/RFC4302, December 2005, <http://www.rfc-editor.org/info/rfc4302>.

[RFC4302]Kent,S.,“IP认证头”,RFC 4302,DOI 10.17487/RFC4302,2005年12月<http://www.rfc-editor.org/info/rfc4302>.

[RFC4787] Audet, F., Ed. and C. Jennings, "Network Address Translation (NAT) Behavioral Requirements for Unicast UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January 2007, <http://www.rfc-editor.org/info/rfc4787>.

[RFC4787]Audet,F.,Ed.和C.Jennings,“单播UDP的网络地址转换(NAT)行为要求”,BCP 127,RFC 4787,DOI 10.17487/RFC4787,2007年1月<http://www.rfc-editor.org/info/rfc4787>.

[RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007, <http://www.rfc-editor.org/info/rfc4821>.

[RFC4821]Mathis,M.和J.Heffner,“打包层路径MTU发现”,RFC 4821,DOI 10.17487/RFC4821,2007年3月<http://www.rfc-editor.org/info/rfc4821>.

[RFC5737] Arkko, J., Cotton, M., and L. Vegoda, "IPv4 Address Blocks Reserved for Documentation", RFC 5737, DOI 10.17487/RFC5737, January 2010, <http://www.rfc-editor.org/info/rfc5737>.

[RFC5737]Arkko,J.,Cotton,M.和L.Vegoda,“为文档保留的IPv4地址块”,RFC 5737,DOI 10.17487/RFC5737,2010年1月<http://www.rfc-editor.org/info/rfc5737>.

[RFC6144] Baker, F., Li, X., Bao, C., and K. Yin, "Framework for IPv4/IPv6 Translation", RFC 6144, DOI 10.17487/RFC6144, April 2011, <http://www.rfc-editor.org/info/rfc6144>.

[RFC6144]Baker,F.,Li,X.,Bao,C.,和K.Yin,“IPv4/IPv6转换框架”,RFC 6144DOI 10.17487/RFC6144,2011年4月<http://www.rfc-editor.org/info/rfc6144>.

[RFC6219] Li, X., Bao, C., Chen, M., Zhang, H., and J. Wu, "The China Education and Research Network (CERNET) IVI Translation Design and Deployment for the IPv4/IPv6 Coexistence and Transition", RFC 6219, DOI 10.17487/RFC6219, May 2011, <http://www.rfc-editor.org/info/rfc6219>.

[RFC6219]Li,X.,Bao,C.,Chen,M.,Zhang,H.,和J.Wu,“针对IPv4/IPv6共存和过渡的中国教育和研究网络(CERNET)IVI翻译设计和部署”,RFC 6219,DOI 10.17487/RFC6219,2011年5月<http://www.rfc-editor.org/info/rfc6219>.

[RFC6691] Borman, D., "TCP Options and Maximum Segment Size (MSS)", RFC 6691, DOI 10.17487/RFC6691, July 2012, <http://www.rfc-editor.org/info/rfc6691>.

[RFC6691]Borman,D.,“TCP选项和最大段大小(MSS)”,RFC 6691,DOI 10.17487/RFC6691192012年7月<http://www.rfc-editor.org/info/rfc6691>.

[RFC7136] Carpenter, B. and S. Jiang, "Significance of IPv6 Interface Identifiers", RFC 7136, DOI 10.17487/RFC7136, February 2014, <http://www.rfc-editor.org/info/rfc7136>.

[RFC7136]Carpenter,B.和S.Jiang,“IPv6接口标识符的重要性”,RFC 7136,DOI 10.17487/RFC7136,2014年2月<http://www.rfc-editor.org/info/rfc7136>.

[RFC7599] Li, X., Bao, C., Dec, W., Ed., Troan, O., Matsushima, S., and T. Murakami, "Mapping of Address and Port using Translation (MAP-T)", RFC 7599, DOI 10.17487/RFC7599, July 2015, <http://www.rfc-editor.org/info/rfc7599>.

[RFC7599]Li,X.,Bao,C.,Dec,W.,Ed.,Troan,O.,Matsushima,S.,和T.Murakami,“地址和端口映射使用翻译(MAP-T)”,RFC 7599,DOI 10.17487/RFC7599,2015年7月<http://www.rfc-editor.org/info/rfc7599>.

Appendix A. Stateless Translation Workflow Example
附录A.无状态翻译工作流示例

A stateless translation workflow example is depicted in the following figure. The documentation address blocks 2001:db8::/32 [RFC3849], 192.0.2.0/24, and 198.51.100.0/24 [RFC5737] are used in this example.

下图描述了一个无状态翻译工作流示例。此示例中使用了文档地址块2001:db8::/32[RFC3849]、192.0.2.0/24和198.51.100.0/24[RFC5737]。

            +--------------+                   +--------------+
            | IPv4 network |                   | IPv6 network |
            |              |     +-------+     |              |
            |   +----+     |-----| XLAT  |---- |  +----+      |
            |   | H4 |-----|     +-------+     |--| H6 |      |
            |   +----+     |                   |  +----+      |
            +--------------+                   +--------------+
        
            +--------------+                   +--------------+
            | IPv4 network |                   | IPv6 network |
            |              |     +-------+     |              |
            |   +----+     |-----| XLAT  |---- |  +----+      |
            |   | H4 |-----|     +-------+     |--| H6 |      |
            |   +----+     |                   |  +----+      |
            +--------------+                   +--------------+
        

Figure 8: Stateless Translation Workflow

图8:无状态翻译工作流

A translator (XLAT) connects the IPv6 network to the IPv4 network. This XLAT uses the Network-Specific Prefix (NSP) 2001:db8:100::/40 defined in [RFC6052] to represent IPv4 addresses in the IPv6 address space (IPv4-converted addresses) and to represent IPv6 addresses (IPv4-translatable addresses) in the IPv4 address space. In this example, 192.0.2.0/24 is the IPv4 block of the corresponding IPv4-translatable addresses.

转换器(XLAT)将IPv6网络连接到IPv4网络。此XLAT使用[RFC6052]中定义的网络特定前缀(NSP)2001:db8:100::/40表示IPv6地址空间中的IPv4地址(IPv4转换地址)和IPv4地址空间中的IPv6地址(IPv4可翻译地址)。在本例中,192.0.2.0/24是对应IPv4可翻译地址的IPv4块。

Based on the address mapping rule, the IPv6 node H6 has an IPv4-translatable IPv6 address 2001:db8:1c0:2:21:: (address mapping from 192.0.2.33). The IPv4 node H4 has IPv4 address 198.51.100.2.

根据地址映射规则,IPv6节点H6具有IPv4可翻译IPv6地址2001:db8:1c0:2:21::(地址映射自192.0.2.33)。IPv4节点H4具有IPv4地址198.51.100.2。

The IPv6 routing is configured in such a way that the IPv6 packets addressed to a destination address in 2001:db8:100::/40 are routed to the IPv6 interface of the XLAT.

IPv6路由的配置方式是,将地址为2001:db8:100::/40中的目标地址的IPv6数据包路由到XLAT的IPv6接口。

The IPv4 routing is configured in such a way that the IPv4 packets addressed to a destination address in 192.0.2.0/24 are routed to the IPv4 interface of the XLAT.

IPv4路由的配置方式是,在192.0.2.0/24中寻址到目标地址的IPv4数据包被路由到XLAT的IPv4接口。

A.1. H6 Establishes Communication with H4
A.1. H6与H4建立通信

The steps by which H6 establishes communication with H4 are:

H6与H4建立通信的步骤如下:

1. H6 performs the destination address mapping, so the IPv4-converted address 2001:db8:1c6:3364:2:: is formed from 198.51.100.2 based on the address mapping algorithm [RFC6052].

1. H6执行目标地址映射,因此IPv4转换地址2001:db8:1c6:3364:2::是基于地址映射算法[RFC6052]从198.51.100.2中形成的。

2. H6 sends a packet to H4. The packet is sent from a source address 2001:db8:1c0:2:21:: to a destination address 2001:db8:1c6:3364:2::.

2. H6向H4发送一个数据包。数据包从源地址2001:db8:1c0:2:21::发送到目标地址2001:db8:1c6:3364:2::。

3. The packet is routed to the IPv6 interface of the XLAT (since IPv6 routing is configured that way).

3. 数据包被路由到XLAT的IPv6接口(因为IPv6路由是以这种方式配置的)。

4. The XLAT receives the packet and performs the following actions:

4. XLAT接收数据包并执行以下操作:

* The XLAT translates the IPv6 header into an IPv4 header using the IP/ICMP Translation Algorithm defined in this document.

* XLAT使用本文档中定义的IP/ICMP转换算法将IPv6报头转换为IPv4报头。

* The XLAT includes 192.0.2.33 as the source address in the packet and 198.51.100.2 as the destination address in the packet. Note that 192.0.2.33 and 198.51.100.2 are extracted directly from the source IPv6 address 2001:db8:1c0:2:21:: (IPv4-translatable address) and destination IPv6 address 2001:db8:1c6:3364:2:: (IPv4-converted address) of the received IPv6 packet that is being translated.

* XLAT包括192.0.2.33作为数据包中的源地址和198.51.100.2作为数据包中的目标地址。请注意,192.0.2.33和198.51.100.2直接从正在转换的接收IPv6数据包的源IPv6地址2001:db8:1c0:2:21:(IPv4可翻译地址)和目标IPv6地址2001:db8:1c6:3364:2:(IPv4转换地址)中提取。

5. The XLAT sends the translated packet out of its IPv4 interface, and the packet arrives at H4.

5. XLAT从其IPv4接口发送转换后的数据包,数据包到达H4。

6. H4 node responds by sending a packet with destination address 192.0.2.33 and source address 198.51.100.2.

6. H4节点通过发送具有目的地址192.0.2.33和源地址198.51.100.2的数据包进行响应。

7. The packet is routed to the IPv4 interface of the XLAT (since IPv4 routing is configured that way). The XLAT performs the following operations:

7. 数据包被路由到XLAT的IPv4接口(因为IPv4路由是以这种方式配置的)。XLAT执行以下操作:

* The XLAT translates the IPv4 header into an IPv6 header using the IP/ICMP Translation Algorithm defined in this document.

* XLAT使用本文档中定义的IP/ICMP转换算法将IPv4报头转换为IPv6报头。

* The XLAT includes 2001:db8:1c0:2:21:: as the destination address in the packet and 2001:db8:1c6:3364:2:: as the source address in the packet. Note that 2001:db8:1c0:2:21:: and 2001:db8:1c6:3364:2:: are formed directly from the destination IPv4 address 192.0.2.33 and the source IPv4 address 198.51.100.2 of the received IPv4 packet that is being translated.

* XLAT包括2001:db8:1c0:2:21::作为数据包中的目标地址,以及2001:db8:1c6:3364:2::作为数据包中的源地址。请注意,2001:db8:1c0:2:21::和2001:db8:1c6:3364:2::直接由正在转换的接收IPv4数据包的目标IPv4地址192.0.2.33和源IPv4地址198.51.100.2组成。

8. The translated packet is sent out of the IPv6 interface to H6.

8. 翻译后的数据包从IPv6接口发送到H6。

The packet exchange between H6 and H4 continues until the session is finished.

H6和H4之间的数据包交换将继续,直到会话结束。

A.2. H4 Establishes Communication with H6
A.2. H4与H6建立通信

The steps by which H4 establishes communication with H6 are:

H4与H6建立通信的步骤如下:

1. H4 performs the destination address mapping, so 192.0.2.33 is formed from the IPv4-translatable address 2001:db8:1c0:2:21:: based on the address mapping algorithm [RFC6052].

1. H4执行目标地址映射,因此192.0.2.33是基于地址映射算法[RFC6052]从IPv4可翻译地址2001:db8:1c0:2:21::形成的。

2. H4 sends a packet to H6. The packet is sent from a source address 198.51.100.2 to a destination address 192.0.2.33.

2. H4向H6发送一个数据包。数据包从源地址198.51.100.2发送到目标地址192.0.2.33。

3. The packet is routed to the IPv4 interface of the XLAT (since IPv4 routing is configured that way).

3. 数据包被路由到XLAT的IPv4接口(因为IPv4路由是以这种方式配置的)。

4. The XLAT receives the packet and performs the following actions:

4. XLAT接收数据包并执行以下操作:

* The XLAT translates the IPv4 header into an IPv6 header using the IP/ICMP Translation Algorithm defined in this document.

* XLAT使用本文档中定义的IP/ICMP转换算法将IPv4报头转换为IPv6报头。

* The XLAT includes 2001:db8:1c6:3364:2:: as the source address in the packet and 2001:db8:1c0:2:21:: as the destination address in the packet. Note that 2001:db8:1c6:3364:2:: (IPv4-converted address) and 2001:db8:1c0:2:21:: (IPv4-translatable address) are obtained directly from the source IPv4 address 198.51.100.2 and destination IPv4 address 192.0.2.33 of the received IPv4 packet that is being translated.

* XLAT包括2001:db8:1c6:3364:2::作为数据包中的源地址,以及2001:db8:1c0:2:21::作为数据包中的目标地址。请注意,2001:db8:1c6:3364:2:(IPv4转换地址)和2001:db8:1c0:2:21:(IPv4可翻译地址)直接从正在翻译的接收IPv4数据包的源IPv4地址198.51.100.2和目标IPv4地址192.0.2.33获取。

5. The XLAT sends the translated packet out its IPv6 interface, and the packet arrives at H6.

5. XLAT将转换后的数据包发送出其IPv6接口,数据包到达H6。

6. H6 node responds by sending a packet with destination address 2001:db8:1c6:3364:2:: and source address 2001:db8:1c0:2:21::.

6. H6节点通过发送一个具有目标地址2001:db8:1c6:3364:2::和源地址2001:db8:1c0:2:21::的数据包进行响应。

7. The packet is routed to the IPv6 interface of the XLAT (since IPv6 routing is configured that way). The XLAT performs the following operations:

7. 数据包被路由到XLAT的IPv6接口(因为IPv6路由是以这种方式配置的)。XLAT执行以下操作:

* The XLAT translates the IPv6 header into an IPv4 header using the IP/ICMP Translation Algorithm defined in this document.

* XLAT使用本文档中定义的IP/ICMP转换算法将IPv6报头转换为IPv4报头。

* The XLAT includes 198.51.100.2 as the destination address in the packet and 192.0.2.33 as the source address in the packet. Note that 198.51.100.2 and 192.0.2.33 are formed directly from the destination IPv6 address 2001:db8:1c6:3364:2:: and source IPv6 address 2001:db8:1c0:2:21:: of the received IPv6 packet that is being translated.

* XLAT包括198.51.100.2作为数据包中的目标地址和192.0.2.33作为数据包中的源地址。请注意,198.51.100.2和192.0.2.33直接由正在转换的接收IPv6数据包的目标IPv6地址2001:db8:1c6:3364:2::和源IPv6地址2001:db8:1c0:2:21::构成。

8. The translated packet is sent out the IPv4 interface to H4.

8. 翻译后的数据包通过IPv4接口发送到H4。

The packet exchange between H4 and H6 continues until the session is finished.

H4和H6之间的数据包交换将继续,直到会话结束。

Acknowledgements

致谢

Gandhar Gokhale, Wesley Eddy, and Fernando Gont submitted and handled the errata reports on [RFC6145]. Fernando Gont, Will (Shucheng) Liu, and Tore Anderson provided the security analysis and the suggestions for updates concerning atomic fragments. In addition, Tore Anderson and Alberto Leiva provided the proposal of the Explicit Address Mapping (EAM) algorithm.

Gandhar Gokhale、Wesley Eddy和Fernando Gont提交并处理了[RFC6145]上的勘误表报告。Fernando Gont、Will(Shucheng)Liu和Tore Anderson提供了有关原子碎片的安全分析和更新建议。此外,Tore Anderson和Alberto Leiva提出了显式地址映射(EAM)算法的建议。

Authors' Addresses

作者地址

Congxiao Bao CERNET Center/Tsinghua University Room 225, Main Building, Tsinghua University Beijing 100084 China

中国北京清华大学主楼225室/聪晓宝CERNET中心北京100084

   Phone: +86 10-62785983
   Email: congxiao@cernet.edu.cn
        
   Phone: +86 10-62785983
   Email: congxiao@cernet.edu.cn
        

Xing Li CERNET Center/Tsinghua University Room 225, Main Building, Tsinghua University Beijing 100084 China

中国北京清华大学兴利赛特中心/清华大学主楼225室,邮编100084

   Phone: +86 10-62785983
   Email: xing@cernet.edu.cn
        
   Phone: +86 10-62785983
   Email: xing@cernet.edu.cn
        

Fred Baker Cisco Systems Santa Barbara, California 93117 United States

美国加利福尼亚州圣巴巴拉市弗雷德·贝克思科系统公司,邮编:93117

   Phone: +1-408-526-4257
   Email: fred@cisco.com
        
   Phone: +1-408-526-4257
   Email: fred@cisco.com
        

Tore Anderson Redpill Linpro Vitaminveien 1A 0485 Oslo Norway

挪威奥斯陆Tore Anderson Redpill Linpro Vitaminveien 1A 0485

   Phone: +47 959 31 212
   Email: tore@redpill-linpro.com
   URI:   http://www.redpill-linpro.com
        
   Phone: +47 959 31 212
   Email: tore@redpill-linpro.com
   URI:   http://www.redpill-linpro.com
        

Fernando Gont Huawei Technologies Evaristo Carriego 2644 Haedo, Provincia de Buenos Aires 1706 Argentina

Fernando Gont Huawei Technologies Evaristo Carriego 2644 Haedo,布宜诺斯艾利斯省1706阿根廷

   Phone: +54 11 4650 8472
   Email: fgont@si6networks.com
   URI:   http://www.si6networks.com
        
   Phone: +54 11 4650 8472
   Email: fgont@si6networks.com
   URI:   http://www.si6networks.com