Method, device, equipment, system and readable storage medium for acquiring mapping rule

CN114513485BActive Publication Date: 2026-10-23HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011282640.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-16
Publication Date
2026-10-23
Estimated Expiration
2040-11-16

AI Technical Summary

Technical Problem

[0004]本申请提出一种获取映射规则的方法、装置、设备、系统及可读存储介质,用于解决获取映射规则的效率较低,维护成本较高的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114513485B_ABST
    Figure CN114513485B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of method, device, equipment, system and readable storage medium for obtaining mapping rule, belong to communication technical field.Example is that first communication equipment obtains mapping rule, this method includes: first communication equipment receives the first message sent by second communication equipment, the first communication equipment and the second communication equipment are located in the first type network, first message carries the information of first mapping rule configured on second communication equipment, the first mapping rule is used for address mapping between address in the first type network and address in the second type network, the first type network is different from the second type network;The first communication equipment obtains first mapping rule according to the information of first mapping rule.The first mapping rule of second communication equipment can be learned dynamically by first communication equipment, and the configuration and maintenance workload of mapping rule can be reduced, so that the efficiency of obtaining mapping rule can be improved, and maintenance cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and more particularly to a method, apparatus, device, system, and readable storage medium for obtaining mapping rules. Background Technology

[0002] With the development of communication technology, Internet Protocol version 4 (IPv4) networks are gradually transitioning to Internet Protocol version 6 (IPv6) networks. With IPv6 networks already widely deployed, IPv4 networks are localized networks isolated from IPv6 networks. To ensure the operation of IPv4 services and the continuous development of IPv6 services, the IPv4-to-IPv6 scenario is a key research focus of long-term evolution technology solutions. Mapping between IPv4 and IPv6 addresses has become an effective solution. Stateless mapping with dual translation (MAP-T) and stateless mapping with dual encapsulation (MAP-E) combines statelessness and dual translation / encapsulation, offering significant advantages in technical performance, reliability, and customer deployment costs. Therefore, MAP-T / MAP-E have become highly popular mapping rules.

[0003] When obtaining mapping rules, related technologies require manual deployment of mapping rules between the two communicating parties on the communication device, which takes a long time to configure, resulting in low efficiency in obtaining mapping rules and high maintenance costs. Summary of the Invention

[0004] This application proposes a method, apparatus, device, system, and readable storage medium for obtaining mapping rules, which addresses the problems of low efficiency and high maintenance cost in obtaining mapping rules.

[0005] In a first aspect, a method for obtaining mapping rules is provided, the method comprising: a first communication device receiving a first message sent by a second communication device, the first communication device and the second communication device being located in a first type of network, the first message carrying information of a first mapping rule configured on the second communication device, the first mapping rule being used for address mapping between addresses in the first type of network and addresses in a second type of network, the first type of network being different from the second type of network; the first communication device obtaining the first mapping rule according to the information of the first mapping rule.

[0006] The second communication device sends the information of the first mapping rule configured on its own end to the first communication device. The first communication device obtains the first mapping rule on the remote second communication device through dynamic learning. This first mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network, thereby ensuring that both devices use the same mapping rule for address mapping. This reduces the workload of configuring and maintaining mapping rules, improves the efficiency of obtaining mapping rules, and reduces maintenance costs.

[0007] In one possible implementation, the information of the first mapping rule is the MAP route generated based on the first mapping rule.

[0008] The first communication device obtains the first mapping rule based on the information of the first mapping rule, including: the first communication device generating the first mapping rule based on the MAP route. Then, the second communication device transmits the information of the first mapping rule in the form of a route to the first communication device in a first message. Furthermore, the information of the first mapping rule in the form of a route can be carried in the first message in TLV format.

[0009] In one possible implementation, before the first communication device receives the first message sent by the second communication device, the method further includes: the first communication device establishing a MAP neighbor relationship with the second communication device.

[0010] In one possible implementation, the establishment of a MAP neighbor relationship between the first communication device and the second communication device includes: the first communication device sending a message carrying a first MAP address cluster to the second communication device; and the first communication device receiving a message carrying a second MAP address cluster sent by the second communication device.

[0011] In one possible implementation, the first message also includes attribute information, which includes the mapped address and port, MAP field type, and MAP field identifier.

[0012] In one possible implementation, the attribute information also includes a route identifier and a route target. For example, the route identifier is a VPN route identifier, used to identify different VPNs. The route target is a VPN route target, used to control the publication of VPN routing information.

[0013] In one possible implementation, the information of the first mapping rule and the attribute information are both carried in the field of the Network Layer Reachability Information (NLRI) of the first message.

[0014] In one possible implementation, the information of the first mapping rule is carried in the network layer reachability information field of the first message, and the attribute information is carried in the extended attribute field of the first message. The information of the first mapping rule and the attribute information can be carried in the same field or in different fields, providing greater flexibility.

[0015] In one possible implementation, the information of the first mapping rule includes at least one of the address information corresponding to the basic mapping rule BMR, the address information corresponding to the forwarding mapping rule FMR, and the address information corresponding to the default mapping rule DMR.

[0016] In one possible implementation, the address information corresponding to the BMR includes the Internet Protocol version 6 (IPv6) prefix, IPv6 prefix length, Internet Protocol version 4 (IPv4) prefix, IPv4 prefix length, EA bit length, and PSID offset.

[0017] In one possible implementation, the address information corresponding to the FMR includes the Internet Protocol version 6 (IPv6) prefix, IPv6 prefix length, Internet Protocol version 4 (IPv4) prefix, IPv4 prefix length, EA bit length, and PSID offset.

[0018] In one possible implementation, the address information corresponding to the DMR includes the Internet Protocol version 6 (IPv6) prefix corresponding to the DMR and the length of the IPv6 prefix.

[0019] In one possible implementation, the address information corresponding to the DMR includes the Internet Protocol version 6 (IPv6) address of the border relay (BR) device and the IPv6 address prefix length.

[0020] In one possible implementation, the method further includes: a first communication device sending a second message to a second communication device, the second message carrying information about a second mapping rule configured on the first communication device. The second mapping rule is used for address mapping between addresses in a first type of network and addresses in a second type of network. The information about the second mapping rule is used by the second communication device to obtain the second mapping rule. In addition to learning the first mapping rule configured on the second communication device, the first communication device also enables the second communication device to learn the second mapping rule configured on the first communication device by sending the information about the second mapping rule configured on the first communication device to the second communication device.

[0021] In one possible implementation, the first type of network is an IPv4 network and the second type of network is an IPv6 network, or the first type of network is an Internet Protocol version 6 (IPv6) network and the second type of network is an Internet Protocol version 4 (IPv4) network; the first mapping rule is used for mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for mapping between the second IPv4 address and the second IPv6 address.

[0022] In one possible implementation, the first communication device is a MAP boundary relay (BR) device, and the second communication device is a broadband access server; or, the first communication device is a broadband access device, and the second communication device is a MAP BR device; or, the first communication device is a first service provider edge (PE) device, and the second communication device is a second PE device.

[0023] In one possible implementation, after the first communication device obtains the first mapping rule based on the information of the first mapping rule, the method further includes: the first communication device receiving a third message, wherein the source address of the third message is a first IPv6 address and the destination address of the third message is a second IPv6 address; the first communication device maps the source address of the third message from the first IPv6 address to the first IPv4 address based on the first mapping rule, and maps the destination address of the third message from the second IPv6 address to the second IPv4 address based on the second mapping rule. During message transmission, address mapping enables messages to be transmitted from one IPv4 network to another IPv6 network, thereby ensuring the operation of IPv4 services.

[0024] In one possible implementation, after the first communication device obtains the first mapping rule based on the information of the first mapping rule, the method further includes: the first communication device obtaining a fourth message, wherein the source address of the fourth message is a second IPv4 address and the destination address of the fourth message is a first IPv4 address; the first communication device maps the source address of the fourth message from the second IPv4 address to the second IPv6 address based on the first mapping rule, and maps the destination address of the fourth message from the first IPv4 address to the first IPv6 address based on the second mapping rule, thereby obtaining a fifth message; and the first communication device sending the fifth message.

[0025] In one possible implementation, after the first communication device obtains the first mapping rule based on the information of the first mapping rule, the method further includes: the first communication device storing the first mapping rule as a routing table entry, and the routing table entry being used to transmit packets.

[0026] In one possible implementation, when the first communication device is a broadband access server, after the first communication device obtains the first mapping rule according to the information of the first mapping rule, it further includes: the first communication device sending a sixth message to the third communication device, so that the third communication device performs address mapping between the address in the first type of network and the address in the second type of network according to the first mapping rule; wherein, the sixth message carries the information of the first mapping rule, and the third communication device is a user edge CE device.

[0027] Secondly, a method for obtaining mapping rules is provided, the method comprising: a first communication device obtaining information of a first mapping rule configured on the first communication device, the first mapping rule being used for address mapping between addresses in a first type of network and addresses in a second type of network; the first communication device sending a first message to a second communication device, the first message carrying information of the first mapping rule, the information of the first mapping rule being used by the second communication device to obtain the first mapping rule, the first communication device and the second communication device being located in a first type of network, the first type of network being different from the second type of network.

[0028] The first communication device sends the information of the first mapping rule configured on the first communication device to the second communication device, enabling the second communication device to dynamically learn the first mapping rule on the first communication device without manual configuration. This reduces the workload of configuring and maintaining mapping rules, thereby improving the efficiency of obtaining mapping rules and reducing maintenance costs.

[0029] In one possible implementation, the first communication device obtains information about a first mapping rule configured on the first communication device, including: the first communication device generating a mapping address and port MAP route based on the first mapping rule, and using the MAP route as information of the first mapping rule. Thus, the first communication device transmits the information of the first mapping rule in the form of a route to the second communication device in a first message. Furthermore, this route-formatted information of the first mapping rule can be carried in the first message in TLV format.

[0030] In one possible implementation, the method further includes: a first communication device receiving a second message sent by a second communication device, the second message carrying information about a second mapping rule configured on the second communication device, the second mapping rule being used for address mapping between addresses in a first type of network and addresses in a second type of network; and the first communication device generating a second mapping rule based on the information of the second mapping rule.

[0031] In addition to enabling the second communication device to learn the first mapping rule configured on the first communication device, the second communication device also enables the first communication device to learn the second mapping rule configured on the second communication device by sending information about the second mapping rule configured on the second communication device to the first communication device.

[0032] In one possible implementation, the first type of network is an Internet Protocol version 4 (IPv4) network, and the second type of network is an Internet Protocol version 6 (IPv6) network; or, the first type of network is an IPv6 network and the second type of network is an IPv4 network; a first mapping rule is used for mapping between a first IPv4 address and a first IPv6 address, and a second mapping rule is used for mapping between a second IPv4 address and a second IPv6 address.

[0033] In one possible implementation, the first communication device is a MAP boundary relay (BR) device, and the second communication device is a broadband access server; or, the first communication device is a broadband access server, and the second communication device is a MAP BR device; or, the first communication device is a first service provider edge (PE) device, and the second communication device is a second PE device.

[0034] In one possible implementation, after the first communication device generates the second mapping rule based on the information of the second mapping rule, the method further includes: the first communication device acquiring a seventh message, wherein the source address of the seventh message is a first IPv4 address and the destination address of the seventh message is a second IPv4 address; the first communication device mapping the source address of the seventh message from the first IPv4 address to the first IPv6 address based on the first mapping rule, and mapping the destination address of the seventh message from the second IPv4 address to the second IPv6 address based on the second mapping rule, thereby obtaining a third message; and the first communication device sending the third message.

[0035] In one possible implementation, after the first communication device generates the second mapping rule based on the information of the second mapping rule, the method further includes: the first communication device receiving a fifth message, wherein the source address of the fifth message is a second IPv6 address and the destination address of the fifth message is a first IPv6 address; the first communication device maps the source address of the fifth message from the second IPv6 address to the second IPv4 address based on the second mapping rule, and maps the destination address of the fifth message from the first IPv6 address to the first IPv4 address based on the first mapping rule.

[0036] Thirdly, an apparatus for obtaining mapping rules is provided, the apparatus being applied to a first communication device, comprising:

[0037] A first receiving module is used to receive a first message sent by a second communication device. The first and second communication devices are located in a first type of network. The first message carries information about a first mapping rule configured on the second communication device. The first mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network. The first type of network is different from the second type of network.

[0038] The first acquisition module is used to acquire the first mapping rule based on the information of the first mapping rule.

[0039] In one possible implementation, the information of the first mapping rule is the mapping address and port MAP route generated based on the first mapping rule.

[0040] In one possible implementation, the device further includes:

[0041] Establishment module, used to establish MAP neighbor relationship with the second communication device.

[0042] In one possible implementation, a module is established to send a message carrying a first MAP address cluster to a second communication device and to receive a message carrying a second MAP address cluster sent by the second communication device.

[0043] In one possible implementation, the first message also includes attribute information, which includes the mapped address and port, MAP field type, and MAP field identifier.

[0044] In one possible implementation, the attribute information also includes the route identifier and the route target.

[0045] In one possible implementation, the information of the first mapping rule and the attribute information are both carried in the field of the Network Layer Reachability Information (NLRI) of the first message.

[0046] In one possible implementation, the information of the first mapping rule is carried in the network layer reachability information field of the first message, and the attribute information is carried in the extended attribute field of the first message.

[0047] In one possible implementation, the mapping rule information includes at least one of the following: address information corresponding to the basic mapping rule BMR, address information corresponding to the forwarding mapping rule FMR, and address information corresponding to the default mapping rule DMR.

[0048] In one possible implementation, the address information corresponding to the BMR includes the Internet Protocol version 6 (IPv6) prefix, IPv6 prefix length, Internet Protocol version 4 (IPv4) prefix, IPv4 prefix length, EA bit length, and port set identifier (PSID) offset.

[0049] In one possible implementation, the address information corresponding to the FMR includes the Internet Protocol version 6 (IPv6) prefix, IPv6 prefix length, Internet Protocol version 4 (IPv4) prefix, IPv4 prefix length, EA bit length, and port set identifier (PSID) offset.

[0050] In one possible implementation, the address information corresponding to the DMR includes the Internet Protocol version 6 (IPv6) prefix corresponding to the DMR and the length of the IPv6 prefix.

[0051] In one possible implementation, the address information corresponding to the DMR includes the Internet Protocol version 6 (IPv6) address of the border relay (BR) device and the IPv6 address prefix length.

[0052] In one possible implementation, the device further includes:

[0053] The first sending module is used to send a second message to the second communication device. The second message carries information about a second mapping rule configured on the first communication device. The second mapping rule is used for address mapping between addresses in a first type of network and addresses in a second type of network. The information of the second mapping rule is used by the second communication device to obtain the second mapping rule.

[0054] In one possible implementation, the first type of network is an Internet Protocol version 4 (IPv4) network, and the second type of network is an Internet Protocol version 6 (IPv6) network; or, the first type of network is an Internet Protocol version 6 (IPv6) network, and the second type of network is an Internet Protocol version 4 (IPv4) network.

[0055] The first mapping rule is used for mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for mapping between the second IPv4 address and the second IPv6 address.

[0056] In one possible implementation, the first communication device is a MAP boundary relay (BR) device, and the second communication device is a broadband access server.

[0057] Alternatively, the first communication device is a broadband access server, and the second communication device is a MAP BR device;

[0058] Alternatively, the first communication device is the edge PE device of the first service provider, and the second communication device is the second PE device.

[0059] In one possible implementation, the device further includes:

[0060] The second receiving module is used to receive the third message, the source address of the third message is the first IPv6 address, and the destination address of the third message is the second IPv6 address.

[0061] The first mapping module is used to map the source address of the third packet from the first IPv6 address to the first IPv4 address based on the first mapping rule, and to map the destination address of the third packet from the second IPv6 address to the second IPv4 address based on the second mapping rule.

[0062] In one possible implementation, the device further includes:

[0063] The second acquisition module is used to acquire the fourth packet, the source address of the fourth packet is the second IPv4 address, and the destination address of the fourth packet is the first IPv4 address;

[0064] The second mapping module is used to map the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, and to map the destination address of the fourth packet from the first IPv4 address to the first IPv6 address based on the second mapping rule, so as to obtain the fifth packet;

[0065] The second sending module is used to send the fifth message.

[0066] In one possible implementation, the device further includes:

[0067] The storage module is used to store the first mapping rule as a routing table entry, which is used to transmit packets.

[0068] In one possible implementation, when the first communication device is a broadband access server, the apparatus further includes: a third sending module, configured to send a sixth message to the third communication device, so that the third communication device performs address mapping between addresses in a first type of network and addresses in a second type of network according to the first mapping rule; wherein the sixth message carries information of the first mapping rule, and the third communication device is a user edge CE device.

[0069] Fourthly, an apparatus for obtaining mapping rules is provided, the apparatus comprising:

[0070] The first acquisition module is used to acquire information about the first mapping rule configured on the first communication device. The first mapping rule is used for address mapping between addresses in a first type of network and addresses in a second type of network.

[0071] The first sending module is used to send a first message to the second communication device. The first message carries information about a first mapping rule. The information about the first mapping rule is used by the second communication device to obtain the first mapping rule. The first communication device and the second communication device are located in a first type of network, which is different from the second type of network.

[0072] In one possible implementation, the first acquisition module is used to generate a mapping address and port MAP route based on the first mapping rule, and to use the MAP route as information of the first mapping rule.

[0073] In one possible implementation, the device further includes:

[0074] The first receiving module is used to receive a second message sent by the second communication device. The second message carries information about a second mapping rule configured on the second communication device. The second mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network.

[0075] The second acquisition module is used to acquire the second mapping rule based on the information of the second mapping rule.

[0076] In one possible implementation, the first type of network is an Internet Protocol version 4 (IPv4) network, and the second type of network is an Internet Protocol version 6 (IPv6) network; or, the first type of network is an IPv6 network and the second type of network is an IPv4 network; a first mapping rule is used for mapping between a first IPv4 address and a first IPv6 address, and a second mapping rule is used for mapping between a second IPv4 address and a second IPv6 address.

[0077] In one possible implementation, the first communication device is a MAP boundary relay (BR) device, and the second communication device is a broadband access server.

[0078] Alternatively, the first communication device is a broadband access server, and the second communication device is a MAP BR device;

[0079] Alternatively, the first communication device is the edge PE device of the first service provider, and the second communication device is the second PE device.

[0080] In one possible implementation, the device further includes:

[0081] The third acquisition module is used to acquire the seventh packet. The source address of the seventh packet is the first IPv4 address, and the destination address of the seventh packet is the second IPv4 address.

[0082] The first mapping module is used to map the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, and to map the destination address of the seventh packet from the second IPv4 address to the second IPv6 address based on the second mapping rule, so as to obtain the third packet;

[0083] The second sending module is used to send the third message.

[0084] In one possible implementation, the device further includes:

[0085] The second receiving module is used to receive the fifth message, the source address of the fifth message is the second IPv6 address, and the destination address of the fifth message is the first IPv6 address;

[0086] The second mapping module is used to map the source address of the fifth packet from the second IPv6 address to the second IPv4 address based on the second mapping rule, and to map the destination address of the fifth packet from the first IPv6 address to the first IPv4 address based on the first mapping rule.

[0087] Fifthly, a communication device is provided, including a processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the communication device to implement the method of acquiring mapping rules in either the first or second aspect.

[0088] In a sixth aspect, a computer-readable storage medium is provided, wherein at least one program instruction or code is stored in the storage medium, and when the program instruction or code is loaded and executed by a processor, enables the computer to implement the method for obtaining mapping rules as described in either the first or second aspect.

[0089] In a seventh aspect, a system for obtaining mapping rules is provided, the system comprising a first communication device and a second communication device, the first communication device being configured to execute the method for obtaining mapping rules as described in the second aspect or any possible implementation thereof, and the second communication device being configured to execute the method for obtaining mapping rules as described in the first aspect or any possible implementation thereof.

[0090] Another communication device is also provided, comprising a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path. The memory stores instructions, and the processor executes the instructions stored in the memory to control the transceiver to receive and transmit signals. When the processor executes the instructions stored in the memory, it causes the processor to perform the method of the first aspect or any possible implementation of the first aspect, or to perform the method of the second aspect or any possible implementation of the second aspect.

[0091] As an exemplary embodiment, the processor may be one or more, and the memory may be one or more.

[0092] As an exemplary embodiment, the memory may be integrated with the processor, or the memory may be disposed separately from the processor.

[0093] In specific implementation, the memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set on different chips. The embodiments of this application do not limit the type of memory or the way the memory and processor are set.

[0094] A computer program (product) is provided, the computer program (product) comprising: computer program code, which, when executed by a computer, causes the computer to perform the methods described in the above aspects.

[0095] A chip is provided, including a processor for retrieving and executing instructions stored in a memory, causing a communication device on which the chip is mounted to perform the methods described above.

[0096] Another chip is provided, comprising: an input interface, an output interface, a processor, and a memory, wherein the input interface, the output interface, the processor, and the memory are connected via an internal connection path, and the processor is used to execute code in the memory, wherein when the code is executed, the processor is used to perform the methods described above. Attached Figure Description

[0097] Figure 1 This is a schematic diagram of the structure of an implementation environment provided in an embodiment of this application;

[0098] Figure 2 This is a schematic diagram of the structure of a communication system provided in an embodiment of this application;

[0099] Figure 3 This is a schematic diagram of another communication system provided in an embodiment of this application;

[0100] Figure 4 This is a flowchart of a method for obtaining mapping rules provided in an embodiment of this application;

[0101] Figure 5 This is a schematic diagram of an extended field provided in an embodiment of this application;

[0102] Figure 6 This is a partial structural diagram of an update message message provided in an embodiment of this application;

[0103] Figure 7 This is a schematic diagram of the structure of a network layer reachability information field provided in an embodiment of this application;

[0104] Figure 8 This is a schematic diagram of a TLV field provided in an embodiment of this application;

[0105] Figure 9 This is another TLV field diagram provided in the embodiments of this application;

[0106] Figure 10 This is another TLV field diagram provided in the embodiments of this application;

[0107] Figure 11 This is a schematic diagram of an extended field provided in an embodiment of this application;

[0108] Figure 12 This is a flowchart of a method for obtaining mapping rules provided in an embodiment of this application;

[0109] Figure 13 This is a schematic diagram of the structure of a communication system provided in an embodiment of this application;

[0110] Figure 14 This is a flowchart of a method for obtaining mapping rules provided in an embodiment of this application;

[0111] Figure 15 This is a flowchart of a method for obtaining mapping rules provided in an embodiment of this application;

[0112] Figure 16 This is a schematic diagram of a device structure for obtaining mapping rules provided in an embodiment of this application;

[0113] Figure 17 This is a schematic diagram of another device structure for obtaining mapping rules provided in an embodiment of this application;

[0114] Figure 18 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application;

[0115] Figure 19 This is a schematic diagram of the structure of another communication device provided in an embodiment of this application;

[0116] Figure 20 This is a schematic diagram of the structure of another communication device provided in an embodiment of this application. Detailed Implementation

[0117] The terminology used in the embodiments section of this application is for explaining the embodiments of this application only and is not intended to limit this application. Embodiments of the present invention are described below with reference to the accompanying drawings.

[0118] Given the widespread deployment of IPv6 networks and the isolation of IPv4 networks from IPv6 networks, mapping between IPv4 and IPv6 addresses has become an effective solution to ensure the operation of IPv4 services and the continuous development of IPv6 services. Obtaining the address mapping rules is crucial for successful address mapping. However, manually configuring mapping rules is inefficient and costly to maintain. Therefore, this application provides a method for obtaining mapping rules, which enables automatic learning of the mapping rules.

[0119] The method provided in the embodiments of this application is applied to Figure 1 Taking the communication system shown as an example, such as Figure 1As shown, the communication system includes a first communication device 101 and a second communication device 102. The first communication device 101 and the second communication device 102 are located in a first type of network. The first communication device 101 is configured with a first mapping rule, and the second communication device 102 is configured with a second mapping rule. The first mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network, and the second mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network. For example, the first type of network is an IPv4 network, and the second type of network is an IPv6 network. One of the first and second mapping rules can map a source address between an IPv4 address and an IPv6 address, and the other mapping rule can map a destination address between an IPv4 address and an IPv6 address. For example, the first mapping rule is used for mapping between a first IPv4 address and a first IPv6 address, and the second mapping rule is used for mapping between a second IPv4 address and a second IPv6 address. Therefore, the first communication device 101 needs to learn the first mapping rule on the second communication device 102, and the second communication device 102 needs to learn the second mapping rule on the first communication device 101.

[0120] exist Figure 1 Based on the communication system shown, taking a centralized MAP-T / MAP-E scenario as an example, such as... Figure 2 As shown, the first communication device 101 is a MAP border relay (MAP BR) device, and the second communication device 102 is a broadband remote access server (BRAS); or, the first communication device is a BRAS and the second communication device is a MAP BR device. Figure 2 In this architecture, the MAP BR (Border Link Provider) acts as an edge device, or relay device, within the MAP domain. It connects IPv4 and IPv6 networks, handling IPv4 and IPv6 encapsulation / decapsulation. The BRAS (Border Link Provider Assignment) allocates addresses to MAP customer edge (MAP CE) devices. The MAP CE is responsible for IPv4 and IPv6 encapsulation / decapsulation, enabling IPv4 users to access IPv4 networks across IPv6 networks. It should be noted that there can be multiple BRAS and MAP BRs. Figure 2 This is just one example. The direction of message transmission or the learning direction of the mapping rule can be from BRAS to MAP BR, or from MAP BR to BRAS.

[0121] Apart from Figure 2In addition to the application scenarios shown, the method provided in this application embodiment is also applicable to the interoperability scenarios of IPv4 islands in IPv6 networks. For example... Figure 3 As shown, the first communication device is the first provider edge (PE) device, and the second communication device is the second PE device. By deploying MAP rules on the PE devices and communicating with each other via the border gateway protocol (BGP), IPv4 islands can communicate across the IPv6 network. There can be more than three PE devices. Figure 3 To illustrate, only three examples are shown. The sending direction of a message or the learning direction of a mapping rule can be from one PE to another.

[0122] Next, taking the example of configuring a first mapping rule on a first communication device and a second mapping rule on a second communication device, and learning the mapping rule through the interaction between the first and second communication devices, the method for obtaining mapping rules provided in this application will be described. See also Figure 4 The method for obtaining mapping rules provided in this application includes the following processes.

[0123] 401, The first communication device obtains information about the first mapping rule configured on the first communication device. The first communication device is located in a first type of network. The first mapping rule is used for address mapping between addresses in the first type of network and addresses in a second type of network. The first type of network is different from the second type of network.

[0124] This application does not limit the method by which the first communication device obtains the first mapping rule configured on the first communication device. For example, after manually configuring the first mapping rule on the first communication device, the first communication device can store the first mapping rule in its storage space or in the storage space of another device. The first communication device can then obtain the first mapping rule configured on the first communication device from the corresponding storage space.

[0125] Furthermore, this application embodiment does not limit the content of the first mapping rule, as long as it can achieve the mapping between IPv4 addresses and IPv6 addresses. Since the Mapping Address and Port (MAP) technology encapsulates and decapsulates IPv4 addresses to map IPv6 addresses to IPv6 addresses through certain rules, it enables IPv4 users to access IPv4 networks across IPv6 networks. MAP technology statelessly reuses the same address and port, and is further divided into two types based on the packet format: Double Encapsulation MAP-E and Double Translation MAP-T. MAP-T / MAP-E technology combines statelessness and double translation / encapsulation, thus offering significant advantages in technical performance, reliability, and customer deployment costs. Moreover, since MAP technology has three mapping rules: basic mapping rule (BMR), forwarding mapping rule (FMR), and default mapping rule (DMR), in one possible implementation, the first mapping rule in this application embodiment includes, but is not limited to, at least one of BMR, FMR, and DMR. The information of the first mapping rule includes at least one of the following: the address information corresponding to the basic mapping rule BMR, the address information corresponding to the forwarding mapping rule FMR, and the address information corresponding to the default mapping rule DMR.

[0126] Furthermore, regardless of the type of the first mapping rule, the method provided in this application embodiment can represent the information of the first mapping rule in the form of a route. In one possible implementation, the first communication device obtains the information of the first mapping rule configured on the first communication device, including: the first communication device generates a MAP route based on the first mapping rule, and uses the MAP route as the information of the first mapping rule. For example, the address information corresponding to the BMR includes, but is not limited to, the IPv6 prefix, IPv6 prefix length, IPv4 prefix, IPv4 prefix length, EA bit length, and port-set ID (PSID) offset corresponding to the BMR. The address information corresponding to the FMR includes, but is not limited to, the IPv6 prefix, IPv6 prefix length, IPv4 prefix, IPv4 prefix length, EA bit length, and PSID offset corresponding to the FMR. The address information corresponding to the DMR includes, but is not limited to, the IPv6 prefix and IPv6 prefix length corresponding to the DMR. Alternatively, the address information corresponding to the DMR includes, but is not limited to, the IPv6 address and IPv6 address prefix length corresponding to the BR device.

[0127] 402, The first communication device sends a first message to the second communication device. The first message carries information about a first mapping rule. The second communication device is located in a network of the first type.

[0128] To enable the second communication device to also learn the first mapping rule configured on the first communication device, the first communication device can send the information of the first mapping rule configured on the first communication device to the second communication device. For example, the first communication device can send the information of the first mapping rule to the second communication device by sending a message. In this embodiment, we take the example of the first communication device sending a first message to the second communication device carrying the information of the first mapping rule in a first message. Before the first communication device sends the first message to the second communication device, the first communication device and the second communication device first establish a MAP neighbor relationship.

[0129] In one possible implementation, the establishment of a MAP neighbor relationship between the first communication device and the second communication device includes: the first communication device sending a message carrying a first MAP address cluster to the second communication device; and the first communication device receiving a message carrying a second MAP address cluster sent by the second communication device. Taking the transmission of MAP address clusters via BGP Open messages as an example, the first and second communication devices can add MAP address family capabilities to the BGP Open messages and establish a BGP MAP neighbor relationship after MAP capability negotiation. For example, the BGP capability negotiation field format is as follows: Figure 5 As shown.

[0130] The extended field under "capabilities advertisement" indicates the MAP address family. The first communication device carries the first MAP address family in the "capabilities advertisement" field of its BGP Open message and sends the BGP Open message containing the first MAP address family to the second communication device. The second communication device carries the second MAP address family in the "capabilities advertisement" field of its BGP Open message and sends the BGP Open message containing the second MAP address family to the first communication device. Thus, after advertising the address families, the first and second communication devices establish a MAP neighbor relationship.

[0131] After establishing a MAP neighbor relationship, the first communication device sends a first message carrying information about the first mapping rule. Exemplarily, this first message also includes attribute information, including the MAP domain type and MAP domain identifier. Optionally, the attribute information also includes a routing identifier and a routing target. This application embodiment does not limit the manner in which the first message carries the information about the first mapping rule and the attribute information, but includes, but is not limited to, the following two methods.

[0132] In the first case, the information and attribute information of the first mapping rule are carried in the network layer reachability information field of the first message.

[0133] This application embodiment does not limit the first message carrying information about the first mapping rule; for example, the first message is an update message. Figure 6 As shown, the information of the first mapping rule is carried in the form of BGP routes in the network layer reachability information (NLRI) field of the update message. The NLRI field in the update message includes a prefix length field, which is expanded after carrying the information of the first mapping rule represented in BGP route form. One possible NLRI information can be arranged as follows: Figure 6 The format definition shown includes extended fields except for the prefix length. The contents of the extended fields are as follows: Figure 7 As shown, this includes attribute information, such as the MAP domain type and MAP domain ID. It also includes a route distinguisher and a route target, for example, a Virtual Private Network (VPN) route distinguisher and VPN route target. The MAP domain type includes MAP-T or MAP-E. The route distinguisher is used to identify different routes; for example, a VPN route distinguisher is used to identify different VPNs. The route target is used to control the dissemination of routing information; for example, a VPN route target is used to control the dissemination of VPN routing information.

[0134] in addition, Figure 7 The data field shown carries information about the first mapping rule in a type-length-value (TLV) format. For example, if the information of the first mapping rule includes the address information corresponding to the BMR, then the BMR TLV format is as follows: Figure 8 As shown.

[0135] BMR TLV: Corresponds to the BMR rule and is used to represent the address information corresponding to the BMR. Figure 2 Taking the communication system shown as an example, MAP-CE is used to perform network address translation (NAT) and IPv6 translation / encapsulation on IPv4 user packets. MAP-BR is used to decapsulate / detunnel IPv4 addresses from IPv6 packets, and to translate and encapsulate the IPv4 address + port of return traffic into IPv6 before forwarding it to MAP-CE in the MAP domain according to IPv6 routing. The address information corresponding to BMR includes: the IPv6 prefix (Rule-IPv6-prefix), IPv6 prefix length, IPv4 prefix (Rule-IPv4-prefix), EA bit length (EA-bits-length), and PSID offset (port-set ID-offset) corresponding to the BMR rule. These parameters, configured on MAP-CE, can calculate the shared IPv4 address and port sequence, as well as the IPv6 address of MAP-CE, thus realizing the mapping between IPv4 and IPv6 addresses.

[0136] For example, if the information in the first mapping rule includes the address information corresponding to the FMR, then the FMR TLV format includes the following: FMR TLV: Corresponding to the FMR rule, this FMR TLV carries the address information corresponding to the FMR, used to enable direct communication of mutual access traffic between MAP and CE in the network. It should be noted that FMR and BMR can be the same; the structure of the BMR TLV is as follows... Figure 8 As shown, a BMR can be configured as an FMR.

[0137] For example, if the information in the first mapping rule includes the address information corresponding to the DMR, then the DMR TLV format is as follows: Figure 9 As shown.

[0138] DMR TLV: Corresponding to the DMR in MAP-T, the DMR TLV carries the mapping information corresponding to the DMR, indicating that the destination IPv4 address of the packet is an address outside the MAP domain, and it is forwarded to the outside domain through the BR. The address information corresponding to the DMR contains two parameters: Rule-IPv6-prefix and Rule-IPv4-prefix. The value of Rule-IPv6-prefix is ​​the IPv6 prefix of the MAP BR, and the value of Rule-IPv4-prefix is ​​0.0.0.0 / 0, which is the mapping rule applicable as the default route when matching IPv4 routes on MAP-CE. After using this rule, the destination IPv6 address will be composed of the Rule-IPv6-prefix configured in the DMR and the destination IPv4 address.

[0139] For example, if the information in the first mapping rule includes the address information corresponding to the DMR, and the address information corresponding to the DMR includes the address information corresponding to the BR device, then the BR address (address) TLV format is as follows: Figure 10 As shown.

[0140] BR Address TLV: Corresponds to DMR in MAP-E. In MAP-E, the destination addresses outside the MAP domain are the IPv6 addresses of the configured MAP-BR.

[0141] The second method involves carrying the information of the first mapping rule in the network layer reachability information field of the first message, and the attribute information in the extended attribute field of the first message.

[0142] like Figure 11 As shown, the NLRI carries information about the first mapping rule, such as BMR / FMR / DMR / BR address, etc. At the same time, an extended attribute field, such as the BGP MAP attribute / extended attribute (community / extended community) field, is added to the update message. This attribute / extended attribute field is used to carry attribute information.

[0143] By adopting the first or second method described above for carrying information and attribute information of the first mapping rule, the information and attribute information of the first mapping rule can be carried in the same field or in different fields, making the carrying method more flexible.

[0144] 403, The second communication device receives the first message sent by the first communication device and obtains the first mapping rule according to the information of the first mapping rule in the first message.

[0145] Before the second communication device receives the first message sent by the first communication device, the second communication device establishes a MAP neighbor relationship with the first communication device. Therefore, after the second communication device receives the first message, since the first message carries information about the first mapping rule, the second communication device can obtain the first mapping rule based on the information about the first mapping rule in the first message.

[0146] For example, the information of the first mapping rule is a MAP route generated based on the first mapping rule; then the second communication device obtains the first mapping rule according to the information of the first mapping rule, including: the second communication device obtains the first mapping rule according to the MAP route. Since the second communication device is configured with the second mapping rule, and the second communication device obtains the first mapping rule configured on the first communication device through dynamic learning, the second communication device can realize the mapping between source address and destination address between IPv4 and IPv6.

[0147] In one possible implementation, when the second communication device is a broadband access server, after the second communication device obtains the first mapping rule according to the information of the first mapping rule, it further includes: the second communication device sending a sixth message to the third communication device, so that the third communication device performs address mapping between the address in the first type of network and the address in the second type of network according to the first mapping rule; wherein, the sixth message carries the information of the first mapping rule, and the third communication device is a user edge CE device.

[0148] The method provided in this application reduces the workload of configuring and maintaining mapping rules by dynamically learning the mapping rules on communication devices, thereby improving the efficiency of obtaining mapping rules and reducing maintenance costs. For example, by using the dynamic learning function of MAP mapping rules, the workload of configuring and maintaining centralized MAP scenarios is reduced, thereby improving the efficiency of obtaining mapping rules and reducing maintenance costs. Furthermore, this method can be applied not only to the interoperability scenarios of IPv4 islands in IPv6 networks, enabling IPv4 islands to interoperate across IPv6 networks.

[0149] exist Figure 4 Based on the second communication device dynamically learning the first mapping rule configured on the first communication device, the method provided in this application embodiment also supports the first communication device dynamically learning the second mapping rule configured on the second communication device. See also Figure 12 The method provided in this application includes the following processes.

[0150] 401, The first communication device obtains information about the first mapping rule configured on the first communication device. The first communication device is located in a first type of network. The first mapping rule is used for address mapping between addresses in the first type of network and addresses in a second type of network. The first type of network is different from the second type of network.

[0151] 402, The first communication device sends a first message to the second communication device. The first message carries information about a first mapping rule. The second communication device is located in a network of the first type.

[0152] 403, The second communication device receives the first message sent by the first communication device and obtains the first mapping rule according to the information of the first mapping rule in the first message.

[0153] It should be noted that the implementation methods for the above 401-403 errors can refer to the above. Figure 4 The relevant descriptions of 401-403 are not repeated here.

[0154] 404, The second communication device sends a second message to the first communication device. The second message carries information about the second mapping rule configured on the second communication device. The second mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network.

[0155] Before sending a second message to the first communication device, the second communication device obtains the mapping rules configured on its own device, and then obtains information about the second mapping rules. This application embodiment does not limit the method by which the second communication device obtains the second mapping rules configured on its own device. For example, after manually configuring the second mapping rules on the second communication device, the second communication device can store the second mapping rules in its own storage space or in the storage space of another device. The second communication device can then retrieve the second mapping rules configured on its own device from the corresponding storage space.

[0156] Furthermore, this application embodiment does not limit the content of the second mapping rule, as long as it can achieve the mapping between IPv4 addresses and IPv6 addresses. In one possible implementation, the second mapping rule in this application embodiment includes, but is not limited to, at least one of BMR, FMR, and DMR. The information of the second mapping rule includes at least one of the following: address information corresponding to the basic mapping rule BMR, address information corresponding to the forwarding mapping rule FMR, and address information corresponding to the default mapping rule DMR.

[0157] Furthermore, regardless of the type of the second mapping rule, the method provided in this application embodiment can represent the information of the second mapping rule in the form of a route. In one possible implementation, the second communication device obtains the information of the second mapping rule configured on the second communication device, including: the second communication device generates a MAP route based on the second mapping rule, and uses the MAP route as the information of the second mapping rule. For example, the address information corresponding to the BMR includes, but is not limited to, the IPv6 prefix, IPv6 prefix length, IPv4 prefix, IPv4 prefix length, EA bit length, and port-set ID (PSID) offset corresponding to the BMR. The address information corresponding to the FMR includes, but is not limited to, the IPv6 prefix, IPv6 prefix length, IPv4 prefix, IPv4 prefix length, EA bit length, and PSID offset corresponding to the FMR. The address information corresponding to the DMR includes, but is not limited to, the IPv6 prefix and IPv6 prefix length corresponding to the DMR. Alternatively, the address information corresponding to the DMR includes, but is not limited to, the IPv6 address and IPv6 address prefix length corresponding to the BR device.

[0158] To enable the first communication device to learn the second mapping rule configured on the second communication device, the second communication device can send the information of the second mapping rule configured on the second communication device to the first communication device. For example, the second communication device can send the information of the second mapping rule to the first communication device by sending a message. In this embodiment, the example is that the second communication device sends a second message to the first communication device carrying the information of the second mapping rule. Before the second communication device sends the second message to the first communication device, the second communication device and the first communication device first establish a MAP neighbor relationship. The method for establishing a MAP neighbor relationship can be found in [reference needed]. Figure 4 The relevant description of 402 will not be repeated here.

[0159] In addition, after establishing the MAP neighbor relationship, the second communication device sends a second message carrying information about the second mapping rule. For example, this second message further includes attribute information, including the MAP domain type and MAP domain identifier. Optionally, the attribute information also includes a routing identifier and a routing target. This application embodiment does not limit the manner in which the second message carries the information about the second mapping rule and the attribute information, but includes, but is not limited to, the following two methods.

[0160] The first type, along with the second mapping rule information and attribute information, are both carried in the network layer reachability information field of the second message.

[0161] The second method involves carrying the information of the second mapping rule in the network layer reachability information field of the second message, and the attribute information in the extended attribute field of the first message.

[0162] The method by which the second message carries information and attribute information of the second mapping rule can be referred to the method by which the first message carries information and attribute information of the first mapping rule, and will not be repeated here.

[0163] 405, the first communication device receives the second message sent by the second communication device, and obtains the second mapping rule according to the information of the second mapping rule in the second message.

[0164] Before the first communication device receives the second message sent by the second communication device, the second communication device establishes a MAP neighbor relationship with the first communication device. Therefore, after the first communication device receives the second message, since the second message carries information about the second mapping rule, the first communication device can obtain the second mapping rule based on the information about the second mapping rule in the second message.

[0165] For example, the information of the second mapping rule is a MAP route generated based on the second mapping rule; then the first communication device obtains the second mapping rule according to the information of the second mapping rule, including: the first communication device obtains the second mapping rule according to the MAP route. Since the first communication device is configured with the first mapping rule, and the first communication device obtains the second mapping rule configured on the second communication device through dynamic learning, it is possible to realize the mapping between source address and destination address between IPv4 and IPv6.

[0166] It should be noted that, whether the first communication device learns the second mapping rule configured on the second communication device, or the second communication device learns the first mapping rule configured on the first communication device, once both the first and second communication devices have the first and second mapping rules, they can store the first and second mapping rules as routing table entries for triggering address mapping during message transmission.

[0167] Furthermore, steps 401 to 403 describe the process of the first communication device sending information about a first mapping rule to the second communication device, enabling the second communication device to learn the first mapping rule configured on the first communication device. Steps 404 and 405 describe the process of the second communication device sending information about a second mapping rule to the first communication device, enabling the first communication device to learn the second mapping rule configured on the second communication device. Besides executing steps 401-403 first, followed by steps 404 and 405, steps 404 and 405 can also be executed first, followed by steps 401-403. This application does not limit the order in which the second communication device learns the first mapping rule configured on the first communication device, or the first communication device learns the second mapping rule configured on the second communication device.

[0168] Furthermore, when both the first and second communication devices dynamically learn the mapping rules of the peer using the method provided in this application embodiment, the first and second communication devices can achieve interoperability between IPv4 and IPv6 networks. Based on this, the first and second communication devices can transmit messages. The message transmission process can be as follows... Figure 12 The steps are shown below.

[0169] 406, The first communication device receives the seventh message. The source address of the seventh message is the first IPv4 address, and the destination address of the seventh message is the second IPv4 address.

[0170] The seventh message is either a message generated by the first communication device or a message received by the first communication device from the previous hop. This application embodiment does not limit the type or content of the seventh message. Taking an example where the first communication device is located in a first type of network, which is an IPv4 network, and a first mapping rule configured on the first communication device is used for mapping between a first IPv4 address and a first IPv6 address, the source address of the seventh message is the first IPv4 address, and the destination address of the seventh message is the second IPv4 address. For example, the first IPv4 address is the address of the first communication device, and the second IPv4 address is the address of the second communication device.

[0171] 407. The first communication device maps the source address of the seventh message from the first IPv4 address to the first IPv6 address based on the first mapping rule, and maps the destination address of the seventh message from the second IPv4 address to the second IPv6 address based on the second mapping rule, thus obtaining the third message.

[0172] Since the destination address of the seventh message is the address of the second communication device, and the first and second communication devices are connected via an IPv6 network, in order to successfully traverse the IPv6 network from the IPv4 network, the first communication device does not directly forward the seventh message. Instead, it first maps the source address of the seventh message from the first IPv4 address to the first IPv6 address based on the first mapping rule, and then maps the destination address of the seventh message from the second IPv4 address to the second IPv6 address based on the second mapping rule, thus obtaining the third message.

[0173] 408, the first communication device sends the third message.

[0174] When the first communication device sends the third message, it can query the routing table to determine the next hop. Then, the first communication device sends the third message to its next hop, forwarding it to the destination address according to the normal message transmission process. The source address of the third message is the first IPv6 address, and the destination address is the second IPv6 address. Therefore, the third message can be successfully sent to the IPv6 network and then transmitted to the second communication device via the IPv6 network.

[0175] 409. The second communication device receives the third message, maps the source address of the third message from the first IPv6 address to the first IPv4 address based on the first mapping rule, and maps the destination address of the third message from the second IPv6 address to the second IPv4 address based on the second mapping rule.

[0176] Since the third message is an IPv6 message with both source and destination addresses being IPv6 addresses, and the second communication device is located in the second network, which is an IPv4 network, after receiving the third message, the second communication device can map the source address of the third message from the first IPv6 address to the first IPv4 address based on the first mapping rule, and map the destination address of the third message from the second IPv6 address to the second IPv4 address based on the second mapping rule.

[0177] The above explanation uses the example of the first communication device sending a message to the second communication device as an example. Similarly, the second communication device can send a message to the first communication device using the same principle. This process can be described as follows: Figure 12 The process is shown below.

[0178] 410. The second communication device obtains the fourth message. The source address of the fourth message is the second IPv4 address, and the destination address of the fourth message is the first IPv4 address.

[0179] The fourth message is either a message generated by the second communication device or a message received by the second communication device from the previous hop. This application embodiment does not limit the specific type and content of the fourth message. Taking an example where the second communication device is located in a second network, which is an IPv4 network, and a second mapping rule configured on the second communication device is used for mapping between a second IPv4 address and a second IPv6 address, the source address of the fourth message is the second IPv4 address, and the destination address of the fourth message is the first IPv4 address. For example, the second IPv4 address is the address of the second communication device, and the first IPv4 address is the address of the first communication device.

[0180] 411. The second communication device maps the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, and maps the destination address of the fourth packet from the first IPv4 address to the first IPv6 address based on the second mapping rule, thus obtaining the fifth packet.

[0181] Since the destination address of the fourth message is the address of the first communication device, and the first and second communication devices are connected via an IPv6 network, the second communication device does not directly send the fourth message. In order for the IPv4 network to successfully traverse the IPv6 network, the second communication device maps the source address of the fourth message from the second IPv4 address to the second IPv6 address based on the first mapping rule, and maps the destination address of the fourth message from the first IPv4 address to the first IPv6 address based on the second mapping rule, thus obtaining the fifth message.

[0182] 412, the second communication device sends the fifth message.

[0183] When the second communication device sends the fifth message, it can query the routing table to determine the next hop. Then, the second communication device sends the fifth message to its next hop, forwarding it to the destination address according to the normal message transmission process. In this case, the source address of the fifth message is the second IPv6 address, and the destination address is the first IPv6 address. Therefore, the fifth message can be successfully sent to the IPv6 network and then transmitted to the first communication device via the IPv6 network.

[0184] 413. The first communication device receives the fifth message, maps the source address of the fifth message from the second IPv6 address to the second IPv4 address based on the second mapping rule, and maps the destination address of the fifth message from the first IPv6 address to the first IPv4 address based on the first mapping rule.

[0185] Since the fifth message is an IPv6 message, with both the source and destination addresses being IPv6 addresses, and the first communication device is located in the first network, which is an IPv4 network, after receiving the fifth message, the first communication device can map the source address of the fifth message from the second IPv6 address to the second IPv4 address based on the second mapping rule, and map the destination address of the fifth message from the first IPv6 address to the first IPv4 address based on the first mapping rule.

[0186] The method provided in this application embodiment can reduce the workload of configuring and maintaining mapping rules by dynamically learning the mapping rules on the communication device, thereby improving the efficiency of obtaining mapping rules and reducing maintenance costs.

[0187] The method provided in this application is applicable to MAP-T / MAP-E scenarios. For example, by using the dynamic learning function of MAP mapping rules, the workload of centralized MAP scenario configuration and maintenance can be reduced, thereby improving the efficiency of obtaining mapping rules and reducing maintenance costs. Furthermore, this method can also be applied to the interoperability scenario of IPv4 islands in IPv6 networks, enabling IPv4 islands to interoperate across IPv6 networks. For ease of understanding, the method for obtaining mapping rules provided in this application will be illustrated below using a MAP scenario as an example.

[0188] See Figure 13 ,exist Figure 2 Based on the centralized MAP-T / MAP-E scenario shown, Figure 13 Taking a scenario where the first communication device is a BRAS (Branded Automated Guided Service) and the second communication device is a MAP (Mapped BR) device, and both the BRAS and MAP BR devices are located in an IPv6 network, Figure 13 In this architecture, the MAP BR (Border Link Controller) acts as an edge device, or relay device, within the MAP domain. It connects IPv4 and IPv6 networks and is responsible for IPv4 / IPv6 encapsulation / decapsulation. The BRAS (Border Link System) assigns addresses to the MAP CE (Border Link Controller). For example, the BRAS might assign the MAP address clusters 1.1.1.0 / 24 and 2001:db8:1:: / 48 to the MAP CE. Here, 1.1.1.0 / 24 is the IPv4 address (the first IPv4 address), and 2001:db8:1:: / 48 is the IPv6 address (the first IPv6 address). The MAP CE is responsible for performing IPv4 / IPv6 encapsulation / decapsulation, enabling IPv4 users to access IPv4 networks across IPv6 networks. In addition, the MAP BR side also has two address clusters: IPv4 address 11.1.1.0 / 24 (i.e., the second IPv4 address) and IPv6 address 2001:db8:2:: / 48 (i.e., the second IPv6 address).

[0189] Furthermore, BRAS established a MAP neighbor relationship with MAP BR. Based on Figure 13 The communication system shown is described in the following document. Figure 14 The method provided in this application includes the following processes.

[0190] 1401, BRAS obtains information about the first mapping rule configured on BRAS. The first mapping rule is used for address mapping between IPv6 network addresses and IPv4 network addresses.

[0191] This application does not limit the method by which the BRAS obtains the first mapping rule configured on the BRAS. For example, after manually configuring the first mapping rule on the BRAS, the BRAS can store the first mapping rule in its storage space or in the storage space of other devices. The BRAS can then obtain the first mapping rule configured on the BRAS from the corresponding storage space.

[0192] Furthermore, this application embodiment does not limit the content of the first mapping rule, as long as it can achieve the mapping between IPv4 addresses and IPv6 addresses. In one possible implementation, the first mapping rule in this application embodiment includes, but is not limited to, at least one of BMR, FMR, and DMR. The information of the first mapping rule includes at least one of the address information corresponding to the basic mapping rule BMR, the address information corresponding to the forwarding mapping rule FMR, and the address information corresponding to the default mapping rule DMR.

[0193] The implementation method for this 1401 can be found in [reference]. Figure 4 The relevant descriptions of 401 shown will not be repeated here.

[0194] At 1402, BRAS sends the first message to MAP-BR, which carries information about the first mapping rule.

[0195] This application embodiment does not limit the first message carrying information about the first mapping rule. For example, the first message is an update message. The implementation of 1402 can be found in [reference needed]. Figure 4 The relevant descriptions of 402 shown will not be repeated here.

[0196] 1403, MAP-BR receives the first message sent by BRAS and obtains the first mapping rule based on the information of the first mapping rule in the first message.

[0197] The implementation of 1403 can be found in [reference needed]. Figure 4 The relevant descriptions of 403 shown will not be repeated here.

[0198] 1404, MAP-BR sends a second message to BRAS. The second message carries information about the second mapping rule configured on MAP-BR. The second mapping rule is used for address mapping between IPv4 network addresses and IPv6 network addresses.

[0199] The implementation of this 1404 error can be found in [link to documentation]. Figure 12 The descriptions related to the 404 error shown will not be repeated here.

[0200] 1405, BRAS receives the second message sent by MAP-BR and obtains the second mapping rule based on the information of the second mapping rule in the second message.

[0201] The implementation method of 1405 can be found in [link to documentation]. Figure 12 The relevant descriptions of 405 shown will not be repeated here.

[0202] At 1406, BRAS sends a sixth message to MAP CE, which carries information about the second mapping rule.

[0203] After obtaining the second mapping rule, the BRAS carries the information of the second mapping rule in the sixth message and sends it to the MAP CE, so that the MAP CE can perform address mapping between addresses in the first type of network and addresses in the second type of network according to the information of the second mapping rule.

[0204] 1407, MAP CE receives the seventh message. The source address of the seventh message is the first IPv4 address, and the destination address of the seventh message is the second IPv4 address.

[0205] The seventh message is either a message generated by the MAP CE or a message received by the MAP CE from the previous hop. This application embodiment does not limit the type or content of the seventh message. (In conjunction with...) Figure 13 In the communication system shown, the first IPv4 address is 1.1.1.0 / 24, the first IPv6 address is 2001:db8:1:: / 48, the second IPv4 address is 11.1.1.0 / 24, and the second IPv6 address is 2001:db8:2:: / 48. Therefore, the source address of the seventh packet is 1.1.1.0 / 24, and the destination address of the seventh packet is 11.1.1.0 / 24. For the implementation of this 1407 protocol, please refer to [link to documentation]. Figure 12 The relevant descriptions of 406 shown will not be repeated here.

[0206] 1408, MAP CE maps the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, and maps the destination address of the seventh packet from the second IPv4 address to the second IPv6 address based on the second mapping rule, thus obtaining the third packet.

[0207] Combination Figure 13In the communication system shown, the first IPv4 address is 1.1.1.0 / 24, the first IPv6 address is 2001:db8:1:: / 48, the second IPv4 address is 11.1.1.0 / 24, and the second IPv6 address is 2001:db8:2:: / 48. Therefore, based on the first mapping rule, MAPCE maps the source address of the seventh packet from 1.1.1.0 / 24 to 2001:db8:1:: / 48, and based on the second mapping rule, maps the destination address of the seventh packet from 11.1.1.0 / 24 to 2001:db8:2:: / 48. Thus, the resulting third packet can be transmitted in the IPv6 network.

[0208] It should be noted that the MAP CE's processing of the packet in step 1408 differs in different network scenarios. Specifically, in the MAP-T scenario, the MAP CE replaces the first IPv4 address with the first IPv6 address and the second IPv4 address with the second IPv6 address; while in the MAP-E scenario, the MAP CE adds the first IPv6 address outside the first IPv4 address and adds the second IPv6 address outside the second IPv4 address.

[0209] The implementation of 1408 can be found in [reference needed]. Figure 12 The relevant descriptions of 407 shown will not be repeated here.

[0210] At 1409, MAP CE sent the third message.

[0211] The implementation method of this 1409 can be found in [link to documentation]. Figure 12 The description of 408 shown will not be repeated here. The MAP CE first sends the third message to the BRAS, which then sends the third message to the MAP BR.

[0212] At 1410, BRAS sent the third message.

[0213] 1411, MAP-BR receives the third packet, maps the source address of the third packet from the first IPv6 address to the first IPv4 address based on the first mapping rule, and maps the destination address of the third packet from the second IPv6 address to the second IPv4 address based on the second mapping rule.

[0214] Combination Figure 13In the communication system shown, the first IPv4 address is 1.1.1.0 / 24, the first IPv6 address is 2001:db8:1:: / 48, the second IPv4 address is 11.1.1.0 / 24, and the second IPv6 address is 2001:db8:2:: / 48. Therefore, after receiving the third packet, MAP-BR maps the source address of the third packet from 2001:db8:1:: / 48 to 1.1.1.0 / 24 based on the first mapping rule, and maps the destination address of the third packet from 2001:db8:2:: / 48 to 11.1.1.0 / 24 based on the second mapping rule.

[0215] It should be noted that the MAP-BR's processing of the packet in step 1411 differs in different network scenarios. Specifically, in the MAP-T scenario, MAP-BR replaces the first IPv6 address with the first IPv4 address and the second IPv6 address with the second IPv4 address; while in the MAP-E scenario, MAP-BR deletes the first IPv6 address but retains the inner first IPv4 address, and deletes the second IPv6 address but retains the inner second IPv4 address.

[0216] The implementation of 1411 can be found in [reference needed]. Figure 12 The relevant descriptions of 409 shown will not be repeated here.

[0217] Combination Figure 13 The communication system shown is described in the following document. Figure 15 The method provided in this application includes the following processes.

[0218] 1501, BRAS obtains information about the first mapping rule configured on BRAS. The first mapping rule is used for address mapping between addresses of IPv4 network and addresses of IPv6 network.

[0219] The implementation method of this 1501 can be found in [reference]. Figure 4 The relevant descriptions of 401 shown will not be repeated here.

[0220] At 1502, BRAS sends the first message to MAP-BR, which carries information about the first mapping rule.

[0221] The implementation method of this 1502 can be found in [reference needed]. Figure 4 The relevant descriptions of 402 shown will not be repeated here.

[0222] 1503, MAP-BR receives the first message sent by BRAS and obtains the first mapping rule based on the information of the first mapping rule in the first message.

[0223] The implementation method of this 1503 can be found in [reference needed]. Figure 4 The relevant descriptions of 403 shown will not be repeated here.

[0224] 1504, MAP-BR sends a second message to BRAS. The second message carries information about the second mapping rule configured on MAP-BR. The second mapping rule is used for address mapping between IPv4 network addresses and IPv6 network addresses.

[0225] The implementation of this 1504 can be found in [reference needed]. Figure 12 The descriptions related to the 404 error shown will not be repeated here.

[0226] 1505, BRAS receives the second message sent by MAP-BR and obtains the second mapping rule based on the information of the second mapping rule in the second message.

[0227] The implementation of 1505 can be found in [reference needed]. Figure 12 The relevant descriptions of 405 shown will not be repeated here.

[0228] In one possible implementation, the BRAS sends a sixth message to the MAP CE, which carries information about the second mapping rule, enabling the MAP CE to perform address mapping between addresses in the first type of network and addresses in the second type of network according to the second mapping rule.

[0229] 1506, MAP-BR receives the fourth packet. The source address of the fourth packet is the second IPv4 address, and the destination address of the fourth packet is the first IPv4 address.

[0230] Combination Figure 13 In the communication system shown, the first IPv4 address is 1.1.1.0 / 24, the first IPv6 address is 2001:db8:1:: / 48, the second IPv4 address is 11.1.1.0 / 24, and the second IPv6 address is 2001:db8:2:: / 48. Therefore, the source address of the fourth packet is 11.1.1.0 / 24, and the destination address of the fourth packet is 1.1.1.0 / 24. For the implementation of this 1506, please refer to [link to implementation details]. Figure 12 The relevant descriptions of 410 shown will not be repeated here.

[0231] 1507. Based on the first mapping rule, MAP-BR maps the source address of the fourth packet from the second IPv4 address to the second IPv6 address, and based on the second mapping rule, maps the destination address of the fourth packet from the first IPv4 address to the first IPv6 address, thus obtaining the fifth packet.

[0232] Combination Figure 13In the communication system shown, the first IPv4 address is 1.1.1.0 / 24, the first IPv6 address is 2001:db8:1:: / 48, the second IPv4 address is 11.1.1.0 / 24, and the second IPv6 address is 2001:db8:2:: / 48. Therefore, MAP-BR maps the source address of the fourth packet from 11.1.1.0 / 24 to 2001:db8:2:: / 48 based on the first mapping rule, and maps the destination address of the fourth packet from 1.1.1.0 / 24 to 2001:db8:1:: / 48 based on the second mapping rule. Thus, the resulting fifth packet can be transmitted in the IPv6 network.

[0233] The implementation method of 1507 can be found in [link to documentation]. Figure 12 The relevant descriptions of 411 shown will not be repeated here.

[0234] At 1508, MAP-BR sent its fifth message.

[0235] The source address of the fifth message is 2001:db8:2:: / 48, and the destination address is 2001:db8:1:: / 48. For the implementation of this 1508, please refer to [link / reference needed]. Figure 12 The relevant descriptions of 412 shown will not be repeated here.

[0236] At 1509, BRAS received the fifth message and sent it to MAP CE.

[0237] 1510, MAP CE receives the fifth message, and based on the second mapping rule, maps the source address of the fifth message from the second IPv6 address to the second IPv4 address, and based on the first mapping rule, maps the destination address of the fifth message from the first IPv6 address to the first IPv4 address.

[0238] Combination Figure 13 In the communication system shown, the first IPv4 address is 1.1.1.0 / 24, the first IPv6 address is 2001:db8:1:: / 48, the second IPv4 address is 11.1.1.0 / 24, and the second IPv6 address is 2001:db8:2:: / 48. Therefore, based on the second mapping rule, MAPCE maps the source address of the fifth packet from 2001:db8:2:: / 48 to 11.1.1.0 / 24, and based on the first mapping rule, maps the destination address of the fifth packet from 2001:db8:1:: / 48 to 1.1.1.0 / 24.

[0239] The implementation of 1510 can be found in [reference needed]. Figure 12 The relevant descriptions of 413 shown will not be repeated here.

[0240] The above describes the method for obtaining mapping rules provided in the embodiments of this application. Corresponding to the above method, the embodiments of this application also provide an apparatus for obtaining mapping rules. Figure 16 This is a schematic diagram of a device for obtaining mapping rules according to an embodiment of this application. The device is applied to a first communication device, which is the aforementioned... Figure 4 , Figure 12 , Figure 14 , Figure 15 The first communication device shown in any of the attached figures. Based on Figure 16 The following modules are shown. Figure 16 The apparatus for obtaining mapping rules shown is capable of performing all or part of the operations performed by the first communication device. It should be understood that the apparatus may include more additional modules than those shown, or may omit some of the modules shown; this application embodiment does not impose limitations in this regard. Figure 16 As shown, the device includes:

[0241] The first receiving module 1601 is used to receive a first message sent by the second communication device. The first and second communication devices are located in a first type of network. The first message carries information about a first mapping rule configured on the second communication device. The first mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network. The first type of network is different from the second type of network.

[0242] The first acquisition module 1602 is used to acquire the first mapping rule based on the information of the first mapping rule.

[0243] In one possible implementation, the information of the first mapping rule is the mapping address and port MAP route generated based on the first mapping rule.

[0244] In one possible implementation, the device further includes:

[0245] Establishment module, used to establish MAP neighbor relationship with the second communication device.

[0246] In one possible implementation, a module is established to send a message carrying a first MAP address cluster to a second communication device and to receive a message carrying a second MAP address cluster sent by the second communication device.

[0247] In one possible implementation, the first message also includes attribute information, which includes the mapped address and port, MAP field type, and MAP field identifier.

[0248] In one possible implementation, the attribute information also includes the route identifier and the route target.

[0249] In one possible implementation, the information of the first mapping rule and the attribute information are both carried in the field of the Network Layer Reachability Information (NLRI) of the first message.

[0250] In one possible implementation, the information of the first mapping rule is carried in the network layer reachability information field of the first message, and the attribute information is carried in the extended attribute field of the first message.

[0251] In one possible implementation, the mapping rule information includes at least one of the following: address information corresponding to the basic mapping rule BMR, address information corresponding to the forwarding mapping rule FMR, and address information corresponding to the default mapping rule DMR.

[0252] In one possible implementation, the address information corresponding to the BMR includes the Internet Protocol version 6 (IPv6) prefix, IPv6 prefix length, Internet Protocol version 4 (IPv4) prefix, IPv4 prefix length, EA bit length, and port set identifier (PSID) offset.

[0253] In one possible implementation, the address information corresponding to the FMR includes the Internet Protocol version 6 (IPv6) prefix, IPv6 prefix length, Internet Protocol version 4 (IPv4) prefix, IPv4 prefix length, EA bit length, and port set identifier (PSID) offset.

[0254] In one possible implementation, the address information corresponding to the DMR includes the Internet Protocol version 6 (IPv6) prefix corresponding to the DMR and the length of the IPv6 prefix.

[0255] In one possible implementation, the address information corresponding to the DMR includes the Internet Protocol version 6 (IPv6) address of the border relay (BR) device and the IPv6 address prefix length.

[0256] In one possible implementation, the device further includes:

[0257] The first sending module is used to send a second message to the second communication device. The second message carries information about a second mapping rule configured on the first communication device. The second mapping rule is used for address mapping between addresses in a first type of network and addresses in a second type of network. The information of the second mapping rule is used by the second communication device to obtain the second mapping rule.

[0258] In one possible implementation, the first type of network is an Internet Protocol version 4 (IPv4) network, and the second type of network is an Internet Protocol version 6 (IPv6) network; or, the first type of network is an Internet Protocol version 6 (IPv6) network, and the second type of network is an Internet Protocol version 4 (IPv4) network.

[0259] The first mapping rule is used for mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for mapping between the second IPv4 address and the second IPv6 address.

[0260] In one possible implementation, the first communication device is a MAP boundary relay (BR) device, and the second communication device is a broadband access server.

[0261] Alternatively, the first communication device is a broadband access server, and the second communication device is a MAP BR device;

[0262] Alternatively, the first communication device is the edge PE device of the first service provider, and the second communication device is the second PE device.

[0263] In one possible implementation, the device further includes:

[0264] The second receiving module is used to receive the third message, the source address of the third message is the first IPv6 address, and the destination address of the third message is the second IPv6 address.

[0265] The first mapping module is used to map the source address of the third packet from the first IPv6 address to the first IPv4 address based on the first mapping rule, and to map the destination address of the third packet from the second IPv6 address to the second IPv4 address based on the second mapping rule.

[0266] In one possible implementation, the device further includes:

[0267] The second acquisition module is used to acquire the fourth packet, the source address of the fourth packet is the second IPv4 address, and the destination address of the fourth packet is the first IPv4 address;

[0268] The second mapping module is used to map the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, and to map the destination address of the fourth packet from the first IPv4 address to the first IPv6 address based on the second mapping rule, so as to obtain the fifth packet;

[0269] The second sending module is used to send the fifth message.

[0270] In one possible implementation, the device further includes:

[0271] The storage module is used to store the first mapping rule as a routing table entry, which is used to transmit packets.

[0272] In one possible implementation, when the first communication device is a broadband access server, the apparatus further includes: a third sending module, configured to send a sixth message to the third communication device, so that the third communication device performs address mapping between addresses in a first type of network and addresses in a second type of network according to the first mapping rule; wherein the sixth message carries information of the first mapping rule, and the third communication device is a user edge CE device.

[0273] Figure 17 This is a schematic diagram of a device for obtaining mapping rules according to an embodiment of this application. The device is applied to a first communication device, which is the aforementioned... Figure 4 , Figure 12 , Figure 14 , Figure 15 The first communication device shown in any of the attached figures. Based on Figure 17 The following modules are shown. Figure 17 The apparatus for obtaining mapping rules shown is capable of performing all or part of the operations performed by the first communication device. It should be understood that the apparatus may include more additional modules than those shown, or may omit some of the modules shown; this application embodiment does not impose limitations in this regard. Figure 17 As shown, the device includes:

[0274] The first acquisition module 1701 is used to acquire information about the first mapping rule configured on the first communication device. The first mapping rule is used for address mapping between addresses in a first type of network and addresses in a second type of network.

[0275] The first sending module 1702 is used to send a first message to the second communication device. The first message carries information about a first mapping rule. The information about the first mapping rule is used by the second communication device to obtain the first mapping rule. The first communication device and the second communication device are located in a first type of network, which is different from the second type of network.

[0276] In one possible implementation, the first acquisition module 1701 is used to generate a mapping address and port MAP route based on the first mapping rule, and use the MAP route as information of the first mapping rule.

[0277] In one possible implementation, the device further includes:

[0278] The first receiving module is used to receive a second message sent by the second communication device. The second message carries information about a second mapping rule configured on the second communication device. The second mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network.

[0279] The second acquisition module is used to acquire the second mapping rule based on the information of the second mapping rule.

[0280] In one possible implementation, the first type of network is an Internet Protocol version 4 (IPv4) network, and the second type of network is an Internet Protocol version 6 (IPv6) network; or, the first type of network is an IPv6 network and the second type of network is an IPv4 network; a first mapping rule is used for mapping between a first IPv4 address and a first IPv6 address, and a second mapping rule is used for mapping between a second IPv4 address and a second IPv6 address.

[0281] In one possible implementation, the first communication device is a MAP boundary relay (BR) device, and the second communication device is a broadband access server.

[0282] Alternatively, the first communication device is a broadband access server, and the second communication device is a MAP BR device;

[0283] Alternatively, the first communication device is the edge PE device of the first service provider, and the second communication device is the second PE device.

[0284] In one possible implementation, the device further includes:

[0285] The third acquisition module is used to acquire the seventh packet. The source address of the seventh packet is the first IPv4 address, and the destination address of the seventh packet is the second IPv4 address.

[0286] The first mapping module is used to map the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, and to map the destination address of the seventh packet from the second IPv4 address to the second IPv6 address based on the second mapping rule, so as to obtain the third packet;

[0287] The second sending module is used to send the third message.

[0288] In one possible implementation, the device further includes:

[0289] The second receiving module is used to receive the fifth message, the source address of the fifth message is the second IPv6 address, and the destination address of the fifth message is the first IPv6 address;

[0290] The second mapping module is used to map the source address of the fifth packet from the second IPv6 address to the second IPv4 address based on the second mapping rule, and to map the destination address of the fifth packet from the first IPv6 address to the first IPv4 address based on the first mapping rule.

[0291] It should be understood that the above Figures 16-17The provided device, in implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.

[0292] The specific hardware structure of the communication device in the above embodiments is as follows: Figure 18 The communication device 1800 shown includes a transceiver 1801, a processor 1802, and a memory 1803. The transceiver 1801, processor 1802, and memory 1803 are connected via a bus 1804. The transceiver 1801 is used to receive and send messages, the memory 1803 is used to store instructions or program code, and the processor 1802 is used to call the instructions or program code in the memory 1803 to cause the communication device to execute the relevant processing steps of the communication device in the above method embodiments. In a specific embodiment, the communication device 1800 of this application embodiment can correspond to the first communication device in the above method embodiments. The processor 1802 in the communication device 1800 reads the instructions or program code in the memory 1803 to... Figure 18 The communication device 1800 shown is capable of performing all or part of the operations performed by the first communication device.

[0293] In a specific embodiment, the communication device 1800 of this application embodiment can correspond to the second communication device in the above-described method embodiments. The processor 1802 in the communication device 1800 reads instructions or program code from the memory 1803, causing... Figure 18 The communication device 1800 shown is capable of performing all or part of the operations performed by the second communication device.

[0294] Communication device 1800 can also correspond to the above. Figure 16 , Figure 17 The device shown, for example, Figure 16 The first receiving module 1601 involved is equivalent to transceiver 1801, and the first acquiring module 1602 is equivalent to processor 1802. For example, Figure 17 The first transmitting module 1702 involved is equivalent to transceiver 1801, and the first acquiring module 1701 is equivalent to processor 1502.

[0295] See Figure 19 , Figure 19 A schematic diagram of the structure of a communication device 2000 provided in an exemplary embodiment of this application is shown. Figure 19 The communication device 2000 shown is used to perform the above. Figure 4 , Figure 12 , Figure 14 , Figure 15 The operations involved in the method of obtaining mapping rules shown in any of the accompanying figures. The communication device 2000 is, for example, a switch, router, etc.

[0296] like Figure 19 As shown, the communication device 2000 includes at least one processor 2001, a memory 2003, and at least one communication interface 2004.

[0297] Processor 2001 may be, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solutions of this application. For example, processor 2001 includes application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A PLD may be, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in connection with the embodiments of this application. The processor may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0298] Optionally, the communication device 2000 also includes a bus. The bus is used to transmit information between the various components of the communication device 2000. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 19 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus. Figure 19 In addition to bus connection, the components of the communication equipment 2000 can also be connected in other ways. This application does not limit the connection method of each component.

[0299] Memory 2003 may be, for example, read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; electrically erasable programmable read-only memory (EEPROM); compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.); magnetic disk storage media or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 2003 may exist independently and be connected to processor 2001 via a bus. Memory 2003 may also be integrated with processor 2001.

[0300] The communication interface 2004 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), or Wireless Local Area Network (WLAN). The communication interface 2004 can include wired and wireless communication interfaces. Specifically, the communication interface 2004 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a WLAN interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In this embodiment, the communication interface 2004 can be used by the communication device 2000 to communicate with other devices.

[0301] In a specific implementation, as one example, the processor 2001 may include one or more CPUs, such as Figure 19 The CPU0 and CPU1 shown are examples of processors. Each of these processors can be a single-core processor or a multi-core processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).

[0302] In a specific implementation, as one example, the communication device 2000 may include multiple processors, such as... Figure 19 The processors shown are 2001 and 2005. Each of these processors can be a single-core processor or a multi-core processor. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0303] In a specific implementation, as one example, the communication device 2000 may further include an output device and an input device. The output device communicates with the processor 2001 and can display information in various ways. For example, the output device may be a liquid crystal display (LCD), a light-emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device communicates with the processor 2001 and can receive user input in various ways. For example, the input device may be a mouse, a keyboard, a touchscreen device, or a sensing device, etc.

[0304] In some embodiments, the memory 2003 stores program code 2010 for executing the solution of this application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. That is, the communication device 2000 can implement the method for obtaining mapping rules provided in the method embodiment through the processor 2001 and the program code 2010 in the memory 2003. The program code 2010 may include one or more software modules. Optionally, the processor 2001 itself may also store program code or instructions for executing the solution of this application.

[0305] In a specific embodiment, the communication device 2000 of this application embodiment can correspond to the first communication device in the above-described method embodiments. The processor 2001 in the communication device 2000 reads the program code 2010 in the memory 2003 or the program code or instructions stored in the processor 2001 itself, causing... Figure 19 The communication device 2000 shown is capable of performing all or part of the operations performed by the first communication device.

[0306] In a specific embodiment, the communication device 2000 of this application embodiment may correspond to the second communication device in the above-described method embodiments. The processor 2001 in the communication device 2000 reads the program code 2010 in the memory 2003 or the program code or instructions stored in the processor 2001 itself, causing... Figure 19 The communication device 2000 shown is capable of performing all or part of the operations performed by the second communication device.

[0307] Communication equipment 2000 can also correspond to the above. Figure 16 and Figure 17 The device shown, Figure 16 and Figure 17 Each functional module in the illustrated device is implemented using the software of the communication device 2000. In other words, Figure 16 and Figure 17The device shown includes functional modules generated by the processor 2001 of the communication device 2000 after reading program code 2010 stored in memory 2003. For example, Figure 16 The first receiving module 1601 involved is equivalent to the communication interface 2004, and the first acquiring module 1602 is equivalent to the processor 2001 and / or the processor 2005. For example, Figure 17 The first sending module 1702 involved is equivalent to the communication interface 2004, and the first acquiring module 1701 is equivalent to the processor 2001 and / or the processor 2005.

[0308] in, Figure 4 , Figure 12 , Figure 14 , Figure 15 Each step of the method for obtaining mapping rules shown is completed through integrated logic circuits in the hardware or software instructions in the processor of the communication device 2000. The steps of the method disclosed in the embodiments of this application can be directly implemented by the hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. Since the storage medium is located in memory, the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method; to avoid repetition, these will not be described in detail here.

[0309] See Figure 20 , Figure 20 A schematic diagram of the structure of a communication device 2100 provided in another exemplary embodiment of this application is shown. Figure 20 The communication device 2100 shown is used to perform the above. Figure 4 , Figure 12 , Figure 14 , Figure 15 The method for obtaining mapping rules shown includes all or part of the operations involved. The communication device 2100 is, for example, a switch, a router, etc., and can be implemented using a general bus architecture.

[0310] like Figure 20 As shown, the communication device 2100 includes a main control board 2110 and an interface board 2130.

[0311] The main control board, also known as the main processing unit (MPU) or route processor card, is used to control and manage the various components in the communication device 2100, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 2110 includes a central processing unit 2111 and a memory 2112.

[0312] Interface board 2130 is also called a line processing unit (LPU), linecard, or service board. Interface board 2130 provides various service interfaces and implements packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, etc., with Ethernet interfaces including, for example, Flexible Ethernet Clients (FlexE Clients). Interface board 2130 includes: a central processing unit 2131, a network processor 2132, a forwarding table entry memory 2134, and a physical interface card (PIC) 2133.

[0313] The central processing unit 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processing unit 2111 on the main control board 2110.

[0314] Network processor 2132 is used to process and transmit packets. Network processor 2132 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented using an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA). Specifically, network processor 2132 forwards received packets based on the forwarding table stored in forwarding table entry memory 2134. If the destination address of the packet is the address of communication device 2100, the packet is sent to the CPU (such as central processing unit 2131) for processing; if the destination address of the packet is not the address of communication device 2100, the next hop and outgoing interface corresponding to the destination address are looked up in the forwarding table according to the destination address, and the packet is forwarded to the outgoing interface corresponding to the destination address. Uplink packet processing may include: packet ingress interface processing, forwarding table lookup; downlink packet processing may include: forwarding table lookup, etc. In some embodiments, the central processing unit can also perform the functions of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for a forwarding chip on the interface board.

[0315] The physical interface card 2133 is used to implement physical layer interfacing functions. Raw traffic enters the interface board 2130 through this card, and processed packets are sent out from the physical interface card 2133. The physical interface card 2133, also called a daughter card, can be installed on the interface board 2130. It is responsible for converting photoelectric signals into packets, performing validity checks on the packets, and forwarding them to the network processor 2132 for processing. In some embodiments, the central processing unit 2131 can also perform the functions of the network processor 2132, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for the network processor 2132 in the physical interface card 2133.

[0316] Optionally, the communication device 2100 includes multiple interface boards. For example, the communication device 2100 also includes an interface board 2140, which includes a central processing unit 2141, a network processor 2142, a forwarding table entry memory 2144, and a physical interface card 2143. The functions and implementation methods of each component in the interface board 2140 are the same as or similar to those of the interface board 2130, and will not be described in detail here.

[0317] Optionally, the communication device 2100 also includes a switching fabric board 2120. The switching fabric board 2120 can also be referred to as a switch fabric unit (SFU). When the communication device has multiple interface boards, the switching fabric board 2120 is used to complete data exchange between the interface boards. For example, interface boards 2130 and 2140 can communicate through the switching fabric board 2120.

[0318] The main control board 2110 and the interface boards are coupled. For example, the main control board 2110, interface boards 2130 and 2140, and the switching network board 2120 communicate with each other via a system bus connected to the system backplane. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 2110 and interface boards 2130 and 2140, and communication between the main control board 2110 and interface boards 2130 and 2140 is achieved through the IPC channel.

[0319] Logically, the communication device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processing unit 2111, while the forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 2134, a physical interface card 2133, and a network processor 2132. The control plane performs functions such as router operation, generating forwarding tables, processing signaling and protocol messages, and configuring and maintaining the status of the communication device. The control plane distributes the generated forwarding table to the forwarding plane. In the forwarding plane, the network processor 2132 forwards messages received by the physical interface card 2133 based on the forwarding table distributed by the control plane. The forwarding table distributed by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same communication device.

[0320] It's worth noting that there may be one or more main control boards, including a primary and a backup main control board. There may also be one or more interface boards; the stronger the data processing capability of the communication equipment, the more interface boards it provides. Each interface board may also have one or more physical interface cards. There may be no switching network board, or one or more; multiple boards can share the load and provide redundancy. In a centralized forwarding architecture, the communication equipment may not need a switching network board, as the interface boards handle the entire system's business data processing. In a distributed forwarding architecture, the communication equipment can have at least one switching network board, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a distributed architecture communication device are greater than those of a centralized architecture communication device. Alternatively, the communication equipment can also be a single board, without a switching network board. The functions of the interface board and the main control board are integrated on this one board. In this case, the central processing unit (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU to perform the combined functions. This type of communication equipment has lower data exchange and processing capabilities (e.g., low-end switches or routers). The specific architecture adopted depends on the specific network deployment scenario, and no restrictions are imposed here.

[0321] In a specific embodiment, the communication device 2100 corresponds to the above. Figure 16 The apparatus shown is for obtaining mapping rules applied to a second communication device. In some embodiments, Figure 16 The first receiving module 1601 shown is equivalent to the physical interface card 2133 or physical interface card 2143 in the communication device 2100. Figure 16 The first acquisition module 1602 shown corresponds to at least one of the central processing unit 2111, network processor 2132 and network processor 2142 in the communication device 2100.

[0322] In some embodiments, the communication device 2100 also corresponds to the above. Figure 17 The apparatus shown is for obtaining mapping rules applied to a first communication device. In some embodiments, Figure 17 The first transmitting module 1702 shown is equivalent to the physical interface card 2133 or physical interface card 2143 in the communication device 2100. Figure 17 The first acquisition module 1701 shown corresponds to at least one of the central processing unit 2111, network processor 2132, and network processor 2142 in the communication device 2100. Here, "at least one of the central processing unit 2111, network processor 2132, and network processor 2142" refers to any one of the central processing unit 2111, network processor 2132, and network processor 2142, or multiple of them forming any combination.

[0323] Based on the above Figure 18 , Figure 19 and Figure 20 The communication device shown in this application embodiment also provides a communication system, which includes a first communication device and a second communication device. Optionally, the first communication device is... Figure 18 The communication device 1500 shown or Figure 19 The communication device shown is 2000 or Figure 20 The communication device 2100 shown, the second communication device is Figure 18 The communication device 1500 shown or Figure 19 The communication device shown is 2000 or Figure 20 The communication device 2100 shown.

[0324] The methods performed by the first and second communication devices are described above. Figure 4 , Figure 12 , Figure 14 , Figure 15 The description of the method embodiment for obtaining mapping rules shown is not repeated here.

[0325] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting the Advanced Reduced Instruction Set Computing (RISC) machine (ARM) architecture.

[0326] Furthermore, in an alternative embodiment, the memory described above may include read-only memory and random access memory, and provide instructions and data to the processor. The memory may also include non-volatile random access memory. For example, the memory may also store device type information.

[0327] The memory can be volatile or non-volatile, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0328] A computer-readable storage medium is also provided, which stores at least one program instruction or code, which, when loaded and executed by a processor, enables the computer to perform the above-described functions. Figure 4 , Figure 12 , Figure 14 , Figure 15 Any of the methods shown for obtaining mapping rules.

[0329] This application provides a computer program that, when executed by a computer, causes a processor or computer to perform the corresponding steps and / or processes in the above method embodiments.

[0330] A chip is provided, including a processor for retrieving and executing instructions stored in a memory, causing a communication device on which the chip is mounted to perform the methods described above.

[0331] Another chip is provided, comprising: an input interface, an output interface, a processor, and a memory, wherein the input interface, the output interface, the processor, and the memory are connected via an internal connection path, and the processor is used to execute code in the memory, wherein when the code is executed, the processor is used to perform the methods described above.

[0332] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).

[0333] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above description is only a specific embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this application should be included within the scope of protection of this application.

[0334] Those skilled in the art will recognize that the method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. To clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0335] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0336] When implemented using software, it can be implemented wholly or partially as a computer program product. This computer program product includes one or more computer program instructions. As an example, the methods of this application embodiment can be described in the context of machine-executable instructions, such as program modules that execute on a device on a real or virtual processor of the target. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functionality of program modules can be combined or divided among the described program modules. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside on both local and remote storage media.

[0337] Computer program code used to implement the methods of the embodiments of this application may be written in one or more programming languages. This computer program code may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the computer or other programmable data processing apparatus, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a computer, partially on a computer, as a standalone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.

[0338] In the context of the embodiments of this application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, etc.

[0339] Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.

[0340] A machine-readable medium can be any tangible medium that contains or stores programs for or relating to an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. More detailed examples of machine-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0341] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be found in the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0342] In the embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or modules, or they may be electrical, mechanical, or other forms of connection.

[0343] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0344] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0345] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0346] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items with substantially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or execution order. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another. For example, without departing from the scope of the various examples described, a first edge network device can be referred to as a second edge network device, and similarly, a second edge network device can be referred to as a first edge network device. Both the first edge network and the second edge network device can be edge network devices, and in some cases, they can be separate and distinct edge network devices.

[0347] It should also be understood that, in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0348] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple second messages refer to two or more second messages. The terms "system" and "network" are often used interchangeably in this document.

[0349] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0350] It should also be understood that the term “comprising” (also referred to as “includes”, “including”, “comprises” and / or “comprising”) as used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0351] It should also be understood that the terms “if” and “if” can be interpreted as meaning “when” or “upon”, or “in response to determination” or “in response to detection”. Similarly, depending on the context, the phrases “if determination…” or “if detection [the stated condition or event]” can be interpreted as meaning “when determination…”, or “in response to determination…”, or “when detection [the stated condition or event]” or “in response to detection [the stated condition or event]”.

[0352] It should be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.

[0353] It should also be understood that the phrases "an embodiment," "an embodiment," and "a possible implementation" used throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment or implementation is included in at least one embodiment of this application. Therefore, the phrases "in an embodiment," "an embodiment," or "a possible implementation" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

Claims

1. A method for obtaining mapping rules, characterized in that, The method includes: The first communication device sends a Border Gateway Protocol Open (BGP Open) message carrying the first mapped address and port MAP address cluster to the second communication device. The first communication device receives a BGP Open message carrying a second MAP address cluster sent by the second communication device to establish a MAP neighbor relationship; The first communication device receives a first message sent by the second communication device. The first communication device and the second communication device are located in a first type of network. The first message carries information about a first mapping rule configured on the second communication device. The information about the first mapping rule is a MAP route generated based on the first mapping rule. The first mapping rule realizes the address mapping between addresses in the first type of network and addresses in the second type of network through MAP. The first type of network is different from the second type of network. The first communication device obtains the first mapping rule based on the information of the first mapping rule.

2. The method according to claim 1, characterized in that, The first message also includes attribute information, which includes MAP field type and MAP field identifier.

3. The method according to claim 2, characterized in that, The attribute information also includes the route identifier and the route target.

4. The method according to claim 2, characterized in that, The information of the first mapping rule and the attribute information are both carried in the Network Layer Reachability Information (NLRI) field of the first message.

5. The method according to claim 2, characterized in that, The information of the first mapping rule is carried in the NLRI field of the first message, and the attribute information is carried in the extended attribute field of the first message.

6. The method according to any one of claims 1-5, characterized in that, The information of the first mapping rule includes at least one of the following: address information corresponding to the basic mapping rule BMR, address information corresponding to the forwarding mapping rule FMR, and address information corresponding to the default mapping rule DMR.

7. The method according to claim 6, characterized in that, The address information corresponding to the BMR includes the Internet Protocol version 6 (IPv6) prefix, IPv6 prefix length, Internet Protocol version 4 (IPv4) prefix, IPv4 prefix length, EA bit length, and port set identifier (PSID) offset.

8. The method according to claim 6, characterized in that, The address information corresponding to the FMR includes the IPv6 prefix, IPv6 prefix length, IPv4 prefix, IPv4 prefix length, EA bit length, and port set identifier PSID offset.

9. The method according to claim 6, characterized in that, The address information corresponding to the DMR includes the IPv6 prefix corresponding to the DMR and the length of the IPv6 prefix.

10. The method according to claim 6, characterized in that, The address information corresponding to the DMR includes the IPv6 address of the border relay (BR) device and the length of the IPv6 address prefix.

11. The method according to any one of claims 1-5, characterized in that, The method further includes: The first communication device sends a second message to the second communication device. The second message carries information about a second mapping rule configured on the first communication device. The second mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network. The information of the second mapping rule is used by the second communication device to obtain the second mapping rule.

12. The method according to any one of claims 1-5, characterized in that, The first type of network is an IPv4 network, and the second type of network is an IPv6 network, or the first type of network is an IPv6 network and the second type of network is an IPv4 network; The first mapping rule is used for mapping between a first IPv4 address and a first IPv6 address, and the second mapping rule configured on the first communication device is used for mapping between a second IPv4 address and a second IPv6 address.

13. The method according to any one of claims 1-5, characterized in that, The first communication device is a MAP BR device, and the second communication device is a broadband access server; Alternatively, the first communication device may be a broadband access server, and the second communication device may be a MAP BR device; Alternatively, the first communication device may be a first service provider edge PE device, and the second communication device may be a second PE device.

14. The method according to any one of claims 1-5, characterized in that, After the first communication device obtains the first mapping rule based on the information of the first mapping rule, it further includes: The first communication device receives a third message, the source address of which is a first IPv6 address and the destination address of which is a second IPv6 address; The first communication device maps the source address of the third packet from the first IPv6 address to the first IPv4 address based on the first mapping rule, and maps the destination address of the third packet from the second IPv6 address to the second IPv4 address based on the second mapping rule.

15. The method according to any one of claims 1-5, characterized in that, After the first communication device obtains the first mapping rule based on the information of the first mapping rule, it further includes: The first communication device acquires a fourth message, the source address of which is a second IPv4 address and the destination address of which is a first IPv4 address; The first communication device maps the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, and maps the destination address of the fourth packet from the first IPv4 address to the first IPv6 address based on the second mapping rule, thus obtaining the fifth packet; The first communication device sends the fifth message.

16. The method according to any one of claims 1-5, characterized in that, When the first communication device is a broadband access server, after the first communication device obtains the first mapping rule based on the information of the first mapping rule, it further includes: The first communication device sends a sixth message to the third communication device, so that the third communication device performs address mapping between the address in the first type of network and the address in the second type of network according to the first mapping rule; The sixth message carries information about the first mapping rule, and the third communication device is a user edge CE device.

17. The method according to any one of claims 1-5, characterized in that, After the first communication device obtains the first mapping rule based on the information of the first mapping rule, it further includes: The first communication device stores the first mapping rule as a routing table entry, and the routing table entry is used to transmit packets.

18. A method for obtaining mapping rules, characterized in that, The method includes: The first communication device sends a Border Gateway Protocol Open (BGP Open) message carrying the first mapped address and port MAP address cluster to the second communication device; The first communication device receives a BGP Open message carrying a second MAP address cluster sent by the second communication device to establish a MAP neighbor relationship; The first communication device obtains information about the first mapping rule configured on the first communication device. The first mapping rule realizes the address mapping between addresses in the first type of network and addresses in the second type of network through MAP. The first communication device sends a first message to the second communication device. The first message carries information about the first mapping rule. The information about the first mapping rule is a MAP route generated based on the first mapping rule. The information about the first mapping rule is used by the second communication device to obtain the first mapping rule. The first communication device and the second communication device are located in a network of the first type. The network of the first type is different from the network of the second type.

19. The method according to claim 18, characterized in that, The first communication device obtains information about the first mapping rule configured on the first communication device, including: The first communication device generates a MAP route based on the first mapping rule and uses the MAP route as information of the first mapping rule.

20. The method according to claim 18 or 19, characterized in that, The method further includes: The first communication device receives a second message sent by the second communication device. The second message carries information about a second mapping rule configured on the second communication device. The second mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network. The first communication device obtains the second mapping rule based on the information of the second mapping rule.

21. The method according to claim 20, characterized in that, The first type of network is an Internet Protocol version 4 (IPv4) network, and the second type of network is an Internet Protocol version 6 (IPv6) network, or the first type of network is an IPv6 network and the second type of network is an IPv4 network; the first mapping rule is used for mapping between a first IPv4 address and a first IPv6 address, and the second mapping rule is used for mapping between a second IPv4 address and a second IPv6 address.

22. The method according to claim 18 or 19, characterized in that, The first communication device is a MAP boundary relay (BR) device, and the second communication device is a broadband access server; Alternatively, the first communication device may be a broadband access server, and the second communication device may be a MAP BR device; Alternatively, the first communication device may be a first service provider edge PE device, and the second communication device may be a second PE device.

23. The method according to claim 20, characterized in that, After the first communication device obtains the second mapping rule based on the information of the second mapping rule, it further includes: The first communication device acquires a seventh message, the source address of which is a first IPv4 address and the destination address of which is a second IPv4 address; The first communication device maps the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, and maps the destination address of the seventh packet from the second IPv4 address to the second IPv6 address based on the second mapping rule, thus obtaining the third packet; The first communication device sends the third message.

24. The method according to claim 20, characterized in that, After the first communication device obtains the second mapping rule based on the information of the second mapping rule, it further includes: The first communication device receives a fifth message, the source address of which is a second IPv6 address and the destination address of which is a first IPv6 address; The first communication device maps the source address of the fifth packet from the second IPv6 address to the second IPv4 address based on the second mapping rule, and maps the destination address of the fifth packet from the first IPv6 address to the first IPv4 address based on the first mapping rule.

25. An apparatus for obtaining mapping rules, characterized in that, The device is applied to a first communication device and includes: The module is used to send a Border Gateway Protocol Open (BGP) message carrying a first mapped address and a port MAP address cluster to the second communication device; and to receive a BGP Open message carrying a second MAP address cluster sent by the second communication device to establish a MAP neighbor relationship. A first receiving module is configured to receive a first message sent by a second communication device. The first and second communication devices are located in a first type of network. The first message carries information about a first mapping rule configured on the second communication device. The information about the first mapping rule is a MAP route generated based on the first mapping rule. The first mapping rule realizes the address mapping between addresses in the first type of network and addresses in the second type of network through MAP. The first type of network is different from the second type of network. The first acquisition module is used to acquire the first mapping rule based on the information of the first mapping rule.

26. The apparatus according to claim 25, characterized in that, The device further includes: The first sending module is configured to send a second message to the second communication device. The second message carries information about a second mapping rule configured on the first communication device. The second mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network. The information of the second mapping rule is used by the second communication device to obtain the second mapping rule.

27. The apparatus according to claim 25 or 26, characterized in that, The device further includes: The second receiving module is used to receive a third message, wherein the source address of the third message is the first IPv6 address and the destination address of the third message is the second IPv6 address. The first mapping module is used to map the source address of the third packet from the first IPv6 address to the first IPv4 address based on the first mapping rule, and to map the destination address of the third packet from the second IPv6 address to the second IPv4 address based on the second mapping rule.

28. The apparatus according to claim 25 or 26, characterized in that, The device further includes: The second acquisition module is used to acquire the fourth packet, wherein the source address of the fourth packet is the second IPv4 address and the destination address of the fourth packet is the first IPv4 address; The second mapping module is used to map the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, and to map the destination address of the fourth packet from the first IPv4 address to the first IPv6 address based on the second mapping rule, so as to obtain the fifth packet; The second sending module is used to send the fifth message.

29. An apparatus for obtaining mapping rules, characterized in that, The device is applied to a first communication device, and the device includes: The module is used to send a Border Gateway Protocol Open (BGP) message carrying a first mapped address and a port MAP address cluster to the second communication device; and to receive a BGP Open message carrying a second MAP address cluster sent by the second communication device to establish a MAP neighbor relationship. The first acquisition module is used to acquire information about the first mapping rule configured on the first communication device. The first mapping rule realizes the address mapping between addresses in a first type of network and addresses in a second type of network through MAP. A first sending module is configured to send a first message to a second communication device. The first message carries information about the first mapping rule. The information about the first mapping rule is a MAP route generated based on the first mapping rule. The information about the first mapping rule is used by the second communication device to obtain the first mapping rule. The first communication device and the second communication device are located in a network of the first type. The network of the first type is different from the network of the second type.

30. The apparatus according to claim 29, characterized in that, The device further includes: The first receiving module is configured to receive a second message sent by the second communication device. The second message carries information about a second mapping rule configured on the second communication device. The second mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network. The second acquisition module is used to acquire the second mapping rule based on the information of the second mapping rule.

31. The apparatus according to claim 29 or 30, characterized in that, The device further includes: The third acquisition module is used to acquire the seventh message, wherein the source address of the seventh message is the first IPv4 address and the destination address of the seventh message is the second IPv4 address; The first mapping module is used to map the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, and to map the destination address of the seventh packet from the second IPv4 address to the second IPv6 address based on the second mapping rule, so as to obtain the third packet; The second sending module is used to send the third message.

32. The apparatus according to claim 29 or 30, characterized in that, The device further includes: The second receiving module is used to receive the fifth message, wherein the source address of the fifth message is the second IPv6 address and the destination address of the fifth message is the first IPv6 address; The second mapping module is used to map the source address of the fifth packet from the second IPv6 address to the second IPv4 address based on the second mapping rule, and to map the destination address of the fifth packet from the first IPv6 address to the first IPv4 address based on the first mapping rule.

33. A communication device, characterized in that, The communication device includes a processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the communication device to implement the method for obtaining mapping rules as described in any one of claims 1-24.

34. A system for obtaining mapping rules, characterized in that, The system includes a first communication device and a second communication device. The first communication device is used to execute the method for obtaining mapping rules as described in any one of claims 1-17, and the second communication device is used to execute the method for obtaining mapping rules as described in any one of claims 18-24.

35. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one program instruction or code, which, when loaded and executed by a processor, enables the computer to implement the method for obtaining mapping rules as described in any one of claims 1-24.

Citation Information

Patent Citations

  • LISP (Locator / Identity Separation Protocol) networking dual-homing realization method and device

    CN106130907A