RFC 7915

IP/ICMP Translation Algorithm

๐Ÿ“… published June 2016, from ietf

Title Block ๐ŸŽ€

  • RFC number: 7915 ๐Ÿ“œ
  • Title: IP/ICMP Translation Algorithm โœจ
  • Authors: C. Bao, X. Li (CERNET Center/Tsinghua University), F. Baker (Cisco Systems), T. Anderson (Redpill Linpro), F. Gont (Huawei Technologies) ๐Ÿ‘‘
  • Category: Standards Track ๐Ÿฆ‹
  • Date: June 2016 ๐ŸŒธ
  • ISSN: 2070-1721
  • Obsoletes: RFC 6145 ๐Ÿ’…
  • Updates: nothing listed ๐Ÿซถ

Abstract

okay so this doc describes the Stateless IP/ICMP Translation Algorithm, aka SIIT ๐Ÿฆ‹. it translates between IPv4 and IPv6 packet headers, and that includes the ICMP headers too ๐Ÿ’–. it also obsoletes RFC 6145, so that one is officially retired now ๐Ÿ˜ญ

Status of This Memo

this is an Internet Standards Track document ๐Ÿ”ฅ.

it's a product of the Internet Engineering Task Force (IETF) ๐ŸŒˆ. it represents the consensus of the IETF community, it got public review, and the Internet Engineering Steering Group (IESG) approved it for publication โœจ. if you want more on Internet Standards, check Section 2 of RFC 7841 ๐Ÿงš.

for the current status, any errata, and how to send feedback, go to http://www.rfc-editor.org/info/rfc7915 ๐Ÿ’œ.

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

this document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the date it was published ๐Ÿ“œ. please actually read these, because they spell out your rights and restrictions for this document ๐Ÿ™ˆ. any Code Components pulled out of this document must include the Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Simplified BSD License describes ๐Ÿ’….

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 โœจ

this doc obsoletes [RFC6145] ๐Ÿ’–.

so, readers are expected to already know the framework in [RFC6144], because it's the foundation for everything here ๐Ÿงš. implementations of this IPv4/IPv6 translation spec MUST support one or more address mapping algorithms, and those are defined in Section 6 ๐Ÿ”ฅ.

1.1. IPv4-IPv6 Translation Model

the translation model has two or more network domains connected by one or more IP/ICMP translators (XLATs), as you can see in Figure 1 ๐ŸŒธ.

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

               Figure 1: IPv4-IPv6 Translation Model

the scenarios for this model are discussed in [RFC6144] ๐Ÿฆ‹.

1.2. Applicability and Limitations

this doc specifies the translation algorithms between IPv4 packets and IPv6 packets ๐Ÿ’….

just like [RFC6145], the translating function here does not translate any IPv4 options ๐Ÿ™ˆ. it also doesn't translate IPv6 extension headers, except the Fragment Header ๐ŸŽ€.

the issues and algorithms for translating datagrams that carry TCP segments are described in [RFC5382] ๐Ÿ’œ.

fragmented IPv4 UDP packets with no UDP checksum (aka the UDP checksum field is zero) aren't of significant use on the Internet ๐Ÿ˜ญ. in general they won't be translated by the IP/ICMP translator (Section 4.5) ๐Ÿ’€. BUT if the translator is configured to forward the packet without a UDP checksum, then those fragmented IPv4 UDP packets will get translated โœจ.

fragmented ICMP/ICMPv6 packets will not be translated by IP/ICMP translators ๐Ÿซถ.

the IP/ICMP header translation here is consistent with the requirements for multicast IP/ICMP headers ๐ŸŒˆ. however, IPv4 multicast addresses [RFC5771] can't be mapped to IPv6 multicast addresses [RFC3307] using the unicast mapping rule [RFC6052] ๐Ÿฅบ. you can find an example of experiments with multicast address mapping in [RFC6219] ๐Ÿงš.

1.3. Stateless vs. Stateful Mode

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 no IPv6 address is talking to a system that has an IPv6 address but no IPv4 address ๐Ÿ’–. or the two systems don't have contiguous routing connectivity, or they might have it but are interacting via masking addresses (aka hairpinning) [RFC4787] ๐Ÿ™ˆ. either way, they're forced to have their communications translated ๐Ÿ”ฅ.

in the stateless mode, an IP/ICMP translator converts IPv4 addresses to IPv6 and vice versa, based only on the configuration of the stateless IP/ICMP translator and the info inside the packet being translated ๐Ÿ’…. for example, with the default behavior defined in [RFC6052], a specific IPv6 address range represents IPv4 systems (IPv4-converted addresses) ๐ŸŒธ. 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 doesn't keep any dynamic session or binding state, so there's no requirement that the packets in a single session or flow traverse a single translator ๐Ÿงš.

in the stateful mode, a specific IPv6 address range (made up of IPv4-converted IPv6 addresses) will typically represent IPv4 systems ๐Ÿ‘‘. the IPv6 nodes may use any IPv6 addresses [RFC4291] except the ones in that range ๐Ÿฆ‹. a stateful IP/ICMP translator continuously maintains a dynamic translation table holding bindings between the IPv4 and IPv6 addresses, and likely also the Layer-4 identifiers, that get used in the translated packets ๐Ÿ˜ญ. so the exact address translations for any given packet depend on how packets in the same session or flow were translated before ๐Ÿ’œ. for this reason, stateful translation generally requires that all packets belonging to a single flow traverse the same translator ๐Ÿซถ.

to successfully translate a packet from IPv4 to IPv6 or vice versa, the translator MUST implement an address mapping algorithm ๐Ÿ”ฅ. this doc doesn't specify any such algorithms, though, and instead they're referenced from Section 6 ๐ŸŒˆ.

1.4. Path MTU Discovery and Fragmentation

because the IPv4 and IPv6 headers have different sizes (20+ octets and 40 octets respectively), handling the maximum packet size is critical for how the IPv4/IPv6 translator operates ๐Ÿ™ˆ. there are three mechanisms for this: 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, which means 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 ๐Ÿ”ฅ.

Don't Fragment, ICMP Packet Too Big, and packet fragmentation are covered in Sections 4 and 5 of this document ๐Ÿ’…. the reassembly of fragmented packets in the stateful translator is discussed in [RFC6146], since it requires state maintenance in the translator ๐Ÿฆ‹.

2. Changes from RFC 6145 ๐ŸŒธ

here's what changed from RFC 6145 ๐Ÿ‘‘:

  1. Added notes about IPv6 extension header handling: [Err3059], [Err3060], [Err3061], and [Err4090] ๐ŸŽ€.
  2. Deprecated the algorithm that generates IPv6 atomic fragments, based on the analysis in [ATOMIC] and the specification in [IPv6] ๐Ÿ˜ญ.
  3. Added notes for stateless source address mapping for ICMPv6 packets [RFC6791] ๐Ÿ’œ.
  4. Supported new address mapping algorithms, and moved the discussion of those algorithms to Section 6 ๐Ÿงš.

3. Conventions ๐ŸŽ€

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] ๐Ÿซถ๐Ÿ’–

4. Translating from IPv4 to IPv6 โœจ

okay so when an IP/ICMP translator gets an IPv4 datagram that's headed toward the IPv6 side, it swaps the IPv4 header for an IPv6 header ๐Ÿฆ‹. The old IPv4 header gets removed and the new IPv6 one takes its place, and the transport checksum gets updated as needed (if the translator supports that transport ๐Ÿ’…). The data part? Totally untouched ๐Ÿซถ. Then the translator forwards the packet based on the IPv6 destination address.

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

Figure 2: IPv4-to-IPv6 Translation

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. ๐ŸŒธ

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. ๐Ÿงš

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 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. ๐Ÿ”ฅ

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

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. โœจ

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. ๐ŸŽ€

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

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. ๐Ÿฆ‹

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. ๐Ÿ™ˆ

The IPv6 header fields are set as follows:

  • Version: 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.
  • Flow Label: 0 (all zero bits)
  • Payload Length: Total length value from the IPv4 header, minus the size of the IPv4 header and IPv4 options, if present.
  • Next Header: For ICMPv4 (1), it is changed to ICMPv6 (58); otherwise, the protocol field MUST be copied from the IPv4 header.
  • 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.
  • Source Address: Mapped to an IPv6 address based on the algorithms presented in Section 6.

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. ๐Ÿ”

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

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. ๐Ÿšซ

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:

IPv6 fields:

  • 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.
  • Next Header: Fragment Header (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.
  • Fragment Offset: Fragment Offset copied from the IPv4 header.
  • M flag: More Fragments bit copied from the IPv4 header.
  • Identification: The low-order 16 bits copied from the Identification field in the IPv4 header. The high-order 16 bits set to zero. ๐Ÿงš this bit is so clever, the fragments still find each other!

4.2. Translating ICMPv4 Headers into ICMPv6 Headers โœจ

okay so every ICMPv4 message we translate needs its ICMPv6 checksum recalculated during translation ๐Ÿงฎ ICMPv6 has a pseudo-header checksum like UDP and TCP do, and ICMPv4 doesn't, so this is a big deal ๐Ÿ’…

ALSO, all ICMPv4 packets MUST have their Type translated ๐Ÿซถ and for ICMPv4 error messages, the included IP header MUST be translated too ๐Ÿ’–

Here's the breakdown of what to do with each message:

  • ICMPv4 query messages: ๐ŸŽ€
    • Echo and Echo Reply (Type 8 and Type 0): Change the Type values to 128 and 129, respectively, then fix the ICMP checksum. You have to account for the type change AND include the ICMPv6 pseudo-header ๐Ÿฆ‹
    • Information Request/Reply (Type 15 and Type 16): Obsoleted in ICMPv6, so silently drop ๐Ÿ™ˆ
    • Timestamp and Timestamp Reply (Type 13 and Type 14): Obsoleted in ICMPv6, so silently drop ๐Ÿ™ˆ
    • Address Mask Request/Reply (Type 17 and Type 18): Obsoleted in ICMPv6, so silently drop ๐Ÿ™ˆ
    • ICMP Router Advertisement (Type 9): It's a single-hop message, so silently drop ๐ŸŒธ
    • ICMP Router Solicitation (Type 10): Single-hop again, so silently drop ๐ŸŒธ
    • Unknown ICMPv4 types: Silently drop. Not our problem bestie ๐Ÿ’€
    • IGMP messages: The MLD messages from [RFC2710], [RFC3590], and [RFC3810] are the logical IPv6 counterparts of IPv4 IGMP messages, which is cute ๐Ÿงš But all the "normal" IGMP messages are single-hop, so the translator SHOULD silently drop them. Other IGMP messages might be used by multicast routing protocols. Since it would be a configuration error to try to have router adjacencies across IP/ICMP translators, those packets SHOULD also be silently dropped ๐Ÿ™…โ€โ™€๏ธ
  • ICMPv4 error messages: ๐Ÿ“
    • Destination Unreachable (Type 3): Translate the Code as described below, set the Type to 1, then fix the ICMP checksum for the type/code change AND the ICMPv6 pseudo-header ๐Ÿ”ฅ

Translate the Code like this:

  • Code 0, 1 (Net Unreachable, Host Unreachable): Set the Code to 0 (No route to destination).
  • 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 ๐Ÿง 
  • Code 3 (Port Unreachable): Set the Code to 4 (Port unreachable).
  • 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) ๐Ÿ‘‘ So it should be set to:
maximum(1280,
  minimum((MTU value in the Packet Too Big Message) + 20,
          MTU_of_IPv6_nexthop,
          (MTU_of_IPv4_nexthop) + 20)).

Note that if the IPv4 router set the MTU field to zero, meaning it doesn't implement [RFC1191], then the translator MUST use the plateau values specified in [RFC1191] to figure out 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.) โœจ

See also the requirements in Section 7 ๐Ÿซถ

  • Code 5 (Source Route Failed): Set the Code to 0 (No route to destination). This error is pretty unlikely since source routes are not translated ๐Ÿ™ˆ
  • Code 6, 7, 8: Set the Code to 0 (No route to destination).
  • Code 9, 10 (Communication with Destination Host Administratively Prohibited): Set the Code to 1 (Communication with destination administratively prohibited).
  • Code 11, 12: Set the Code to 0 (No route to destination).
  • Code 13 (Communication Administratively Prohibited): Set the Code to 1 (Communication with destination administratively prohibited).
  • Code 14 (Host Precedence Violation): Silently drop.
  • Code 15 (Precedence cutoff in effect): Set the Code to 1 (Communication with destination administratively prohibited).
  • Other Code values: Silently drop.
  • Redirect (Type 5): Single-hop message, so silently drop ๐ŸŒธ
  • Alternative Host Address (Type 6): Silently drop.
  • Source Quench (Type 4): Obsoleted in ICMPv6, so silently drop ๐Ÿ™ˆ
  • Time Exceeded (Type 11): Set the Type to 3, then fix the ICMP checksum for the type change AND the ICMPv6 pseudo-header. The Code stays the same ๐Ÿ’œ
  • Parameter Problem (Type 12): Set the Type to 4, then fix the ICMP checksum for the type/code change AND the ICMPv6 pseudo-header ๐Ÿฆ‹

Translate the Code like this:

  • 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.)
  • Code 1 (Missing a required option): Silently drop.
  • 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.)
  • Other Code values: Silently drop.
  • Unknown ICMPv4 types: Silently drop.

Here's the pointer map for Figure 3, which is giving "lookup table" energy ๐Ÿ“‹

+--------------------------------+--------------------------------+
|   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 ๐Ÿ“

  • ICMP Error Payload: ๐Ÿ’… If the received ICMPv4 packet contains an ICMPv4 Extension [RFC4884], translating it will make the ICMPv6 packet change length. When that happens, the ICMPv6 Extension length attribute MUST be adjusted accordingly (for example, it gets longer because the translation goes from IPv4 to IPv6) ๐Ÿ”ฅ If the ICMPv4 Extension is bigger than 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 along as opaque bit strings. Extensions containing IPv4 address literals will NOT have their included addresses translated to IPv6 address literals, and this may cause problems with processing those ICMP extensions ๐Ÿ˜ญ

4.3. Translating ICMPv4 Error Messages into ICMPv6 ๐Ÿฆ‹

There are some differences between the ICMPv4 and 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 for the TTL value of the inner IPv4/IPv6 packet). If translating this "packet in error" changes the length of the datagram, the Total Length field in the outer IPv6 header MUST be updated ๐Ÿ’–

          +-------------+                 +-------------+
          |    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

The inner IP header can be translated by calling the function that translated the outer IP headers ๐Ÿงš This process MUST stop at the first embedded header, and the packet MUST be dropped if it contains more embedded headers ๐Ÿ™…โ€โ™€๏ธ


4.4. Generation of ICMPv4 Error Message ๐ŸŒธ

If the IPv4 packet gets discarded, the translator SHOULD be able to send an ICMPv4 error message back 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 this document or [RFC6146] says otherwise โœจ The translator SHOULD allow an administrator to configure whether ICMPv4 error messages are sent, rate-limited, or not sent ๐Ÿ‘‘

4.5. Transport-Layer Header Translation ๐ŸŽ€

okay bestie, so if the address translation is not checksum neutral (see Section 4.1 of [RFC6052]), the transport-layer headers that carry pseudo-headers need to get recalculated and updated ๐Ÿ”ฅ 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) ๐Ÿ’–

For UDP packets that do not have a UDP checksum (the UDP checksum field is zero), the translator SHOULD give you a configuration function so you can choose between:

  1. Dropping the packet and generating a system management event that specifies at least the IP addresses and port numbers of the packet. ๐Ÿ™ˆ
  2. Calculating an IPv6 checksum and forwarding the packet (which has performance implications). โœจ

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. ๐Ÿ’€

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

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. ๐Ÿซถ

4.6. Knowing When to Translate ๐ŸŒธ

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. ๐Ÿ‘‘


5. Translating from IPv6 to 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. ๐ŸŒˆ

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

                Figure 5: IPv6-to-IPv4 Translation

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. ๐Ÿง

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

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

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]. ๐Ÿ“

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. ๐Ÿ’…

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 โœจ

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

  • Version: 4
  • Internet Header Length: 5 (no IPv4 options)
  • 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. ๐ŸŽ€
  • Total Length: Payload length value from the IPv6 header, plus the size of the IPv4 header.
  • 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.
  • 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 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. โณ
  • 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.
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). ๐Ÿ™ˆ
  • Header Checksum: Computed once the IPv4 header has been created.
  • Source Address: Mapped to an IPv4 address based on the algorithms presented in Section 6.

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

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

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. ๐Ÿงš

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. ๐Ÿšซ

5.1.1. IPv6 Fragment Processing ๐Ÿงฉ

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

  • 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.
  • Identification: Copied from the low-order 16 bits in the Identification field in the Fragment Header.
  • 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.
  • 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.
  • 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.

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. ๐ŸŒท

5.2. Translating ICMPv6 Headers into ICMPv4 Headers โœจ

okay so 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. the reason is that ICMPv6 (unlike ICMPv4) puts a pseudo-header in the checksum, just like UDP and TCP do ๐Ÿงฎ

also, all ICMP packets MUST have the Type translated. and for ICMP error messages, the included IP header MUST also be translated ๐Ÿ’…

here's the breakdown of what to do with each ICMPv6 message:

ICMPv6 informational messages:

  • 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 ๐Ÿ“
  • MLD Multicast Listener Query/Report/Done (Type 130, 131, 132): single-hop message. Silently drop ๐Ÿ™ˆ
  • Neighbor Discover messages (Type 133 through 137): single-hop message. Silently drop ๐Ÿ™ˆ
  • Unknown informational messages: Silently drop ๐Ÿ’€

ICMPv6 error messages:

  • 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. Translate the Code as follows:
    • Code 0 (No route to destination): set the Code to 1 (Host unreachable).
    • Code 1 (Communication with destination administratively prohibited): set the Code to 10 (Communication with destination host administratively prohibited).
    • 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 ๐ŸŒ
    • Code 3 (Address unreachable): set the Code to 1 (Host unreachable).
    • Code 4 (Port unreachable): set the Code to 3 (Port unreachable).
    • 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). See also the requirements in Section 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 โฐ
  • 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. 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.)
    • Code 1 (Unrecognized Next Header type encountered): translate this to an ICMPv4 protocol unreachable (Type 3, Code 2).
    • Code 2 (Unrecognized IPv6 option encountered): Silently drop.
  • Unknown error messages: Silently drop ๐Ÿ’€

Here's the pointer mapping you need for the Parameter Problem case ๐Ÿ—บ๏ธ

+--------------------------------+--------------------------------+
|   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

  • 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 happens, 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. Any IPv6 address literals contained therein will not be translated to IPv4 address literals, and this may cause problems with processing of those ICMP extensions ๐Ÿ˜ฌ

5.3. Translating ICMPv6 Error Messages into 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, so the Total Length field in the outer IPv4 header MUST be updated ๐Ÿ“ฆ

              +-------------+                 +-------------+
              |    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

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 it MUST drop the packet if it contains more embedded headers ๐Ÿง…


5.4. Generation of ICMPv6 Error Messages ๐Ÿ“จ

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.

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 ๐ŸŽ›๏ธ


5.5. Transport-Layer Header Translation ๐Ÿšš

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 โœ…

Other transport protocols (e.g., DCCP) are OPTIONAL to support. To make debugging and troubleshooting easier, translators MUST forward all transport protocols as described in the "Protocol" step of Section 5.1 ๐Ÿ› ๏ธ


5.6. Knowing When to Translate ๐Ÿงญ

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 ๐ŸŒ‰


6. Mapping of IP Addresses ๐Ÿ 

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 ๐Ÿงพ

The stateless translator SHOULD support the explicit address mapping algorithm defined in [RFC7757] ๐Ÿ—‚๏ธ

The stateless translator SHOULD support [RFC6791] for handling ICMP/ICMPv6 packets ๐Ÿ“ฌ

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

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


7. Special Considerations for ICMPv6 Packet Too Big ๐Ÿšจ

A number of studies [ATOMIC] indicate that it is 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]. Yikes, that's a whole mess ๐Ÿ˜ญ๐Ÿ•ณ๏ธ


8. Security Considerations ๐Ÿ’€๐Ÿ”

this one is serious, bestie, so read it carefully ๐Ÿซถ

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.

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 ๐Ÿšซ

The IPsec Authentication Header [RFC4302] cannot be used for NAT44 or 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]. main character energy, ESP edition ๐ŸŒˆ


9. References ๐Ÿ“š

9.1. Normative References โœจ

okay bestie, this is the reading list the spec leans on hardest ๐Ÿ“š every one of these is needed to understand the rules, so no skipping ๐Ÿซถ

9.2. Informative References ๐ŸŒธ

these ones are the extra-credit reading ๐Ÿงš handy for background, but the spec doesn't need them to make sense

Appendix A. Stateless Translation Workflow Example ๐Ÿฆ‹

okay this is the vibe check moment ๐Ÿ’… the appendix walks through a stateless translation setup, and it's giving picture-perfect diagram energy. the documentation address blocks 2001:db8::/32 [RFC3849], 192.0.2.0/24, and 198.51.100.0/24 [RFC5737] are the placeholder addresses doing all the work here ๐Ÿ™ˆ

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

               Figure 8: Stateless Translation Workflow

so the setup is that 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 ๐Ÿ’–

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) โœจ and the IPv4 node H4 has IPv4 address 198.51.100.2 ๐Ÿ“

the routing part is where it gets fun ๐Ÿงš the IPv6 routing is configured in such a way that IPv6 packets addressed to a destination address in 2001:db8:100::/40 are routed to the IPv6 interface of the XLAT. meanwhile, the IPv4 routing is configured in such a way that IPv4 packets addressed to a destination address in 192.0.2.0/24 are routed to the IPv4 interface of the XLAT. both sides point at the translator, and that's the whole plot ๐Ÿ‘‘

A.1. H6 Establishes Communication with H4 โœจ

okay so here's how H6 gets the chat started with H4 ๐Ÿฆ‹ The steps are:

  1. H6 does the destination address mapping, so the IPv4-converted address 2001:db8:1c6:3364:2:: gets formed from 198.51.100.2 based on the address mapping algorithm [RFC6052]. ๐Ÿ’–
  2. H6 sends a packet to H4. The packet is sent from source address 2001:db8:1c0:2:21:: to destination address 2001:db8:1c6:3364:2::. ๐ŸŽ€
  3. The packet gets routed to the IPv6 interface of the XLAT, since IPv6 routing is configured that way. ๐Ÿงš
  4. The XLAT receives the packet and does the following:
    • The XLAT translates the IPv6 header into an IPv4 header using the IP/ICMP Translation Algorithm defined in this document. ๐Ÿ’…
    • The XLAT puts 192.0.2.33 in as the source address and 198.51.100.2 as the destination address in the packet. ngl, these are pulled straight from the source IPv6 address 2001:db8:1c0:2:21:: (IPv4-translatable address) and the destination IPv6 address 2001:db8:1c6:3364:2:: (IPv4-converted address) of the IPv6 packet being translated. ๐ŸŒธ
  5. The XLAT sends the translated packet out of its IPv4 interface, and the packet arrives at H4. ๐Ÿซถ
  6. H4 responds by sending a packet with destination address 192.0.2.33 and source address 198.51.100.2. ๐Ÿ™ˆ
  7. The packet gets routed to the IPv4 interface of the XLAT, since IPv4 routing is configured that way. The XLAT does the following:
    • The XLAT translates the IPv4 header into an IPv6 header using the IP/ICMP Translation Algorithm defined in this document. โœจ
    • The XLAT puts 2001:db8:1c0:2:21:: in as the destination address 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 IPv4 packet being translated. ๐Ÿ”ฅ
  8. The translated packet is sent out of the IPv6 interface to H6. ๐Ÿ’œ

The packet exchange between H6 and H4 keeps going until the session is finished. ๐Ÿ‘‘

A.2. H4 Establishes Communication with H6

the other way around is just as iconic ๐ŸŒˆ H4 starts things like this:

  1. H4 does 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]. ๐Ÿงš
  2. H4 sends a packet to H6. The packet is sent from source address 198.51.100.2 to destination address 192.0.2.33. ๐ŸŒธ
  3. The packet gets routed to the IPv4 interface of the XLAT, since IPv4 routing is configured that way. ๐ŸŽ€
  4. The XLAT receives the packet and does the following:
    • The XLAT translates the IPv4 header into an IPv6 header using the IP/ICMP Translation Algorithm defined in this document. ๐Ÿ’…
    • The XLAT puts 2001:db8:1c6:3364:2:: in as the source address 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 the destination IPv4 address 192.0.2.33 of the IPv4 packet being translated. ๐Ÿ’–
  5. The XLAT sends the translated packet out of its IPv6 interface, and the packet arrives at H6. ๐Ÿซถ
  6. H6 responds by sending a packet with destination address 2001:db8:1c6:3364:2:: and source address 2001:db8:1c0:2:21::. ๐Ÿ™ˆ
  7. The packet gets routed to the IPv6 interface of the XLAT, since IPv6 routing is configured that way. The XLAT does the following:
    • The XLAT translates the IPv6 header into an IPv4 header using the IP/ICMP Translation Algorithm defined in this document. โœจ
    • The XLAT puts 198.51.100.2 in as the destination address 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 the source IPv6 address 2001:db8:1c0:2:21:: of the IPv6 packet being translated. ๐Ÿ”ฅ
  8. The translated packet is sent out of the IPv4 interface to H4. ๐Ÿ’œ

The packet exchange between H4 and H6 keeps going until the session is finished. ๐Ÿ‘‘

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. Also, Tore Anderson and Alberto Leiva came up with the proposal of the Explicit Address Mapping (EAM) algorithm. iconic behaviour, honestly ๐ŸŒˆ

Authors' Addresses ๐Ÿฆ‹

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

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


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

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


Fred Baker
Cisco Systems
Santa Barbara, California  93117
United States

Phone: +1-408-526-4257
Email: fred@cisco.com
Tore Anderson
Redpill Linpro
Vitaminveien 1A
0485 Oslo
Norway

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

Phone: +54 11 4650 8472
Email: fgont@si6networks.com
URI:   http://www.si6networks.com
๐Ÿ“ฆ where this page comes from