MAP-T/MAP-E Mapping Rules

Port Mapping

Concept of A+P

From the perspective of IPv4 addresses and transport layer ports, the number of 32-bit IPv4 addresses is limited, and a few 16-bit transport layer ports (transport port) are used. Therefore, the IPv4 addresses can be extended by using the transport layer ports.

MAP mapping also uses the A+P concept that maps a pair of a public IPv4 address and a port number to an IPv4 private address. In MAP, 16 bits of a transport layer port number are divided into three parts: A, port-set ID, and M.
Figure 1 Concept of A+P

About A and a

Ports 0 through 1023 are well-known port numbers. It is recommended that the ports be extended to ports 0 through 4095 (2^12 ports in total) in MAP. Namely, the default value of a is recommended to be 4 (16 bits-12 bits). a is generally set to a non-zero value. If a is set to 0, ports in all port ranges can be allocated.

About port-set ID and k

Size k of a port-set ID (PSID) determines a sharing ratio, and the sharing ratio R is 2^k. That is, the transport layer ports can be divided into 2^k sets, and each set is shared by a CPE. Each of the CPEs that share the IPv4 address obtains a unique PSID that identifies a unique port set.

About m

Size m of the M field determines a contiguous block of ports in a port set. The continuous length is 2^m.

Consequently, a total of 2^k port sets are obtained. Each port set is identified by a unique PSID. A port set identified by each PSID contains a number of [(2^a) - 1] x (2^m) ports.

The following is an example of a MAP mapping rule.

m = 2 can be calculated based on the sharing ratios of R = 1024 and a = 4. Table 1 shows mappings between PSIDs and port sets.

Each port-set group is inconsecutive, and therefore is displayed by segment in the table. If the PSID is 0, when A is 0001 (port-set-1 in the table, indicating the first continuous segment), the corresponding ports are 0001000000000000 (4096), 0001000000000001 (4097), 0001000000000010 (4098) and 0001000000000011 (4099); when A is 0010 (port-set-2 in the table, indicating the second continuous segment), the corresponding ports are 0010000000000000 (8192), 0010000000000001 (8193), 0010000000000010 (8194) and 0010000000000011 (8195). With the rest applying the same rule, the mappings between PSIDs and port-sets are obtained.

Table 1 An example of a MAP mapping rule

PSID

Port-set-1(A=0001)

Port-set-2(A=0010)

...

Port-set-15(A=1111)

0

4096,4097,4098,4099

8192,8193,8194,8195

...

61440,61441,61442,61443

1

4100,4101,4102,4103

8196,8197,8198,8199

...

61444,61445,61446,61447

2

4104,4105,4106,4107

8200,8201,8202,8203

...

61448,61449,61450,61451

3

4108,4109,4110,4111

8204,8205,8206,8207

...

61452,61453,61454,61455

...

...

...

...

...

1023

8188,8189,8190,8191

12284,12285,12286,12287

...

65532,65533,65534,65535

Address Mapping

The mapping between IPv4 and IPv6 addresses is implemented by embedding a part of IPv4 addresses and some attributes of ports into IPv6 addresses. The attribute part of IPv4 addresses is IPv4-Addr-suffix, and that of a port set is a port-set ID. The IPv4 address and port information are closely associated with IPv6 addresses to create stateless mapping.
Figure 2 Mapping between IPv4+port information and IPv6 addresses
The mapping between IPv4+port and IPv6 addresses shows that the public IPv4 address and port sequence can be derived based on the attributes, including the End-user IPv6-prefix, Rule-IPv6-prefix, EA-bits, Rule-IPv4, and Port-Set ID offset, regardless of the MAP-CE or MAP-BR.
Figure 3 Interface ID

As shown in Figure 3, the MAP technology combines an IPv4 address and a port-set ID to create an interface ID to identify a MAP-CE. The interface ID is combined with the End-user IPv6-prefix to form an IPv6 address, which uniquely identifies the MAP-CE in a MAP domain.

IPv4address field: If a public IPv4 address is allocated, the IPv4address field is set to the allocated IPv4 address, and the length is 32 bits. If the IPv4address field is allocated to an IPv4 user (possibly an enterprise user), this field needs to be padded with 0s. For example, if an IPv4 prefix of 1.1.1.0/29 is allocated to a user, the IPv4address field must be set to 0x01010100 (hexadecimal).

Port-Set ID field: If the port-set ID extracted from the EA-bits field is less than 16 bits, pad 0 on the left. For example, if the Port-Set ID field value is 0xAC, 0s are padded to generate value 0x00AC. If an IPv4 prefix or an exclusive IPv4 address is assigned, no port set ID is extracted, and the Port-Set ID field value is 0x0000.

To create stateless mapping, close associations have been established between IPv6 addresses and the pairs of IPv4 addresses and ports of the IPv4 address sharing users in the MAP domain. In addition, an IPv6 address can uniquely identify a user in the MAP domain.

Mapping Rule Definition

In MAP technology, there are three MAP rules: basic mapping rule (BMR), forwarding mapping rule (FMR), and default mapping rule (DMR). The DMR is called destinations outside the MAP domain in MAP-E technology.

BMR (mandatory)

A BMR is used to compute an IPv4 address, a port set, and an IPv6 address of a MAP-CE. The BMR must be configured on MAP-CEs and the MAP-BR. MAP-CEs use this rule to perform NAT44 and IPv6 translation and encapsulation for IPv4 user packets. The MAP-BR uses this rule to perform the following operations:
  • Decapsulates or removes tunnel information from IPv6 packets for IPv4 addresses.
  • Performs IPv6 translation and encapsulation based on IPv4 addresses and ports for return traffic and forwards the traffic to MAP-CEs over IPv6 routes in the MAP domain.

The basic BMR parameters include the Rule-IPv6-prefix, Rule-IPv4-prefix, EA-bits-length, and Port-Set ID-offset. These parameters can be used on a MAP-CE to calculate the shared IPv4 address and port sequence and the IPv6 address of the MAP-CE.

In the MAP domain, multiple sub-domains can be divided based on the IPv4 subnet logic. Each IPv4 subnet serves as a sub-domain. Mapping rules on all MAP-CEs in each sub-domain can be summarized to a single rule. Each MAP-CE is assigned a particular End-user IPv6-prefix and the same BMR.

FMR (optional)

An FMR is used to allow MAP-CEs to communicate with one another on a mesh network, without passing through the MAP-BR. When a local MAP-CE accesses another MAP-CE, the destination IPv6 address must be set to the address of the peer MAP-CE. The source IPv6 address in packets is generated based on the BMR, and the IPv6 address of the destination MAP-CE is to be converted based on the FMR. The MAP-CEs use the same BMR (in a certain range). Therefore, the FMR and BMR can be the same. Therefore, a BMR can be configured as an FMR.

For example, a BMR is the same as an FMR a MAP domain. When the IPv4 service of a MAP-CE2 user accesses the IPv4 service of a MAP-CE1 user, MAP-CE2 uses NAT44 and the BMR to generate a source IPv6 address and uses the FMR to generate the IPv6 address of the destination MAP-CE1.
Figure 4 FMR

DMR (optional)

Different from the BMR and FMR that apply to both MAP-E and MAP-T scenarios, DMRs differ between MAP-E and MAP-T scenarios:
  • MAP-T: Based on the DMR, the destination IPv4 address in packets is an address outside a MAP domain, and packets carrying such a destination IP address are forwarded outside the MAP domain through the MAP-BR. The DMR defines the Rule-IPv6-prefix and Rule-IPv4-prefix. The Rule-IPv6-prefix value is set to the IPv6 prefix of the MAP-BR. The Rule-IPv4-prefix value is set to 0.0.0.0/0. A MAP-CE uses the DMR as a default mapping rule for matching IPv4 routes. In the following figure, after the DMR is used, the destination IPv6 address is generated using the Rule-IPv6-prefix configured based on the DMR and destination IPv4 address.
    Figure 5 Destination IPv6 address format
  • MAP-E: The DMR refers to destinations outside the MAP domain. In MAP-E, an IPv6 header has an IPv4 address embedded. Therefore, if the destination IPv4 address in packets is an address outside a MAP domain, the MAP-BR's IPv6 address merely needs to be encapsulated. When the packet reaches the MAP-BR, the MAP-BR removes the IPv6 header to restore the destination IPv4 address. In MAP-E, using the DMR is to configure the MAP-BR's IPv6 address.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >