Internet Engineering Task Force (IETF) O. Troan, Ed. Request for Comments: 7597 W. Dec Category: Standards Track Cisco Systems ISSN: 2070-1721 X. Li C. Bao Tsinghua University S. Matsushima SoftBank Telecom T. Murakami IP Infusion T. Taylor, Ed. Huawei Technologies July 2015 Mapping of Address and Port with Encapsulation (MAP-E)
AbstractThis document describes a mechanism for transporting IPv4 packets across an IPv6 network using IP encapsulation. It also describes a generic mechanism for mapping between IPv6 addresses and IPv4 addresses as well as transport-layer ports. Status of This Memo This is an Internet Standards Track document. This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741. Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7597.
Copyright Notice Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Table of Contents1. Introduction ....................................................4 2. Conventions .....................................................5 3. Terminology .....................................................5 4. Architecture ....................................................7 5. Mapping Algorithm ...............................................8 5.1. Port-Mapping Algorithm ....................................10 5.2. Basic Mapping Rule (BMR) ..................................11 5.3. Forwarding Mapping Rule (FMR) .............................14 5.4. Destinations outside the MAP Domain .......................14 6. The IPv6 Interface Identifier ..................................15 7. MAP Configuration ..............................................15 7.1. MAP CE ....................................................15 7.2. MAP BR ....................................................16 8. Forwarding Considerations ......................................17 8.1. Receiving Rules ...........................................17 8.2. ICMP ......................................................18 8.3. Fragmentation and Path MTU Discovery ......................18 8.3.1. Fragmentation in the MAP Domain ....................18 8.3.2. Receiving IPv4 Fragments on the MAP Domain Borders ............................................19 8.3.3. Sending IPv4 Fragments to the Outside ..............19 9. NAT44 Considerations ...........................................19 10. Security Considerations .......................................20 11. References ....................................................21 11.1. Normative References .....................................21 11.2. Informative References ...................................21 Appendix A. Examples ..............................................25 Appendix B. A More Detailed Description of the Derivation of the Port-Mapping Algorithm ................................29 B.1. Bit Representation of the Algorithm ........................31 B.2. GMA Examples ...............................................32 Acknowledgements ..................................................32 Contributors ......................................................33 Authors' Addresses ................................................34
1. IntroductionMapping of IPv4 addresses in IPv6 addresses has been described in numerous mechanisms dating back to the mid-1990s [RFC1933] [RFC4213]. The "automatic tunneling" mechanism as first described in [RFC1933] assigned a globally unique IPv6 address to a host by combining the host's IPv4 address with a well-known IPv6 prefix. Given an IPv6 packet with a destination address with an embedded IPv4 address, a node could automatically tunnel this packet by extracting the IPv4 tunnel endpoint address from the IPv6 destination address. There are numerous variations of this idea, as described in 6over4 [RFC2529], 6to4 [RFC3056], the Intra-Site Automatic Tunnel Addressing Protocol (ISATAP) [RFC5214], and IPv6 Rapid Deployment on IPv4 Infrastructures (6rd) [RFC5969]. The commonalities of all of these IPv6-over-IPv4 mechanisms are as follows: o Automatic provisioning of an IPv6 address for a host or an IPv6 prefix for a site. o Algorithmic or implicit address resolution of tunnel endpoint addresses. Given an IPv6 destination address, an IPv4 tunnel endpoint address can be calculated. o Embedding of an IPv4 address or part thereof into an IPv6 address. In later phases of IPv4-to-IPv6 migration, it is expected that IPv6-only networks will be common, while there will still be a need for residual IPv4 deployment. This document describes a generic mapping of IPv4 to IPv6 and a mechanism for encapsulating IPv4 over IPv6. Just as for the IPv6-over-IPv4 mechanisms referred to above, the residual IPv4-over-IPv6 mechanism must be capable of: o Provisioning an IPv4 prefix, an IPv4 address, or a shared IPv4 address. o Algorithmically mapping between an IPv4 prefix, an IPv4 address, or a shared IPv4 address and an IPv6 address. The mapping scheme described here supports encapsulation of IPv4 packets in IPv6 in both mesh and hub-and-spoke topologies, including address mappings with full independence between IPv6 and IPv4 addresses.
This document describes the delivery of IPv4 unicast service across an IPv6 infrastructure. IPv4 multicast is not considered in this document. The Address plus Port (A+P) architecture of sharing an IPv4 address by distributing the port space is described in [RFC6346]. Specifically, Section 4 of [RFC6346] covers stateless mapping. The corresponding stateful solution, Dual-Stack Lite (DS-Lite), is described in [RFC6333]. The motivations for this work are described in [Solutions-4v6]. [RFC7598] defines DHCPv6 options for the provisioning of MAP. Other means of provisioning are possible. Deployment considerations are described in [MAP-Deploy]. MAP relies on IPv6 and is designed to deliver dual-stack service while allowing IPv4 to be phased out within the service provider's (SP's) network. The phasing out of IPv4 within the SP network is independent of whether the end user disables IPv4 service or not. Further, "greenfield" IPv6-only networks may use MAP in order to deliver IPv4 to sites via the IPv6 network.
2. ConventionsThe key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
3. TerminologyMAP domain: One or more MAP Customer Edge (CE) devices and Border Relays (BRs) connected to the same virtual link. A service provider may deploy a single MAP domain or may utilize multiple MAP domains. MAP Rule: A set of parameters describing the mapping between an IPv4 prefix, IPv4 address, or shared IPv4 address and an IPv6 prefix or address. Each domain uses a different mapping rule set. MAP node: A device that implements MAP.
MAP Border Relay (BR): A MAP-enabled router managed by the service provider at the edge of a MAP domain. A BR has at least an IPv6-enabled interface and an IPv4 interface connected to the native IPv4 network. A MAP BR may also be referred to as simply a "BR" within the context of MAP. MAP Customer Edge (CE): A device functioning as a Customer Edge router in a MAP deployment. A typical MAP CE adopting MAP Rules will serve a residential site with one WAN-side interface and one or more LAN-side interfaces. A MAP CE may also be referred to as simply a "CE" within the context of MAP. Port set: Each node has a separate part of the transport-layer port space; this is denoted as a port set. Port Set ID (PSID): Algorithmically identifies a set of ports exclusively assigned to a CE. Shared IPv4 address: An IPv4 address that is shared among multiple CEs. Only ports that belong to the assigned port set can be used for communication. Also known as a port-restricted IPv4 address. End-user IPv6 prefix: The IPv6 prefix assigned to an End-user CE by means other than MAP itself, e.g., provisioned using DHCPv6 Prefix Delegation (PD) [RFC3633], assigned via Stateless Address Autoconfiguration (SLAAC) [RFC4862], or configured manually. It is unique for each CE. MAP IPv6 address: The IPv6 address used to reach the MAP function of a CE from other CEs and from BRs. Rule IPv6 prefix: An IPv6 prefix assigned by a service provider for a mapping rule. Rule IPv4 prefix: An IPv4 prefix assigned by a service provider for a mapping rule.
Embedded Address (EA) bits: The IPv4 EA-bits in the IPv6 address identify an IPv4 prefix/address (or part thereof) or a shared IPv4 address (or part thereof) and a Port Set Identifier.
4. ArchitectureIn accordance with the requirements stated above, the MAP mechanism can operate with shared IPv4 addresses, full IPv4 addresses, or IPv4 prefixes. Operation with shared IPv4 addresses is described here, and the differences for full IPv4 addresses and prefixes are described below. The MAP mechanism uses existing standard building blocks. The existing Network Address and Port Translator (NAPT) [RFC2663] on the CE is used with additional support for restricting transport-protocol ports, ICMP identifiers, and fragment identifiers to the configured port set. For packets outbound from the private IPv4 network, the CE NAPT MUST translate transport identifiers (e.g., TCP and UDP port numbers) so that they fall within the CE's assigned port range. The NAPT MUST in turn be connected to a MAP-aware forwarding function that does encapsulation/decapsulation of IPv4 packets in IPv6. MAP supports the encapsulation mode specified in [RFC2473]. In addition, MAP specifies an algorithm to do "address resolution" from an IPv4 address and port to an IPv6 address. This algorithmic mapping is specified in Section 5. The MAP architecture described here restricts the use of the shared IPv4 address to only be used as the global address (outside) of the NAPT running on the CE. A shared IPv4 address MUST NOT be used to identify an interface. While it is theoretically possible to make host stacks and applications port-aware, it would be a drastic change to the IP model [RFC6250]. For full IPv4 addresses and IPv4 prefixes, the architecture just described applies, with two differences: first, a full IPv4 address or IPv4 prefix can be used as it is today, e.g., for identifying an interface or as a DHCP pool, respectively. Second, the NAPT is not required to restrict the ports used on outgoing packets.
This architecture is illustrated in Figure 1. User N Private IPv4 | Network | O--+---------------O | | MAP CE | | +-----+--------+ | | NAPT44| MAP | | | +-----+ | |\ ,-------. .------. | +--------+ | \ ,-' `-. ,-' `-. O------------------O / \ O---------O / Public \ / IPv6-only \ | MAP | / IPv4 \ ( Network --+ Border +- Network ) \ (MAP Domain) / | Relay | \ / O------------------O \ / O---------O \ / | MAP CE | /". ,-' `-. ,-' | +-----+--------+ | / `----+--' ------' | NAPT44| MAP | |/ | +-----+ | | | | +--------+ | O---+--------------O | User M Private IPv4 Network Figure 1: Network Topology The MAP BR connects one or more MAP domains to external IPv4 networks.
5. Mapping AlgorithmA MAP node is provisioned with one or more mapping rules. Mapping rules are used differently, depending on their function. Every MAP node must be provisioned with a Basic Mapping Rule. This is used by the node to configure its IPv4 address, IPv4 prefix, or shared IPv4 address. This same basic rule can also be used for forwarding, where an IPv4 destination address and, optionally, a destination port are mapped into an IPv6 address. Additional mapping rules are specified to allow for multiple different IPv4 subnets to exist within the domain and optimize forwarding between them.
Traffic outside of the domain (i.e., when the destination IPv4 address does not match (using longest matching prefix) any Rule IPv4 prefix in the Rules database) is forwarded to the BR. There are two types of mapping rules: 1. Basic Mapping Rule (BMR) - mandatory. A CE can be provisioned with multiple End-user IPv6 prefixes. There can only be one Basic Mapping Rule per End-user IPv6 prefix. However, all CEs having End-user IPv6 prefixes within (aggregated by) the same Rule IPv6 prefix may share the same Basic Mapping Rule. In combination with the End-user IPv6 prefix, the Basic Mapping Rule is used to derive the IPv4 prefix, address, or shared address and the PSID assigned to the CE. 2. Forwarding Mapping Rule (FMR) - optional; used for forwarding. The Basic Mapping Rule may also be a Forwarding Mapping Rule. Each Forwarding Mapping Rule will result in an entry in the rule table for the Rule IPv4 prefix. Given a destination IPv4 address and port within the MAP domain, a MAP node can use the matching FMR to derive the End-user IPv6 address of the interface through which that IPv4 destination address and port combination can be reached. In hub-and-spoke mode, there are no FMRs. Both mapping rules share the same parameters: o Rule IPv6 prefix (including prefix length) o Rule IPv4 prefix (including prefix length) o Rule EA-bit length (in bits) A MAP node finds its BMR by doing a longest match between the End-user IPv6 prefix and the Rule IPv6 prefix in the Mapping Rules table. The rule is then used for IPv4 prefix, address, or shared address assignment. A MAP IPv6 address is formed from the BMR Rule IPv6 prefix. This address MUST be assigned to an interface of the MAP node and is used to terminate all MAP traffic being sent or received to the node. Port-restricted IPv4 routes are installed in the rule table for all the Forwarding Mapping Rules, and a default route is installed to the MAP BR (see Section 5.4).
Forwarding Mapping Rules are used to allow direct communication between MAP CEs; this is known as "Mesh mode". In hub-and-spoke mode, there are no Forwarding Mapping Rules; all traffic MUST be forwarded directly to the BR. While an FMR is optional in the sense that a MAP CE MAY be configured with zero or more FMRs -- depending on the deployment -- all MAP CEs MUST implement support for both rule types.
5.1. Port-Mapping AlgorithmThe port-mapping algorithm is used in domains whose rules allow IPv4 address sharing. The simplest way to represent a port range is using a notation similar to Classless Inter-Domain Routing (CIDR) [RFC4632]. For example, the first 256 ports are represented as port prefix 0.0/8 and the last 256 ports as 255.0/8. In hexadecimal, these would be 0x0000/8 (PSID = 0) and 0xFF00/8 (PSID = 0xFF), respectively. Using this technique but wishing to avoid allocating the system ports [RFC6335] to the user, one would have to exclude the use of one or more PSIDs (e.g., PSIDs 0 to 3 in the example just given). When the PSID is embedded in the End-user IPv6 prefix, it is desirable to minimize the restrictions of possible PSID values in order to minimize dependencies between the End-user IPv6 prefix and the assigned port set. This is achieved by using an infix representation of the port value. Using such a representation, the well-known ports are excluded by restrictions on the value of the high-order bit field (A) rather than the PSID. The infix algorithm allocates ports to a given CE as a series of contiguous ranges spaced at regular intervals throughout the complete range of possible port-set values. 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-----------+-----------+-------+ Ports in | A | PSID | j | the CE port set | > 0 | | | +-----------+-----------+-------+ | a bits | k bits |m bits | Figure 2: Structure of a Port-Restricted Port Field
a bits: The number of offset bits -- 6 by default, as this excludes the system ports (0-1023). To guarantee non-overlapping port sets, the offset 'a' MUST be the same for every MAP CE sharing the same address. A: Selects the range of the port number. For 'a' > 0, A MUST be larger than 0. This ensures that the algorithm excludes the system ports. For the default value of 'a' (6), the system ports are excluded by requiring that A be greater than 0. Smaller values of 'a' exclude a larger initial range, e.g., 'a' = 4 will exclude ports 0-4095. The interval between initial port numbers of successive contiguous ranges assigned to the same user is 2^(16 - a). k bits: The length in bits of the PSID field. To guarantee non-overlapping port sets, the length 'k' MUST be the same for every MAP CE sharing the same address. The sharing ratio is 2^k. The number of ports assigned to the user is 2^(16 - k) - 2^m (excluded ports). PSID: The Port Set Identifier (PSID). Different PSID values guarantee non-overlapping port sets, thanks to the restrictions on 'a' and 'k' stated above, because the PSID always occupies the same bit positions in the port number. m bits: The number of contiguous ports is given by 2^m. j: Selects the specific port within a particular range specified by the concatenation of A and the PSID.
5.2. Basic Mapping Rule (BMR)The Basic Mapping Rule is mandatory and is used by the CE to provision itself with an IPv4 prefix, IPv4 address, or shared IPv4 address. Recall from Section 5 that the BMR consists of the following parameters: o Rule IPv6 prefix (including prefix length) o Rule IPv4 prefix (including prefix length) o Rule EA-bit length (in bits)
Figure 3 shows the structure of the complete MAP IPv6 address as specified in this document. | n bits | o bits | s bits | 128-n-o-s bits | +--------------------+-----------+---------+-----------------------+ | Rule IPv6 prefix | EA bits |subnet ID| interface ID | +--------------------+-----------+---------+-----------------------+ |<--- End-user IPv6 prefix --->| Figure 3: MAP IPv6 Address Format The Rule IPv6 prefix is common among all CEs using the same Basic Mapping Rule within the MAP domain. The EA bit field encodes the CE-specific IPv4 address and port information. The EA bit field, which is unique for a given Rule IPv6 prefix, can contain a full or partial IPv4 address and, in the shared IPv4 address case, a PSID. An EA bit field length of 0 signifies that all relevant MAP IPv4 addressing information is passed directly in the BMR and is not derived from the EA bit field in the End-user IPv6 prefix. The MAP IPv6 address is created by concatenating the End-user IPv6 prefix with the MAP subnet identifier (if the End-user IPv6 prefix is shorter than 64 bits) and the interface identifier as specified in Section 6. The MAP subnet identifier is defined to be the first subnet (s bits set to zero). Define: r = length of the IPv4 prefix given by the BMR; o = length of the EA bit field as given by the BMR; p = length of the IPv4 suffix contained in the EA bit field. The length r MAY be zero, in which case the complete IPv4 address or prefix is encoded in the EA bits. If only a part of the IPv4 address / prefix is encoded in the EA bits, the Rule IPv4 prefix is provisioned to the CE by other means (e.g., a DHCPv6 option). To create a complete IPv4 address (or prefix), the IPv4 address suffix (p) from the EA bits is concatenated with the Rule IPv4 prefix (r bits). The offset of the EA bit field in the IPv6 address is equal to the BMR Rule IPv6 prefix length. The length of the EA bit field (o) is given by the BMR Rule EA-bit length and can be between 0 and 48. A length of 48 means that the complete IPv4 address and port are
embedded in the End-user IPv6 prefix (a single port is assigned). A length of 0 means that no part of the IPv4 address or port is embedded in the address. The sum of the Rule IPv6 Prefix length and the Rule EA-bit length MUST be less than or equal to the End-user IPv6 prefix length. If o + r < 32 (length of the IPv4 address in bits), then an IPv4 prefix is assigned. This case is shown in Figure 4. | r bits | o bits = p bits | +-------------+---------------------+ | Rule IPv4 | IPv4 address suffix | +-------------+---------------------+ | < 32 bits | Figure 4: IPv4 Prefix If o + r is equal to 32, then a full IPv4 address is to be assigned. The address is created by concatenating the Rule IPv4 prefix and the EA-bits. This case is shown in Figure 5. | r bits | o bits = p bits | +-------------+---------------------+ | Rule IPv4 | IPv4 address suffix | +-------------+---------------------+ | 32 bits | Figure 5: Complete IPv4 Address If o + r is > 32, then a shared IPv4 address is to be assigned. The number of IPv4 address suffix bits (p) in the EA bits is given by 32 - r bits. The PSID bits are used to create a port set. The length of the PSID bit field within the EA bits is q = o - p. | r bits | p bits | | q bits | +-------------+---------------------+ +------------+ | Rule IPv4 | IPv4 address suffix | |Port Set ID | +-------------+---------------------+ +------------+ | 32 bits | Figure 6: Shared IPv4 Address The length of r MAY be 32, with no part of the IPv4 address embedded in the EA bits. This results in a mapping with no dependence between the IPv4 address and the IPv6 address. In addition, the length of o MAY be zero (no EA bits embedded in the End-user IPv6 prefix), meaning that the PSID is also provisioned using, for example, DHCP.
See Appendix A for an example of the Basic Mapping Rule.
5.3. Forwarding Mapping Rule (FMR)The Forwarding Mapping Rule is optional and is used in Mesh mode to enable direct CE-to-CE connectivity. On adding an FMR rule, an IPv4 route is installed in the rule table for the Rule IPv4 prefix (Figures 4, 5, and 6). | 32 bits | | 16 bits | +--------------------------+ +-------------------+ | IPv4 destination address | | IPv4 dest port | +--------------------------+ +-------------------+ : : ___/ : | p bits | / q bits : +-----------+ +------------+ |IPv4 suffix| |Port Set ID | +-----------+ +------------+ \ / ____/ ________/ \ : __/ _____/ \ : / / | n bits | o bits | s bits | 128-n-o-s bits | +--------------------+-----------+---------+------------+----------+ | Rule IPv6 prefix | EA bits |subnet ID| interface ID | +--------------------+-----------+---------+-----------------------+ |<--- End-user IPv6 prefix --->| Figure 7: Derivation of MAP IPv6 Address See Appendix A for an example of the Forwarding Mapping Rule.
5.4. Destinations outside the MAP DomainIPv4 traffic between MAP nodes that are all within one MAP domain is encapsulated in IPv6, with the sender's MAP IPv6 address as the IPv6 source address and the receiving MAP node's MAP IPv6 address as the IPv6 destination address. To reach IPv4 destinations outside of the MAP domain, traffic is also encapsulated in IPv6, but the destination IPv6 address is set to the configured IPv6 address of the MAP BR. On the CE, the path to the BR can be represented as a point-to-point IPv4-over-IPv6 tunnel [RFC2473] with the source address of the tunnel being the CE's MAP IPv6 address and the BR IPv6 address as the remote tunnel address. When MAP is enabled, a typical CE router will install a default IPv4 route to the BR.
The BR forwards traffic received from the outside to CEs using the normal MAP forwarding rules.
6. The IPv6 Interface IdentifierThe interface identifier format of a MAP node is described below. | 128-n-o-s bits | | 16 bits| 32 bits | 16 bits| +--------+----------------+--------+ | 0 | IPv4 address | PSID | +--------+----------------+--------+ Figure 8: IPv6 Interface Identifier In the case of an IPv4 prefix, the IPv4 address field is right-padded with zeros up to 32 bits. The PSID field is left-padded with zeros to create a 16-bit field. For an IPv4 prefix or a complete IPv4 address, the PSID field is zero. If the End-user IPv6 prefix length is larger than 64, the most significant parts of the interface identifier are overwritten by the prefix.
7. MAP ConfigurationFor a given MAP domain, the BR and CE MUST be configured with the following MAP elements. The configured values for these elements are identical for all CEs and BRs within a given MAP domain. o The Basic Mapping Rule and, optionally, the Forwarding Mapping Rules, including the Rule IPv6 prefix, Rule IPv4 prefix, and Length of EA bits. o Hub-and-spoke mode or Mesh mode (if all traffic should be sent to the BR, or if direct CE-to-CE traffic should be supported). In addition, the MAP CE MUST be configured with the IPv6 address(es) of the MAP BR (Section 5.4).
7.1. MAP CEThe MAP elements are set to values that are the same across all CEs within a MAP domain. The values may be configured in a variety of ways, including provisioning methods such as the Broadband Forum's "TR-69" Residential Gateway management interface [TR069], an XML-based object retrieved after IPv6 connectivity is established, or manual configuration by an administrator. IPv6 DHCP options for MAP
configuration are defined in [RFC7598]. Other configuration and management methods may use the formats described by these options for consistency and convenience of implementation on CEs that support multiple configuration methods. The only remaining provisioning information the CE requires in order to calculate the MAP IPv4 address and enable IPv4 connectivity is the IPv6 prefix for the CE. The End-user IPv6 prefix is configured as part of obtaining IPv6 Internet access. The MAP provisioning parameters, and hence the IPv4 service itself, are tied to the associated End-user IPv6 prefix lifetime; thus, the MAP service is also tied to this in terms of authorization, accounting, etc. A single MAP CE MAY be connected to more than one MAP domain, just as any router may have more than one IPv4-enabled service-provider- facing interface and more than one set of associated addresses assigned by DHCP. Each domain within which a given CE operates would require its own set of MAP configuration elements and would generate its own IPv4 address. Each MAP domain requires a distinct End-user IPv6 prefix. MAP DHCP options are specified in [RFC7598].
7.2. MAP BRThe MAP BR MUST be configured with corresponding mapping rules for each MAP domain for which it is acting as a BR. For increased reliability and load balancing, the BR IPv6 address MAY be an anycast address shared across a given MAP domain. As MAP is stateless, any BR may be used at any time. If the BR IPv6 address is anycast, the relay MUST use this anycast IPv6 address as the source address in packets relayed to CEs. Since MAP uses provider address space, no specific routes need to be advertised externally for MAP to operate in IPv6 or IPv4 BGP. However, if anycast is used for the MAP IPv6 relays, the anycast addresses must be advertised in the service provider's IGP.