idnits 2.17.1 draft-baker-behave-v4v6-translation-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([RFC0791], [RFC0792], [RFC2119], [RFC2460], [RFC2765], [RFC4443]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (February 21, 2009) is 5540 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'I-D.petithuguenin-behave-stun-pmtud' is defined on line 964, but no explicit reference was found in the text == Unused Reference: 'RFC1112' is defined on line 973, but no explicit reference was found in the text == Unused Reference: 'RFC1981' is defined on line 979, but no explicit reference was found in the text == Unused Reference: 'RFC3493' is defined on line 998, but no explicit reference was found in the text == Unused Reference: 'RFC4821' is defined on line 1021, but no explicit reference was found in the text == Unused Reference: 'RFC4861' is defined on line 1024, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'FRAMEWORK' == Outdated reference: A later version (-03) exists of draft-bagnulo-behave-nat64-02 ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) ** Obsolete normative reference: RFC 2765 (Obsoleted by RFC 6145) == Outdated reference: A later version (-03) exists of draft-petithuguenin-behave-stun-pmtud-02 -- Obsolete informational reference (is this intentional?): RFC 1981 (Obsoleted by RFC 8201) -- Obsolete informational reference (is this intentional?): RFC 3171 (Obsoleted by RFC 5771) Summary: 4 errors (**), 0 flaws (~~), 10 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 behave X. Li, Ed. 3 Internet-Draft C. Bao, Ed. 4 Intended status: Standards Track CERNET Center/Tsinghua University 5 Expires: August 25, 2009 F. Baker, Ed. 6 Cisco Systems 7 February 21, 2009 9 IP/ICMP Translation Algorithm 10 draft-baker-behave-v4v6-translation-02 12 Status of this Memo 14 This Internet-Draft is submitted to IETF in full conformance with the 15 provisions of BCP 78 and BCP 79. 17 Internet-Drafts are working documents of the Internet Engineering 18 Task Force (IETF), its areas, and its working groups. Note that 19 other groups may also distribute working documents as Internet- 20 Drafts. 22 Internet-Drafts are draft documents valid for a maximum of six months 23 and may be updated, replaced, or obsoleted by other documents at any 24 time. It is inappropriate to use Internet-Drafts as reference 25 material or to cite them other than as "work in progress." 27 The list of current Internet-Drafts can be accessed at 28 http://www.ietf.org/ietf/1id-abstracts.txt. 30 The list of Internet-Draft Shadow Directories can be accessed at 31 http://www.ietf.org/shadow.html. 33 This Internet-Draft will expire on August 25, 2009. 35 Copyright Notice 37 Copyright (c) 2009 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. 47 Abstract 49 This document specifies an update to the Stateless IP/ICMP 50 Translation Algorithm (SIIT) described in RFC 2765. The algorithm 51 translates between IPv4 and IPv6 packet headers (including ICMP 52 headers). 54 This specification addresses both a stateless and a stateful mode. 55 In the stateless mode, translation information is carried in the 56 address itself, permitting both IPv4->IPv6 and IPv6->IPv4 session 57 establishment with neither state nor configuration in the IP/ICMP 58 translator. In the stateful mode, translation state is maintained 59 between IPv4 address/transport_port tuples and IPv6 address/ 60 transport_port tuples, enabling IPv6 systems to open sessions with 61 IPv4 systems. The choice of operational mode is made by the operator 62 deploying the network and is critical to the operation of the 63 applications using it. 65 Significant issues exist in the stateless and stateful modes that are 66 not addressed in this document, related to the address assignment and 67 the maintenance of the translation tables, respectively. This 68 document confines itself to the actual translation. 70 Acknowledgement of previous work 72 This document is a product of the 2008-2009 effort to define a 73 replacement for NAT-PT. It is an update to and directly derivative 74 from Erik Nordmark's [RFC2765], which similarly provides both 75 stateless and stateful translation between IPv4 [RFC0791] and IPv6 76 [RFC2460], and between ICMPv4 [RFC0792] and ICMPv6 [RFC4443]. The 77 original document was a product of the NGTRANS working group. 79 The changes in this document reflect five components: 81 1. Redescribing the network model to map to present and projected 82 usage. 84 2. Moving the address format to the framework document, to 85 coordinate with other drafts on the topic. 87 3. Description of both stateful and stateless operation. 89 4. Some changes in ICMP. 91 5. Updating references. 93 Requirements 95 The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, 96 SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this 97 document, are to be interpreted as described in [RFC2119]. 99 Table of Contents 101 1. Introduction and Motivation . . . . . . . . . . . . . . . . . 4 102 1.1. Translation Model . . . . . . . . . . . . . . . . . . . . 4 103 1.2. Applicability and Limitations . . . . . . . . . . . . . . 5 104 1.3. Stateless vs Stateful Mode . . . . . . . . . . . . . . . . 6 105 1.4. IPv4-embedded IPv6 addresses and IPv4-related IPv6 106 addresses . . . . . . . . . . . . . . . . . . . . . . . . 6 107 2. Translating from IPv4 to IPv6 . . . . . . . . . . . . . . . . 7 108 2.1. Translating IPv4 Headers into IPv6 Headers . . . . . . . . 8 109 2.2. Translating UDP over IPv4 . . . . . . . . . . . . . . . . 10 110 2.3. Translating ICMPv4 Headers into ICMPv6 Headers . . . . . . 11 111 2.4. Translating ICMPv4 Error Messages into ICMPv6 . . . . . . 13 112 2.5. Transport-layer Header Translation . . . . . . . . . . . . 13 113 2.6. Knowing when to Translate . . . . . . . . . . . . . . . . 14 114 3. Translating from IPv6 to IPv4 . . . . . . . . . . . . . . . . 14 115 3.1. Translating IPv6 Headers into IPv4 Headers . . . . . . . . 15 116 3.2. Translating ICMPv6 Headers into ICMPv4 Headers . . . . . . 17 117 3.3. Translating ICMPv6 Error Messages into ICMPv4 . . . . . . 18 118 3.4. Transport-layer Header Translation . . . . . . . . . . . . 19 119 3.5. Knowing when to Translate . . . . . . . . . . . . . . . . 19 120 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 121 5. Security Considerations . . . . . . . . . . . . . . . . . . . 20 122 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 20 123 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 20 124 7.1. Normative References . . . . . . . . . . . . . . . . . . . 20 125 7.2. Informative References . . . . . . . . . . . . . . . . . . 21 126 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 23 128 1. Introduction and Motivation 130 An understanding of the framework presented in [FRAMEWORK] is 131 presumed in this document. With that remark... 133 The transition mechanisms specified in [RFC4213] handle the case of 134 dual IPv4/IPv6 hosts interoperating with both dual hosts and IPv4- 135 only hosts, which is needed early in the transition to IPv6. The 136 dual hosts are assigned both an IPv4 and one or more IPv6 addresses. 137 The number of available globally unique IPv4 addresses are becoming 138 smaller and smaller as the Internet grows; we expect that there will 139 be a desire to take advantage of the large IPv6 address and not 140 require that every new Internet node have a permanently assigned IPv4 141 address. 143 The SIIT [RFC2765] is designed for the case for small networks (e.g., 144 a single subnet) and for a site which has IPv6-only hosts in a dual 145 IPv4/IPv6 network. This use assumes a mechanism for the IPv6 nodes 146 to acquire a temporary address from the pool of IPv4 addresses. 147 However, SIIT is not to be useful in the case when the IPv6 nodes to 148 acquire temporary IPv4 addresses from a "distant" SIIT box operated 149 by a different administration, or require that the IPv6 routing 150 contain routes for IPv6-mapped addresses (The latter is known to be a 151 very bad idea due to the size of the IPv4 routing table that would 152 potentially be injected into IPv6 routing in the form of IPv4-mapped 153 addresses.) 155 In addition, due to the IPv4 address deletion problem, it is 156 desirable that a single IPv4 address needs to be shared via transport 157 port multiplexing technique for different IPv6 nodes when they 158 communicate with other IPv4 hosts. 160 Furthermore, in the SIIT [RFC2765] implemetation, an IPv6-only node 161 which works through SIIT translators needs some modifications beyond 162 a normal IPv6-only node. These modifications are not strictly 163 implied in this document, since the normal IPv6 addresses can be used 164 in the IPv6 end nodes. 166 The detailed discussion of the transition scenarios is presented in 167 [FRAMEWORK], the technical specifications of the translation 168 algorithm itself is illustrated in this document. 170 1.1. Translation Model 172 This document specifies the traslation algorithm that is one of the 173 components descrbed in [FRAMEWORK] needed to make IPv6-only nodes 174 interoperate with IPv4-only nodes as shown in Figure 1. 176 -------- -------- 177 // IPv4 \\ // IPv6 \\ 178 / Domain \ / Domain \ 179 / +----+ +--+ \ 180 | |XLAT| |S2| | Sn: Servers 181 | +--+ +----+ +--+ | Hn: Clients 182 | |S1| +----+ | 183 | +--+ |DNS | +--+ | XLAT: V4/V6 Translator 184 \ +--+ +----+ |H2| / DNS: DNS Server 185 \ |H1| / \ +--+ / 186 \\ +--+ // \\ // 187 -------- -------- 189 Figure 1: Translation Model 191 The translation model consists of two or more network domains 192 connected by one or more IP/ICMP translators. One of those networks 193 either routes IPv4 but not IPv6, or contains some hosts that only 194 implement IPv4. The other network either routes IPv6 but not IPv4, 195 or contains some hosts that only implement IPv6. Both networks 196 contain clients, servers, and peers. 198 1.2. Applicability and Limitations 200 The use of this translation algorithm assumes that the IPv6 network 201 is somehow well connected i.e. when an IPv6 node wants to communicate 202 with another IPv6 node there is an IPv6 path between them. Various 203 tunneling schemes exist that can provide such a path, but those 204 mechanisms and their use is outside the scope of this document 205 [RFC2765]. 207 The translation algorithm can be used no only in a subnet or small 208 networks, but can also be used in the autonomous system scope. 210 The translating function as specified in this document does not 211 translate any IPv4 options and it does not translate IPv6 routing 212 headers, hop-by-hop extension headers, destination options headers or 213 source routing headers [RFC2765]. 215 The issues and algorithms in the translation of datagram containing 216 TCP segments are described in [RFC5382]. The considerations of that 217 document are applicable in this case as well. 219 Fragmented IPv4 UDP packets that do not contain a UDP checksum (i.e. 220 the UDP checksum field is zero) are not of significant use over wide- 221 areas in the Internet and will not be translated by the IP/ICMP 222 translator [Miller]. 224 The considerations of The IPSec [RFC4301] [RFC4302] [RFC4303] 225 functionality discussed in [RFC2765] are applicable in this case as 226 well. 228 IPv4 multicast addresses [RFC3171] can not be mapped to IPv6 229 multicast addresses [RFC3307] based on the unicast mapping rule. 230 However, special rule of the address translation can be created for 231 the multicast packet translation algorithm and the IP/ICMP header 232 translation aspect of this memo works. 234 1.3. Stateless vs Stateful Mode 236 The IP/ICMP translator has two possible modes of operation: stateless 237 and stateful. In both cases, we assume that a system that has an 238 IPv4 address but not an IPv6 address is communicating with a system 239 that has an IPv6 address but no IPv4 address, or that the two systems 240 do not have contiguous routing connectivity in either domain and 241 hence are forced to have their communications translated. 243 In the stateless mode, one system has an IPv4 address and one has an 244 address of the form specified in [FRAMEWORK], which is explicitly 245 mapped to an IPv4 address. In this mode, there is no need to concern 246 oneself with port translation or translation tables, as the IPv4 and 247 IPv6 counterparts are algorithmically related. 249 In the stateful mode, the system with the IPv4 address will be 250 represented by that same address type, but the IPv6 system may use 251 any [RFC4291] address except one in that range. In this case, a 252 translation table is required. 254 1.4. IPv4-embedded IPv6 addresses and IPv4-related IPv6 addresses 256 In SIIT [RFC2765] an IPv6 node should send an IPv6 packet where the 257 destination address is the IPv4-mapped address and the source address 258 is the node's temporarily assigned IPv4-translated address. If the 259 node does not have a temporarily assigned IPv4-translated address it 260 should acquire one. Different from the SIIT model, as describled in 261 [FRAMEWORK] the new forms of the IPv6 addresses are introduced. 263 The IPv4-embedded IPv6 addresses are the IPv6 addresses which have 264 unique relationship to specific IPv4 addresses. This relationship is 265 self described by embedding IPv4 address in the IPv6 address. The 266 IPv4-embedded IPv6 addresses are used for both the statesless and the 267 stateful modes. 269 The IPv4-related IPv6 addresses are the IPv6 addresses which have 270 unique relationship to specific IPv4 addresses. This relationship is 271 maintained as the states (mapping table between IPv4 address/ 272 transport_port and IPv6 address/transport_port) in the IP/ICMP 273 translator. The states are session initiated. The IPv4-related IPv6 274 addresses are used fo the stateful mode only. 276 2. Translating from IPv4 to IPv6 278 When an IP/ICMP translator receives an IPv4 datagram addressed to a 279 destination towards the IPv6 domain, it translates the IPv4 header of 280 that packet into an IPv6 header. Since the ICMP [RFC0792][RFC4443], 281 TCP [RFC0793] and UDP [RFC0768] headers consist of check sums which 282 include the IP header, the recalculation and updating of the ICMP 283 header and the transport-layer headers MUST be performed. This is 284 different from [RFC2765], since [RFC2765] uses special prefix 285 (0::ffff:0:a:b:c:d) to avoid the recalculation of the transport-layer 286 header checksum. The data portion of the packet are left unchanged. 287 The IP/ICMP translator then forwards the packet based on the IPv6 288 destination address. The original IPv4 header on the packet is 289 removed and replaced by an IPv6 header. 291 +-------------+ +-------------+ 292 | IPv4 | | IPv6 | 293 | Header | | Header | 294 +-------------+ +-------------+ 295 | Transport | | Fragment | 296 | Layer | ===> | Header | 297 | Header | |(not always) | 298 +-------------+ +-------------+ 299 | | | Transport | 300 ~ Data ~ | Layer | 301 | | | Header | 302 +-------------+ +-------------+ 303 | | 304 ~ Data ~ 305 | | 306 +-------------+ 308 Figure 2: IPv4-to-IPv6 Translation 310 One of the differences between IPv4 and IPv6 is that in IPv6 path MTU 311 discovery is mandatory but it is optional in IPv4. This implies that 312 IPv6 routers will never fragment a packet - only the sender can do 313 fragmentation. 315 When the IPv4 node performs path MTU discovery (by setting the DF bit 316 in the header) the path MTU discovery can operate end-to-end i.e. 317 across the translator. In this case either IPv4 or IPv6 routers 318 might send back ICMP "packet too big" messages to the sender. When 319 these ICMP errors are sent by the IPv6 routers they will pass through 320 a translator which will translate the ICMP error to a form that the 321 IPv4 sender can understand. In this case an IPv6 fragment header is 322 only included if the IPv4 packet is already fragmented. 324 However, when the IPv4 sender does not perform path MTU discovery the 325 translator has to ensure that the packet does not exceed the path MTU 326 on the IPv6 side. This is done by fragmenting the IPv4 packet so 327 that it fits in 1280 byte IPv6 packet since IPv6 guarantees that 1280 328 byte packets never need to be fragmented. Also, when the IPv4 sender 329 does not perform path MTU discovery the translator MUST always 330 include an IPv6 fragment header to indicate that the sender allows 331 fragmentation. That is needed should the packet pass through an IP/ 332 ICMP translator. 334 The above rules ensure that when packets are fragmented either by the 335 sender or by IPv4 routers that the low-order 16 bits of the fragment 336 identification is carried end-end to ensure that packets are 337 correctly reassembled. In addition, the rules use the presence of an 338 IPv6 fragment header to indicate that the sender might not be using 339 path MTU discovery i.e. the packet should not have the DF flag set 340 should it later be translated back to IPv4. 342 Other than the special rules for handling fragments and path MTU 343 discovery the actual translation of the packet header consists of a 344 simple mapping as defined below. Note that ICMP packets require 345 special handling in order to translate the content of ICMP error 346 message and also to add the ICMP pseudo-header checksum. 348 2.1. Translating IPv4 Headers into IPv6 Headers 350 If the DF flag is not set and the IPv4 packet will result in an IPv6 351 packet larger than 1280 bytes the IPv4 packet MUST be fragmented 352 prior to translating it. Since IPv4 packets with DF not set will 353 always result in a fragment header being added to the packet the IPv4 354 packets must be fragmented so that their length, excluding the IPv4 355 header, is at most 1232 bytes (1280 minus 40 for the IPv6 header and 356 8 for the Fragment header). The resulting fragments are then 357 translated independently using the logic described below. 359 If the DF bit is set and the packet is not a fragment (i.e., the MF 360 flag is not set and the Fragment Offset is zero) then there is no 361 need to add a fragment header to the packet. The IPv6 header fields 362 are set as follows: 364 Version: 6 366 Traffic Class: By default, copied from IP Type Of Service and 367 Precedence field (all 8 bits are copied). According to [RFC2474] 368 the semantics of the bits are identical in IPv4 and IPv6. 369 However, in some IPv4 environments these fields might be used with 370 the old semantics of "Type Of Service and Precedence". An 371 implementation of a translator SHOULD provide the ability to 372 ignore the IPv4 "TOS" and always set the IPv6 traffic class to 373 zero. 375 Flow Label: 0 (all zero bits) 377 Payload Length: Total length value from IPv4 header, minus the size 378 of the IPv4 header and IPv4 options, if present. 380 Next Header: Protocol field copied from IPv4 header 382 Hop Limit: TTL value copied from IPv4 header. Since the translator 383 is a router, as part of forwarding the packet it needs to 384 decrement either the IPv4 TTL (before the translation) or the IPv6 385 Hop Limit (after the translation). As part of decrementing the 386 TTL or Hop Limit the translator (as any router) needs to check for 387 zero and send the ICMPv4 or ICMPv6 "ttl exceeded" error. 389 Source Address: The source address is derived from the IPv4 source 390 address to form IPv4-embedded IPv6 address as specified in 391 [FRAMEWORK]. 393 Destination Address: In stateless mode, which is to say that if the 394 IPv4 destination address is within the range of the stateless 395 translation prefix described in Section 1.3, the destination 396 address is derived from the IPv4 destination address to form IPv4- 397 embedded IPv6 address in [FRAMEWORK] [I-D.baker-behave-ivi]. 399 In stateful mode, which is to say that if the IPv4 destination 400 address is not within the range of the stateless translation 401 prefix described in Section 1.3, the IPv6 address (IPv4-related 402 IPv6 address) and transport layer destination port corresponding 403 to the IPv4 destination address and destination port are derived 404 from the database reflecting current session state in the 405 translator [I-D.bagnulo-behave-nat64]. 407 If IPv4 options are present in the IPv4 packet, they are ignored 408 i.e., there is no attempt to translate them. However, if an 409 unexpired source route option is present then the packet MUST instead 410 be discarded, and an ICMPv4 "destination unreachable/source route 411 failed" (Type 3/Code 5) error message SHOULD be returned to the 412 sender. 414 If there is need to add a fragment header (the DF bit is not set or 415 the packet is a fragment) the header fields are set as above with the 416 following exceptions: 418 IPv6 fields: 420 Payload Length: Total length value from IPv4 header, plus 8 for 421 the fragment header, minus the size of the IPv4 header and IPv4 422 options, if present. 424 Next Header: Fragment Header (44). 426 Fragment header fields: 428 Next Header: Protocol field copied from IPv4 header. 430 Fragment Offset: Fragment Offset copied from the IPv4 header. 432 M flag More Fragments bit copied from the IPv4 header. 434 Identification The low-order 16 bits copied from the 435 Identification field in the IPv4 header. The high-order 16 436 bits set to zero. 438 2.2. Translating UDP over IPv4 440 If a UDP packet has a zero UDP checksum then a valid checksum must be 441 calculated in order to translate the packet. A stateless translator 442 can not do this for fragmented packets but [Miller] indicates that 443 fragmented UDP packets with a zero checksum appear to only be used 444 for malicious purposes. Thus this is not believed to be a noticeable 445 limitation. 447 When a translator receives the first fragment of a fragmented UDP 448 IPv4 packet and the checksum field is zero the translator SHOULD drop 449 the packet and generate a system management event specifying at least 450 the IP addresses and port numbers in the packet. When it receives 451 fragments other than the first it SHOULD silently drop the packet, 452 since there is no port information to log. 454 When a translator receives an unfragmented UDP IPv4 packet and the 455 checksum field is zero the translator MUST compute the missing UDP 456 checksum as part of translating the packet. Also, the translator 457 SHOULD maintain a counter of how many UDP checksums are generated in 458 this manner. 460 2.3. Translating ICMPv4 Headers into ICMPv6 Headers 462 All ICMP messages that are to be translated require that the ICMP 463 checksum field be updated as part of the translation since ICMPv6 464 unlike ICMPv4 has a pseudo-header checksum just like UDP and TCP. 466 In addition all ICMP packets need to have the Type value translated 467 and for ICMP error messages the included IP header also needs 468 translation. 470 The actions needed to translate various ICMPv4 messages are: 472 ICMPv4 query messages: 474 Echo and Echo Reply (Type 8 and Type 0) Adjust the type to 128 475 and 129, respectively, and adjust the ICMP checksum both to 476 take the type change into account and to include the ICMPv6 477 pseudo-header. 479 Information Request/Reply (Type 15 and Type 16) Obsoleted in 480 ICMPv4 Silently drop. 482 Timestamp and Timestamp Reply (Type 13 and Type 14) Obsoleted in 483 ICMPv6 Silently drop. 485 Address Mask Request/Reply (Type 17 and Type 18) Obsoleted in 486 ICMPv6 Silently drop. 488 ICMP Router Advertisement (Type 9) Single hop message. Silently 489 drop. 491 ICMP Router Solicitation (Type 10) Single hop message. Silently 492 drop. 494 Unknown ICMPv4 types Silently drop. 496 IGMP messages: While the MLD messages [RFC2710][RFC3590][RFC3810] 497 are the logical IPv6 counterparts for the IPv4 IGMP messages 498 all the "normal" IGMP messages are single-hop messages and 499 should be silently dropped by the translator. Other IGMP 500 messages might be used by multicast routing protocols and, 501 since it would be a configuration error to try to have router 502 adjacencies across IP/ICMP translators those packets should 503 also be silently dropped. 505 ICMPv4 error messages: 507 Destination Unreachable (Type 3) For all that are not 508 explicitly listed below set the Type to 1. 510 Translate the code field as follows: 512 Code 0, 1 (net, host unreachable): Set Code to 0 (no route 513 to destination). 515 Code 2 (protocol unreachable): Translate to an ICMPv6 516 Parameter Problem (Type 4, Code 1) and make the Pointer 517 point to the IPv6 Next Header field. 519 Code 3 (port unreachable): Set Code to 4 (port 520 unreachable). 522 Code 4 (fragmentation needed and DF set): Translate to an 523 ICMPv6 Packet Too Big message (Type 2) with code 0. The 524 MTU field needs to be adjusted for the difference between 525 the IPv4 and IPv6 header sizes. Note that if the IPv4 526 router did not set the MTU field i.e. the router does not 527 implement [RFC1191], then the translator must use the 528 plateau values specified in [RFC1191] to determine a 529 likely path MTU and include that path MTU in the ICMPv6 530 packet. (Use the greatest plateau value that is less 531 than the returned Total Length field.) 533 Code 5 (source route failed): Set Code to 0 (no route to 534 destination). Note that this error is unlikely since 535 source routes are not translated. 537 Code 6,7: Set Code to 0 (no route to destination). 539 Code 8: Set Code to 0 (no route to destination). 541 Code 9, 10 (communication with destination host 542 administratively prohibited): Set Code to 1 (communication 543 with destination administratively prohibited) 545 Code 11, 12: Set Code to 0 (no route to destination). 547 Redirect (Type 5) Single hop message. Silently drop. 549 Source Quench (Type 4) Obsoleted in ICMPv6 Silently drop. 551 Time Exceeded (Type 11) Set the Type field to 3. The Code 552 field is unchanged. 554 Parameter Problem (Type 12) Set the Type field to 4. The 555 Pointer needs to be updated to point to the corresponding 556 field in the translated include IP header. 558 2.4. Translating ICMPv4 Error Messages into ICMPv6 560 There are some differences between the IPv4 and the IPv6 ICMP error 561 message formats as detailed above. In addition, the ICMP error 562 messages contain the IP header for the packet in error which needs to 563 be translated just like a normal IP header. The translation of this 564 "packet in error" is likely to change the length of the datagram thus 565 the Payload Length field in the outer IPv6 header might need to be 566 updated. 568 +-------------+ +-------------+ 569 | IPv4 | | IPv6 | 570 | Header | | Header | 571 +-------------+ +-------------+ 572 | ICMPv4 | | ICMPv6 | 573 | Header | | Header | 574 +-------------+ +-------------+ 575 | IPv4 | ===> | IPv6 | 576 | Header | | Header | 577 +-------------+ +-------------+ 578 | Partial | | Partial | 579 | Transport | | Transport | 580 | Layer | | Layer | 581 | Header | | Header | 582 +-------------+ +-------------+ 584 Figure 3: IPv4-to-IPv6 ICMP Error Translation 586 The translation of the inner IP header can be done by recursively 587 invoking the function that translated the outer IP headers. 589 2.5. Transport-layer Header Translation 591 For the IPv6 addresses described in [FRAMEWORK], the recalculation 592 and updating of the transport-layer headers MUST be performed. 594 2.6. Knowing when to Translate 596 If the IP/ICMP translator is implemented in a router providing both 597 translation and normal forwarding, and the address is reachable by a 598 more specific route without translation, the router should forward it 599 without translating it. Otherwise, when an IP/ICMP translator 600 receives an IPv4 datagram addressed to a destination towards the IPv6 601 domain, the packet will be translated to IPv6. 603 3. Translating from IPv6 to IPv4 605 When an IP/ICMP translator receives an IPv6 datagram addressed to a 606 destination towards the IPv4 domain, it translates the IPv6 header of 607 that packet into an IPv4 header. Since the ICMP [RFC0792][RFC4443], 608 TCP [RFC0793] and UDP [RFC0768] headers consist of check sums which 609 include the IP header, the recalculation and updating of the ICMP 610 header and the transport-layer headers MUST be performed. This is 611 different from [RFC2765], since [RFC2765] uses special prefix 612 (0::ffff:0:a:b:c:d) to avoid the recalculation of the transport-layer 613 header checksum. The data portion of the packet are left unchanged. 614 The IP/ICMP translator then forwards the packet based on the IPv4 615 destination address. The original IPv6 header on the packet is 616 removed and replaced by an IPv4 header. 618 +-------------+ +-------------+ 619 | IPv6 | | IPv4 | 620 | Header | | Header | 621 +-------------+ +-------------+ 622 | Fragment | | Transport | 623 | Header | ===> | Layer | 624 |(if present) | | Header | 625 +-------------+ +-------------+ 626 | Transport | | | 627 | Layer | ~ Data ~ 628 | Header | | | 629 +-------------+ +-------------+ 630 | | 631 ~ Data ~ 632 | | 633 +-------------+ 635 Figure 4: IPv6-to-IPv4 Translation 637 There are some differences between IPv6 and IPv4 in the area of 638 fragmentation and the minimum link MTU that effect the translation. 640 An IPv6 link has to have an MTU of 1280 bytes or greater. The 641 corresponding limit for IPv4 is 68 bytes. Thus, unless there were 642 special measures, it would not be possible to do end-to-end path MTU 643 discovery when the path includes an translator since the IPv6 node 644 might receive ICMP "packet too big" messages originated by an IPv4 645 router that report an MTU less than 1280. However, [RFC2460] 646 requires that IPv6 nodes handle such an ICMP "packet too big" message 647 by reducing the path MTU to 1280 and including an IPv6 fragment 648 header with each packet. This allows end-to-end path MTU discovery 649 across the translator as long as the path MTU is 1280 bytes or 650 greater. When the path MTU drops below the 1280 limit the IPv6 651 sender will originate 1280 byte packets that will be fragmented by 652 IPv4 routers along the path after being translated to IPv4. 654 The only drawback with this scheme is that it is not possible to use 655 PMTU to do optimal UDP fragmentation (as opposed to completely 656 avoiding fragmentation) at sender since the presence of an IPv6 657 Fragment header is interpreted that is it OK to fragment the packet 658 on the IPv4 side. Thus if a UDP application wants to send large 659 packets independent of the PMTU, the sender will only be able to 660 determine the path MTU on the IPv6 side of the translator. If the 661 path MTU on the IPv4 side of the translator is smaller then the IPv6 662 sender will not receive any ICMP "too big" errors and can not adjust 663 the size fragments it is sending. 665 Other than the special rules for handling fragments and path MTU 666 discovery the actual translation of the packet header consists of a 667 simple mapping as defined below. Note that ICMP packets require 668 special handling in order to translate the content of ICMP error 669 message and also to add the ICMP pseudo-header checksum. 671 3.1. Translating IPv6 Headers into IPv4 Headers 673 If there is no IPv6 Fragment header the IPv4 header fields are set as 674 follows: 676 Version: 4 678 Internet Header Length: 5 (no IPv4 options) 680 Type of Service (TOS) Octet: By default, copied from the IPv6 681 Traffic Class (all 8 bits). According to [RFC2474] the semantics 682 of the bits are identical in IPv4 and IPv6. However, in some IPv4 683 environments these bits might be used with the old semantics of 684 "Type Of Service and Precedence". An implementation of a 685 translator SHOULD provide the ability to ignore the IPv6 traffic 686 class and always set the IPv4 TOS Octet to a specified value. 688 Total Length: Payload length value from IPv6 header, plus the size 689 of the IPv4 header. 691 Identification: All zero. 693 Flags: The More Fragments flag is set to zero. The Don't Fragments 694 flag is set to one. 696 Fragment Offset: All zero. 698 Time to Live: Hop Limit value copied from IPv6 header. Since the 699 translator is a router, as part of forwarding the packet it needs 700 to decrement either the IPv6 Hop Limit (before the translation) or 701 the IPv4 TTL (after the translation). As part of decrementing the 702 TTL or Hop Limit the translator (as any router) needs to check for 703 zero and send the ICMPv4 or ICMPv6 "ttl exceeded" error. 705 Protocol: Next Header field copied from IPv6 header. 707 Header Checksum: Computed once the IPv4 header has been created. 709 Source Address: In stateless mode, which is to say that if the IPv6 710 source address is within the range of the stateless translation 711 prefix described in Section 1.3, the source address is derived 712 from the IPv4-embedded IPv6 address as specified in [FRAMEWORK] 713 [I-D.baker-behave-ivi]. 715 In stateful mode, which is to say that if the IPv6 source address 716 is not within the range of the stateless translation prefix 717 described in Section 1.3, the IPv4 source address and transport 718 layer source port corresponding to the IPv6 source address (IPv4- 719 related IPv6 address) and source port are derived from the 720 database reflecting current session state in the translator as 721 described in [I-D.bagnulo-behave-nat64]. 723 Destination Address: IPv6 packets that are translated have an IPv4- 724 mapped destination address. Thus the address is derived from the 725 IPv6 address as specified in [FRAMEWORK]. 727 If any of an IPv6 hop-by-hop options header, destination options 728 header, or routing header with the Segments Left field equal to zero 729 are present in the IPv6 packet, they are ignored i.e., there is no 730 attempt to translate them. However, the Total Length field and the 731 Protocol field would have to be adjusted to "skip" these extension 732 headers. 734 If a routing header with a non-zero Segments Left field is present 735 then the packet MUST NOT be translated, and an ICMPv6 "parameter 736 problem/ erroneous header field encountered" (Type 4/Code 0) error 737 message, with the Pointer field indicating the first byte of the 738 Segments Left field, SHOULD be returned to the sender. 740 If the IPv6 packet contains a Fragment header the header fields are 741 set as above with the following exceptions: 743 Total Length: Payload length value from IPv6 header, minus 8 for the 744 Fragment header, plus the size of the IPv4 header. 746 Identification: Copied from the low-order 16-bits in the 747 Identification field in the Fragment header. 749 Flags: The More Fragments flag is copied from the M flag in the 750 Fragment header. The Don't Fragments flag is set to zero allowing 751 this packet to be fragmented by IPv4 routers. 753 Fragment Offset: Copied from the Fragment Offset field in the 754 Fragment Header. 756 Protocol: Next Header value copied from Fragment header. 758 3.2. Translating ICMPv6 Headers into ICMPv4 Headers 760 All ICMP messages that are to be translated require that the ICMP 761 checksum field be updated as part of the translation since ICMPv6 762 unlike ICMPv4 has a pseudo-header checksum just like UDP and TCP. 764 In addition all ICMP packets need to have the Type value translated 765 and for ICMP error messages the included IP header also needs 766 translation. 768 The actions needed to translate various ICMPv6 messages are: 770 ICMPv6 informational messages: 772 Echo Request and Echo Reply (Type 128 and 129) Adjust the type to 773 0 and 8, respectively, and adjust the ICMP checksum both to 774 take the type change into account and to exclude the ICMPv6 775 pseudo-header. 777 MLD Multicast Listener Query/Report/Done (Type 130, 131, 132) 778 Single hop message. Silently drop. 780 Neighbor Discover messages (Type 133 through 137) Single hop 781 message. Silently drop. 783 Unknown informational messages Silently drop. 785 ICMPv6 error messages: 787 Destination Unreachable (Type 1) Set the Type field to 3. 788 Translate the code field as follows: 790 Code 0 (no route to destination): Set Code to 1 (host 791 unreachable). 793 Code 1 (communication with destination administratively 794 prohibited): Set Code to 10 (communication with destination 795 host administratively prohibited). 797 Code 2 (beyond scope of source address): Set Code to 1 (host 798 unreachable). Note that this error is very unlikely since 799 the IPv4-translatable source address is considered to have 800 global scope. 802 Code 3 (address unreachable): Set Code to 1 (host 803 unreachable). 805 Code 4 (port unreachable): Set Code to 3 (port unreachable). 807 Packet Too Big (Type 2) Translate to an ICMPv4 Destination 808 Unreachable with code 4. The MTU field needs to be adjusted 809 for the difference between the IPv4 and IPv6 header sizes 810 taking into account whether or not the packet in error includes 811 a Fragment header. 813 Time Exceeded (Type 3) Set the Type to 11. The Code field is 814 unchanged. 816 Parameter Problem (Type 4) If the Code is 1 translate this to an 817 ICMPv4 protocol unreachable (Type 3, Code 2). Otherwise set 818 the Type to 12 and the Code to zero. The Pointer needs to be 819 updated to point to the corresponding field in the translated 820 include IP header. 822 Unknown error messages Silently drop. 824 3.3. Translating ICMPv6 Error Messages into ICMPv4 826 There are some differences between the IPv4 and the IPv6 ICMP error 827 message formats as detailed above. In addition, the ICMP error 828 messages contain the IP header for the packet in error which needs to 829 be translated just like a normal IP header. The translation of this 830 "packet in error" is likely to change the length of the datagram thus 831 the Total Length field in the outer IPv4 header might need to be 832 updated. 834 +-------------+ +-------------+ 835 | IPv6 | | IPv4 | 836 | Header | | Header | 837 +-------------+ +-------------+ 838 | ICMPv6 | | ICMPv4 | 839 | Header | | Header | 840 +-------------+ +-------------+ 841 | IPv6 | ===> | IPv4 | 842 | Header | | Header | 843 +-------------+ +-------------+ 844 | Partial | | Partial | 845 | Transport | | Transport | 846 | Layer | | Layer | 847 | Header | | Header | 848 +-------------+ +-------------+ 850 Figure 5: IPv6-to-IPv4 ICMP Error Translation 852 The translation of the inner IP header can be done by recursively 853 invoking the function that translated the outer IP headers. 855 3.4. Transport-layer Header Translation 857 For the IPv6 addresses described in [FRAMEWORK], the recalculation 858 and updating of the transport-layer headers MUST be performed. 860 3.5. Knowing when to Translate 862 If the IP/ICMP translator is implemented in a router providing both 863 translation and normal forwarding, and the address is reachable by a 864 more specific route without translation, the router should forward it 865 without translating it. When an IP/ICMP translator receives an IPv6 866 datagram addressed to a destination towards the IPv4 domain, the 867 packet will be translated to IPv4. 869 4. IANA Considerations 871 This memo adds no new IANA considerations. 873 Note to RFC Editor: This section will have served its purpose if it 874 correctly tells IANA that no new assignments or registries are 875 required, or if those assignments or registries are created during 876 the RFC publication process. From the author's perspective, it may 877 therefore be removed upon publication as an RFC at the RFC Editor's 878 discretion. 880 5. Security Considerations 882 The use of stateless IP/ICMP translators does not introduce any new 883 security issues beyond the security issues that are already present 884 in the IPv4 and IPv6 protocols and in the routing protocols which are 885 used to make the packets reach the translator. 887 As the Authentication Header [RFC4302] is specified to include the 888 IPv4 Identification field and the translating function not being able 889 to always preserve the Identification field, it is not possible for 890 an IPv6 endpoint to compute AH on received packets that have been 891 translated from IPv4 packets. Thus AH does not work through a 892 translator. 894 Packets with ESP can be translated since ESP does not depend on 895 header fields prior to the ESP header. Note that ESP transport mode 896 is easier to handle than ESP tunnel mode; in order to use ESP tunnel 897 mode the IPv6 node needs to be able to generate an inner IPv4 header 898 when transmitting packets and remove such an IPv4 header when 899 receiving packets. 901 6. Acknowledgements 903 This is under development by a large group of people. Those who have 904 posted to the list during the discussion include Andrew Sullivan, 905 Andrew Yourtchenko, Brian Carpenter, Dan Wing, Ed Jankiewicz, Fred 906 Baker, Hiroshi Miyata, Iljitsch van Beijnum, John Schnizlein, Kevin 907 Yin, Magnus Westerlund, Marcelo Bagnulo Braun, Margaret Wasserman, 908 Masahito Endo, Phil Roberts, Philip Matthews, Remi Denis-Courmont, 909 Remi Despres, and Xing Li. 911 7. References 913 7.1. Normative References 915 [FRAMEWORK] 916 Baker, F., "Framework for IPv4/IPv6 Translation - baker- 917 behave-v4v6-framework", October 2008. 919 [I-D.bagnulo-behave-nat64] 920 Bagnulo, M., Matthews, P., and I. Beijnum, "NAT64: Network 921 Address and Protocol Translation from IPv6 Clients to IPv4 922 Servers", draft-bagnulo-behave-nat64-02 (work in 923 progress), November 2008. 925 [I-D.baker-behave-ivi] 926 Li, X., Bao, C., Baker, F., and K. Yin, "IVI Update to 927 SIIT and NAT-PT", draft-baker-behave-ivi-01 (work in 928 progress), September 2008. 930 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 931 August 1980. 933 [RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, 934 September 1981. 936 [RFC0792] Postel, J., "Internet Control Message Protocol", STD 5, 937 RFC 792, September 1981. 939 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 940 RFC 793, September 1981. 942 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 943 Requirement Levels", BCP 14, RFC 2119, March 1997. 945 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 946 (IPv6) Specification", RFC 2460, December 1998. 948 [RFC2765] Nordmark, E., "Stateless IP/ICMP Translation Algorithm 949 (SIIT)", RFC 2765, February 2000. 951 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 952 Architecture", RFC 4291, February 2006. 954 [RFC4443] Conta, A., Deering, S., and M. Gupta, "Internet Control 955 Message Protocol (ICMPv6) for the Internet Protocol 956 Version 6 (IPv6) Specification", RFC 4443, March 2006. 958 [RFC5382] Guha, S., Biswas, K., Ford, B., Sivakumar, S., and P. 959 Srisuresh, "NAT Behavioral Requirements for TCP", BCP 142, 960 RFC 5382, October 2008. 962 7.2. Informative References 964 [I-D.petithuguenin-behave-stun-pmtud] 965 Petit-Huguenin, M., "Path MTU Discovery Using Session 966 Traversal Utilities for NAT (STUN)", 967 draft-petithuguenin-behave-stun-pmtud-02 (work in 968 progress), November 2008. 970 [Miller] Miller, G., "Email to the ngtrans mailing list", 971 March 1999. 973 [RFC1112] Deering, S., "Host extensions for IP multicasting", STD 5, 974 RFC 1112, August 1989. 976 [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, 977 November 1990. 979 [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery 980 for IP version 6", RFC 1981, August 1996. 982 [RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black, 983 "Definition of the Differentiated Services Field (DS 984 Field) in the IPv4 and IPv6 Headers", RFC 2474, 985 December 1998. 987 [RFC2710] Deering, S., Fenner, W., and B. Haberman, "Multicast 988 Listener Discovery (MLD) for IPv6", RFC 2710, 989 October 1999. 991 [RFC3171] Albanna, Z., Almeroth, K., Meyer, D., and M. Schipper, 992 "IANA Guidelines for IPv4 Multicast Address Assignments", 993 BCP 51, RFC 3171, August 2001. 995 [RFC3307] Haberman, B., "Allocation Guidelines for IPv6 Multicast 996 Addresses", RFC 3307, August 2002. 998 [RFC3493] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W. 999 Stevens, "Basic Socket Interface Extensions for IPv6", 1000 RFC 3493, February 2003. 1002 [RFC3590] Haberman, B., "Source Address Selection for the Multicast 1003 Listener Discovery (MLD) Protocol", RFC 3590, 1004 September 2003. 1006 [RFC3810] Vida, R. and L. Costa, "Multicast Listener Discovery 1007 Version 2 (MLDv2) for IPv6", RFC 3810, June 2004. 1009 [RFC4213] Nordmark, E. and R. Gilligan, "Basic Transition Mechanisms 1010 for IPv6 Hosts and Routers", RFC 4213, October 2005. 1012 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 1013 Internet Protocol", RFC 4301, December 2005. 1015 [RFC4302] Kent, S., "IP Authentication Header", RFC 4302, 1016 December 2005. 1018 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 1019 RFC 4303, December 2005. 1021 [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU 1022 Discovery", RFC 4821, March 2007. 1024 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 1025 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 1026 September 2007. 1028 Authors' Addresses 1030 Xing Li (editor) 1031 CERNET Center/Tsinghua University 1032 Room 225, Main Building, Tsinghua University 1033 Beijing, 100084 1034 China 1036 Phone: +86 62785983 1037 Email: xing@cernet.edu.cn 1039 Congxiao Bao (editor) 1040 CERNET Center/Tsinghua University 1041 Room 225, Main Building, Tsinghua University 1042 Beijing, 100084 1043 China 1045 Phone: +86 62785983 1046 Email: congxiao@cernet.edu.cn 1048 Fred Baker (editor) 1049 Cisco Systems 1050 Santa Barbara, California 93117 1051 USA 1053 Phone: +1-408-526-4257 1054 Email: fred@cisco.com