CN114513485A - Method, device, equipment and system for obtaining mapping rule and readable storage medium - Google Patents

Method, device, equipment and system for obtaining mapping rule and readable storage medium Download PDF

Info

Publication number
CN114513485A
CN114513485A CN202011282640.8A CN202011282640A CN114513485A CN 114513485 A CN114513485 A CN 114513485A CN 202011282640 A CN202011282640 A CN 202011282640A CN 114513485 A CN114513485 A CN 114513485A
Authority
CN
China
Prior art keywords
address
communication device
mapping rule
network
mapping
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011282640.8A
Other languages
Chinese (zh)
Inventor
邢飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011282640.8A priority Critical patent/CN114513485A/en
Publication of CN114513485A publication Critical patent/CN114513485A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a method, a device, equipment and a system for obtaining a mapping rule and a readable storage medium, and belongs to the technical field of communication. Taking the example that the first communication device acquires the mapping rule, the method includes: a first communication device receives a first message sent by a 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 of a first mapping rule configured on the second communication device, the first mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network, and the first type of network is different from the second type of network; the first communication device acquires the first mapping rule according to the information of the first mapping rule. The first communication device can reduce the configuration and maintenance workload of the mapping rule by dynamically learning the first mapping rule on the second communication device, thereby improving the efficiency of obtaining the mapping rule and reducing the maintenance cost.

Description

Method, device, equipment and system for acquiring mapping rule and readable storage medium
Technical Field
The present disclosure relates to the field of communications, and in particular, to a method, an apparatus, a device, a system, and a readable storage medium for obtaining a mapping rule.
Background
With the development of communication technology, internet protocol version 4 (IPv 4) networks gradually transit to internet protocol version 6 (IPv 6) networks, and in the case where IPv6 networks are deployed in large quantities, the IPv4 network is a local network isolated by the IPv6 network. In order to ensure the operation of the IPv4 service and the development of the continuously updated IPv6 service, the scenes from IPv4 to IPv6 are the research focus of the long term evolution technical scheme. The mapping between the IPv4 address and the IPv6 address becomes an effective solution, and because stateless mapping and a dual translation technology (MAP-T)/stateless mapping and a dual encapsulation technology (MAP-E) combine stateless and dual translation/encapsulation, there are great advantages in technical performance, reliability, and deployment cost of the client, so the MAP-T/MAP-E becomes a mapping rule with a high attention.
In the related art, when the mapping rule is obtained, the mapping rules of both communication parties need to be manually deployed on the communication equipment, so that the configuration time is long, the efficiency of obtaining the mapping rule is low, and the maintenance cost is high.
Disclosure of Invention
The application provides a method, a device, equipment and a system for obtaining a mapping rule and a readable storage medium, which are used for solving the problems of low efficiency and high maintenance cost of obtaining the mapping rule.
In a first aspect, a method for obtaining a mapping rule is provided, where the method includes: a first communication device receives a first message sent by a 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 of a first mapping rule configured on the second communication device, the first mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network, and the first type of network is different from the second type of network; the first communication device acquires the first mapping rule according to the information of the first mapping rule.
The second communication equipment sends the information of the first mapping rule configured by the local terminal to the first communication equipment, and the first communication equipment acquires the first mapping rule on the remote second communication equipment through dynamic learning and is used for address mapping between the address in the first type of network and the address in the second type of network, so that the equipment at two ends can be ensured to adopt the same mapping rule to carry out address mapping; the configuration and maintenance workload of the mapping rules can be reduced, the efficiency of obtaining the mapping rules is improved, and the maintenance cost is reduced.
In one possible implementation, the information of the first mapping rule is a MAP route generated based on the first mapping rule.
The first communication device acquires the first mapping rule according to the information of the first mapping rule, and the method comprises the following steps: the first communication device generates a first mapping rule according to the MAP route. Therefore, the second communication device carries the information of the first mapping rule in the first message in a routing mode and transmits the first message to the first communication device. Furthermore, the information of the first mapping rule in the form of a route may be carried in the first message in TLV format.
In a possible implementation manner, before the first communication device receives the first packet sent by the second communication device, the method further includes: the first communication device establishes a MAP neighbor relationship with the second communication device.
In one possible implementation manner, the establishing, by the first communication device, a MAP neighbor relationship with the second communication device includes: the first communication equipment sends a message carrying the first MAP address cluster to the second communication equipment; and the first communication equipment receives a message which is sent by the second communication equipment and carries the second MAP address cluster.
In a possible implementation manner, the first packet further includes attribute information, where the attribute information includes a mapping address, a port MAP domain type, and a MAP domain identifier.
In one possible implementation, the attribute information further includes a route identifier and a route target. For example, the route identifier is a VPN route identifier that identifies a different VPN. The route target is a VPN route target and is used for controlling the release of VPN route information.
In a possible implementation manner, the information of the first mapping rule and the attribute information are both carried in a field of network layer reachability information NLRI of the first packet.
In a possible implementation manner, the information of the first mapping rule is carried in a field of network layer reachability information of the first packet, and the attribute information is carried in an extended attribute field of the first packet. The information and the attribute information of the first mapping rule can be carried in the same field or different fields, and the carrying mode is more flexible.
In a possible implementation manner, the information of the first mapping rule includes at least one of 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.
In a possible implementation manner, the address information corresponding to the BMR includes an internet protocol version 6 IPv6 prefix, an IPv6 prefix length, an internet protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a PSID offset corresponding to the BMR.
In a possible implementation manner, the address information corresponding to the FMR includes an internet protocol version 6 IPv6 prefix, an IPv6 prefix length, an internet protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a PSID offset corresponding to the FMR.
In a possible implementation manner, the address information corresponding to the DMR includes an internet protocol version 6 IPv6 prefix and an IPv6 prefix length corresponding to the DMR.
In a possible implementation manner, the address information corresponding to the DMR includes an address of an internet protocol version 6 IPv6 corresponding to the border relay BR device and an IPv6 address prefix length.
In one possible implementation, the method further includes: the first communication device sends a second message to the second communication device, the second message carries information of a second mapping rule configured on the first communication device, the second mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network, and the information of the second mapping rule is used for 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 enables the second communication device to learn the second mapping rule on the first communication device by sending information of the second mapping rule configured on the first communication device to the second communication device.
In a possible implementation manner, 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.
In one possible implementation manner, 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 provider edge PE device, and the second communication device is a second PE device.
In a possible implementation manner, after the first communication device obtains the first mapping rule according to the information of the first mapping rule, the method further includes: the first communication equipment receives 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 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. In the process of transmitting the message, the message can be transmitted to another IPv4 network after traversing the IPv6 network from one IPv4 network through address mapping, so that the operation of the IPv4 service is ensured.
In a possible implementation manner, after the first communication device obtains the first mapping rule according to the information of the first mapping rule, the method further includes: the first communication equipment acquires 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 equipment maps the source address of the fourth message into a second IPv6 address from a second IPv4 address based on the first mapping rule, and maps the destination address of the fourth message into a first IPv6 address from a first IPv4 address based on the second mapping rule to obtain a fifth message; and the first communication equipment sends a fifth message.
In a possible implementation manner, after the first communication device obtains the first mapping rule according to the information of the first mapping rule, the method further includes: the first communication device stores the first mapping rule as a routing table entry, and the routing table entry is used for transmitting the message.
In a possible implementation manner, when the first communication device is a broadband access server, after the first communication device obtains the first mapping rule according to information of the first mapping rule, the method further includes: the first communication equipment sends a sixth message to the third communication equipment, so that the third communication equipment executes 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 of the first mapping rule, and the third communication device is a customer edge CE device.
In a second aspect, a method for obtaining a mapping rule is provided, and the method includes: the method comprises the steps that first communication equipment obtains information of a first mapping rule configured on the first communication equipment, wherein the first mapping rule is used for address mapping between an address in a first type of network and an address in a second type of network; the first communication equipment sends a first message to the second communication equipment, the first message carries information of a first mapping rule, the information of the first mapping rule is used for the second communication equipment to obtain the first mapping rule, the first communication equipment and the second communication equipment are located in a first type of network, and the first type of network is different from a second type of network.
The first communication equipment sends the information of the first mapping rule configured on the first communication equipment to the second communication equipment, so that the second communication equipment can dynamically learn the first mapping rule on the first communication equipment without manual configuration, the configuration and maintenance workload of the mapping rule can be reduced, the efficiency of acquiring the mapping rule can be improved, and the maintenance cost can be reduced.
In a possible implementation manner, the obtaining, by the first communication device, information of the first mapping rule configured on the first communication device includes: the first communication device generates a mapping address and a port MAP route based on the first mapping rule, with the MAP route as information of the first mapping rule. Therefore, the first communication device carries the information of the first mapping rule in the first message in a routing mode and transmits the information to the second communication device. Furthermore, the information of the first mapping rule in the form of a route may be carried in the first message in TLV format.
In one possible implementation, the method further comprises: the first communication equipment receives a second message sent by second communication equipment, wherein the second message carries information of a second mapping rule configured on the second communication equipment, and the second mapping rule is used for address mapping between an address in a first type of network and an address in a second type of network; the first communication device generates a second mapping rule according to the information of the second mapping rule.
In addition to having the second communication device learn the first mapping rule configured on the first communication device, the second communication device enables the first communication device to learn the second mapping rule on the second communication device by transmitting information of the second mapping rule configured on the second communication device to the first communication device.
In a possible implementation manner, 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; 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.
In one possible implementation manner, 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 provider edge PE device, and the second communication device is a second PE device.
In a possible implementation manner, after the first communication device generates the second mapping rule according to the information of the second mapping rule, the method further includes: the first communication equipment acquires 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 equipment maps the source address of the seventh message into a first IPv6 address from a first IPv4 address based on the first mapping rule, and maps the destination address of the seventh message into a second IPv6 address from a second IPv4 address based on the second mapping rule to obtain a third message; and the first communication equipment sends the third message.
In a possible implementation manner, after the first communication device generates the second mapping rule according to the information of the second mapping rule, the method further includes: the first communication equipment receives 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.
In a third aspect, an apparatus for obtaining a mapping rule is provided, and the apparatus is applied to a first communication device, and includes:
the first receiving module is used for receiving a first message sent by second communication equipment, the first communication equipment and the second communication equipment are positioned in a first type of network, the first message carries information of a first mapping rule configured on the second communication equipment, the first mapping rule is used for address mapping between an address in the first type of network and an address in a second type of network, and the first type of network is different from the second type of network;
and the first obtaining module is used for obtaining the first mapping rule according to the information of the first mapping rule.
In one possible implementation, the information of the first mapping rule is a mapping address and a port MAP route generated based on the first mapping rule.
In one possible implementation manner, the apparatus further includes:
and the establishing module is used for establishing the MAP neighbor relation with the second communication equipment.
In a possible implementation manner, the establishing module is configured to send a message carrying the first MAP address cluster to the second communication device; and receiving a message which is sent by the second communication equipment and carries the second MAP address cluster.
In a possible implementation manner, the first packet further includes attribute information, where the attribute information includes a mapping address, a port MAP domain type, and a MAP domain identifier.
In one possible implementation, the attribute information further includes a route identifier and a route target.
In a possible implementation manner, the information of the first mapping rule and the attribute information are both carried in a field of network layer reachability information NLRI of the first packet.
In a possible implementation manner, the information of the first mapping rule is carried in a field of network layer reachability information of the first packet, and the attribute information is carried in an extended attribute field of the first packet.
In a possible implementation manner, the information of the mapping rule includes at least one of 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.
In a possible implementation manner, the address information corresponding to the BMR includes an internet protocol version 6 IPv6 prefix, an IPv6 prefix length, an internet protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a port set identification PSID offset corresponding to the BMR.
In a possible implementation manner, the address information corresponding to the FMR includes an internet protocol version 6 IPv6 prefix, an IPv6 prefix length, an internet protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a port set identification PSID offset corresponding to the FMR.
In a possible implementation manner, the address information corresponding to the DMR includes an internet protocol version 6 IPv6 prefix and an IPv6 prefix length corresponding to the DMR.
In one possible implementation manner, the address information corresponding to the DMR includes an address of an internet protocol version 6 IPv6 corresponding to the border relay BR device and an IPv6 address prefix length.
In one possible implementation, the apparatus further includes:
the first sending module is configured to send a second packet to the second communication device, where the second packet carries information of a second mapping rule configured on the first communication device, the second mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network, and the information of the second mapping rule is used for the second communication device to obtain the second mapping rule.
In a possible implementation manner, 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;
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.
In one possible implementation manner, 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 provider edge PE device, and the second communication device is a second PE device.
In one possible implementation manner, the apparatus further includes:
the second receiving module is used for 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 mapping module is used for mapping the source address of the third message into a first IPv4 address from a first IPv6 address based on the first mapping rule, and mapping the destination address of the third message into a second IPv4 address from a second IPv6 address based on the second mapping rule.
In one possible implementation manner, the apparatus further includes:
the second obtaining module is used for 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 second mapping module is used for mapping the source address of the fourth message into a second IPv6 address from a second IPv4 address based on the first mapping rule, and mapping the destination address of the fourth message into a first IPv6 address from a first IPv4 address based on the second mapping rule to obtain a fifth message;
and the second sending module is used for sending the fifth message.
In one possible implementation manner, the apparatus further includes:
and the storage module is used for storing the first mapping rule as a routing table entry, and the routing table entry is used for transmitting the message.
In a possible implementation manner, when the first communication device is a broadband access server, the apparatus further includes: a third sending module, configured to send a sixth packet to a third communication device, so that the third communication device performs address mapping between an address in the first type of network and an address in the second type of network according to the first mapping rule; the sixth message carries information of the first mapping rule, and the third communication device is a customer edge CE device.
In a fourth aspect, an apparatus for obtaining a mapping rule is provided, and the apparatus includes:
a first obtaining module, configured to obtain information of a first mapping rule configured on a first communication device, where the first mapping rule is used for address mapping between an address in a first type of network and an address in a second type of network;
the first sending module is used for sending a first message to the second communication device, the first message carries information of a first mapping rule, the information of the first mapping rule is used for 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, and the first type of network is different from a second type of network.
In a possible implementation manner, the first obtaining module is configured to generate a mapping address and a port MAP route based on a first mapping rule, and use the MAP route as information of the first mapping rule.
In one possible implementation, the apparatus further includes:
the first receiving module is used for receiving a second message sent by the second communication device, wherein the second message carries information of a second mapping rule configured on the second communication device, and the second mapping rule is used for address mapping between an address in a first type of network and an address in a second type of network;
and the second obtaining module is used for obtaining the second mapping rule according to the information of the second mapping rule.
In a possible implementation manner, 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; 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.
In one possible implementation manner, 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 provider edge PE device, and the second communication device is a second PE device.
In one possible implementation, the apparatus further includes:
a third obtaining module, configured to obtain a seventh packet, where a source address of the seventh packet is a first IPv4 address, and a destination address of the seventh packet is a second IPv4 address;
the first mapping module is used for mapping the source address of the seventh message into a first IPv6 address from a first IPv4 address based on a first mapping rule, and mapping the destination address of the seventh message into a second IPv6 address from a second IPv4 address based on a second mapping rule to obtain a third message;
and the second sending module is used for sending the third message.
In one possible implementation manner, the apparatus further includes:
the second receiving module is used for 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;
and the second mapping module is used for mapping the source address of the fifth message into a second IPv4 address from the second IPv6 address based on the second mapping rule, and mapping the destination address of the fifth message into a first IPv4 address from the first IPv6 address based on the first mapping rule.
In a fifth aspect, a communication device is provided, which includes a processor coupled to a memory, where at least one program instruction or code is stored, and the at least one program instruction or code is loaded and executed by the processor, so as to enable the communication device to implement the method for obtaining a mapping rule according to any one of the first aspect or the second aspect.
In a sixth aspect, a computer-readable storage medium is provided, in which at least one program instruction or code is stored, which is loaded and executed by a processor to cause a computer to implement the method for obtaining mapping rules according to any one of the first or second aspects.
In a seventh aspect, a system for obtaining a mapping rule is provided, where the system includes a first communication device and a second communication device, the first communication device is configured to execute the method for obtaining a mapping rule according to any possible implementation manner of the second aspect or the second aspect, and the second communication device is configured to execute the method for obtaining a mapping rule according to any possible implementation manner of the first aspect or the first aspect.
There is also provided another communication device, including: a transceiver, a memory, and a processor. Wherein the transceiver, the memory and the processor communicate with each other via an internal connection path, the memory is configured to store instructions, and the processor is configured to execute the instructions stored by the memory to control the transceiver to receive signals and control the transceiver to transmit signals, and when the processor executes the instructions stored by the memory, to cause the processor to perform the method of the first aspect or any of the possible embodiments of the first aspect, or to perform the method of the second aspect or any of the possible embodiments of the second aspect.
In an exemplary embodiment, the processor is one or more, and the memory is one or more.
As an example embodiment, the memory may be integrated with the processor or provided separately from the processor.
In a specific implementation process, the memory may be a non-transient memory, such as a Read Only Memory (ROM), which may be integrated on the same chip as the processor, or may be separately disposed on different chips.
There is provided a computer program (product) comprising: computer program code which, when run by a computer, causes the computer to perform the method of the above aspects.
There is provided a chip comprising a processor for retrieving from a memory and executing instructions stored in the memory, so that a communication device in which the chip is installed performs the method of the above aspects.
Providing another chip comprising: the system comprises 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 through an internal connection path, the processor is used for executing codes in the memory, and when the codes are executed, the processor is used for executing the method in the aspects.
Drawings
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
fig. 2 is a schematic structural diagram of a communication system according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of another communication system provided in an embodiment of the present application;
fig. 4 is a flowchart of a method for obtaining a mapping rule according to an embodiment of the present application;
FIG. 5 is a diagram of an extended field provided in an embodiment of the present application;
fig. 6 is a schematic diagram of a partial structure of an update message according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a network layer reachability information field provided in an embodiment of the present application;
fig. 8 is a schematic diagram of a TLV field provided in an embodiment of the present application;
fig. 9 is a schematic diagram of another TLV field provided in an embodiment of the present application;
fig. 10 is a schematic diagram of another TLV field provided in an embodiment of the present application;
FIG. 11 is a diagram illustrating an extended field provided by an embodiment of the present application;
fig. 12 is a flowchart of a method for obtaining a mapping rule according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a communication system according to an embodiment of the present application;
fig. 14 is a flowchart of a method for obtaining a mapping rule according to an embodiment of the present application;
fig. 15 is a flowchart of a method for obtaining a mapping rule according to an embodiment of the present application;
fig. 16 is a schematic structural diagram of an apparatus for obtaining a mapping rule according to an embodiment of the present application;
fig. 17 is a schematic structural diagram of another apparatus for obtaining a mapping rule according to an embodiment of the present application;
fig. 18 is a schematic structural diagram of a communication device according to an embodiment of the present application;
fig. 19 is a schematic structural diagram of another communication device provided in an embodiment of the present application;
fig. 20 is a schematic structural diagram of another communication device provided in an embodiment of the present application.
Detailed Description
The terminology used in the description of the embodiments section of the present application is for the purpose of explanation only of the examples of the present application and is not intended to be limiting of the present application. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Aiming at the condition that an IPv6 network is deployed in a large quantity and an IPv4 network is isolated by an IPv6 network, in order to ensure the running of an IPv4 service and the development of a continuously updated IPv6 service, the mapping between an IPv4 address and an IPv6 address becomes an effective solution, and how to obtain a mapping rule of address mapping is the key for successfully mapping addresses. However, the efficiency of manually configuring the mapping rules is low, and the maintenance cost is high, so the embodiment of the application provides a method for obtaining the mapping rules, and the method can realize the automatic learning of the mapping rules.
Taking the application of the method provided by the embodiment of the present application to the communication system shown in fig. 1 as an example, as shown in fig. 1, the communication system includes a first communication device 101 and a second communication device 102. Wherein the first communication device 101 and the second communication device 102 are located in a first type of network. A first mapping rule for address mapping between addresses in a first type of network and addresses in a second type of network is configured on the first communication device 101, and a second mapping rule for address mapping between addresses in the first type of network and addresses in the second type of network is configured on the second communication device 102. Illustratively, the first type of network is an IPv4 network and the second type of network is an IPv6 network. One of the first mapping rule and the second mapping rule enables mapping of a source address between an IPv4 address and an IPv6 address, and the other mapping rule enables mapping of a destination address between an IPv4 address and an IPv6 address. For example, 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. Therefore, the first communication device 101 needs to learn a first mapping rule on the second communication device 102, and the second communication device 102 needs to learn a second mapping rule on the first communication device 101.
Based on the communication system shown in fig. 1, taking the communication system as a centralized MAP-T/MAP-E scenario as an example, as shown in fig. 2, the first communication device 101 is a MAP border relay (MAP BR) device, and the second communication device 102 is a broadband access server (BRAS); or the first communication equipment is a BRAS and the second communication equipment is a MAP BR equipment. In fig. 2, the MAP BR is used as an edge device of the MAP domain, i.e. a relay device, for connecting the IPv4 network and the IPv6 network, and is responsible for encapsulating/decapsulating IPv4 and IPv 6. The BRAS allocates addresses to MAP customer edge (MAP CE) equipment, and the MAP CE is responsible for encapsulating/de-encapsulating IPv4 and IPv6, so that the function that IPv4 users access the IPv4 network through the IPv6 network is realized. It should be noted that there may be a plurality of BRAS and MAP BRs, and fig. 2 only illustrates one example. The sending direction of the message or the learning direction of the mapping rule can be from BRAS to MAP BR or from MAP BR to BRAS.
Besides the application scenario shown in fig. 2, the method provided by the embodiment of the present application is also applicable to an interworking scenario in which IPv4 is isolated in an IPv6 network. As shown in fig. 3, the first communication device is a Provider Edge (PE) device, and the second communication device is a second PE device. By deploying MAP rules on PE equipment and mutually announcing through Border Gateway Protocol (BGP), the intercommunication of IPv4 island across IPv6 network is realized. Where there may be more than three PEs, fig. 3 is merely illustrative of three. The sending direction of the message or the learning direction of the mapping rule may be from one PE to another PE.
Next, a method for obtaining a mapping rule provided in the embodiment of the present application is described by taking an example in which a first mapping rule is configured on a first communication device, a second mapping rule is configured on a second communication device, and learning of the mapping rule is realized through an interaction process between the first communication device and the second communication device. Referring to fig. 4, a method for obtaining a mapping rule provided in an embodiment of the present application includes the following processes.
401, a first communication device obtains information of a first mapping rule configured on the first communication device, where the first communication device is located in a first type of network, the first mapping rule is used for address mapping between an address in the first type of network and an address in a second type of network, and the first type of network is different from the second type of network.
The embodiment of the present application does not limit the manner in which the first communication device obtains the first mapping rule configured on the first communication device, for example, after the first mapping rule is manually configured on the first communication device, the first communication device may store the first mapping rule, and store the first mapping rule in a storage space of the first communication device or in a storage space of another device. The first communication device may obtain the first mapping rule configured on the first communication device from the corresponding storage space.
In addition, the embodiment of the present application does not limit the content of the first mapping rule, and the mapping between the IPv4 address and the IPv6 address may be implemented. The MAP Address and Port (MAP) technology MAPs the IPv4 address encapsulation and decapsulation IPv6 to an IPv6 address through a certain rule, so that the purpose that an IPv4 user accesses an IPv4 network through an IPv6 network is achieved. The MAP technology multiplexes the same address (address) and port (port) statelessly, and is divided into a dual-encapsulation MAP-E and a dual-translation MAP-T according to the message format. The MAP-T/MAP-E technology combines stateless and dual translation/encapsulation, and thus has great advantages in technical performance, reliability, and cost to deploy for the customer. In addition, the MAP technology has three mapping rules, which are a Basic Mapping Rule (BMR), a Forwarding Mapping Rule (FMR), and a Default Mapping Rule (DMR). Therefore, in a possible implementation manner, the first mapping rule in the embodiment of the present application 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 address information corresponding to a basic mapping rule BMR, address information corresponding to a forwarding mapping rule FMR, and address information corresponding to a default mapping rule DMR.
Further, no matter what kind of mapping rule the first mapping rule is, in the method provided by the embodiment of the present application, information of the first mapping rule may be represented in the form of a route. In a possible implementation manner, the obtaining, by the first communication device, information of the first mapping rule configured on the first communication device includes: the first communication device generates a MAP route based on the first mapping rule, with the MAP route being information of the first mapping rule. Illustratively, the address information corresponding to the BMR includes, but is not limited to, an IPv6 prefix, an IPv6 prefix length, an IPv4 prefix, an IPv4 prefix length, an EA bit length, and a Port Set Identification (PSID) offset corresponding to the BMR. The address information corresponding to the FMR includes, but is not limited to, an IPv6 prefix, an IPv6 prefix length, an IPv4 prefix, an IPv4 prefix length, an EA bit length, and a PSID offset corresponding to the FMR. The address information corresponding to the DMR includes, but is not limited to, an IPv6 prefix and an IPv6 prefix length corresponding to the DMR. Alternatively, the address information corresponding to the DMR includes, but is not limited to, an address of IPv6 corresponding to the BR device and an IPv6 address prefix length.
402, a first communication device sends a first message to a second communication device, where the first message carries information of a first mapping rule, and the second communication device is located in a first type of network.
In order to enable the second communication device to learn the first mapping rule configured on the first communication device, the first communication device may send information of the first mapping rule configured on the first communication device to the second communication device. For example, the first communication device sends the information of the first mapping rule to the second communication device in a message sending manner. In this embodiment, for example, the first communication device sends the first packet to the second communication device through the first packet carrying information of the first mapping rule. Before the first communication device sends the first message to the second communication device, the first communication device and the second communication device establish a MAP neighbor relation.
In one possible implementation manner, the establishing, by the first communication device, a MAP neighbor relationship with the second communication device includes: the first communication equipment sends a message carrying the first MAP address cluster to the second communication equipment; and the first communication equipment receives a message which is sent by the second communication equipment and carries the second MAP address cluster. Taking the example of transmitting the MAP address cluster through a BGP Open (Open) message, the first communication device and the second communication device may add a MAP address family capability to the BGP Open message, and establish a BGP MAP neighbor after negotiating the MAP capability. Illustratively, the BGP capability negotiation field format is shown in fig. 5.
Wherein, a field is extended under capability advertisement (capabilities advertisement) for indicating a MAP address family. The first communication device carries the first MAP address cluster in the capability advertisement field in the BGP Open message, and sends the BGP Open message carrying the first MAP address cluster to the second communication device. And the second communication equipment carries a second MAP address cluster under a capability advertisement field in the BGP Open message and sends the BGP Open message carrying the second MAP address cluster to the first communication equipment. Thus, after advertising the address cluster, the first communication device establishes a MAP neighbor relationship with the second communication device.
After establishing the MAP neighbor relation, the first communication device sends a first message carrying information of the first mapping rule. Illustratively, the first packet further includes attribute information, and the attribute information includes a MAP domain type and a MAP domain identifier. Optionally, the attribute information further includes a route identifier and a route target. The embodiment of the present application does not limit the manner in which the first packet carries the information of the first mapping rule and the attribute information, including but not limited to the following two.
First, the information of the first mapping rule and the attribute information are both carried in the field of the network layer reachability information of the first packet.
In the embodiment of the present application, a first packet carrying information of a first mapping rule is not limited, and exemplarily, the first packet is an update (update) packet. As shown in fig. 6, the information of the first mapping rule is carried in a Network Layer Reachability Information (NLRI) field of the update message in the form of BGP route, and is transferred. The NLRI field in the update message includes a prefix length field (prefix length), and is extended after carrying information of the first mapping rule expressed in the BGP route form. One possible NLRI information may be defined in a format as shown in fig. 6, in which, in addition to the prefix length, other fields are extended, the contents of which are shown in fig. 7, including attribute information including a MAP domain type (MAP domain type) and a MAP domain identification (MAP domain ID). Also included are route identifiers (route distinguishers) and route targets (route targets), such as Virtual Private Network (VPN) route identifiers and VPN route targets. Wherein the MAP domain type includes MAP-T or MAP-E. The route identifiers are used to identify different routes, e.g., VPN route identifiers are used to identify different VPNs. The route target is used to control the distribution of route information, e.g., the VPN route target is used to control the distribution of VPN route information.
In addition, the data (data) field shown in fig. 7 carries information of the first mapping rule in a type-length-content (TLV) form. For example, if the information of the first mapping rule includes address information corresponding to the BMR, the BMR TLV format is as shown in fig. 8.
BMR TLV: and the corresponding BMR rule is used for representing address information corresponding to the BMR. Taking the communication system shown in fig. 2 as an example, the MAP-CE is configured to perform Network Address Translation (NAT) 4 and IPv6 translation/encapsulation on an IPv4 user packet, the MAP-BR is configured to decapsulate/decapsulate an IPv4 address from an IPv6 packet, and forward an IPv4 address + port (port) of backhaul traffic to the MAP-CE in the MAP domain according to an IPv6 route after IPv6 translation and encapsulation are performed on the IPv4 address + port (port). The address information corresponding to the BMR includes: IPv6 prefix (Rule-IPv6-prefix), IPv6 prefix length (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 are configured on the MAP-CE, and shared IPv4 address and port sequence and IPv6 address of the MAP-CE can be calculated, so that mapping between IPv4 address and IPv6 address is realized.
For example, if the information of the first mapping rule includes address information corresponding to the FMR, the FMR TLV format includes the following. FMR TLV: corresponding to FMR rules, the FMR TLV is used for carrying address information corresponding to FMR and is used for realizing direct communication of mutual access traffic among MAP-CEs in a network. It should be noted that FMR and BMR may be the same, and the structure of BMR TLV is shown in fig. 8, that is, BMR may be configured as FMR.
For example, if the information of the first mapping rule includes address information corresponding to DMR, DMR TLV format is as shown in fig. 9.
DMR TLV: and corresponding to the DMR in the MAP-T, wherein the DMR TLV carries mapping information corresponding to the DMR, represents that the destination IPv4 address of the message is an address outside a MAP domain (domain), and forwards the message to the outside of the domain through a BR. The address information corresponding to the DMR contains two parameters of Rule-IPv6-prefix and Rule-IPv 4-prefix. The value of Rule-IPv6-prefix is IPv6 prefix of MAP BR, and the value of Rule-IPv4-prefix is 0.0.0.0/0, namely the mapping Rule applicable as default route when matching IPv4 route on MAP-CE. After using this Rule, the destination IPv6 address constitutes the destination IPv6 address as a Rule-IPv6-prefix + destination IPv4 address configured by DMR.
For example, if the information of the first mapping rule includes address information corresponding to a DMR, and the address information corresponding to the DMR includes address information corresponding to a BR device, a BR address (address) TLV format is as shown in fig. 10.
BR Address TLV: corresponding to the DMR in the MAP-E, the destination address (destination address) outside the MAP domain in the MAP-E is the IPv6 address of the configured MAP-BR.
Second, the information of the first mapping rule is carried in the field of the network layer reachability information of the first packet, and the attribute information is carried in the extended attribute field of the first packet.
As shown in fig. 11, the NLRI carries information of the first mapping rule, such as BMR/FMR/DMR/BR address, and adds an extended attribute field, such as BGP MAP attribute/extended attribute (community/extended community) field, in the update message, where the attribute/extended attribute field is used to carry attribute information.
By adopting the first or second mode of carrying the information and the attribute information of the first mapping rule, the information and the attribute information of the first mapping rule can be carried in the same field or different fields, and the carrying mode is more flexible.
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.
Before the second communication device receives the first message sent by the first communication device, the second communication device establishes an MAP neighbor relation with the first communication device, so that after the second communication device receives the first message, the second communication device can acquire the first mapping rule according to the information of the first mapping rule in the first message because the first message carries the information of the first mapping rule.
Illustratively, the information of the first mapping rule is a MAP route generated based on the first mapping rule; the second communication device obtains the first mapping rule according to the information of the first mapping rule, including: and the second communication equipment acquires the first mapping rule according to the MAP route. The second communication device is configured with the second mapping rule, and the second communication device acquires the first mapping rule configured on the first communication device through dynamic learning, so that the second communication device can realize the mapping between the source address and the destination address in the IPv4 and the IPv 6.
In a possible implementation manner, 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, the method further includes: the second communication equipment sends a sixth message to the third communication equipment, so that the third communication equipment executes 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 of the first mapping rule, and the third communication device is a customer edge CE device.
According to the method provided by the embodiment of the application, the mapping rules on the communication equipment are dynamically learned, so that the configuration and maintenance workload of the mapping rules can be reduced, the efficiency of obtaining the mapping rules can be improved, and the maintenance cost can be reduced. For example, through the dynamic learning function of the MAP mapping rule, the workload of centralized MAP scene configuration and maintenance is reduced, so that the efficiency of acquiring the mapping rule can be improved, and the maintenance cost can be reduced. In addition, the method can be applied to an intercommunication scene of the IPv4 island in the IPv6 network, and the intercommunication of the IPv4 island through the IPv6 network is realized.
On the basis that the second communication device illustrated in fig. 4 dynamically learns the first mapping rule configured on the first communication device, the method provided in the embodiment of the present application further supports the first communication device to dynamically learn the second mapping rule configured on the second communication device. Referring to fig. 12, a method provided in an embodiment of the present application includes the following processes.
401, a first communication device obtains information of a first mapping rule configured on the first communication device, where the first communication device is located in a first type of network, the first mapping rule is used for address mapping between an address in the first type of network and an address in a second type of network, and the first type of network is different from the second type of network.
402, a first communication device sends a first message to a second communication device, where the first message carries information of a first mapping rule, and the second communication device is located in a first type of network.
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.
It should be noted that, the implementation manner of 401-403 may refer to the related description of 401-403 in fig. 4, and is not described herein again.
404, the second communication device sends a second packet to the first communication device, where the second packet carries information of a second mapping rule configured on the second communication device, and the second mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network.
Before the second communication device sends the second message to the first communication device, the second communication device obtains the mapping rule configured on the second communication device, and further obtains the information of the second mapping rule. The embodiment of the present application does not limit the manner in which the second communication device acquires the second mapping rule configured on the second communication device, for example, after the second mapping rule is manually configured on the second communication device, the second communication device may store the second mapping rule, and store the second mapping rule in a storage space of the second communication device or in a storage space of another device. The second communication device may obtain the second mapping rule configured on the second communication device from the corresponding storage space.
In addition, the embodiment of the present application does not limit the content of the second mapping rule, and the IPv4 address and the IPv6 address may be mapped. In one possible implementation, the second mapping rule in the embodiment of the present application 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 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.
Further, no matter what kind of mapping rule the second mapping rule is, in the method provided by the embodiment of the present application, information of the second mapping rule may be represented in the form of a route. In a possible implementation manner, the obtaining, by the second communication device, information of the second mapping rule configured on the second communication device includes: the second communication device generates a MAP route based on the second mapping rule, taking the MAP route as information of the second mapping rule. Illustratively, the address information corresponding to the BMR includes, but is not limited to, an IPv6 prefix, an IPv6 prefix length, an IPv4 prefix, an IPv4 prefix length, an EA bit length, and a Port Set Identification (PSID) offset corresponding to the BMR. The address information corresponding to the FMR includes, but is not limited to, an IPv6 prefix, an IPv6 prefix length, an IPv4 prefix, an IPv4 prefix length, an EA bit length, and a PSID offset corresponding to the FMR. The address information corresponding to the DMR includes, but is not limited to, an IPv6 prefix and an IPv6 prefix length corresponding to the DMR. Alternatively, the address information corresponding to the DMR includes, but is not limited to, an address of IPv6 corresponding to the BR device and an IPv6 address prefix length.
In order to enable the first communication device to learn the second mapping rule configured on the second communication device, the second communication device may send information of the second mapping rule configured on the second communication device to the first communication device. For example, the second communication device sends the information of the second mapping rule to the first communication device in a message sending manner. In this embodiment, for example, the second message carries information of the second mapping rule, and the second communication device sends the second message to the first communication device. Before the second communication device sends the second message to the first communication device, the second communication device and the first communication device establish a MAP neighbor relation. The method for establishing the MAP neighbor relation may refer to the related description of 402 in fig. 4, and is not described herein again.
In addition, after the MAP neighbor relation is established, the second communication device sends a second message carrying information of the second mapping rule. Illustratively, the second packet further includes attribute information, and the attribute information includes a MAP domain type and a MAP domain identifier. Optionally, the attribute information further includes a route identifier and a route target. The embodiment of the present application does not limit the manner in which the second packet carries the information of the second mapping rule and the attribute information, including but not limited to the following two.
First, the information of the second mapping rule and the attribute information are both carried in the field of the network layer reachability information of the second packet.
Second, the information of the second mapping rule is carried in the field of the network layer reachability information of the second packet, and the attribute information is carried in the extended attribute field of the first packet.
The manner in which the second packet carries the information and attribute information of the second mapping rule may refer to the manner in which the first packet carries the information and attribute information of the first mapping rule, and is not described herein again.
405, the first communication device receives a second message sent by the second communication device, and acquires a second mapping rule according to information of the second mapping rule in the second message.
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, so that after the first communication device receives the second message, the first communication device can acquire the second mapping rule according to the information of the second mapping rule in the second message because the second message carries the information of the second mapping rule.
Illustratively, the information of the second mapping rule is a MAP route generated based on the second mapping rule; the first communication device obtains the second mapping rule according to the information of the second mapping rule, including: the first communication device acquires 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 acquires the second mapping rule configured on the second communication device through dynamic learning, the mapping between the source address and the destination address in IPv4 and IPv6 can be realized.
It should be noted that, no matter 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, after the first communication device and the second communication device both have the first mapping rule and the second mapping rule, the first mapping rule and the second mapping rule may be stored as a routing table entry for triggering address mapping during message transmission.
In addition, 401 to 403 described above are processes in which the first communication device transmits information of the first mapping rule to the second communication device so that the second communication device learns the first mapping rule configured on the first communication device, and 404 and 405 are processes in which the second communication device transmits information of the second mapping rule to the first communication device so that the first communication device learns the second mapping rule configured on the second communication device. In addition to executing 401-403 first and then 404-405, 404-405 may be executed first and then 401-403 may be executed. The embodiment of the application does not limit the sequence of the process of the second communication device for learning the first mapping rule configured on the first communication device and the process of the first communication device for learning the second mapping rule configured on the second communication device.
Further, under the condition that the first communication device and the second communication device both dynamically learn the mapping rule of the opposite end through the method provided by the embodiment of the application, the first communication device and the second communication device can realize the intercommunication between the IPv4 network and the IPv6 network. On the basis, the first communication equipment and the second communication equipment can carry out message transmission. The process of message transmission may be as follows as shown in fig. 12.
406, the first communication device obtains a seventh packet, where a source address of the seventh packet is a first IPv4 address, and a destination address of the seventh packet is a second IPv4 address.
The seventh message is a message generated by the first communication device or a message received by the first communication device from the previous hop, and the embodiment of the present application does not limit the type and content of the seventh message. Taking as an example that the first communication device is located in a first-type network, the first-type network is an IPv4 network, and the first mapping rule configured on the first communication device is used for mapping between the first IPv4 address and the first IPv6 address, the source address of the seventh packet is a first IPv4 address, and the destination address of the seventh packet is a second IPv4 address. For example, the first IPv4 address is an address of a first communication device, and the second IPv4 address is an address of a second communication device.
407, 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, so as to obtain the third packet.
Since the destination address of the seventh packet is the address of the second communication device, and the first communication device and the second communication device are connected through the IPv6 network, in order to successfully traverse the IPv6 network through the IPv4 network, the first communication device does not directly forward the seventh packet, but 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, so as to obtain the third packet.
408, the first communication device sends a third message.
When the first communication device sends the third packet, the routing table may be queried to determine the next hop. And then, the first communication equipment sends the third message to the next hop of the first communication equipment, and the third message is forwarded to the destination address according to the normal flow of message transmission. 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. Therefore, the third message can be successfully sent to the IPv6 network, and further transmitted to the second communication device through the IPv6 network.
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.
Since the third packet is an IPv6 packet, the source address and the destination address are both IPv6 addresses, and the second communication device is located in the second network, that is, the IPv4 network, after receiving the third packet, the second communication device may 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 map the destination address of the third packet from the second IPv6 address to the second IPv4 address based on the second mapping rule.
In the above, the first communication device sends the message to the second communication device as an example, and similarly, the second communication device may send the message to the first communication device according to the same principle, and the procedure may be as follows as shown in fig. 12.
410, the second communication device obtains a fourth packet, where a source address of the fourth packet is a second IPv4 address, and a destination address of the fourth packet is a first IPv4 address.
The fourth message is a message generated by the second communication device, or a message received by the second communication device from the previous hop. Taking the example that the second communication device is located in the second network, the second network is an IPv4 network, and the second mapping rule configured on the second communication device is used for mapping between the second IPv4 address and the second IPv6 address, 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. For example, the second IPv4 address is an address of the second communication device, and the first IPv4 address is an address of the first communication device.
411, the second communications 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, so as to obtain the fifth packet.
Because the destination address of the fourth packet is the address of the first communication device, and the first communication device is connected to the second communication device through the IPv6 network, the second communication device does not directly send the fourth packet, and in order to successfully traverse the IPv6 network by the IPv4 network, 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, thereby obtaining the fifth packet.
The second communication device sends 412 a fifth message.
And when the second communication equipment sends the fifth message, the second communication equipment can inquire the routing table and determine the next hop. And then, the second communication equipment sends the fifth message to the next hop of the second communication equipment, and the fifth message is forwarded to the destination address according to the normal flow of message transmission. 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. Therefore, the fifth message can be successfully sent to the IPv6 network, and further transmitted to the first communication device through the IPv6 network.
413, the first communication device receives the fifth packet, 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.
Since the fifth packet is an IPv6 packet, the source address and the destination address are both IPv6 addresses, and the first communication device is located in the first network, that is, the IPv4 network, after receiving the fifth packet, the first communication device may 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 map the destination address of the fifth packet from the first IPv6 address to the first IPv4 address based on the first mapping rule.
According to the method provided by the embodiment of the application, the mapping rules on the communication equipment are dynamically learned, so that the configuration and maintenance workload of the mapping rules can be reduced, the efficiency of obtaining the mapping rules can be improved, and the maintenance cost can be reduced.
The method provided by the embodiment of the application can be suitable for the MAP-T/MAP-E scene, for example, the workload of centralized MAP scene configuration and maintenance is reduced through the dynamic learning function of the MAP mapping rule, so that the efficiency of obtaining the mapping rule can be improved, and the maintenance cost is reduced. In addition, the method can also be applied to an intercommunication scene of the IPv4 island in the IPv6 network, and the intercommunication of the IPv4 island through the IPv6 network is realized. For convenience of understanding, a MAP scenario is taken as an example, and a method for obtaining a mapping rule provided in the embodiment of the present application is illustrated below.
Referring to fig. 13, based on the centralized MAP-T/MAP-E scenario shown in fig. 2, in fig. 13, for example, the first communication device is a BRAS, the second communication device is a MAP BR device, and the BRAS and the MAP BR device are located in an IPv6 network, and in fig. 13, the MAP BR is used as an edge device of a MAP domain, that is, a relay device, for connecting an IPv4 network and an IPv6 network, and is responsible for encapsulating/decapsulating IPv4 and IPv 6. BRAS assigns addresses to MAP CEs, e.g., BRAS issues MAP address clusters 1.1.1.0/24 and 2001: db8:1: 48, wherein 1.1.1.0/24 is an IPv4 address (namely, a first IPv4 address), and 2001: db8:1: 48 is an IPv6 address (namely, a first IPv6 address). The MAP CE is responsible for carrying out encapsulation/de-encapsulation of IPv4 and IPv6, and the function that an IPv4 user passes through an IPv6 network to access an IPv4 network is achieved. In addition, the MAP BR side also has two address clusters of IPv4 address 11.1.1.0/24 (namely, the second IPv4 address) and IPv6 address 2001: db8:2:: 48 (namely, the second IPv6 address).
In addition, the BRAS establishes a MAP neighbor relationship with the MAP BR. Based on the communication system shown in fig. 13, referring to fig. 14, the method provided by the embodiment of the present application includes the following processes.
1401, the BRAS obtains information of a first mapping rule configured on the BRAS, wherein the first mapping rule is used for address mapping between an address of an IPv6 network and an address of an IPv4 network.
The embodiment of the application does not limit the way of acquiring the first mapping rule configured on the BRAS by the BRAS, for example, after the first mapping rule is manually configured on the BRAS, the BRAS can store the first mapping rule, and the first mapping rule is stored in a storage space of the BRAS or a storage space of other equipment. The BRAS can obtain the first mapping rule configured on the BRAS from the corresponding storage space.
In addition, the embodiment of the present application does not limit the content of the first mapping rule, and the mapping between the IPv4 address and the IPv6 address may be implemented. In one possible implementation manner, the first mapping rule in the embodiment of the present application 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 address information corresponding to a basic mapping rule BMR, address information corresponding to a forwarding mapping rule FMR, and address information corresponding to a default mapping rule DMR.
The implementation of 1401 may refer to the related description of 401 shown in fig. 4, and is not described in detail here.
1402, the BRAS sends a first message to the MAP-BR, where the first message carries information of the first mapping rule.
In the embodiment of the present application, a first packet carrying information of a first mapping rule is not limited, and exemplarily, the first packet is an update (update) packet. The implementation of this 1402 can refer to the related description of 402 shown in fig. 4, and is not described in detail here.
1403, the MAP-BR receives a first message sent by the BRAS, and acquires a first mapping rule according to the information of the first mapping rule in the first message.
The implementation of this 1403 can be referred to the related description of 403 shown in fig. 4, and is not described in detail here.
1404, the MAP-BR sends a second message to the BRAS, where the second message carries information of a second mapping rule configured on the MAP-BR, and the second mapping rule is used for address mapping between an address of the IPv4 network and an address of the IPv6 network.
The implementation of this 1404 can be seen in the related description of 404 shown in fig. 12, and is not described in detail here.
1405, the BRAS receives the second message sent by the MAP-BR, and acquires the second mapping rule according to the information of the second mapping rule in the second message.
The implementation of 1405 can be referred to the related description of 405 shown in fig. 12, and is not described in detail here.
1406, the BRAS sends a sixth message to the MAP CE, where the sixth message carries information of the second mapping rule.
After the BRAS acquires the second mapping rule, the information of the second mapping rule is carried in a sixth message and sent to the MAP CE, so that the MAP CE can perform address mapping between the address in the first type of network and the address in the second type of network according to the information of the second mapping rule.
1407, the MAP CE acquires the seventh message, where 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 seventh message is a message generated by the MAP CE, or a message received by the MAP CE from the previous hop, and the embodiment of the present application does not limit the type and content of the seventh message. In connection with the communication system shown in FIG. 13, 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, so that the source address of the seventh message is 1.1.1.0/24, and the destination address of the seventh message is 11.1.1.0/24. The implementation of 1407 can be referred to the related description of 406 in fig. 12, and is not repeated here.
1408, the 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, so as to obtain the third packet.
In connection with the communication system shown in fig. 13, the address of the first IPv4 is 1.1.1.0/24, the address of the first IPv6 is 2001: db8:1:: 48, the address of the second IPv4 is 11.1.1.0/24, and the address of the second IPv6 is 2001: db8:2:: 48, so that the MAP CE MAPs the source address of the seventh packet from 1.1.1.0/24 to 2001: db8:1:: 48 based on the first mapping rule, and MAPs the destination address of the seventh packet from 11.1.1.0/24 to 2001: db8:2: 48 based on the second mapping rule. Thus, the obtained third message can be transmitted in the IPv6 network.
It should be noted that, in different network scenarios, the processing procedure of the MAP CE on the packet in this 1408 step is different. Specifically, in a MAP-T scenario, the MAP CE replaces the first IPv4 address with a first IPv6 address, and replaces the second IPv4 address with a second IPv6 address; in the MAP-E scenario, the MAP CE adds a first IPv6 address in the outer layer of the first IPv4 address and adds a second IPv6 address in the outer layer of the second IPv4 address.
The 1408 can be realized as described in 407 of fig. 12, and is not described in detail here.
1409, the MAP CE transmits the third message.
The implementation of 1409 can refer to the related description of 408 shown in fig. 12, and is not described in detail here. The MAP CE sends the third message to the BRAS, and the BRAS sends the third message to the MAP BR.
1410, the BRAS sends a third message.
1411, the 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.
With reference to the communication system shown in fig. 13, the address of the first IPv4 is 1.1.1.0/24, the address of the first IPv6 is 2001: db8: 1:/48, the address of the second IPv4 is 11.1.1.0/24, and the address of the second IPv6 is 2001: db8: 2:/48, so that after the MAP-BR receives the third packet, the source address of the third packet is mapped from 2001: db8: 1:/48 to 1.1.1.0/24 based on the first mapping rule, and the destination address of the third packet is mapped from 2001: db8:2:: 48 to 11.1.1.0/24 based on the second mapping rule.
It should be noted that, in different network scenarios, the processing procedure of the MAP-BR for the message in the step 1411 is different. Specifically, in a MAP-T scenario, the MAP-BR replaces the first IPv6 address with a first IPv4 address, and replaces the second IPv6 address with a second IPv4 address; and in the MAP-E scenario, the MAP-BR deletes the first IPv6 address and reserves the first IPv4 address of the inner layer, and deletes the second IPv6 address and reserves the second IPv4 address of the inner layer.
The implementation of 1411 can be referred to the related description of 409 shown in fig. 12, and is not described in detail here.
Referring to fig. 15 in conjunction with the communication system shown in fig. 13, the method provided in the embodiment of the present application includes the following processes.
1501, the BRAS obtains information of a first mapping rule configured on the BRAS, wherein the first mapping rule is used for address mapping between an address of an IPv4 network and an address of an IPv6 network.
The 1501 can be implemented as described in relation to 401 shown in fig. 4, and is not described in detail here.
1502, the BRAS sends a first message to the MAP-BR, where the first message carries information of the first mapping rule.
The implementation of 1502 can be referred to the related description of 402 shown in fig. 4, and a detailed description thereof is omitted here.
1503, the MAP-BR receives the first message sent by the BRAS and obtains the first mapping rule according to the information of the first mapping rule in the first message.
The implementation of this 1503 can refer to the related description of 403 shown in fig. 4, and is not described in detail here.
1504, the MAP-BR sends a second message to the BRAS, the second message carries information of a second mapping rule configured on the MAP-BR, and the second mapping rule is used for address mapping between an address of the IPv4 network and an address of the IPv6 network.
The implementation of this 1504 can be referred to the related description of 404 shown in fig. 12, and is not described in detail here.
1505, the BRAS receives the second message sent by the MAP-BR, and acquires the second mapping rule according to the information of the second mapping rule in the second message.
The 1505 implementation can be referred to the related description of 405 shown in fig. 12, and is not repeated here.
In a possible implementation manner, the BRAS sends a sixth packet to the MAP CE, where the sixth packet carries information of the second mapping rule, so that the MAP CE can perform address mapping between an address in the first type of network and an address in the second type of network according to the second mapping rule.
1506, the MAP-BR acquires 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.
In connection with the communication system shown in FIG. 13, 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, so that the source address of the fourth message is 11.1.1.0/24 and the destination address of the fourth message is 1.1.1.0/24. The implementation of the 1506 can be referred to the related description of 410 shown in fig. 12, and is not described in detail here.
1507, the MAP-BR 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, to obtain the fifth packet.
In connection with the communication system shown in fig. 13, the address of the first IPv4 is 1.1.1.0/24, the address of the first IPv6 is 2001: db8:1:: 48, the address of the second IPv4 is 11.1.1.0/24, and the address of the second IPv6 is 2001: db8:2:: 48, so that the 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 obtained fifth message can be transmitted in the IPv6 network.
The implementation of this 1507 can be seen from the related description of 411 shown in fig. 12, and is not described in detail here.
1508, the MAP-BR sends a fifth message.
The source address of the fifth message is 2001: db8:2: 48, and the destination address of the fifth message is 2001: db8:1: 48. The implementation of this 1508 can be seen in the related description of 412 shown in fig. 12, and is not described in detail here.
1509, BRAS receives the fifth message and sends the fifth message to MAP CE.
1510, the MAP CE receives the fifth packet, 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.
In connection with the communication system shown in fig. 13, the address of the first IPv4 is 1.1.1.0/24, the address of the first IPv6 is 2001: db8:1:: 48, the address of the second IPv4 is 11.1.1.0/24, and the address of the second IPv6 is 2001: db8:2:: 48, so that the MAP CE MAPs the source address of the fifth packet from 2001: db8:2:: 48 to 11.1.1.0/24 based on the second mapping rule, and MAPs the destination address of the fifth packet from 2001: db8:1:: 48 to 1.1.1.0/24 based on the first mapping rule.
The 1510 implementation can be referred to the related description of 413 shown in fig. 12, and is not described in detail here.
The method for obtaining the mapping rule provided in the embodiment of the present application is introduced above, and corresponding to the method, the embodiment of the present application further provides a device for obtaining the mapping rule. Fig. 16 is a schematic structural diagram of an apparatus for obtaining a mapping rule according to an embodiment of the present application, where the apparatus is applied to a first communication device, and the first communication device is the first communication device shown in any one of fig. 4, fig. 12, fig. 14, and fig. 15. The apparatus for obtaining the mapping rule shown in fig. 16 is capable of performing all or part of the operations performed by the first communication device based on a plurality of modules shown in fig. 16. It should be understood that the apparatus may include more additional modules than those shown or omit some of the modules shown therein, which is not limited by the embodiments of the present application. As shown in fig. 16, the apparatus includes:
a first receiving module 1601, configured to receive a first packet sent by a second communication device, where the first communication device and the second communication device are located in a first type of network, the first packet carries information of a first mapping rule configured on the second communication device, the first mapping rule is used for address mapping between an address in the first type of network and an address in a second type of network, and the first type of network is different from the second type of network;
a first obtaining module 1602, configured to obtain the first mapping rule according to the information of the first mapping rule.
In one possible implementation, the information of the first mapping rule is a mapping address and a port MAP route generated based on the first mapping rule.
In one possible implementation, the apparatus further includes:
and the establishing module is used for establishing the MAP neighbor relation with the second communication equipment.
In a possible implementation manner, the establishing module is configured to send a message carrying the first MAP address cluster to the second communication device; and receiving a message which is sent by the second communication equipment and carries the second MAP address cluster.
In a possible implementation manner, the first packet further includes attribute information, and the attribute information includes a mapping address, a port MAP domain type, and a MAP domain identifier.
In one possible implementation, the attribute information further includes a route identifier and a route target.
In a possible implementation manner, the information of the first mapping rule and the attribute information are both carried in a field of network layer reachability information NLRI of the first packet.
In a possible implementation manner, the information of the first mapping rule is carried in a field of network layer reachability information of the first packet, and the attribute information is carried in an extended attribute field of the first packet.
In a possible implementation manner, the information of the mapping rule includes at least one of 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.
In a possible implementation manner, the address information corresponding to the BMR includes an internet protocol version 6 IPv6 prefix, an IPv6 prefix length, an internet protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a port set identification PSID offset corresponding to the BMR.
In a possible implementation manner, the address information corresponding to the FMR includes an internet protocol version 6 IPv6 prefix, an IPv6 prefix length, an internet protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a port set identification PSID offset corresponding to the FMR.
In a possible implementation manner, the address information corresponding to the DMR includes an internet protocol version 6 IPv6 prefix and an IPv6 prefix length corresponding to the DMR.
In a possible implementation manner, the address information corresponding to the DMR includes an address of an internet protocol version 6 IPv6 corresponding to the border relay BR device and an IPv6 address prefix length.
In one possible implementation, the apparatus further includes:
the first sending module is configured to send a second packet to the second communication device, where the second packet carries information of a second mapping rule configured on the first communication device, the second mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network, and the information of the second mapping rule is used for the second communication device to obtain the second mapping rule.
In a possible implementation manner, 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;
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.
In one possible implementation manner, 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 provider edge PE device, and the second communication device is a second PE device.
In one possible implementation, the apparatus further includes:
the second receiving module is used for 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 mapping module is used for mapping the source address of the third message into a first IPv4 address from a first IPv6 address based on the first mapping rule, and mapping the destination address of the third message into a second IPv4 address from a second IPv6 address based on the second mapping rule.
In one possible implementation, the apparatus further includes:
the second obtaining module is used for 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 second mapping module is used for mapping the source address of the fourth message into a second IPv6 address from a second IPv4 address based on the first mapping rule, and mapping the destination address of the fourth message into a first IPv6 address from a first IPv4 address based on the second mapping rule to obtain a fifth message;
and the second sending module is used for sending the fifth message.
In one possible implementation, the apparatus further includes:
and the storage module is used for storing the first mapping rule as a routing table entry, and the routing table entry is used for transmitting the message.
In a possible implementation manner, when the first communication device is a broadband access server, the apparatus further includes: a third sending module, configured to send a sixth packet to a third communications device, so that the third communications device performs address mapping between an address in the first type of network and an address in the second type of network according to the first mapping rule; the sixth message carries information of the first mapping rule, and the third communication device is a customer edge CE device.
Fig. 17 is a schematic structural diagram of an apparatus for obtaining a mapping rule according to an embodiment of the present application, where the apparatus is applied to a first communication device, and the first communication device is the first communication device shown in any one of fig. 4, fig. 12, fig. 14, and fig. 15. The apparatus for obtaining the mapping rule shown in fig. 17 is capable of performing all or part of the operations performed by the first communication device based on a plurality of modules shown in fig. 17. It should be understood that the apparatus may include more additional modules than those shown or omit some of the modules shown therein, which is not limited by the embodiments of the present application. As shown in fig. 17, the apparatus includes:
a first obtaining module 1701 for obtaining information of a first mapping rule configured on the first communication device, the first mapping rule being used for address mapping between an address in a first type of network and an address in a second type of network;
a first sending module 1702, configured to send a first packet to a second communication device, where the first packet carries information of a first mapping rule, and the information of the first mapping rule is used for the second communication device to obtain the first mapping rule, where the first communication device and the second communication device are located in a first type of network, and the first type of network is different from a second type of network.
In a possible implementation, the first obtaining module 1701 is configured to generate a mapping address and a port MAP route based on a first mapping rule, and use the MAP route as information of the first mapping rule.
In one possible implementation, the apparatus further includes:
the first receiving module is used for receiving a second message sent by the second communication device, wherein the second message carries information of a second mapping rule configured on the second communication device, and the second mapping rule is used for address mapping between an address in a first type of network and an address in a second type of network;
and the second obtaining module is used for obtaining the second mapping rule according to the information of the second mapping rule.
In a possible implementation manner, 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; 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.
In one possible implementation manner, 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 an MAP BR device;
or, the first communication device is a first provider edge PE device, and the second communication device is a second PE device.
In one possible implementation, the apparatus further includes:
a third obtaining module, configured to obtain a seventh packet, where a source address of the seventh packet is a first IPv4 address, and a destination address of the seventh packet is a second IPv4 address;
the first mapping module is used for mapping the source address of the seventh message into a first IPv6 address from a first IPv4 address based on a first mapping rule, and mapping the destination address of the seventh message into a second IPv6 address from a second IPv4 address based on a second mapping rule to obtain a third message;
and the second sending module is used for sending the third message.
In one possible implementation manner, the apparatus further includes:
the second receiving module is used for 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;
and the second mapping module is used for mapping the source address of the fifth message into a second IPv4 address from the second IPv6 address based on the second mapping rule, and mapping the destination address of the fifth message into a first IPv4 address from the first IPv6 address based on the first mapping rule.
It should be understood that the apparatus provided in fig. 16-17 is only illustrated by the above-mentioned division of the functional modules when implementing the functions thereof, and in practical applications, the above-mentioned function distribution may be performed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
The specific hardware structure of the communication device in the above embodiment is the communication device 1800 shown in fig. 18, which includes a transceiver 1801, a processor 1802, and a memory 1803. The transceiver 1801, processor 1802, and memory 1803 are coupled via a bus 1804. The transceiver 1801 is configured to receive a message and send a message, the memory 1803 is configured to store an instruction or a program code, and the processor 1802 is configured to call the instruction or the program code in the memory 1803, so that the communication device performs relevant processing steps of the communication device in the foregoing method embodiments. In a specific embodiment, the communication device 1800 of the embodiment of the present application may correspond to the first communication device in the above-described method embodiments, and the processor 1802 in the communication device 1800 reads the instructions or the program codes in the memory 1803, so that the communication device 1800 shown in fig. 18 can perform all or part of the operations performed by the first communication device.
In a specific embodiment, the communication device 1800 of the embodiment of the present application may correspond to the second communication device in the above-mentioned method embodiments, and the processor 1802 in the communication device 1800 reads the instructions or the program codes in the memory 1803, so that the communication device 1800 shown in fig. 18 can perform all or part of the operations performed by the second communication device.
The communication device 1800 may also correspond to the apparatuses shown in fig. 16 and 17, for example, the first receiving module 1601 referred to in fig. 16 corresponds to the transceiver 1801, and the first obtaining module 1602 corresponds to the processor 1802. Also for example, the first sending module 1702 and the first obtaining module 1701 in fig. 17 correspond to the transceiver 1801 and the processor 1502, respectively.
Referring to fig. 19, fig. 19 is a schematic structural diagram of a communication device 2000 according to an exemplary embodiment of the present application. The communication device 2000 shown in fig. 19 is configured to perform the operations related to the method for obtaining the mapping rule shown in any one of fig. 4, fig. 12, fig. 14 and fig. 15. The communication device 2000 is, for example, a switch, a router, or the like.
As shown in fig. 19, the communication device 2000 includes at least one processor 2001, memory 2003, and at least one communication interface 2004.
The processor 2001 is, for example, a 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 present disclosure. For example, the processor 2001 includes an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. PLDs are, for example, Complex Programmable Logic Devices (CPLDs), field-programmable gate arrays (FPGAs), General Array Logic (GAL), or any combination thereof. Which may implement or perform the various logical blocks, modules, and circuits described in connection with the embodiment disclosure of the present application. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others.
Optionally, the communication device 2000 further comprises a bus. The bus is used to transfer information between the components of the communication device 2000. The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 19, but it is not intended that there be only one bus or one type of bus. In fig. 19, the components of the communication device 2000 may be connected by other methods besides bus connection, and the connection method of the components is not limited in the embodiments of the present application.
The Memory 2003 is, for example, but not limited to, a read-only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only Memory (EEPROM), a compact disk read-only Memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 2003 is, for example, independent and connected to the processor 2001 via a bus. The memory 2003 may also be integrated with the processor 2001.
Communication interface 2004 uses any transceiver or the like for communicating with other devices or a communication network, such as an ethernet, Radio Access Network (RAN), or Wireless Local Area Network (WLAN), among others. The communication interface 2004 may include a wired communication interface and may also include a wireless communication interface. Specifically, the communication interface 2004 may be an Ethernet (Ethernet) interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a Wireless Local Area Network (WLAN) interface, a cellular network communication interface, or a combination thereof. The ethernet interface may be an optical interface, an electrical interface, or a combination thereof. In an embodiment of the present application, the communication interface 2004 may be used for the communication device 2000 to communicate with other devices.
In particular implementations, processor 2001 may include one or more CPUs such as CPU0 and CPU1 shown in fig. 19 as one embodiment. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, the communication device 2000 may include multiple processors, such as the processor 2001 and the processor 2005 shown in fig. 19, as an example. Each of these processors may be a single-Core Processor (CPU) or a multi-Core Processor (CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In one implementation, the communication device 2000 may also include an output device and an input device, as an example. An output device communicates with the processor 2001 and may display information in a variety of 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, a projector (projector), or the like. The input device communicates with the processor 2001 and may receive user input in a variety of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
In some embodiments, the memory 2003 is used to store program code 2010 for performing aspects of the present application, and the processor 2001 may execute the program code 2010 stored in the memory 2003. That is, the communication device 2000 may implement the method for obtaining the mapping rule provided by the method embodiment through the processor 2001 and the program code 2010 in the memory 2003. One or more software modules may be included in program code 2010. Optionally, the processor 2001 itself may also store program code or instructions to perform aspects of the present application.
In a specific embodiment, the communication device 2000 of the embodiment of the present application may correspond to the first communication device in the above-described respective method embodiments, and the processor 2001 in the communication device 2000 reads the program code 2010 in the memory 2003 or the program code or instructions stored by the processor 2001 itself, so that the communication device 2000 shown in fig. 19 can perform all or part of the operations performed by the first communication device.
In a specific embodiment, the communication device 2000 of the embodiment of the present application may correspond to the second communication device in each of the above-described method embodiments, and the processor 2001 in the communication device 2000 reads the program code 2010 in the memory 2003 or the program code or instructions stored by the processor 2001 itself, so that the communication device 2000 shown in fig. 19 can perform all or part of the operations performed by the second communication device.
The communication device 2000 may also correspond to the apparatuses shown in fig. 16 and 17 described above, and each functional block in the apparatuses shown in fig. 16 and 17 is implemented by software of the communication device 2000. In other words, the apparatuses shown in fig. 16 and 17 include functional blocks that are generated after the processor 2001 of the communication device 2000 reads the program code 2010 stored in the memory 2003. For example, the first receiving module 1601 referred to in fig. 16 corresponds to the communication interface 2004, and the first obtaining module 1602 corresponds to the processor 2001 and/or the processor 2005. For another example, the first sending module 1702 shown in fig. 17 corresponds to the communication interface 2004, and the first obtaining module 1701 corresponds to the processor 2001 and/or the processor 2005.
The steps of the method for obtaining the mapping rule shown in fig. 4, 12, 14 and 15 are performed by an integrated logic circuit of hardware or an instruction in the form of software in a processor of the communication device 2000. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and performs the steps of the above method in combination with hardware thereof, which are not described in detail herein to avoid repetition.
Referring to fig. 20, fig. 20 is a schematic structural diagram of a communication device 2100 according to another exemplary embodiment of the present application, where the communication device 2100 shown in fig. 20 is configured to perform all or part of the operations involved in the method for obtaining a mapping rule shown in fig. 4, fig. 12, fig. 14, and fig. 15. The communication device 2100 is, for example, a switch, a router, etc., and the communication device 2100 may be implemented by a general bus architecture.
As shown in fig. 20, the communication device 2100 includes: a main control board 2110 and an interface board 2130.
The main control board is also called a Main Processing Unit (MPU) or a route processor card (route processor card), and the main control board 2110 is used for controlling and managing various components in the communication device 2100, including routing computation, device management, device maintenance, and protocol processing functions. The main control board 2110 includes: a central processor 2111 and a memory 2112.
The interface board 2130 is also referred to as a Line Processing Unit (LPU), a line card (line card), or a service board. The interface board 2130 is used for providing various service interfaces and forwarding data packets. The service interfaces include, but are not limited to, Ethernet interfaces, such as Flexible Ethernet services interfaces (FlexE Ethernet Clients), POS (Packet over SONET/SDH) interfaces, and the like. The interface board 2130 includes: central processor 2131 network processor 2132, forwarding table entry memory 2134, and Physical Interface Card (PIC) 2133.
The central processor 2131 on the interface board 2130 is used for controlling and managing the interface board 2130 and communicating with the central processor 2111 on the main control board 2110.
The network processor 2132 is configured to implement sending processing of a packet. The network processor 2132 may take the form of a forwarding chip. The forwarding chip may be a Network Processor (NP). In some embodiments, the forwarding chip may be implemented by an application-specific integrated circuit (ASIC) or a Field Programmable Gate Array (FPGA). Specifically, the network processor 2132 is configured to forward the received message based on a forwarding table stored in the forwarding table entry memory 2134, and if a destination address of the message is an address of the communication device 2100, send the message to a CPU (e.g., the central processing unit 2131) for processing; if the destination address of the packet is not the address of the communication device 2100, the next hop and the outgoing interface corresponding to the destination address are found from the forwarding table according to the destination address, and the packet is forwarded to the outgoing interface corresponding to the destination address. Wherein, the processing of the uplink message may include: processing a message input interface and searching a forwarding table; the processing of the downlink message may include: forwarding table lookups, and the like. In some embodiments, the central processing unit may also perform the functions of a forwarding chip, such as implementing software forwarding based on a general purpose CPU, so that no forwarding chip is needed in the interface board.
The physical interface card 2133 is used to implement a physical layer interface function, from which the original traffic enters the interface board 2130, and the processed message is sent out from the physical interface card 2133. The physical interface card 2133 is also called a daughter card, and may be installed on the interface board 2130, and is responsible for converting the photoelectric signal into a message, performing validity check on the message, and forwarding the message to the network processor 2132 for processing. In some embodiments, the central processor 2131 may also perform the functions of the network processor 2132, such as implementing software forwarding based on a general purpose CPU, so that the network processor 2132 is not required in the physical interface card 2133.
Optionally, the communication device 2100 includes a plurality of interface boards, for example, the communication device 2100 further includes an interface board 2140, and the interface board 2140 includes: a central processor 2141, a network processor 2142, a forwarding table entry memory 2144, and a physical interface card 2143. The functions and implementations of the components in the interface board 2140 are the same as or similar to those of the interface board 2130, and are not described herein again.
Optionally, the communication device 2100 further comprises a switch board 2120. The switch board 2120 may also be called a Switch Fabric Unit (SFU). In the case where the communication apparatus has a plurality of interface boards, the switch board 2120 is used to complete data exchange between the interface boards. For example, the interface board 2130 and the interface board 2140 can communicate with each other via the switch board 2120.
The main control board 2110 is coupled to the interface board. For example. The main control board 2110, the interface board 2130, the interface board 2140, and the switch board 2120 are connected to the system backplane through the system bus to realize intercommunication. In a possible implementation manner, an inter-process communication (IPC) channel is established between the main control board 2110 and the interface board 2130 and the interface board 2140, and the main control board 2110 and the interface board 2130 and the interface board 2140 communicate with each other through the IPC channel.
Logically, the communication device 2100 comprises a control plane comprising a main control board 2110 and a central processor 2111, and a forwarding plane comprising various components performing forwarding, such as a forwarding entry memory 2134, a physical interface card 2133, and a network processor 2132. The control plane executes functions of a router, generating a forwarding table, processing signaling and protocol messages, configuring and maintaining the state of the communication equipment, and the like, and issues the generated forwarding table to the forwarding plane, and in the forwarding plane, the network processor 2132 looks up the table of the messages received by the physical interface card 2133 and forwards the messages based on the forwarding table issued by the control plane. The forwarding table issued by the control plane may be stored in the forwarding table entry storage 2134. In some embodiments, the control plane and the forwarding plane may be completely separate and not on the same communication device.
It should be noted that there may be one or more main control boards, and when there are more main control boards, the main control boards may include a main control board and a standby main control board. The interface board may have one or more blocks, and the stronger the data processing capability of the communication device, the more interface boards are provided. There may also be one or more physical interface cards on an interface board. The exchange network board may not have one or more blocks, and when there are more blocks, the load sharing redundancy backup can be realized together. Under the centralized forwarding architecture, the communication device does not need a switching network board, and the interface board undertakes the processing function of the service data of the whole system. Under the distributed forwarding architecture, the communication device can have at least one switching network board, and the data exchange among a plurality of interface boards is realized through the switching network board, so that the high-capacity data exchange and processing capacity is provided. Therefore, the data access and processing capabilities of communication devices in a distributed architecture are greater than those of communication devices in a centralized architecture. Optionally, the communication device may also be in a form of only one board card, that is, there is no switching network board, and the functions of the interface board and the main control board are integrated on the one board card, at this time, the central processing unit on the interface board and the central processing unit on the main control board may be combined into one central processing unit on the one board card to perform a function of superimposing the two, and the data switching and processing capability of the communication device in this form is low (for example, communication devices such as a low-end switch or a router, etc.). Which architecture is specifically adopted depends on the specific networking deployment scenario, and is not limited herein.
In a specific embodiment, the communication device 2100 corresponds to the apparatus for obtaining a mapping rule applied to the second communication device shown in fig. 16 described above. In some embodiments, the first receiving module 1601 shown in fig. 16 corresponds to a physical interface card 2133 or a physical interface card 2143 in the communication device 2100. The first obtaining module 1602 shown in fig. 16 corresponds to at least one of the central processor 2111, the network processor 2132 and the network processor 2142 in the communication device 2100.
In some embodiments, the communication device 2100 also corresponds to the apparatus for obtaining a mapping rule applied to a first communication device illustrated in fig. 17 above. In some embodiments, the first sending module 1702 shown in fig. 17 corresponds to a physical interface card 2133 or a physical interface card 2143 in the communication device 2100. The first obtaining module 1701 illustrated in fig. 17 corresponds to at least one of the central processor 2111, the network processor 2132, and the network processor 2142 in the communication apparatus 2100. At least one of the central processor 2111, the network processor 2132 and the network processor 2142 refers to any one of the central processor 2111, the network processor 2132 and the network processor 2142, or any combination of a plurality of the central processors.
Based on the communication devices shown in fig. 18, 19, and 20, an embodiment of the present application further provides a communication system, including: the communication device comprises a first communication device and a second communication device. Optionally, the first communication device is the communication device 1500 shown in fig. 18, the communication device 2000 shown in fig. 19, or the communication device 2100 shown in fig. 20, and the second communication device is the communication device 1500 shown in fig. 18, the communication device 2000 shown in fig. 19, or the communication device 2100 shown in fig. 20.
The methods executed by the first communication device and the second communication device may refer to the related descriptions of the embodiments of the method for obtaining the mapping rule shown in fig. 4, fig. 12, fig. 14, and fig. 15, and are not described again here.
It should be understood that the processor may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor or the like. It is noted that the processor may be an advanced reduced instruction set machine (ARM) architecture supported processor.
Further, in an alternative embodiment, the memory may include both 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.
The memory may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available. For example, Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct memory bus RAM (DR RAM).
There is also provided a computer readable storage medium having stored therein at least one program instruction or code, which is loaded and executed by a processor to cause a computer to implement the method of obtaining mapping rules as shown in any of fig. 4, 12, 14, 15 above.
The present application provides a computer program, which when executed by a computer, may cause the processor or the computer to perform the respective steps and/or procedures corresponding to the above-described method embodiments.
There is provided a chip comprising a processor for retrieving from a memory and executing instructions stored in the memory, so that a communication device in which the chip is installed performs the method of the above aspects.
Providing another chip comprising: the system comprises 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 through an internal connection path, the processor is used for executing codes in the memory, and when the codes are executed, the processor is used for executing the method in the aspects.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of 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, the processes or functions described in the present application are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may 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 Disk), among others.
The above-mentioned embodiments, objects, technical solutions and advantages of the present application are further described in detail, it should be understood that the above-mentioned embodiments are only examples of the present application, and are not intended to limit the scope of the present application, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present application should be included in the scope of the present application.
Those of ordinary skill in the art will appreciate that the various method steps and modules described in connection with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof, and that the steps and components of the embodiments have been described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by hardware related to instructions of a program, and the program may be stored in a computer readable storage medium, where the above mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk.
When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. By way of example, the methods of embodiments of the present application may be described in the context of machine-executable instructions, such as those included in program modules, being executed in devices on target real or virtual processors. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform particular tasks or implement particular abstract data types. In various embodiments, the functionality of the program modules may be combined or divided between program modules as described. Machine-executable instructions for program modules may be executed within local or distributed devices. In a distributed facility, program modules may be located in both local and remote memory storage media.
Computer program code for implementing the methods of embodiments of the present application may be written in one or more programming languages. These computer program codes may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the computer or other programmable data processing apparatus, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. The program code may execute entirely on the computer, partly on the computer, as a stand-alone software package, partly on the computer and partly on a remote computer or entirely on the remote computer or server.
In the context of embodiments of the present application, computer program code or relevant 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 a carrier include a signal, computer readable medium, and the like.
Examples of signals may include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, and the like.
A machine-readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of a machine-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the device and the module described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the module is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. Further, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may also be an electrical, mechanical or other form of connection.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The terms "first," "second," and the like in this application are used for distinguishing between similar items and items that have substantially the same function or similar functionality, and it should be understood that "first," "second," and "nth" do not have any logical or temporal dependency or limitation on the number or order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first edge network device may be referred to as a second edge network device, and similarly, a second edge network device may be referred to as a first edge network device, without departing from the scope of the various described examples. The first edge network and the device and the second edge network device may both be edge network devices, and in some cases, may be separate and distinct edge network devices.
It should also be understood that, in the embodiments of the present application, the size of the serial number of each process does not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
The term "at least one" in this application means one or more, and the term "plurality" in this application means two or more, for example, a plurality of second messages means two or more second messages. The terms "system" and "network" are often used interchangeably herein.
It is to be understood that the terminology used in the description of the various described 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 described examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It will be further understood that the terms "comprises," "comprising," "includes," and/or "including," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terms "if" and "if" may be interpreted to mean "when" ("where" or "upon") or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined," or "if [ a stated condition or event ] is detected," may be interpreted to mean "upon determining," or "in response to determining," or "upon detecting [ a stated condition or event ], or" in response to detecting [ a stated condition or event ] ", depending on the context.
It should be understood that determining B from a does not mean determining B from a alone, but may also be determined from a and/or other information.
It should also be appreciated that reference throughout this specification to "one embodiment," "an embodiment," "one possible implementation" means that a particular feature, structure, or characteristic described in connection with the embodiment or implementation is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" or "one possible implementation" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

Claims (39)

1. A method for obtaining mapping rules, the method comprising:
a first communication device receives a first message sent by a second communication device, wherein the first communication device and the second communication device are located in a first type of network, the first message carries information of a first mapping rule configured on the second communication device, the first mapping rule is used for address mapping between an address in the first type of network and an address in a second type of network, and the first type of network is different from the second type of network;
and the first communication equipment acquires the first mapping rule according to the information of the first mapping rule.
2. The method of claim 1, wherein the information of the first mapping rule is a mapping address and a port MAP route generated based on the first mapping rule.
3. The method according to claim 1 or 2, wherein before the first communication device receives the first message sent by the second communication device, the method further comprises:
and the first communication equipment and the second communication equipment establish a MAP neighbor relation.
4. The method of claim 3, wherein the first communication device establishes a MAP neighbor relationship with the second communication device, comprising:
the first communication equipment sends a message carrying a first MAP address cluster to the second communication equipment;
and the first communication equipment receives a message which is sent by the second communication equipment and carries a second MAP address cluster.
5. The method according to any of claims 1-4, wherein the first packet further comprises attribute information, the attribute information comprising a MAP Domain type and a MAP Domain identification.
6. The method of claim 5, wherein the attribute information further comprises a route identifier and a route target.
7. The method according to claim 5 or 6, wherein the information of the first mapping rule and the attribute information are both carried in a field of network layer reachability information NLRI of the first packet.
8. The method according to claim 5 or 6, wherein the information of the first mapping rule is carried in a field of the NLRI of the first packet, and the attribute information is carried in an extended attribute field of the first packet.
9. The method according to any of claims 1 to 8, wherein the information of the first mapping rule comprises at least one of address information corresponding to a basic mapping rule BMR, address information corresponding to a forwarding mapping rule FMR and address information corresponding to a default mapping rule DMR.
10. The method of claim 9, wherein the address information corresponding to the BMR comprises an internet protocol version 6 IPv6 prefix, an IPv6 prefix length, an internet protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a Port Set Identification (PSID) offset corresponding to the BMR.
11. The method as claimed in claim 9 or 10, wherein the address information corresponding to the FMR comprises IPv6 prefix, IPv6 prefix length, IPv4 prefix, IPv4 prefix length, EA bit length, and port set identification PSID offset corresponding to the FMR.
12. The method according to any of claims 9-11, wherein the address information corresponding to the DMR comprises an IPv6 prefix and an IPv6 prefix length corresponding to the DMR.
13. The method of any of claims 9-11, wherein the address information corresponding to the DMR comprises an IPv6 address corresponding to the border relay BR device and an IPv6 address prefix length.
14. The method according to any one of claims 1-13, further comprising:
the first communication device sends a second packet to the second communication device, where the second packet carries information of a second mapping rule configured on the first communication device, the second mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network, and the information of the second mapping rule is used for the second communication device to obtain the second mapping rule.
15. The method of any of claims 1-14, wherein the first type of network is an IPv4 network and the second type of network is an IPv6 network, or wherein 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.
16. The method of any of claims 1-15, wherein the first communication device is a MAP 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 provider edge PE device, and the second communication device is a second PE device.
17. The method according to any of claims 1-16, wherein after the first communication device obtains the first mapping rule according to the information of the first mapping rule, the method further comprises:
the first communication equipment receives 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 packet from the first IPv6 address to a 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.
18. The method according to any of claims 1-17, wherein after the first communication device obtains the first mapping rule according to the information of the first mapping rule, the method further comprises:
the first communication equipment acquires 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 to a second IPv6 address from the second IPv4 address based on the first mapping rule, and maps the destination address of the fourth message to the first IPv6 address from the first IPv4 address based on the second mapping rule to obtain a fifth message;
and the first communication equipment sends the fifth message.
19. The method according to any one of claims 1 to 17, wherein 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, the method further comprises:
the first communication device sends a sixth message to a third communication device, so that the third communication device executes 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;
and the sixth message carries information of the first mapping rule, and the third communication device is a Customer Edge (CE) device.
20. The method according to any of claims 1-19, wherein after the first communication device obtains the first mapping rule according to the information of the first mapping rule, the method further comprises:
and the first communication equipment stores the first mapping rule as a routing table entry, and the routing table entry is used for transmitting a message.
21. A method for obtaining mapping rules, the method comprising:
the method comprises the steps that a first communication device obtains information of a first mapping rule configured on the first communication device, wherein the first mapping rule is used for address mapping between an address in a first type of network and an address in a second type of network;
the first communication device sends a first message to a second communication device, the first message carries information of the first mapping rule, the information of the first mapping rule is used for the second communication device to obtain the first mapping rule, the first communication device and the second communication device are located in the first type of network, and the first type of network is different from the second type of network.
22. The method of claim 21, wherein the obtaining, by the first communication device, information of the first mapping rule configured on the first communication device comprises:
the first communication device generates a mapping address and a port MAP route based on the first mapping rule, the MAP route being information of the first mapping rule.
23. The method according to claim 21 or 22, further comprising:
the first communication device receives a second message sent by the second communication device, where the second message carries information of a second mapping rule configured on the second communication device, and the second mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network;
and the first communication equipment acquires the second mapping rule according to the information of the second mapping rule.
24. The method of claim 23, wherein 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 wherein 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.
25. The method of any of claims 21-24, wherein the first communication device is a MAP border 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 provider edge PE device, and the second communication device is a second PE device.
26. The method according to any of claims 21-25, wherein after the first communication device generates the second mapping rule according to the information of the second mapping rule, further comprising:
the first communication equipment acquires 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 maps the source address of the seventh message to a first IPv6 address from the first IPv4 address based on the first mapping rule, and maps the destination address of the seventh message to a second IPv6 address from the second IPv4 address based on the second mapping rule to obtain a third message;
and the first communication equipment sends the third message.
27. The method according to any of claims 21-26, wherein after the first communication device generates the second mapping rule according to the information of the second mapping rule, the method further comprises:
the first communication equipment receives 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 a 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.
28. An apparatus for obtaining a mapping rule, the apparatus being applied to a first communication device, and comprising:
a first receiving module, configured to receive a first packet sent by a second communication device, where the first communication device and the second communication device are located in a first type of network, the first packet carries information of a first mapping rule configured on the second communication device, the first mapping rule is used for address mapping between an address in the first type of network and an address in a second type of network, and the first type of network is different from the second type of network;
and the first obtaining module is used for obtaining the first mapping rule according to the information of the first mapping rule.
29. The apparatus of claim 28, further comprising:
and the establishing module is used for establishing a mapping address and port MAP neighbor relation with the second communication equipment.
30. The apparatus of claim 28 or 29, further comprising:
a first sending module, configured to send a second packet to the second communication device, where the second packet carries information of a second mapping rule configured on the first communication device, the second mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network, and the information of the second mapping rule is used for the second communication device to obtain the second mapping rule.
31. The apparatus of any one of claims 28-30, further comprising:
a second receiving module, configured to receive a third packet, where a source address of the third packet is a first IPv6 address, and a destination address of the third packet is a second IPv6 address;
the first mapping module is used for mapping the source address of the third packet from the first IPv6 address to a first IPv4 address based on the first mapping rule, and mapping the destination address of the third packet from the second IPv6 address to the second IPv4 address based on the second mapping rule.
32. The apparatus of any one of claims 28-31, further comprising:
a second obtaining module, configured to obtain a fourth packet, where a source address of the fourth packet is a second IPv4 address, and a destination address of the fourth packet is a first IPv4 address;
a second mapping module, configured to map, based on the first mapping rule, the source address of the fourth packet from the second IPv4 address to a second IPv6 address, and map, based on the second mapping rule, the destination address of the fourth packet from the first IPv4 address to the first IPv6 address, so as to obtain a fifth packet;
and the second sending module is used for sending the fifth message.
33. An apparatus for obtaining a mapping rule, the apparatus comprising:
a first obtaining module, configured to obtain information of a first mapping rule configured on the first communication device, where the first mapping rule is used for address mapping between an address in a first type of network and an address in a second type of network;
a first sending module, configured to send a first packet to a second communication device, where the first packet carries information of the first mapping rule, and the information of the first mapping rule is used for the second communication device to obtain the first mapping rule, and the first communication device and the second communication device are located in the first type of network, where the first type of network is different from the second type of network.
34. The apparatus of claim 33, further comprising:
a first receiving module, configured to receive a second packet sent by the second communication device, where the second packet carries information of a second mapping rule configured on the second communication device, and the second mapping rule is used for address mapping between an address in the first type of network and an address in the second type of network;
and the second obtaining module is used for obtaining the second mapping rule according to the information of the second mapping rule.
35. The apparatus of claim 33 or 34, further comprising:
a third obtaining module, configured to obtain a seventh packet, where a source address of the seventh packet is a first IPv4 address, and a destination address of the seventh packet is a second IPv4 address;
a first mapping module, configured to map, based on the first mapping rule, a source address of the seventh packet from the first IPv4 address to a first IPv6 address, and map, based on the second mapping rule, a destination address of the seventh packet from the second IPv4 address to the second IPv6 address, so as to obtain a third packet;
and the second sending module is used for sending the third message.
36. The apparatus as claimed in any one of claims 33-35, further comprising:
a second receiving module, configured to receive a fifth packet, where a source address of the fifth packet is a second IPv6 address, and a destination address of the fifth packet is a first IPv6 address;
a second mapping module, configured to map, based on the second mapping rule, the source address of the fifth packet from the second IPv6 address to a second IPv4 address, and map, based on the first mapping rule, the destination address of the fifth packet from the first IPv6 address to the first IPv4 address.
37. A communication device, characterized in that the communication device comprises: a processor coupled to a memory, the memory having stored therein at least one program instruction or code, the at least one program instruction or code loaded and executed by the processor to cause the communication device to implement the method of retrieving mapping rules of any of claims 1-27.
38. A system for acquiring mapping rules, the system comprising a first communication device and a second communication device, the first communication device being configured to perform the method for acquiring mapping rules according to the first communication device of any of claims 1 to 20, and the second communication device being configured to perform the method for acquiring mapping rules according to the second communication device of any of claims 21 to 27.
39. A computer-readable storage medium, having stored therein at least one program instruction or code, which is loaded and executed by a processor to cause a computer to implement a method of obtaining mapping rules as claimed in any one of claims 1-27.
CN202011282640.8A 2020-11-16 2020-11-16 Method, device, equipment and system for obtaining mapping rule and readable storage medium Pending CN114513485A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011282640.8A CN114513485A (en) 2020-11-16 2020-11-16 Method, device, equipment and system for obtaining mapping rule and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011282640.8A CN114513485A (en) 2020-11-16 2020-11-16 Method, device, equipment and system for obtaining mapping rule and readable storage medium

Publications (1)

Publication Number Publication Date
CN114513485A true CN114513485A (en) 2022-05-17

Family

ID=81546501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011282640.8A Pending CN114513485A (en) 2020-11-16 2020-11-16 Method, device, equipment and system for obtaining mapping rule and readable storage medium

Country Status (1)

Country Link
CN (1) CN114513485A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024011982A1 (en) * 2022-07-12 2024-01-18 华为技术有限公司 Message forwarding method, system, network device, storage medium and program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024011982A1 (en) * 2022-07-12 2024-01-18 华为技术有限公司 Message forwarding method, system, network device, storage medium and program product

Similar Documents

Publication Publication Date Title
US10645056B2 (en) Source-dependent address resolution
CN111885075B (en) Container communication method, device, network equipment and storage medium
US10541836B2 (en) Virtual gateways and implicit routing in distributed overlay virtual environments
CN112165725B (en) Message processing method and device
WO2022001835A1 (en) Method and apparatus for sending message, and network device, system and storage medium
CN113824638A (en) Method, equipment and system for forwarding message
CN115004656A (en) Message sending method, equipment and system
US20230198885A1 (en) Network layer reachable information transmission method, system, and apparatus and network device
CN113660164A (en) Message forwarding method and network equipment
CN113726915A (en) Network system, message transmission method therein and related device
WO2022117018A1 (en) Packet transmission method and apparatus
WO2022068744A1 (en) Method for obtaining message header information and generating message, device, and storage medium
WO2023179457A1 (en) Method, apparatus and system for identifying service connection, and storage medium
CN114513485A (en) Method, device, equipment and system for obtaining mapping rule and readable storage medium
CN114553699A (en) Message transmission method, device, equipment and computer readable storage medium
WO2023273957A1 (en) Computing power release method and apparatus, and computing power update method and apparatus
WO2022042403A1 (en) Method for generating routing information, method for sending location information, method for forwarding message, and device
WO2022111666A1 (en) Route advertisement method, apparatus, and system
CN116828024A (en) Service connection identification method, device, system and storage medium
JP2024504845A (en) Packet processing method and related equipment
CN114826898A (en) Cross-host communication method, device, equipment, system and readable storage medium
CN114157455A (en) Data transmission method, device, equipment and storage medium
CN115473765A (en) Message transmission method, device and system
CN114531360A (en) Semantic name acquisition method, device, equipment and storage medium
CN114221895A (en) Data transmission method, device and network equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination