idnits 2.17.1 draft-ietf-softwire-map-03.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 : ---------------------------------------------------------------------------- == There are 3 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (January 24, 2013) is 4100 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.ietf-softwire-stateless-4v6-motivation' is defined on line 886, but no explicit reference was found in the text == Outdated reference: A later version (-12) exists of draft-ietf-softwire-map-dhcp-01 -- Obsolete informational reference (is this intentional?): RFC 1933 (Obsoleted by RFC 2893) -- Obsolete informational reference (is this intentional?): RFC 3633 (Obsoleted by RFC 8415) Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group O. Troan 3 Internet-Draft W. Dec 4 Intended status: Standards Track Cisco Systems 5 Expires: July 28, 2013 X. Li 6 C. Bao 7 CERNET Center/Tsinghua University 8 S. Matsushima 9 SoftBank Telecom 10 T. Murakami 11 IP Infusion 12 January 24, 2013 14 Mapping of Address and Port with Encapsulation (MAP) 15 draft-ietf-softwire-map-03 17 Abstract 19 This document describes a mechanism for transporting IPv4 packets 20 across an IPv6 network using IP encapsulation, and a generic 21 mechanism for mapping between IPv6 addresses and IPv4 addresses and 22 transport layer ports. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at http://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on July 28, 2013. 41 Copyright Notice 43 Copyright (c) 2013 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (http://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 59 2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 4 60 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 61 4. Architecture . . . . . . . . . . . . . . . . . . . . . . . . . 5 62 5. Mapping Algorithm . . . . . . . . . . . . . . . . . . . . . . 6 63 5.1. Port mapping algorithm . . . . . . . . . . . . . . . . . . 8 64 5.2. Basic mapping rule (BMR) . . . . . . . . . . . . . . . . . 9 65 5.3. Forwarding mapping rule (FMR) . . . . . . . . . . . . . . 11 66 5.4. Destinations outside the MAP domain . . . . . . . . . . . 11 67 6. The IPv6 Interface Identifier . . . . . . . . . . . . . . . . 12 68 7. MAP Configuration . . . . . . . . . . . . . . . . . . . . . . 12 69 7.1. MAP CE . . . . . . . . . . . . . . . . . . . . . . . . . . 12 70 7.2. MAP BR . . . . . . . . . . . . . . . . . . . . . . . . . . 13 71 7.3. Backwards compatibility . . . . . . . . . . . . . . . . . 13 72 7.4. Address Independence . . . . . . . . . . . . . . . . . . . 13 73 8. Forwarding Considerations . . . . . . . . . . . . . . . . . . 14 74 8.1. Receiving rules . . . . . . . . . . . . . . . . . . . . . 14 75 8.2. MAP BR . . . . . . . . . . . . . . . . . . . . . . . . . . 14 76 9. ICMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 77 10. Fragmentation and Path MTU Discovery . . . . . . . . . . . . . 15 78 10.1. Fragmentation in the MAP domain . . . . . . . . . . . . . 15 79 10.2. Receiving IPv4 Fragments on the MAP domain borders . . . 16 80 10.3. Sending IPv4 fragments to the outside . . . . . . . . . . 16 81 11. NAT44 Considerations . . . . . . . . . . . . . . . . . . . . . 17 82 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 83 13. Security Considerations . . . . . . . . . . . . . . . . . . . 17 84 14. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 18 85 15. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 19 86 16. References . . . . . . . . . . . . . . . . . . . . . . . . . . 19 87 16.1. Normative References . . . . . . . . . . . . . . . . . . 19 88 16.2. Informative References . . . . . . . . . . . . . . . . . 20 89 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 22 90 Appendix B. Alternate description of the Port mapping algorithm . 26 91 B.1. Bit Representation of the Algorithm . . . . . . . . . . . 27 92 B.2. GMA examples . . . . . . . . . . . . . . . . . . . . . . . 27 93 B.3. Port Offset . . . . . . . . . . . . . . . . . . . . . . . 28 94 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 28 96 1. Introduction 98 Mapping of IPv4 addresses in IPv6 addresses has been described in 99 numerous mechanisms dating back to 1996 [RFC1933]. The Automatic 100 tunneling mechanism described in RFC1933, assigned a globally unique 101 IPv6 address to a host by combining the host's IPv4 address with a 102 well-known IPv6 prefix. Given an IPv6 packet with a destination 103 address with an embedded IPv4 address, a node could automatically 104 tunnel this packet by extracting the IPv4 tunnel end-point address 105 from the IPv6 destination address. 107 There are numerous variations of this idea, described in 6over4 108 [RFC2529], 6to4 [RFC3056], ISATAP [RFC5214], and 6rd [RFC5969]. 110 The commonalities of all these IPv6 over IPv4 mechanisms are: 112 o Automatically provisions an IPv6 address for a host or an IPv6 113 prefix for a site 115 o Algorithmic or implicit address resolution of tunnel end point 116 addresses. Given an IPv6 destination address, an IPv4 tunnel 117 endpoint address can be calculated. 119 o Embedding of an IPv4 address or part thereof into an IPv6 address. 121 In phases of IPv4 to IPv6 migration, IPv6 only networks will be 122 common, while there will still be a need for residual IPv4 123 deployment. This document describes a generic mapping of IPv4 to 124 IPv6, and a mechanism for encapsulating IPv4 over IPv6. 126 Just as the IPv6 over IPv4 mechanisms referred to above, the residual 127 IPv4 over IPv6 mechanism must be capable of: 129 o Provisioning an IPv4 prefix, an IPv4 address or a shared IPv4 130 address. 132 o Algorithmically map between an IPv4 prefix, IPv4 address or a 133 shared IPv4 address and an IPv6 address. 135 The mapping scheme described here supports encapsulation of IPv4 136 packets in IPv6 in both mesh and hub and spoke topologies, including 137 address mappings with full independence between IPv6 and IPv4 138 addresses. 140 This document describes delivery of IPv4 unicast service across an 141 IPv6 infrastructure. IPv4 multicast is not considered further in 142 this document. 144 The A+P (Address and Port) architecture of sharing an IPv4 address by 145 distributing the port space is described in [RFC6346]. Specifically 146 section 4 of [RFC6346] covers stateless mapping. The corresponding 147 stateful solution DS-lite is described in [RFC6333]. The motivation 148 for the work is described in [I-D.ietf-softwire-stateless- 149 4v6-motivation]. 151 A companion document defines a DHCPv6 option for provisioning of MAP 152 [I-D.ietf-softwire-map-dhcp]. Other means of provisioning is 153 possible. Deployment considerations are described in [I-D.mdt- 154 softwire-map-deployment]. 156 MAP relies on IPv6 and is designed to deliver production-quality 157 dual-stack service while allowing IPv4 to be phased out within the SP 158 network. The phasing out of IPv4 within the SP network is 159 independent of whether the end user disables IPv4 service or not. 160 Further, "Greenfield"; IPv6-only networks may use MAP in order to 161 deliver IPv4 to sites via the IPv6 network. 163 2. Conventions 165 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 166 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 167 document are to be interpreted as described in RFC 2119 [RFC2119]. 169 3. Terminology 171 MAP domain: One or more MAP CEs and BRs connected to the 172 same virtual link. A service provider may 173 deploy a single MAP domain, or may utilize 174 multiple MAP domains. 176 MAP Rule A set of parameters describing the mapping 177 between an IPv4 prefix, IPv4 address or 178 shared IPv4 address and an IPv6 prefix or 179 address. Each domain uses a different 180 mapping rule set. 182 MAP node A device that implements MAP. 184 MAP Border Relay (BR): A MAP enabled router managed by the service 185 provider at the edge of a MAP domain. A 186 Border Relay router has at least an 187 IPv6-enabled interface and an IPv4 interface 188 connected to the native IPv4 network. A MAP 189 BR may also be referred to simply as a "BR" 190 within the context of MAP. 192 MAP Customer Edge (CE): A device functioning as a Customer Edge 193 router in a MAP deployment. A typical MAP CE 194 adopting MAP rules will serve a residential 195 site with one WAN side interface, and one or 196 more LAN side interfaces. A MAP CE may also 197 be referred to simply as a "CE" within the 198 context of MAP. 200 Port-set: The separate part of the transport layer port 201 space; denoted as a port-set. 203 Port-set ID (PSID): Algorithmically identifies a set of ports 204 exclusively assigned to a CE. 206 Shared IPv4 address: An IPv4 address that is shared among multiple 207 CEs. Only ports that belong to the assigned 208 port-set can be used for communication. Also 209 known as a Port-Restricted IPv4 address. 211 End-user IPv6 prefix: The IPv6 prefix assigned to an End-user CE by 212 other means than MAP itself. E.g. 213 Provisioned using DHCPv6 PD [RFC3633], 214 assigned via SLAAC [RFC4861], or configured 215 manually. It is unique for each CE. 217 MAP IPv6 address: The IPv6 address used to reach the MAP 218 function of a CE from other CEs and from BRs. 220 Rule IPv6 prefix: An IPv6 prefix assigned by a Service Provider 221 for a mapping rule. 223 Rule IPv4 prefix: An IPv4 prefix assigned by a Service Provider 224 for a mapping rule. 226 Embedded Address (EA) bits: The IPv4 EA-bits in the IPv6 address 227 identify an IPv4 prefix/address (or part 228 thereof) or a shared IPv4 address (or part 229 thereof) and a port-set identifier. 231 4. Architecture 233 The MAP mechanism uses existing standard building blocks. The 234 existing NAPT on the CE is used with additional support for 235 restricting transport protocol ports, ICMP identifiers and fragment 236 identifiers to the configured port set. MAP supports the 237 encapsulation mode specified in [RFC2473]. In addition MAP specifies 238 an algorithm to do "address resolution" from an IPv4 address and port 239 to an IPv6 address. This algorithmic mapping is specified in Section 240 5. 242 A full IPv4 address or IPv4 prefix can be used like today, e.g. For 243 identifying an interface or as a DHCP pool. A shared IPv4 address on 244 the other hand, MUST NOT be used to identify an interface. While it 245 is theoretically possible to make host stacks and applications port- 246 aware, that is considered a too drastic change to the IP model 247 [RFC6250]. 249 The MAP architecture described here, restricts the use of the shared 250 IPv4 address to only be used as the global address (outside) of the 251 NAPT [RFC2663] running on the CE. The NAPT MUST in turn be connected 252 to a MAP aware forwarding function, that does encapsulation/ 253 decapsulation of IPv4 packets in IPv6. 255 When MAP is used to provision a full IPv4 address or an IPv4 prefix 256 to the CE, these restrictions do not apply. 258 For packets outbound from the private IPv4 network, the CE NAPT MUST 259 translate transport identifiers (e.g. TCP and UDP port numbers) so 260 that they fall within the assigned CE's port-range. 262 User N 263 Private IPv4 264 | Network 265 | 266 O--+---------------O 267 | | MAP CE | 268 | +-----+--------+ | 269 | NAPT44| MAP | | 270 | +-----+ | | |\ ,-------. .------. 271 | +--------+ | \ ,-' `-. ,-' `-. 272 O------------------O / \ O---------O / Public \ 273 / IPv6 only \ | MAP | / IPv4 \ 274 ( Network --+ Border +- Network ) 275 \ (MAP Domain) / | Relay | \ / 276 O------------------O \ / O---------O \ / 277 | MAP CE | /". ,-' `-. ,-' 278 | +-----+--------+ | / `----+--' ------' 279 | NAPT44| MAP | |/ 280 | +-----+ | | 281 | | +--------+ | 282 O---.--------------O 283 | 284 User M 285 Private IPv4 286 Network 288 Figure 1: Network Topology 290 The MAP BR is responsible for connecting external IPv4 networks to 291 the IPv4 nodes in one or more MAP domains. 293 5. Mapping Algorithm 295 A MAP node is provisioned with one or more mapping rules. 297 Mapping rules are used differently depending on their function. 298 Every MAP node must be provisioned with a Basic mapping rule. This 299 is used by the node to configure its IPv4 address, IPv4 prefix or 300 shared IPv4 address. This same basic rule can also be used for 301 forwarding, where an IPv4 destination address and optionally a 302 destination port is mapped into an IPv6 address. Additional mapping 303 rules are specified to allow for multiple different IPv4 sub-nets to 304 exist within the domain and optimize forwarding between them. 306 Traffic outside of the domain (i.e. When the destination IPv4 307 address does not match (using longest matching prefix) any Rule IPv4 308 prefix in the Rules database) is forwarded to the BR. 310 There are two types of mapping rules: 312 1. Basic Mapping Rule (BMR) - mandatory, used for IPv4 prefix, 313 address or port set assignment. There can only be one Basic 314 Mapping Rule per End-user IPv6 prefix. The Basic Mapping Rule is 315 used to configure the MAP IPv6 address or prefix. 317 2. Forwarding Mapping Rule (FMR) - optional, used for forwarding. 318 The Basic Mapping Rule is also a Forwarding Mapping Rule. Each 319 Forwarding Mapping Rule will result in an entry in the Rules 320 table for the Rule IPv4 prefix. 322 Both mapping rules share the same parameters: 324 o Rule IPv6 prefix (including prefix length) 326 o Rule IPv4 prefix (including prefix length) 328 o Rule EA-bits length (in bits) 330 o Rule Port Parameters (optional) 332 A MAP node finds its Basic Mapping Rule by doing a longest match 333 between the End-user IPv6 prefix and the Rule IPv6 prefix in the 334 Mapping Rules table. The rule is then used for IPv4 prefix, address 335 or shared address assignment. 337 A MAP IPv6 address is formed from the BMR Rule IPv6 prefix. This 338 address MUST be assigned to an interface of the MAP node and is used 339 to terminate all MAP traffic being sent or received to the node. 341 Port-aware IPv4 entries in the Rules table are installed for all the 342 Forwarding Mapping Rules and an IPv4 default route to the MAP BR. 344 Forwarding rules are used to allow direct communication between MAP 345 CEs, known as mesh mode. In hub and spoke mode, there are no 346 forwarding rules, all traffic MUST be forwarded directly to the BR. 348 5.1. Port mapping algorithm 350 The port mapping algorithm is used in domains whose rules allow IPv4 351 address sharing. 353 The simplest way to represent a port range is using a notation 354 similar to CIDR [RFC4632]. For example the first 256 ports are 355 represented as port prefix 0.0/8. The last 256 ports as 255.0/8. In 356 hexadecimal, 0x0000/8 (PSID = 0) and 0xFF00/8 (PSID = 0xFF). 358 To minimise dependencies between the End-user IPv6 prefix and the 359 resulting port set, a PSID of 0, would, in the naive representation 360 assign the system ports [I-D.ietf-tsvwg-iana-ports] to the user. 361 Instead using an infix representation, and requiring that the first 362 bit field (A) is greater than 0, the well known ports are excluded. 364 0 1 365 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 366 +-------+-----------+-----------+ 367 Ports in | A | PSID | M | 368 the CE port set | > 0 | | any value | 369 +-------+-----------+-----------+ 370 |a bits | k bits | m bits | 372 Figure 2: PSID 374 A For a > 0, A MUST be larger than 0. This ensures that the 375 algorithm excludes the system ports. For a = 0, A MAY be 0 to 376 allow for the provisioning of the system ports. 378 a-bits The number of offset bits (excluded ports) are optionally 379 provisioned via the "Rule Port Mapping Parameters" in the Basic 380 Mapping Rule. The default Offset bits (a) are: 4. To simplify 381 the port mapping algorithm the defaults are chosen so that the 382 PSID field starts on a nibble boundary and the excluded port range 383 (0-1023) is extended to 0-4095. 385 PSID The Port Set Identifier. Different Port-Set Identifiers (PSID) 386 MUST have non-overlapping port-sets. 388 k-bits The length in bits of the PSID field. The sharing ratio is 389 k^2. The number of ports assigned to the user is 2^(16-k) - 2^m 390 (excluded ports) 392 M The contiguous ports. 394 m bits The size contiguous ports. The number of contiguous ports is 395 given by 2^m. 397 5.2. Basic mapping rule (BMR) 399 The Basic Mapping Rule is mandatory, used by the CE to provision 400 itself with an IPv4 prefix, IPv4 address or shared IPv4 address. 402 | n bits | o bits | s bits | 128-n-o-s bits | 403 +--------------------+-----------+---------+------------+----------+ 404 | Rule IPv6 prefix | EA bits |subnet ID| interface ID | 405 +--------------------+-----------+---------+-----------------------+ 406 |<--- End-user IPv6 prefix --->| 408 Figure 3: IPv6 address format 410 The Rule IPv6 prefix is the part of the End-user IPv6 prefix that is 411 common among all CEs using the same Basic Mapping Rule within the MAP 412 domain. The EA bits encode the CE specific IPv4 address and port 413 information. The EA bits, which are unique for a given Rule IPv6 414 prefix, can contain a full or part of an IPv4 address and, in the 415 shared IPv4 address case, a Port-Set Identifier (PSID). An EA-bit 416 length of 0 signifies that all relevant MAP IPv4 addressing 417 information is passed directly in the BMR rule, and not derived from 418 the End-user IPv6 prefix. 420 The MAP IPv6 address is created by concatenating the End-user IPv6 421 prefix with the MAP subnet-id (if the End-user IPv6 prefix is shorter 422 than 64 bits) and the interface-id as specified in Section 6. 424 The MAP subnet ID is defined to be the first subnet (all bits set to 425 zero). Unless configured differently, a MAP node MUST reserve the 426 first IPv6 prefix in an End-user IPv6 prefix for the purpose of MAP. 428 The MAP IPv6 is created by combining the End-User IPv6 prefix with 429 the all zeros subnet-id and the MAP IPv6 interface identifier. 431 Shared IPv4 address: 433 | r bits | p bits | | q bits | 434 +-------------+---------------------+ +------------+ 435 | Rule IPv4 | IPv4 Address suffix | |Port-Set ID | 436 +-------------+---------------------+ +------------+ 437 | 32 bits | 439 Figure 4: Shared IPv4 address 441 Complete IPv4 address: 443 | r bits | p bits | 444 +-------------+---------------------+ 445 | Rule IPv4 | IPv4 Address suffix | 446 +-------------+---------------------+ 447 | 32 bits | 449 Figure 5: Complete IPv4 address 451 IPv4 prefix: 453 | r bits | p bits | 454 +-------------+---------------------+ 455 | Rule IPv4 | IPv4 Address suffix | 456 +-------------+---------------------+ 457 | < 32 bits | 459 Figure 6: IPv4 prefix 461 The length of r MAY be zero, in which case the complete IPv4 address 462 or prefix is encoded in the EA bits. If only a part of the IPv4 463 address/prefix is encoded in the EA bits, the Rule IPv4 prefix is 464 provisioned to the CE by other means (e.g. a DHCPv6 option). To 465 create a complete IPv4 address (or prefix), the IPv4 address suffix 466 (p) from the EA bits, are concatenated with the Rule IPv4 prefix (r 467 bits). 469 The offset of the EA bits field in the IPv6 address is equal to the 470 BMR Rule IPv6 prefix length. The length of the EA bits field (o) is 471 given by the BMR Rule EA-bits length, and can be between 0 and 48. 472 The sum of the Rule IPv6 Prefix length and the Rule EA-bits length 473 MUST be less or equal than the End-user IPv6 prefix length. 475 If o + r < 32 (length of the IPv4 address in bits), then an IPv4 476 prefix is assigned. 478 If o + r is equal to 32, then a full IPv4 address is to be assigned. 479 The address is created by concatenating the Rule IPv4 prefix and the 480 EA-bits. 482 If o + r is > 32, then a shared IPv4 address is to be assigned. The 483 number of IPv4 address suffix bits (p) in the EA bits is given by 32 484 - r bits. The PSID bits are used to create a port-set. The length 485 of the PSID bit field within EA bits is: o - p. 487 The length of r MAY be 32, with no part of the IPv4 address embedded 488 in the EA bits. This results in a mapping with no dependence between 489 the IPv4 address and the IPv6 address. In addition the length of o 490 MAY be zero (no EA bits embedded in the End-User IPv6 prefix), 491 meaning that also the PSID is provisioned using e.g. the DHCP 492 option. 494 See Appendix A for an example of the Basic Mapping Rule. 496 5.3. Forwarding mapping rule (FMR) 498 The Forwarding Mapping Rule is optional, and used in mesh mode to 499 merit direct CE to CE connectivity. 501 On adding an FMR rule, an IPv4 route is installed in the Rules table 502 for the Rule IPv4 prefix. 504 On forwarding an IPv4 packet, a best matching prefix look up is done 505 in the Rules table and the correct FMR is chosen. 507 | 32 bits | | 16 bits | 508 +--------------------------+ +-------------------+ 509 | IPv4 destination address | | IPv4 dest port | 510 +--------------------------+ +-------------------+ 511 : : ___/ : 512 | p bits | / q bits : 513 +----------+ +------------+ 514 |IPv4 sufx| |Port-Set ID | 515 +----------+ +------------+ 516 \ / ____/ ________/ 517 \ : __/ _____/ 518 \ : / / 519 | n bits | o bits | s bits | 128-n-o-s bits | 520 +--------------------+-----------+---------+------------+----------+ 521 | Rule IPv6 prefix | EA bits |subnet ID| interface ID | 522 +--------------------+-----------+---------+-----------------------+ 523 |<--- End-user IPv6 prefix --->| 525 Figure 7: Deriving of MAP IPv6 address 527 See Appendix A for an example of the Forwarding Mapping Rule. 529 5.4. Destinations outside the MAP domain 531 To reach IPv4 destinations outside of the MAP domain, traffic is sent 532 to the configured address of the MAP BR. On the CE, the default can 533 be represented as a point to point IPv4 over IPv6 tunnel [RFC2473] to 534 the BR. 536 6. The IPv6 Interface Identifier 538 The Interface identifier format of a MAP node is based on the format 539 specified in section 2.2 of [RFC6052], with the added PSID field if 540 present, as shown in figure Figure 8. 542 +--+---+---+---+---+---+---+---+---+ 543 |PL| 8 16 24 32 40 48 56 | 544 +--+---+---+---+---+---+---+---+---+ 545 |64| u | IPv4 address | PSID | 0 | 546 +--+---+---+---+---+---+---+---+---+ 548 Figure 8 550 In the case of an IPv4 prefix, the IPv4 address field is right-padded 551 with zeroes up to 32 bits. The PSID field is left-padded to create a 552 16 bit field. For an IPv4 prefix or a complete IPv4 address, the 553 PSID field is zero. 555 If the End-user IPv6 prefix length is larger than 64, the most 556 significant parts of the interface identifier is overwritten by the 557 prefix. 559 7. MAP Configuration 561 For a given MAP domain, the BR and CE MUST be configured with the 562 following MAP elements. The configured values for these elements are 563 identical for all CEs and BRs within a given MAP domain. 565 o The End-User IPv6 prefix (Part of the normal IPv6 provisioning). 567 o The Basic Mapping Rule and optionally the Forwarding Mapping 568 Rules, including the Rule IPv6 prefix, Rule IPv4 prefix, and 569 Length of EA bits 571 o The IPv6 address of the MAP BR. 573 o Hub and spoke mode or Mesh mode. (If all traffic should be sent 574 to the BR, or if direct CE to CE traffic should be supported). 576 7.1. MAP CE 577 The MAP elements are set to values that are the same across all CEs 578 within a MAP domain. The values may be configured in a variety of 579 manners, including provisioning methods such as the Broadband Forum's 580 "TR-69" Residential Gateway management interface, an XML-based object 581 retrieved after IPv6 connectivity is established, or manual 582 configuration by an administrator. This document describes how to 583 configure the necessary parameters via a single IPv6 DHCP option. A 584 CE that allows IPv6 configuration by DHCP SHOULD implement this 585 option. Other configuration and management methods may use the 586 format described by this option for consistency and convenience of 587 implementation on CEs that support multiple configuration methods. 589 The only remaining provisioning information the CE requires in order 590 to calculate the MAP IPv4 address and enable IPv4 connectivity is the 591 IPv6 prefix for the CE. The End-user IPv6 prefix is configured as 592 part of obtaining IPv6 Internet access. 594 A single MAP CE MAY be connected to more than one MAP domain, just as 595 any router may have more than one IPv4-enabled service provider 596 facing interface and more than one set of associated addresses 597 assigned by DHCP. Each domain a given CE operates within would 598 require its own set of MAP configuration elements and would generate 599 its own IPv4 address. 601 The MAP DHCP option is specified in [I-D.ietf-softwire-map-dhcp]. 603 7.2. MAP BR 605 The MAP BR MUST be configured with the same MAP elements as the MAP 606 CEs operating within the same domain. 608 For increased reliability and load balancing, the BR IPv6 address MAY 609 be an anycast address shared across a given MAP domain. As MAP is 610 stateless, any BR may be used at any time. If the BR IPv6 address is 611 anycast the relay MUST use this anycast IPv6 address as the source 612 address in packets relayed to CEs. 614 Since MAP uses provider address space, no specific routes need to be 615 advertised externally for MAP to operate, neither in IPv6 nor IPv4 616 BGP. However, if anycast is used for the MAP IPv6 relays, the 617 anycast addresses must be advertised in the service provider's IGP. 619 7.3. Backwards compatibility 621 A MAP-E CE provisioned with only the IPv6 address of the BR, and with 622 no IPv4 address and port range configured by other means, MUST 623 disable its NAT44 functionality. This characteristic makes a MAP CE 624 compatible with DS-Lite [RFC6333] AFTRs, whose addresses are 625 configured as the MAP BR. 627 7.4. Address Independence 628 The MAP solution supports use and configuration of domains in so 629 called 1:1 mode (meaning 1 mapping rule set per CE), which allows 630 complete independence between the IPv6 prefix assigned to the CE and 631 the IPv4 address and/or port-range it uses. This is achieved in all 632 cases when the EA-bit length is set to 0. 634 The constraint imposed is that each such MAP domain be composed of 635 just 1 MAP CE which has a predetermined IPv6 prefix, i.e. The BR 636 would be configured with a rule-set per CPE, where the FMR would 637 uniquely describe the IPv6 prefix of a given CE. Each CE would have 638 a distinct BMR, that would fully describe that CE's IPv4 address, and 639 PSID if any. 641 8. Forwarding Considerations 643 Figure 1 depicts the overall MAP architecture with IPv4 users (N and 644 M) networks connected to a routed IPv6 network. 646 MAP supports Encapsulation mode as specified in [RFC2473]. 648 For a shared IPv4 address, a MAP CE forwarding IPv4 packets from the 649 LAN performs NAT44 functions first and creates appropriate NAT44 650 bindings. The resulting IPv4 packets MUST contain the source IPv4 651 address and source transport identifiers defined by MAP. The 652 resulting IPv4 packet is forwarded to the CE's MAP forwarding 653 function. The IPv6 source and destination addresses MUST then be 654 derived as per Section 5 of this draft. 656 A MAP CE receiving an IPv6 packet to its MAP IPv6 address sends this 657 packet to the CE's MAP function. All other IPv6 traffic is forwarded 658 as per the CE's IPv6 routing rules. The resulting IPv4 packet is 659 then forwarded to the CE's NAT44 function where the destination port 660 number MUST be checked against the stateful port mapping session 661 table and the destination port number MUST be mapped to its original 662 value. 664 8.1. Receiving rules 666 The CE SHOULD check that MAP received packets' transport-layer 667 destination port number is in the range configured by MAP for the CE 668 and the CE SHOULD drop any non conforming packet and respond with an 669 ICMPv6 "Address Unreachable" (Type 1, Code 3). 671 8.2. MAP BR 672 A MAP BR receiving IPv6 packets selects a best matching MAP domain 673 rule based on a longest address match of the packets' source address 674 against the BR's configured MAP BMR prefix(es), as well as a match of 675 the packet destination address against the configured BR IPv6 address 676 or FMR prefix(es). The selected MAP rule allows the BR to determine 677 the EA-bits from the source IPv6 address. The BR MUST perform a 678 validation of the consistency of the source IPv6 address and source 679 port number for the packet using BMR. If the packets source port 680 number is found to be outside the range allowed for this CE and the 681 BMR, the BR MUST drop the packet and respond with an ICMPv6 682 "Destination Unreachable, Source address failed ingress/egress 683 policy" (Type 1, Code 5). 685 9. ICMP 687 ICMP message should be supported in MAP domain. Hence, the NAT44 in 688 MAP CE must implement the behavior for ICMP message conforming to the 689 best current practice documented in [RFC5508]. 691 If a MAP CE receives an ICMP message having ICMP identifier field in 692 ICMP header, NAT44 in the MAP CE must rewrite this field to a 693 specific value assigned from the port-set. BR and other CEs must 694 handle this field similar to the port number in the TCP/UDP header 695 upon receiving the ICMP message with ICMP identifier field. 697 If a MAP node receives an ICMP error message without the ICMP 698 identifier field for errors that is detected inside a IPv6 tunnel, a 699 node should relay the ICMP error message to the original source. 700 This behavior should be implemented conforming to the section 8 of 701 [RFC2473]. 703 10. Fragmentation and Path MTU Discovery 705 Due to the different sizes of the IPv4 and IPv6 header, handling the 706 maximum packet size is relevant for the operation of any system 707 connecting the two address families. There are three mechanisms to 708 handle this issue: Path MTU discovery (PMTUD), fragmentation, and 709 transport-layer negotiation such as the TCP Maximum Segment Size 710 (MSS) option [RFC0897]. MAP uses all three mechanisms to deal with 711 different cases. 713 10.1. Fragmentation in the MAP domain 715 Encapsulating an IPv4 packet to carry it across the MAP domain will 716 increase its size (40 bytes). It is strongly recommended that the 717 MTU in the MAP domain is well managed and that the IPv6 MTU on the CE 718 WAN side interface is set so that no fragmentation occurs within the 719 boundary of the MAP domain. 721 Fragmentation on MAP domain entry is described in section 7.2 of 722 [RFC2473] 724 The use of an anycast source address could lead to any ICMP error 725 message generated on the path being sent to a different BR. 726 Therefore, using dynamic tunnel MTU Section 6.7 of [RFC2473] is 727 subject to IPv6 Path MTU black-holes. A MAP BR SHOULD NOT by default 728 use Path MTU discovery across the MAP domain. 730 Multiple BRs using the same anycast source address could send 731 fragmented packets to the same CE at the same time. If the 732 fragmented packets from different BRs happen to use the same fragment 733 ID, incorrect reassembly might occur. See [RFC4459] for an analysis 734 of the problem. Section 3.4 suggests solving the problem by 735 fragmenting the inner packet. 737 10.2. Receiving IPv4 Fragments on the MAP domain borders 739 Forwarding of an IPv4 packet received from the outside of the MAP 740 domain requires the IPv4 destination address and the transport 741 protocol destination port. The transport protocol information is 742 only available in the first fragment received. As described in 743 section 5.3.3 of [RFC6346] a MAP node receiving an IPv4 fragmented 744 packet from outside has to reassemble the packet before sending the 745 packet onto the MAP link. If the first packet received contains the 746 transport protocol information, it is possible to optimize this 747 behavior by using a cache and forwarding the fragments unchanged. A 748 description of this algorithm is outside the scope of this document. 750 10.3. Sending IPv4 fragments to the outside 752 If two IPv4 host behind two different MAP CE's with the same IPv4 753 address sends fragments to an IPv4 destination host outside the 754 domain. Those hosts may use the same IPv4 fragmentation identifier, 755 resulting in incorrect reassembly of the fragments at the destination 756 host. Given that the IPv4 fragmentation identifier is a 16 bit 757 field, it could be used similarly to port ranges. A MAP CE SHOULD 758 rewrite the IPv4 fragmentation identifier to be within its allocated 759 port set. 761 11. NAT44 Considerations 763 The NAT44 implemented in the MAP CE SHOULD conform with the behavior 764 and best current practice documented in [RFC4787], [RFC5508], and 765 [RFC5382]. In MAP address sharing mode (determined by the MAP domain 766 /rule configuration parameters) the operation of the NAT44 MUST be 767 restricted to the available port numbers derived via the basic 768 mapping rule. 770 12. IANA Considerations 772 This specification does not require any IANA actions. 774 13. Security Considerations 776 Spoofing attacks: With consistency checks between IPv4 and IPv6 777 sources that are performed on IPv4/IPv6 packets received by MAP 778 nodes, MAP does not introduce any new opportunity for spoofing 779 attacks that would not already exist in IPv6. 781 Denial-of-service attacks: In MAP domains where IPv4 addresses are 782 shared, the fact that IPv4 datagram reassembly may be necessary 783 introduces an opportunity for DOS attacks. This is inherent to 784 address sharing, and is common with other address sharing 785 approaches such as DS-Lite and NAT64/DNS64. The best protection 786 against such attacks is to accelerate IPv6 deployment, so that, 787 where MAP is supported, it is less and less used. 789 Routing-loop attacks: This attack may exist in some automatic 790 tunneling scenarios are documented in [RFC6324]. They cannot 791 exist with MAP because each BRs checks that the IPv6 source 792 address of a received IPv6 packet is a CE address based on 793 Forwarding Mapping Rule. 795 Attacks facilitated by restricted port set: From hosts that 796 are not subject to ingress filtering of [RFC2827], some attacks 797 are possible by an attacker injecting spoofed packets during 798 ongoing transport connections ([RFC4953], [RFC5961], [RFC6056]. 799 The attacks depend on guessing which ports are currently used by 800 target hosts, and using an unrestricted port set is preferable, 801 i.e. Using native IPv6 connections that are not subject to MAP 802 port range restrictions. To minimize this type of attacks when 803 using a restricted port set, the MAP CE's NAT44 filtering behavior 804 SHOULD be "Address-Dependent Filtering". Furthermore, the MAP CEs 805 SHOULD use a DNS transport proxy function to handle DNS traffic, 806 and source such traffic from IPv6 interfaces not assigned to MAP. 807 Practicalities of these methods are discussed in Section 5.9 of 808 [I-D.dec-stateless-4v6]. 810 [RFC6269] outlines general issues with IPv4 address sharing. 812 14. Contributors 814 This document is the result of the IETF Softwire MAP design team 815 effort and numerous previous individual contributions in this area: 817 Chongfeng Xie (China Telecom) 818 Room 708, No.118, Xizhimennei Street Beijing 100035 CN 819 Phone: +86-10-58552116 820 Email: xiechf@ctbri.com.cn 822 Qiong Sun (China Telecom) 823 Room 708, No.118, Xizhimennei Street Beijing 100035 CN 824 Phone: +86-10-58552936 825 Email: sunqiong@ctbri.com.cn 827 Gang Chen (China Mobile) 828 53A,Xibianmennei Ave. Beijing 100053 P.R.China 829 Email: chengang@chinamobile.com 831 Yu Zhai 832 CERNET Center/Tsinghua University 833 Room 225, Main Building, Tsinghua University 834 Beijing 100084 835 CN 836 Email: jacky.zhai@gmail.com 838 Wentao Shang (CERNET Center/Tsinghua University) 839 Room 225, Main Building, Tsinghua University Beijing 100084 840 CN 841 Email: wentaoshang@gmail.com 842 Guoliang Han (CERNET Center/Tsinghua University) 843 Room 225, Main Building, Tsinghua University Beijing 100084 844 CN 845 Email: bupthgl@gmail.com 847 Rajiv Asati (Cisco Systems) 848 7025-6 Kit Creek Road Research Triangle Park NC 27709 USA 849 Email: rajiva@cisco.com 851 15. Acknowledgements 853 This document is based on the ideas of many, including Masakazu 854 Asama, Mohamed Boucadair, Gang Chen, Maoke Chen, Wojciech Dec, 855 Xiaohong Deng, Jouni Korhonen, Tomasz Mrugalski, Jacni Qin, Chunfa 856 Sun, Qiong Sun, and Leaf Yeh. The authors want in particular to 857 recognize Remi Despres, who has tirelessly worked on generalized 858 mechanisms for stateless address mapping. 860 The authors would like to thank Guillaume Gottard, Dan Wing, Jan 861 Zorz, Necj Scoberne, Tina Tsou for their thorough review and 862 comments. 864 16. References 866 16.1. Normative References 868 [I-D.ietf-softwire-map-dhcp] 869 Mrugalski, T., Troan, O., Bao, C., Dec, W., and L. Yeh, 870 "DHCPv6 Options for Mapping of Address and Port", draft- 871 ietf-softwire-map-dhcp-01 (work in progress), August 2012. 873 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 874 Requirement Levels", BCP 14, RFC 2119, March 1997. 876 [RFC2473] Conta, A. and S. Deering, "Generic Packet Tunneling in 877 IPv6 Specification", RFC 2473, December 1998. 879 16.2. Informative References 881 [I-D.dec-stateless-4v6] 882 Dec, W., Asati, R., and H. Deng, "Stateless 4Via6 Address 883 Sharing", draft-dec-stateless-4v6-04 (work in progress), 884 October 2011. 886 [I-D.ietf-softwire-stateless-4v6-motivation] 887 Boucadair, M., Matsushima, S., Lee, Y., Bonness, O., 888 Borges, I., and G. Chen, "Motivations for Carrier-side 889 Stateless IPv4 over IPv6 Migration Solutions", draft-ietf- 890 softwire-stateless-4v6-motivation-05 (work in progress), 891 November 2012. 893 [I-D.ietf-tsvwg-iana-ports] 894 Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. 895 Cheshire, "Internet Assigned Numbers Authority (IANA) 896 Procedures for the Management of the Service Name and 897 Transport Protocol Port Number Registry", draft-ietf- 898 tsvwg-iana-ports-10 (work in progress), February 2011. 900 [RFC0897] Postel, J., "Domain name system implementation schedule", 901 RFC 897, February 1984. 903 [RFC1933] Gilligan, R. and E. Nordmark, "Transition Mechanisms for 904 IPv6 Hosts and Routers", RFC 1933, April 1996. 906 [RFC2529] Carpenter, B. and C. Jung, "Transmission of IPv6 over IPv4 907 Domains without Explicit Tunnels", RFC 2529, March 1999. 909 [RFC2663] Srisuresh, P. and M. Holdrege, "IP Network Address 910 Translator (NAT) Terminology and Considerations", RFC 911 2663, August 1999. 913 [RFC2827] Ferguson, P. and D. Senie, "Network Ingress Filtering: 914 Defeating Denial of Service Attacks which employ IP Source 915 Address Spoofing", BCP 38, RFC 2827, May 2000. 917 [RFC3056] Carpenter, B. and K. Moore, "Connection of IPv6 Domains 918 via IPv4 Clouds", RFC 3056, February 2001. 920 [RFC3633] Troan, O. and R. Droms, "IPv6 Prefix Options for Dynamic 921 Host Configuration Protocol (DHCP) version 6", RFC 3633, 922 December 2003. 924 [RFC4459] Savola, P., "MTU and Fragmentation Issues with In-the- 925 Network Tunneling", RFC 4459, April 2006. 927 [RFC4632] Fuller, V. and T. Li, "Classless Inter-domain Routing 928 (CIDR): The Internet Address Assignment and Aggregation 929 Plan", BCP 122, RFC 4632, August 2006. 931 [RFC4787] Audet, F. and C. Jennings, "Network Address Translation 932 (NAT) Behavioral Requirements for Unicast UDP", BCP 127, 933 RFC 4787, January 2007. 935 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 936 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 937 September 2007. 939 [RFC4953] Touch, J., "Defending TCP Against Spoofing Attacks", RFC 940 4953, July 2007. 942 [RFC5214] Templin, F., Gleeson, T., and D. Thaler, "Intra-Site 943 Automatic Tunnel Addressing Protocol (ISATAP)", RFC 5214, 944 March 2008. 946 [RFC5382] Guha, S., Biswas, K., Ford, B., Sivakumar, S., and P. 947 Srisuresh, "NAT Behavioral Requirements for TCP", BCP 142, 948 RFC 5382, October 2008. 950 [RFC5508] Srisuresh, P., Ford, B., Sivakumar, S., and S. Guha, "NAT 951 Behavioral Requirements for ICMP", BCP 148, RFC 5508, 952 April 2009. 954 [RFC5961] Ramaiah, A., Stewart, R., and M. Dalal, "Improving TCP's 955 Robustness to Blind In-Window Attacks", RFC 5961, August 956 2010. 958 [RFC5969] Townsley, W. and O. Troan, "IPv6 Rapid Deployment on IPv4 959 Infrastructures (6rd) -- Protocol Specification", RFC 960 5969, August 2010. 962 [RFC6052] Bao, C., Huitema, C., Bagnulo, M., Boucadair, M., and X. 963 Li, "IPv6 Addressing of IPv4/IPv6 Translators", RFC 6052, 964 October 2010. 966 [RFC6056] Larsen, M. and F. Gont, "Recommendations for Transport- 967 Protocol Port Randomization", BCP 156, RFC 6056, January 968 2011. 970 [RFC6250] Thaler, D., "Evolution of the IP Model", RFC 6250, May 971 2011. 973 [RFC6269] Ford, M., Boucadair, M., Durand, A., Levis, P., and P. 974 Roberts, "Issues with IP Address Sharing", RFC 6269, June 975 2011. 977 [RFC6324] Nakibly, G. and F. Templin, "Routing Loop Attack Using 978 IPv6 Automatic Tunnels: Problem Statement and Proposed 979 Mitigations", RFC 6324, August 2011. 981 [RFC6333] Durand, A., Droms, R., Woodyatt, J., and Y. Lee, "Dual- 982 Stack Lite Broadband Deployments Following IPv4 983 Exhaustion", RFC 6333, August 2011. 985 [RFC6346] Bush, R., "The Address plus Port (A+P) Approach to the 986 IPv4 Address Shortage", RFC 6346, August 2011. 988 Appendix A. Examples 990 Example 1 - BMR 991 Given the MAP domain information and an IPv6 address of 992 an endpoint: 994 IPv6 prefix assigned to the end user: 2001:db8:0012:3400::/56 995 Basic Mapping Rule: {2001:db8:0000::/40 (Rule IPv6 prefix), 996 192.0.2.0/24 (Rule IPv4 prefix), 16 (Rule EA-bits length)} 997 PSID length: (16 - (32 - 24) = 8. (Sharing ratio of 256) 998 PSID offset: 4 1000 A MAP node (CE or BR) can via the BMR, or equivalent FMR, 1001 determine the IPv4 address and port-set as shown below: 1003 EA bits offset: 40 1004 IPv4 suffix bits (p) Length of IPv4 address (32) - IPv4 prefix 1005 length (24) = 8 1006 IPv4 address 192.0.2.18 (0xc0000212) 1007 PSID start: 40 + p = 40 + 8 = 48 1008 PSID length: o - p = (56 - 40) - 8 = 8 1009 PSID: 0x34 1011 Port-set-1: 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 1012 4937, 4938, 4939, 4940, 4941, 4942, 4943 1013 Port-set-2: 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 1014 9033, 9034, 9035, 9036, 9037, 9038, 9039 1015 ... ... 1016 Port-set-15 62272, 62273, 62274, 62275, 62276, 62277, 62278, 1017 62279, 62280, 62281, 62282, 62283, 62284, 62285, 62286, 62287 1019 The BMR information allows a MAP CE also to determine (complete) 1020 its IPv6 address within the indicated IPv6 prefix. 1022 IPv6 address of MAP CE: 2001:db8:0012:3400:00c0:0002:1200:3400 1024 Example 2: 1026 Another example can be made of a hypothetical MAP BR, 1027 configured with the following FMR when receiving a packet 1028 with the following characteristics: 1030 IPv4 source address: 1.2.3.4 (0x01020304) 1031 IPv4 source port: 80 1032 IPv4 destination address: 192.0.2.18 (0xc0000212) 1033 IPv4 destination port: 9030 1035 Configured Forwarding Mapping Rule: {2001:db8:0000::/40 1036 (Rule IPv6 prefix), 192.0.2.0/24 (Rule IPv4 prefix), 1037 16 (Rule EA-bits length)} 1039 MAP BR Prefix 2001:db8:ffff::/64 1041 The above information allows the BR to derive as follows 1042 the mapped destination IPv6 address for the corresponding 1043 MAP CE, and also the mapped source IPv6 address for 1044 the IPv4 source. 1046 IPv4 suffix bits (p) 32 - 24 = 8 (18 (0x12)) 1047 PSID length: 8 1048 PSID: 0x34 (9030 (0x2346)) 1050 The resulting IPv6 packet will have the following key fields: 1052 IPv6 source address 2001:db8:ffff:0:0001:0203:0400:: 1053 IPv6 destination address: 2001:db8:0012:3400:00c0:0002:1200:3400 1054 IPv6 source Port: 80 1055 IPv6 destination Port: 9030 1057 Example 3 - FMR: 1059 An IPv4 host behind the MAP CE (addressed as per the previous 1060 examples) corresponding with IPv4 host 1.2.3.4 will have its 1061 packets converted into IPv6 using the IPv6 address of the BR 1062 configured on the MAP CE as follows: 1064 IPv6 address of BR used by MAP CE: 2001:db8:ffff::1 1065 IPv4 source address (post NAT44 if present) 192.0.2.18 1066 IPv4 destination address: 1.2.3.4 1067 IPv4 source port (post NAT44 if present): 9030 1068 IPv4 destination port: 80 1069 IPv6 source address of MAP CE: 1070 2001:db8:0012:3400:00c0:0002:1200:3400 1071 IPv6 destination address: 2001:db8:ffff:0:0001:0203:0400:: 1073 Example 4 - 1:1 Rule with no address sharing 1074 IPv6 prefix assigned to the end user: 2001:db8:0012:3400::/56 1075 Basic Mapping Rule: {2001:db8:0012:3400::/56 (Rule IPv6 prefix), 1076 192.0.2.1/32 (Rule IPv4 prefix), 0 (Rule EA-bits length)} 1077 PSID length: 0 (Sharing ratio is 1) 1078 PSID offset: n/a 1080 A MAP node (CE or BR) can via the BMR or equivalent FMR, determine 1081 the IPv4 address and port-set as shown below: 1083 EA bits offset: 0 1084 IPv4 suffix bits (p) Length of IPv4 address (32) - IPv4 prefix 1085 length (32) = 0 1086 IPv4 address 192.0.2.1 (0xc0000201) 1087 PSID start: 0 1088 PSID length: 0 1089 PSID: null 1091 The BMR information allows a MAP CE also to determine (complete) 1092 its full IPv6 address by combining the IPv6 prefix with the MAP 1093 interface identifier (that embeds the IPv4 address). 1095 IPv6 address of MAP CE: 2001:db8:0012:3400:00c0:0002:0100:0000 1097 Example 5 - 1:1 Rule with address sharing (sharing ratio 256) 1098 IPv6 prefix assigned to the end user: 2001:db8:0012:3400::/56 1099 Basic Mapping Rule: {2001:db8:0012:3400::/56 (Rule IPv6 prefix), 1100 192.0.2.1/32 (Rule IPv4 prefix), 0 (Rule EA-bits length)} 1101 PSID length: (16 - (32 - 24) = 8. (Sharing ratio of 256) 1102 PSID offset: 4 1104 A MAP node (CE or BR) can via the BMR or equivalent FMR determine 1105 the IPv4 address and port-set as shown below: 1107 EA bits offset: 0 1108 IPv4 suffix bits (p) Length of IPv4 address (32) - IPv4 prefix 1109 length (32) = 0 1110 IPv4 address 192.0.2.1 (0xc0000201) 1111 PSID start: 0 1112 PSID length: 8 1113 PSID: 0x34 1115 Port-set-1: 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 1116 4937, 4938, 4939, 4940, 4941, 4942, 4943 1117 Port-set-2: 9024, 9025, 9026, 9027, 9028, 9029, 9030, 9031, 9032, 1118 9033, 9034, 9035, 9036, 9037, 9038, 9039 1119 ... ... 1120 Port-set-15 62272, 62273, 62274, 62275, 62276, 62277, 62278, 1121 62279, 62280, 62281, 62282, 62283, 62284, 62285, 62286, 62287 1123 The BMR information allows a MAP CE also to determine (complete) 1124 its full IPv6 address by combining the IPv6 prefix with the MAP 1125 interface identifier (that embeds the IPv4 address and PSID). 1127 IPv6 address of MAP CE: 2001:db8:0012:3400:00c0:0002:1200:3400 1129 Note that the IPv4 address and PSID is not derived from the IPv6 1130 prefix assigned to the CE. 1132 Appendix B. Alternate description of the Port mapping algorithm 1134 The port mapping algorithm is used in domains whose rules allow IPv4 1135 address sharing. Different Port-Set Identifiers (PSID) MUST have 1136 non-overlapping port-sets. The two extreme cases are: (1) the port 1137 numbers are not contiguous for each PSID, but uniformly distributed 1138 across the port range (0-65535); (2) the port numbers are contiguous 1139 in a single range for each PSID. The port mapping algorithm proposed 1140 here is called the Generalized Modulus Algorithm (GMA) and supports 1141 both these cases. 1143 For a given sharing ratio (R) and the maximum number of contiguous 1144 ports (M), the GMA algorithm is defined as: 1146 1. The port number (P) of a given PSID (K) is composed of: 1148 P = R * M * j + M * K + i 1149 Where: 1151 * PSID: K = 0 to R - 1 1153 * Port range index: j = (4096 / M) / R to ((65536 / M) / R) - 1, if 1154 the port numbers (0 - 4095) are excluded. 1156 * Contiguous Port index: i = 0 to M - 1 1158 2. The PSID (K) of a given port number (P) is determined by: 1160 K = (floor(P/M)) % R 1162 Where: 1164 * % is the modulus operator 1166 * floor(arg) is a function that returns the largest integer not 1167 greater than arg. 1169 B.1. Bit Representation of the Algorithm 1171 Given a sharing ratio (R=2^k), the maximum number of contiguous ports 1172 (M=2^m), for any PSID (K) and available ports (P) can be represented 1173 as: 1175 0 8 15 1176 +---------------+----------+------+-------------------+ 1177 | P | 1178 ----------------+-----------------+-------------------+ 1179 | A (j) | PSID (K) | M (i) | 1180 +---------------+----------+------+-------------------+ 1181 |<----a bits--->|<-----k bits---->|<------m bits----->| 1183 Figure 9: Bit representation 1185 Where j and i are the same indexes defined in the port mapping 1186 algorithm. 1188 For any port number, the PSID can be obtained by bit mask operation. 1190 For a > 0, j MUST be larger than 0. This ensures that the algorithm 1191 excludes the system ports ([I-D.ietf-tsvwg-iana-ports]). For a = 0, 1192 j MAY be 0 to allow for the provisioning of the system ports. 1194 B.2. GMA examples 1196 For example, for R = 1024, PSID offset: a = 4 and PSID length: k = 10 1197 bits 1198 Port-set-1 Port-set-2 1199 PSID=0 | 4096, 4097, 4098, 4099, | 8192, 8193, 8194, 8195, | ... 1200 PSID=1 | 4100, 4101, 4102, 4103, | 8196, 8197, 8198, 8199, | ... 1201 PSID=2 | 4104, 4105, 4106, 4107, | 8200, 8201, 8202, 8203, | ... 1202 PSID=3 | 4108, 4109, 4110, 4111, | 8204, 8205, 8206, 8207, | ... 1203 ... 1204 PSID=1023| 8188, 8189, 8190, 8191, | 12284, 12285, 12286, 12287,| ... 1206 For example, for R = 64, a = 0 (PSID offset = 0 and PSID length = 6 1207 bits): 1209 Port-set 1210 PSID=0 | [ 0 - 1023] 1211 PSID=1 | [1024 - 2047] 1212 PSID=2 | [2048 - 3071] 1213 PSID=3 | [3072 - 4095] 1214 ... 1215 PSID=63 | [64512 - 65535] 1217 B.3. Port Offset 1219 The number of offset bits (excluded ports) are optionally provisioned 1220 via the "Rule Port Mapping Parameters" in the Basic Mapping Rule. 1222 The default Offset bits (a) are: 4 1224 To simplify the GMA port mapping algorithm the defaults are chosen so 1225 that the PSID field starts on a nibble boundary and the excluded port 1226 range (0-1023) is extended to 0-4095. 1228 For (a) offset bits, the range of excluded ports is 0 to 2 ^ (16-a) - 1229 1. 1231 Authors' Addresses 1233 Ole Troan 1234 Cisco Systems 1235 Philip Pedersens vei 1 1236 Lysaker 1366 1237 Norway 1239 Email: ot@cisco.com 1241 Wojciech Dec 1242 Cisco Systems 1243 Haarlerbergpark Haarlerbergweg 13-19 1244 Amsterdam, NOORD-HOLLAND 1101 CH 1245 Netherlands 1247 Email: wdec@cisco.com 1248 Xing Li 1249 CERNET Center/Tsinghua University 1250 Room 225, Main Building, Tsinghua University 1251 Beijing 100084 1252 CN 1254 Email: xing@cernet.edu.cn 1256 Congxiao Bao 1257 CERNET Center/Tsinghua University 1258 Room 225, Main Building, Tsinghua University 1259 Beijing 100084 1260 CN 1262 Email: congxiao@cernet.edu.cn 1264 Satoru Matsushima 1265 SoftBank Telecom 1266 1-9-1 Higashi-Shinbashi, Munato-ku 1267 Tokyo 1268 Japan 1270 Email: satoru.matsushima@g.softbank.co.jp 1272 Tetsuya Murakami 1273 IP Infusion 1274 1188 East Arques Avenue 1275 Sunnyvale 1276 USA 1278 Email: tetsuya@ipinfusion.com