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.
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.
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 |
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.
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)
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.
DMR (optional)