[go: up one dir, main page]

CN114513485A - Method, apparatus, device, system and readable storage medium for obtaining mapping rules - Google Patents

Method, apparatus, device, system and readable storage medium for obtaining mapping rules 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
communication device
address
mapping rule
packet
network
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, apparatus, device, system and readable storage medium for obtaining mapping rules

技术领域technical field

本申请实施例涉及通信领域,尤其涉及一种获取映射规则的方法、装置、设备、系统及可读存储介质。The embodiments of the present application relate to the field of communications, and in particular, to a method, apparatus, device, system, and readable storage medium for acquiring a mapping rule.

背景技术Background technique

随着通信技术的发展,互联网协议第4版(internet protocol version 4,IPv4)网络逐渐向互联网协议第6版(internet protocol version 6,IPv6)网络过渡,在IPv6网络已被大量部署的情况下,IPv4网络是被IPv6网络隔离开的局部网络。为了保证IPv4业务的运行和不断更新的IPv6业务的发展,IPv4到IPv6的场景是长期演进技术方案的研究重点。而IPv4地址与IPv6地址之间的映射成为了有效的解决方案,由于无状态的映射与双重翻译技术(the mapping of address and port using translation,MAP-T)/无状态的映射与双重封装技术(the mapping of address and port using encapsulation,MAP-E)结合了无状态和双重翻译/封装,在技术性能、可靠性和客户的部署成本上都存在较大的优势,因而MAP-T/MAP-E成为了关注度较高的映射规则。With the development of communication technology, the Internet Protocol Version 4 (IPv4) network is gradually transitioning to the Internet Protocol Version 6 (IPv6) network. An IPv4 network is a partial network isolated from an IPv6 network. In order to ensure the operation of IPv4 services and the development of continuously updated IPv6 services, the scenario from IPv4 to IPv6 is the research focus of the long-term evolution technical solution. The mapping between IPv4 addresses and IPv6 addresses has become an effective solution, due to the stateless mapping and double translation technology (the mapping of address and port using translation, MAP-T) / stateless mapping and double encapsulation technology ( the mapping of address and port using encapsulation, MAP-E) combines stateless and double translation/encapsulation, and has great advantages in technical performance, reliability and customer deployment costs, so MAP-T/MAP-E It has become a mapping rule with high attention.

相关技术在获取映射规则时,需要在通信设备上手动部署通信双方的映射规则,配置时间较长,导致获取映射规则的效率较低,且维护成本较高。When acquiring the mapping rules in the related art, it is necessary to manually deploy the mapping rules of both communication parties on the communication device, which takes a long time to configure, resulting in low efficiency in acquiring the mapping rules and high maintenance costs.

发明内容SUMMARY OF THE INVENTION

本申请提出一种获取映射规则的方法、装置、设备、系统及可读存储介质,用于解决获取映射规则的效率较低,维护成本较高的问题。The present application provides a method, apparatus, device, system and readable storage medium for acquiring mapping rules, which are used to solve the problems of low efficiency in acquiring mapping rules and high maintenance cost.

第一方面,提供了一种获取映射规则的方法,方法包括:第一通信设备接收第二通信设备发送的第一报文,该第一通信设备和该第二通信设备位于第一类型的网络,第一报文携带第二通信设备上配置的第一映射规则的信息,该第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,第一类型的网络与第二类型的网络不同;该第一通信设备根据第一映射规则的信息获取第一映射规则。A first aspect provides a method for acquiring a mapping rule, the method comprising: a first communication device receiving a first packet sent by a second communication device, where the first communication device and the second communication device are located in a network of a first type , the first message carries the information of the first mapping rule configured on the second communication device, and the first mapping rule is used for address mapping between addresses in the network of the first type and addresses in the network of the second type, The network of the first type is different from the network of the second type; the first communication device acquires the first mapping rule according to the information of the first mapping rule.

第二通信设备将本端配置的第一映射规则的信息发送给第一通信设备,第一通信设备通过动态学习,获取远端第二通信设备上的第一映射规则,用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,从而确保两端设备采取相同的映射规则进行地址映射;能够减少映射规则的配置和维护工作量,提高获取映射规则的效率,并降低维护成本。The second communication device sends the information of the first mapping rule configured at the local end to the first communication device, and the first communication device acquires the first mapping rule on the remote second communication device through dynamic learning, which is used for the first type of mapping rule. Address mapping between addresses in the network and addresses in the second type of network, so as to ensure that the devices at both ends adopt the same mapping rules for address mapping; it can reduce the configuration and maintenance workload of mapping rules, and improve the efficiency of obtaining mapping rules , and reduce maintenance costs.

在一种可能的实现方式中,第一映射规则的信息为基于第一映射规则生成的MAP路由。In a possible implementation manner, the information of the first mapping rule is a MAP route generated based on the first mapping rule.

第一通信设备根据第一映射规则的信息获取第一映射规则,包括:第一通信设备根据MAP路由生成第一映射规则。如此,第二通信设备将第一映射规则的信息以路由的形式携带在第一报文中传输给第一通信设备。此外,该路由形式的第一映射规则的信息可以TLV格式携带在第一报文中。Acquiring the first mapping rule by the first communication device according to the information of the first mapping rule includes: the first communication device generating the first mapping rule according to the MAP route. In this way, the second communication device carries the information of the first mapping rule in the form of routing in the first message and transmits it to the first communication device. In addition, the information of the first mapping rule in the routing form may be carried in the first packet in a TLV format.

在一种可能的实现方式中,第一通信设备接收第二通信设备发送的第一报文之前,还包括:第一通信设备与第二通信设备建立MAP邻居关系。In a possible implementation manner, before the first communication device receives the first packet sent by the second communication device, the method further includes: establishing a MAP neighbor relationship between the first communication device and the second communication device.

在一种可能的实现方式中,第一通信设备与第二通信设备建立MAP邻居关系,包括:第一通信设备向第二通信设备发送携带第一MAP地址簇的报文;第一通信设备接收第二通信设备发送的携带第二MAP地址簇的报文。In a possible implementation manner, establishing a MAP neighbor relationship between the first communication device and the second communication device includes: the first communication device sends a packet carrying the first MAP address cluster to the second communication device; the first communication device receives The packet that is sent by the second communication device and carries the second MAP address cluster.

在一种可能的实现方式中,第一报文还包括属性信息,属性信息包括映射地址和端口MAP域类型和MAP域标识。In a possible implementation manner, the first packet further includes attribute information, where the attribute information includes a mapping address, a port MAP field type, and a MAP field identifier.

在一种可能的实现方式中,属性信息还包括路由标识符以及路由目标。例如,路由标识符为VPN路由标识符,用于标识不同的VPN。路由目标为VPN路由目标,用于控制VPN路由信息的发布。In a possible implementation manner, the attribute information further includes a route identifier and a route target. For example, the route identifier is a VPN route identifier, which is used to identify different VPNs. The routing target is the VPN routing target, which is used to control the publication of VPN routing information.

在一种可能的实现方式中,第一映射规则的信息以及属性信息均携带在第一报文的网络层可达性信息NLRI的字段中。In a possible implementation manner, the information of the first mapping rule and the attribute information are both carried in the field of the network layer reachability information NLRI of the first packet.

在一种可能的实现方式中,第一映射规则的信息携带在第一报文的网络层可达性信息的字段中,属性信息携带在第一报文的扩展属性字段中。第一映射规则的信息及属性信息既可以携带在同一个字段中,也可携带在不同字段中,携带方式更为灵活。In a possible implementation manner, the information of the first mapping rule is carried in the network layer reachability information field of the first packet, and the attribute information is carried in the extended attribute field of the first packet. The information and attribute information of the first mapping rule may be carried in the same field or in different fields, and the carrying manner is more flexible.

在一种可能的实现方式中,第一映射规则的信息包括基本映射规则BMR对应的地址信息、转发映射规则FMR对应的地址信息以及默认映射规则DMR对应的地址信息中的至少一种。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.

在一种可能的实现方式中,BMR对应的地址信息包括BMR对应的互联网协议第6版IPv6前缀、IPv6前缀长度、互联网协议第4版IPv4前缀、IPv4前缀长度、EA比特长度以及PSID偏移量。In a possible implementation manner, the address information corresponding to the BMR includes an Internet Protocol version 6 IPv6 prefix corresponding to the BMR, an IPv6 prefix length, an Internet Protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a PSID offset. .

在一种可能的实现方式中,FMR对应的地址信息包括FMR对应的互联网协议第6版IPv6前缀、IPv6前缀长度、互联网协议第4版IPv4前缀、IPv4前缀长度、EA比特长度以及PSID偏移量。In a possible implementation manner, the address information corresponding to the FMR includes the IPv6 prefix of the Internet Protocol version 6 corresponding to the FMR, the IPv6 prefix length, the IPv4 prefix of the Internet Protocol version 4, the IPv4 prefix length, the EA bit length, and the PSID offset. .

在一种可能的实现方式中,DMR对应的地址信息包括DMR对应的互联网协议第6版IPv6前缀以及IPv6前缀长度。In a possible implementation manner, the address information corresponding to the DMR includes an IPv6 prefix corresponding to the Internet Protocol Version 6 and an IPv6 prefix length corresponding to the DMR.

在一种可能的实现方式中,DMR对应的地址信息包括边界中继BR设备对应的互联网协议第6版IPv6的地址以及IPv6地址前缀长度。In a possible implementation manner, the address information corresponding to the DMR includes the IPv6 address of the Internet Protocol version 6 and the IPv6 address prefix length corresponding to the border relay BR device.

在一种可能的实现方式中,该方法还包括:第一通信设备向第二通信设备发送第二报文,第二报文携带第一通信设备上配置的第二映射规则的信息,第二映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,第二映射规则的信息用于第二通信设备获取第二映射规则。第一通信设备除了学习第二通信设备上配置的第一映射规则,该第一通信设备通过将第一通信设备上配置的第二映射规则的信息发送给第二通信设备,使得第二通信设备也能够学习第一通信设备上的第二映射规则。In a possible implementation manner, the method further includes: the first communication device sends a second packet to the second communication device, where the second packet carries information of the second mapping rule configured on the first communication device, and the second packet carries information of the second mapping rule configured on the first communication device. The mapping rule is used for address mapping between addresses in the network of the first type and addresses in the network of the second type, 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 sends information about the second mapping rule configured on the first communication device to the second communication device, so that the second communication device The second mapping rule on the first communication device can also be learned.

在一种可能的实现方式中,第一类型的网络为IPv4网络,第二类型的网络为IPv6网络,或者,第一类型的网络为互联网协议第6版IPv6网络,第二类型的网络为互联网协议第4版IPv4网络;第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射,第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射。In a possible implementation manner, the first type of network is an IPv4 network, 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 the Internet Protocol version 4 IPv4 network; the first mapping rule is used for the mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for the mapping between the second IPv4 address and the second IPv6 address.

在一种可能的实现方式中,第一通信设备为MAP边界中继BR设备,第二通信设备为宽带接入服务器;或者,第一通信设备为宽带接入设备,第二通信设备为MAP BR设备;或者,第一通信设备为第一服务商边缘PE设备,第二通信设备为第二PE设备。In a possible implementation manner, 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 device, and the second communication device is a MAP BR device; or, the first communication device is a first service provider edge PE device, and the second communication device is a second PE device.

在一种可能的实现方式中,第一通信设备根据第一映射规则的信息获取第一映射规则之后,还包括:第一通信设备接收第三报文,第三报文的源地址为第一IPv6地址,第三报文的目的地址为第二IPv6地址;第一通信设备基于第一映射规则将第三报文的源地址由第一IPv6地址映射为第一IPv4地址,基于第二映射规则将第三报文的目的地址由第二IPv6地址映射为第二IPv4地址。在传输报文的过程中,通过地址映射,可实现报文从一个IPv4网络穿越IPv6网络后传输至另一个IPv4网络,从而保证了IPv4业务的运行。In a possible implementation manner, after the first communication device acquires the first mapping rule according to the information of the first mapping rule, the method further includes: the first communication device receives a third packet, and the source address of the third packet is the first IPv6 address, the destination address of the third packet is the 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, based on the second mapping rule The destination address of the third packet is mapped from the second IPv6 address to the second IPv4 address. In the process of packet transmission, through address mapping, packets can be transmitted from one IPv4 network to another IPv4 network after traversing an IPv6 network, thereby ensuring the operation of IPv4 services.

在一种可能的实现方式中,第一通信设备根据第一映射规则的信息获取第一映射规则之后,还包括:第一通信设备获取第四报文,第四报文的源地址为第二IPv4地址,第四报文的目的地址为第一IPv4地址;第一通信设备基于第一映射规则将第四报文的源地址由第二IPv4地址映射为第二IPv6地址,基于第二映射规则将第四报文的目的地址由第一IPv4地址映射为第一IPv6地址,得到第五报文;第一通信设备发送第五报文。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 obtains a fourth packet, and the source address of the fourth packet is the second IPv4 address, the destination address of the fourth packet is the first IPv4 address; the first communication device maps the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, based on the second mapping rule The destination address of the fourth packet is mapped from the first IPv4 address to the first IPv6 address to obtain the fifth packet; the first communication device sends the fifth packet.

在一种可能的实现方式中,第一通信设备根据第一映射规则的信息获取第一映射规则之后,还包括:第一通信设备将第一映射规则作为路由表项进行存储,路由表项用于传输报文。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 uses for transmitting messages.

在一种可能的实现方式中,当第一通信设备为宽带接入服务器时,第一通信设备根据第一映射规则的信息获取第一映射规则之后,还包括:第一通信设备向第三通信设备发送第六报文,以使得第三通信设备根据第一映射规则执行第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;其中,第六报文携带第一映射规则的信息,第三通信设备为用户边缘CE设备。In a possible implementation manner, when the first communication device is a broadband access server, after the first communication device acquires the first mapping rule according to the information of the first mapping rule, the method further includes: the first communication device communicates with the third The device sends a sixth packet, so that the third communication device performs the address mapping between the address in the network of the first type and the address in the network of the second type according to the first mapping rule; wherein, the sixth packet carries the first information of a mapping rule, the third communication device is a user edge CE device.

第二方面,提供了一种获取映射规则的方法,该方法包括:第一通信设备获取第一通信设备上配置的第一映射规则的信息,第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;第一通信设备向第二通信设备发送第一报文,第一报文携带第一映射规则的信息,第一映射规则的信息用于第二通信设备获取第一映射规则,第一通信设备和第二通信设备位于第一类型的网络,第一类型的网络与第二类型的网络不同。In a second aspect, a method for acquiring a mapping rule is provided, the method comprising: acquiring, by a first communication device, information of a first mapping rule configured on the first communication device, where the first mapping rule is used in a network of a first type Address mapping between addresses and addresses in the second type of network; the first communication device sends a first packet to the second communication device, the first packet carries the information of the first mapping rule, and the information of the first mapping rule is used The first mapping rule is obtained from the second communication device, 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 the second type of network.

第一通信设备通过将第一通信设备上配置的第一映射规则的信息发送给第二通信设备,使得第二通信设备能够动态学习第一通信设备上的第一映射规则,而无需手动配置,因而能够减少映射规则的配置和维护工作量,从而能够提高获取映射规则的效率,并降低维护成本。The first communication device sends the information of the first mapping rule configured on the first communication device to the second communication device, so that the second communication device can dynamically learn the first mapping rule on the first communication device without manual configuration, Therefore, the workload of configuring and maintaining the mapping rules can be reduced, thereby improving the efficiency of acquiring the mapping rules and reducing the maintenance cost.

在一种可能的实现方式中,第一通信设备获取第一通信设备上配置的第一映射规则的信息,包括:第一通信设备基于第一映射规则生成映射地址和端口MAP路由,将MAP路由作为第一映射规则的信息。如此,第一通信设备将第一映射规则的信息以路由的形式携带在第一报文中传输给第二通信设备。此外,该路由形式的第一映射规则的信息可以TLV格式携带在第一报文中。In a possible implementation manner, acquiring the information of the first mapping rule configured on the first communication device by the first communication device includes: the first communication device generates a mapping address and a port MAP route based on the first mapping rule, and routes the MAP route information as the first mapping rule. In this way, the first communication device carries the information of the first mapping rule in the form of routing in the first message and transmits it to the second communication device. In addition, the information of the first mapping rule in the routing form may be carried in the first packet in a TLV format.

在一种可能的实现方式中,方法还包括:第一通信设备接收第二通信设备发送的第二报文,第二报文携带第二通信设备上配置的第二映射规则的信息,第二映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;第一通信设备根据第二映射规则的信息生成第二映射规则。In a possible implementation manner, the method further includes: the first communication device receives a second packet sent by the second communication device, the second packet carries information of the second mapping rule configured on the second communication device, the second The mapping rule is used for address mapping between addresses in the network of the first type and addresses in the network of the second type; the first communication device generates the second mapping rule according to the information of the second mapping rule.

除了使第二通信设备学习第一通信设备上配置的第一映射规则,该第二通信设备通过将第二通信设备上配置的第二映射规则的信息发送给第一通信设备,使得第一通信设备也能够学习第二通信设备上的第二映射规则。In addition to causing the second communication device to learn the first mapping rule configured on the first communication device, the second communication device enables the first communication device to transmit information about the second mapping rule configured on the second communication device to the first communication device. The device can also learn the second mapping rule on the second communication device.

在一种可能的实现方式中,第一类型的网络为互联网协议第4版IPv4网络,第二类型的网络为互联网协议第6版IPv6网络,或者,所述第一类型的网络为互联网协议第6版IPv6网络,所述第二类型的网络为互联网协议第4版IPv4网络;第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射,第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射。In a possible implementation manner, the first type of network is an Internet Protocol version 4 IPv4 network, 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. Version 6 IPv6 network, the network of the second type is the Internet Protocol Version 4 IPv4 network; the first mapping rule is used for the mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for the second IPv4 A mapping between the address and the second IPv6 address.

在一种可能的实现方式中,第一通信设备为MAP边界中继BR设备,第二通信设备为宽带接入服务器;或者,第一通信设备为宽带接入服务器,第二通信设备为MAP BR设备;或者,第一通信设备为第一服务商边缘PE设备,第二通信设备为第二PE设备。In a possible implementation manner, 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 service provider edge PE device, and the second communication device is a second PE device.

在一种可能的实现方式中,第一通信设备根据第二映射规则的信息生成第二映射规则之后,还包括:第一通信设备获取第七报文,第七报文的源地址为第一IPv4地址,第七报文的目的地址为第二IPv4地址;第一通信设备基于第一映射规则将第七报文的源地址由第一IPv4地址映射为第一IPv6地址,基于第二映射规则将第七报文的目的地址由第二IPv4地址映射为第二IPv6地址,得到第三报文;第一通信设备发送第三报文。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 device obtains a seventh packet, and the source address of the seventh packet is the first IPv4 address, the destination address of the seventh packet is the second IPv4 address; the first communication device maps the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, based on the second mapping rule The destination address of the seventh packet is mapped from the second IPv4 address to the second IPv6 address to obtain a third packet; the first communication device sends the third packet.

在一种可能的实现方式中,第一通信设备根据第二映射规则的信息生成第二映射规则之后,还包括:第一通信设备接收第五报文,第五报文的源地址为第二IPv6地址,第五报文的目的地址为第一IPv6地址;第一通信设备基于第二映射规则将第五报文的源地址由第二IPv6地址映射为第二IPv4地址,基于第一映射规则将第五报文的目的地址由第一IPv6地址映射为第一IPv4地址。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 device receives a fifth packet, and the source address of the fifth packet is the second IPv6 address, the destination address of the fifth packet is the first IPv6 address; the first communication device maps the source address of the fifth packet from the second IPv6 address to the second IPv4 address based on the second mapping rule, based on the first mapping rule The destination address of the fifth packet is mapped from the first IPv6 address to the first IPv4 address.

第三方面,提供了一种获取映射规则的装置,该装置应用于第一通信设备,包括:In a third aspect, an apparatus for acquiring a mapping rule is provided, and the apparatus is applied to a first communication device, including:

第一接收模块,用于接收第二通信设备发送的第一报文,第一通信设备和第二通信设备位于第一类型的网络,第一报文携带第二通信设备上配置的第一映射规则的信息,第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,第一类型的网络与第二类型的网络不同;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 network of a first type, and the first packet carries a first mapping configured on the second communication device The information of the rule, the first mapping rule is used for the address mapping between the address in the network of the first type and the address in the network of the second type, and the network of the first type is different from the network of the second type;

第一获取模块,用于根据第一映射规则的信息获取第一映射规则。The first obtaining module is configured to obtain the first mapping rule according to the information of the first mapping rule.

在一种可能的实现方式中,第一映射规则的信息为基于第一映射规则生成的映射地址和端口MAP路由。In a possible implementation manner, the information of the first mapping rule is a mapping address and a port MAP route generated based on the first mapping rule.

在一种可能的实现方式中,装置,还包括:In a possible implementation manner, the device further includes:

建立模块,用于与第二通信设备建立MAP邻居关系。An establishing module is configured to establish a MAP neighbor relationship with the second communication device.

在一种可能的实现方式中,建立模块,用于向第二通信设备发送携带第一MAP地址簇的报文;接收第二通信设备发送的携带第二MAP地址簇的报文。In a possible implementation manner, the establishment module is configured to send a message carrying the first MAP address cluster to the second communication device; and receive a message carrying the second MAP address cluster sent by the second communication device.

在一种可能的实现方式中,第一报文还包括属性信息,属性信息包括映射地址和端口MAP域类型和MAP域标识。In a possible implementation manner, the first packet further includes attribute information, where the attribute information includes a mapping address, a port MAP field type, and a MAP field identifier.

在一种可能的实现方式中,属性信息还包括路由标识符以及路由目标。In a possible implementation manner, the attribute information further includes a route identifier and a route target.

在一种可能的实现方式中,第一映射规则的信息以及属性信息均携带在第一报文的网络层可达性信息NLRI的字段中。In a possible implementation manner, the information of the first mapping rule and the attribute information are both carried in the field of the network layer reachability information NLRI of the first packet.

在一种可能的实现方式中,第一映射规则的信息携带在第一报文的网络层可达性信息的字段中,属性信息携带在第一报文的扩展属性字段中。In a possible implementation manner, the information of the first mapping rule is carried in the network layer reachability information field of the first packet, and the attribute information is carried in the extended attribute field of the first packet.

在一种可能的实现方式中,映射规则的信息包括基本映射规则BMR对应的地址信息、转发映射规则FMR对应的地址信息以及默认映射规则DMR对应的地址信息中的至少一种。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.

在一种可能的实现方式中,BMR对应的地址信息包括BMR对应的互联网协议第6版IPv6前缀、IPv6前缀长度、互联网协议第4版IPv4前缀、IPv4前缀长度、EA比特长度以及端口集标识PSID偏移量。In a possible implementation manner, the address information corresponding to the BMR includes an Internet Protocol version 6 IPv6 prefix corresponding to the BMR, an IPv6 prefix length, an Internet Protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a port set identifier PSID. Offset.

在一种可能的实现方式中,FMR对应的地址信息包括FMR对应的互联网协议第6版IPv6前缀、IPv6前缀长度、互联网协议第4版IPv4前缀、IPv4前缀长度、EA比特长度以及端口集标识PSID偏移量。In a possible implementation manner, the address information corresponding to the FMR includes the IPv6 prefix of the Internet Protocol version 6 corresponding to the FMR, the IPv6 prefix length, the IPv4 prefix of the Internet Protocol version 4, the IPv4 prefix length, the EA bit length, and the port set identifier PSID. Offset.

在一种可能的实现方式中,DMR对应的地址信息包括DMR对应的互联网协议第6版IPv6前缀以及IPv6前缀长度。In a possible implementation manner, the address information corresponding to the DMR includes an IPv6 prefix corresponding to the Internet Protocol Version 6 and an IPv6 prefix length corresponding to the DMR.

在一种可能的实现方式中,DMR对应的地址信息包括边界中继BR设备对应的互联网协议第6版IPv6的地址以及IPv6地址前缀长度。In a possible implementation manner, the address information corresponding to the DMR includes the IPv6 address of the Internet Protocol version 6 and the IPv6 address prefix length corresponding to the border relay BR device.

在一种可能的实现方式中,装置还包括:In a possible implementation manner, the apparatus further includes:

第一发送模块,用于向第二通信设备发送第二报文,第二报文携带第一通信设备上配置的第二映射规则的信息,第二映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,第二映射规则的信息用于第二通信设备获取第二映射规则。The first sending module is configured to send a second message to the second communication device, where the second message carries the information of the second mapping rule configured on the first communication device, and the second mapping rule is used for Address mapping between addresses and addresses in the second type of network, and the information of the second mapping rule is used by the second communication device to obtain the second mapping rule.

在一种可能的实现方式中,第一类型的网络为互联网协议第4版IPv4网络,第二类型的网络为互联网协议第6版IPv6网络,或者,第一类型的网络为互联网协议第6版IPv6网络,第二类型的网络为互联网协议第4版IPv4网络;In a possible implementation manner, the first type of network is an Internet Protocol version 4 IPv4 network, 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 network IPv6 network, the second type of network is the Internet Protocol Version 4 IPv4 network;

第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射,第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射。The first mapping rule is used for the mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for the mapping between the second IPv4 address and the second IPv6 address.

在一种可能的实现方式中,第一通信设备为MAP边界中继BR设备,第二通信设备为宽带接入服务器;In a possible implementation manner, the first communication device is a MAP border relay BR device, and the second communication device is a broadband access server;

或者,第一通信设备为宽带接入服务器,第二通信设备为MAP BR设备;Or, the first communication device is a broadband access server, and the second communication device is a MAP BR device;

或者,第一通信设备为第一服务商边缘PE设备,第二通信设备为第二PE设备。Alternatively, the first communication device is a first service provider edge PE device, and the second communication device is a second PE device.

在一种可能的实现方式中,装置,还包括:In a possible implementation manner, the device further includes:

第二接收模块,用于接收第三报文,第三报文的源地址为第一IPv6地址,第三报文的目的地址为第二IPv6地址;A second receiving module, configured to receive a third packet, where the source address of the third packet is the first IPv6 address, and the destination address of the third packet is the second IPv6 address;

第一映射模块,用于基于第一映射规则将第三报文的源地址由第一IPv6地址映射为第一IPv4地址,基于第二映射规则将第三报文的目的地址由第二IPv6地址映射为第二IPv4地址。The first mapping module is configured to map the source address of the third packet from the first IPv6 address to the first IPv4 address based on the first mapping rule, and map the destination address of the third packet from the second IPv6 address based on the second mapping rule. Mapped to the second IPv4 address.

在一种可能的实现方式中,装置,还包括:In a possible implementation manner, the device further includes:

第二获取模块,用于获取第四报文,第四报文的源地址为第二IPv4地址,第四报文的目的地址为第一IPv4地址;A second obtaining module, configured to obtain a fourth packet, where 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;

第二映射模块,用于基于第一映射规则将第四报文的源地址由第二IPv4地址映射为第二IPv6地址,基于第二映射规则将第四报文的目的地址由第一IPv4地址映射为第一IPv6地址,得到第五报文;The second mapping module is configured to map the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, and map the destination address of the fourth packet from the first IPv4 address based on the second mapping rule Mapping to the first IPv6 address to obtain the fifth packet;

第二发送模块,用于发送第五报文。The second sending module is used for sending the fifth message.

在一种可能的实现方式中,装置,还包括:In a possible implementation manner, the device further includes:

存储模块,用于将第一映射规则作为路由表项进行存储,路由表项用于传输报文。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.

在一种可能的实现方式中,当第一通信设备为宽带接入服务器时,该装置还包括:第三发送模块,用于向第三通信设备发送第六报文,以使得第三通信设备根据第一映射规则执行第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;其中,第六报文携带第一映射规则的信息,第三通信设备为用户边缘CE设备。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 the third communication device, so that the third communication device Execute address mapping between addresses in the network of the first type and addresses in the network of the second type according to the first mapping rule; wherein, the sixth packet carries the information of the first mapping rule, and the third communication device is the user edge CE equipment.

第四方面,提供了一种获取映射规则的装置,该装置包括:In a fourth aspect, a device for acquiring a mapping rule is provided, the device comprising:

第一获取模块,用于获取第一通信设备上配置的第一映射规则的信息,第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;The first acquisition module is used to acquire the information of the first mapping rule configured on the first communication device, and the first mapping rule is used for the address mapping between the address in the network of the first type and the address in the network of the second type ;

第一发送模块,用于向第二通信设备发送第一报文,第一报文携带第一映射规则的信息,第一映射规则的信息用于第二通信设备获取第一映射规则,第一通信设备和第二通信设备位于第一类型的网络,第一类型的网络与第二类型的网络不同。A first sending module, configured to send a first packet to the second communication device, where the first packet carries information of the first mapping rule, and the information of the first mapping rule is used by the second communication device to obtain the first mapping rule, and the first The communication device and the second communication device are located on a first type of network, which is different from the second type of network.

在一种可能的实现方式中,第一获取模块,用于基于第一映射规则生成映射地址和端口MAP路由,将MAP路由作为第一映射规则的信息。In a possible implementation manner, the first obtaining module is configured to generate the mapped address and the port MAP route based on the first mapping rule, and use the MAP route as the information of the first mapping rule.

在一种可能的实现方式中,该装置还包括:In a possible implementation, the device further includes:

第一接收模块,用于接收第二通信设备发送的第二报文,第二报文携带第二通信设备上配置的第二映射规则的信息,第二映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;The first receiving module is configured to receive a second packet sent by the second communication device, where the second packet carries information of the second mapping rule configured on the second communication device, and the second mapping rule is used in the first type of network address mapping between addresses in the second type of networks and addresses in networks of the second type;

第二获取模块,用于根据第二映射规则的信息获取第二映射规则。The second obtaining module is configured to obtain the second mapping rule according to the information of the second mapping rule.

在一种可能的实现方式中,第一类型的网络为互联网协议第4版IPv4网络,第二类型的网络为互联网协议第6版IPv6网络,或者,第一类型的网络为互联网协议第6版IPv6网络,第二类型的网络为互联网协议第4版IPv4网络;第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射,第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射。In a possible implementation manner, the first type of network is an Internet Protocol version 4 IPv4 network, 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 network IPv6 network, the second type of network is the Internet Protocol version 4 IPv4 network; the first mapping rule is used for the mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for the second IPv4 address and the second Mapping between IPv6 addresses.

在一种可能的实现方式中,第一通信设备为MAP边界中继BR设备,第二通信设备为宽带接入服务器;In a possible implementation manner, the first communication device is a MAP border relay BR device, and the second communication device is a broadband access server;

或者,第一通信设备为宽带接入服务器,第二通信设备为MAP BR设备;Or, the first communication device is a broadband access server, and the second communication device is a MAP BR device;

或者,第一通信设备为第一服务商边缘PE设备,第二通信设备为第二PE设备。Alternatively, the first communication device is a first service provider edge PE device, and the second communication device is a second PE device.

在一种可能的实现方式中,该装置还包括:In a possible implementation, the device further includes:

第三获取模块,用于获取第七报文,第七报文的源地址为第一IPv4地址,第七报文的目的地址为第二IPv4地址;a third obtaining module, configured to obtain a seventh packet, where the source address of the seventh packet is the first IPv4 address, and the destination address of the seventh packet is the second IPv4 address;

第一映射模块,用于基于第一映射规则将第七报文的源地址由第一IPv4地址映射为第一IPv6地址,基于第二映射规则将第七报文的目的地址由第二IPv4地址映射为第二IPv6地址,得到第三报文;The first mapping module is configured to map the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, and map the destination address of the seventh packet from the second IPv4 address based on the second mapping rule. Mapping to the second IPv6 address to obtain the third packet;

第二发送模块,用于发送第三报文。The second sending module is used for sending the third message.

在一种可能的实现方式中,该装置,还包括:In a possible implementation, the device further includes:

第二接收模块,用于接收第五报文,第五报文的源地址为第二IPv6地址,第五报文的目的地址为第一IPv6地址;A second receiving module, configured to receive a fifth packet, where the source address of the fifth packet is the second IPv6 address, and the destination address of the fifth packet is the first IPv6 address;

第二映射模块,用于基于第二映射规则将第五报文的源地址由第二IPv6地址映射为第二IPv4地址,基于第一映射规则将第五报文的目的地址由第一IPv6地址映射为第一IPv4地址。The second mapping module is configured to map the source address of the fifth packet from the second IPv6 address to the second IPv4 address based on the second mapping rule, and map the destination address of the fifth packet from the first IPv6 address based on the first mapping rule Mapped to the first IPv4 address.

第五方面,提供了一种通信设备,包括处理器,处理器与存储器耦合,存储器中存储有至少一条程序指令或代码,至少一条程序指令或代码由处理器加载并执行,以使通信设备实现第一方面或第二方面中任一的获取映射规则的方法。In a fifth aspect, a communication device is provided, comprising a processor, the processor is coupled to a memory, and at least one program instruction or code is stored in the memory, and the at least one program instruction or code is loaded and executed by the processor, so that the communication device realizes The method for obtaining a mapping rule according to any one of the first aspect or the second aspect.

第六方面,提供了一种计算机可读存储介质,存储介质中存储有至少一条程序指令或代码,程序指令或代码由处理器加载并执行时以使计算机实现如第一方面或第二方面中任一所述的获取映射规则的方法。A sixth aspect provides a computer-readable storage medium, where at least one program instruction or code is stored in the storage medium, and when the program instruction or code is loaded and executed by a processor, the computer implements the method as described in the first aspect or the second aspect. Any of the described methods for obtaining mapping rules.

第七方面,提供了一种获取映射规则的系统,所述系统包括第一通信设备和第二通信设备,所述第一通信设备用于执行第二方面或第二方面中任一可能的实现方式所述的获取映射规则的方法,所述第二通信设备用于执行第一方面或第一方面中任一可能的实现方式所述的获取映射规则的方法。A seventh aspect provides a system for acquiring mapping rules, the system includes a first communication device and a second communication device, the first communication device is configured to execute the second aspect or any possible implementation of the second aspect The method for acquiring a mapping rule according to the method, the second communication device is configured to execute the method for acquiring a mapping rule according to the first aspect or any possible implementation manner of the first aspect.

还提供了另一种通信设备,该设备包括:收发器、存储器和处理器。其中,该收发器、该存储器和该处理器通过内部连接通路互相通信,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,以控制收发器接收信号,并控制收发器发送信号,并且当该处理器执行该存储器存储的指令时,使得该处理器执行第一方面或第一方面的任一种可能的实施方式中的方法,或者执行第二方面或第二方面的任一种可能的实施方式中的方法。Another communication device is also provided that includes a transceiver, a memory, and a processor. The transceiver, the memory and the processor communicate with each other through an internal connection path, the memory is used for storing instructions, and the processor is used for executing the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals , and when the processor executes the instructions stored in the memory, it causes the processor to execute the method in the first aspect or any possible implementation manner of the first aspect, or execute the second aspect or any one of the second aspect method in a possible implementation.

作为一种示例性实施例,所述处理器为一个或多个,所述存储器为一个或多个。As an exemplary embodiment, the processor is one or more, and the memory is one or more.

作为一种示例性实施例,所述存储器可以与所述处理器集成在一起,或者所述存储器与处理器分离设置。As an exemplary embodiment, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

在具体实现过程中,存储器可以为非瞬时性(non-transitory)存储器,例如只读存储器(read only memory,ROM),其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型以及存储器与处理器的设置方式不做限定。In a specific implementation process, the memory may be a non-transitory memory, such as a read only memory (ROM), which may be integrated with the processor on the same chip, or may be separately provided in different On the chip, the embodiment of the present application does not limit the type of the memory and the setting manner of the memory and the processor.

提供了一种计算机程序(产品),所述计算机程序(产品)包括:计算机程序代码,当所述计算机程序代码被计算机运行时,使得所述计算机执行上述各方面中的方法。A computer program (product) is provided, the computer program (product) comprising: computer program code which, when executed by a computer, causes the computer to perform the methods of the above aspects.

提供了一种芯片,包括处理器,用于从存储器中调用并运行所述存储器中存储的指令,使得安装有所述芯片的通信设备执行上述各方面中的方法。A chip is provided, including a processor for invoking and executing instructions stored in a memory, so that a communication device on which the chip is installed performs the methods in the above-mentioned aspects.

提供另一种芯片,包括:输入接口、输出接口、处理器和存储器,所述输入接口、输出接口、所述处理器以及所述存储器之间通过内部连接通路相连,所述处理器用于执行所述存储器中的代码,当所述代码被执行时,所述处理器用于执行上述各方面中的方法。Another chip is provided, including: an input interface, an output interface, a processor, and a memory, the input interface, the output interface, the processor, and the memory are connected through an internal connection path, and the processor is used to execute all The code in the memory, when the code is executed, the processor is configured to perform the methods of the above aspects.

附图说明Description of drawings

图1是本申请实施例提供的一种实施环境的结构示意图;1 is a schematic structural diagram of an implementation environment provided by an embodiment of the present application;

图2是本申请实施例提供的一种通信系统的结构示意图;FIG. 2 is a schematic structural diagram of a communication system provided by an embodiment of the present application;

图3是本申请实施例提供的另一种通信系统的结构示意图;3 is a schematic structural diagram of another communication system provided by an embodiment of the present application;

图4是本申请实施例提供的一种获取映射规则的方法流程图;4 is a flowchart of a method for obtaining a mapping rule provided by an embodiment of the present application;

图5是本申请实施例提供的一种扩展字段示意图;5 is a schematic diagram of an extension field provided by an embodiment of the present application;

图6是本申请实施例提供的一种更新消息报文的部分结构示意图;6 is a schematic diagram of a partial structure of an update message message provided by an embodiment of the present application;

图7是本申请实施例提供的一种网络层可达性信息字段的结构示意图;7 is a schematic structural diagram of a network layer reachability information field provided by an embodiment of the present application;

图8是本申请实施例提供的一种TLV字段示意图;8 is a schematic diagram of a TLV field provided by an embodiment of the present application;

图9是本申请实施例提供的另一种TLV字段示意图;9 is a schematic diagram of another TLV field provided by an embodiment of the present application;

图10是本申请实施例提供的另一种TLV字段示意图;10 is a schematic diagram of another TLV field provided by an embodiment of the present application;

图11是本申请实施例提供的一种扩展字段示意图;11 is a schematic diagram of an extension field provided by an embodiment of the present application;

图12是本申请实施例提供的一种获取映射规则的方法流程图;12 is a flowchart of a method for obtaining a mapping rule provided by an embodiment of the present application;

图13是本申请实施例提供的一种通信系统的结构示意图;13 is a schematic structural diagram of a communication system provided by an embodiment of the present application;

图14是本申请实施例提供的一种获取映射规则的方法流程图;14 is a flowchart of a method for obtaining a mapping rule provided by an embodiment of the present application;

图15是本申请实施例提供的一种获取映射规则的方法流程图;15 is a flowchart of a method for obtaining a mapping rule provided by an embodiment of the present application;

图16是本申请实施例提供的一种获取映射规则的装置结构示意图;16 is a schematic structural diagram of an apparatus for acquiring mapping rules provided by an embodiment of the present application;

图17是本申请实施例提供的另一种获取映射规则的装置结构示意图;17 is a schematic structural diagram of another apparatus for acquiring mapping rules provided by an embodiment of the present application;

图18是本申请实施例提供的一种通信设备的结构示意图;FIG. 18 is a schematic structural diagram of a communication device provided by an embodiment of the present application;

图19是本申请实施例提供的另一种通信设备的结构示意图;FIG. 19 is a schematic structural diagram of another communication device provided by an embodiment of the present application;

图20是本申请实施例提供的另一种通信设备的结构示意图。FIG. 20 is a schematic structural diagram of another communication device provided by an embodiment of the present application.

具体实施方式Detailed ways

本申请的实施方式部分使用的术语仅用于对本申请的实施例进行解释,而非旨在限定本申请。下面结合附图,对本发明的实施例进行描述。The terms used in the embodiment part of the present application are only used to explain the embodiments of the present application, and are not intended to limit the present application. Embodiments of the present invention will be described below with reference to the accompanying drawings.

针对IPv6网络已被大量部署,IPv4网络被IPv6网络隔离开的情况,为了保证IPv4业务的运行和不断更新的IPv6业务的发展,IPv4地址与IPv6地址之间的映射成为了有效的解决方案,而如何获取地址映射的映射规则,是成功进行地址映射的关键。但由于手动配置映射规则的效率较低,且维护成本较高,因此,本申请实施例提供了一种获取映射规则的方法,该方法可实现映射规则的自动学习。In view of the situation that IPv6 networks have been deployed in large numbers and IPv4 networks are isolated from IPv6 networks, in order to ensure the operation of IPv4 services and the development of continuously updated IPv6 services, the mapping between IPv4 addresses and IPv6 addresses has become an effective solution. How to obtain the mapping rules for address mapping is the key to successful address mapping. However, since the efficiency of manually configuring the mapping rules is low and the maintenance cost is high, the embodiments of the present application provide a method for acquiring the mapping rules, which can realize automatic learning of the mapping rules.

以本申请实施例提供的方法应用于图1所示的通信系统为例,如图1所示,该通信系统包括第一通信设备101和第二通信设备102。其中,第一通信设备101和第二通信设备102位于第一类型的网络。第一通信设备101上配置有第一映射规则,第二通信设备102上配置有第二映射规则,第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,第二映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射。示例性地,第一类型的网络为IPv4网络,第二类型的网络为IPv6网络。第一映射规则和第二映射规则中的一个映射规则能够实现将源地址在IPv4地址与IPv6地址之间进行映射,另一个映射规则能够实现将目的地址在IPv4地址与IPv6地址之间进行映射。例如,第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射,第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射。因此,第一通信设备101需要学习第二通信设备102上的第一映射规则,第二通信设备102需要学习第一通信设备101上的第二映射规则。Taking the method provided by the embodiment of the present application applied 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 the first type of network. The first communication device 101 is configured with a first mapping rule, the second communication device 102 is configured with a second mapping rule, and the first mapping rule is used for the difference between the address in the first type of network and the address in the second type of network. The second mapping rule is used for the address mapping between the addresses in the network of the first type and the addresses in the network of the second type. Exemplarily, 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 can map the source address between the IPv4 address and the IPv6 address, and the other mapping rule can map the destination address between the IPv4 address and the IPv6 address. For example, the first mapping rule is used for the mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for the mapping between the second IPv4 address and the second IPv6 address. Therefore, the first communication device 101 needs to learn the first mapping rule on the second communication device 102 , and the second communication device 102 needs to learn the second mapping rule on the first communication device 101 .

在图1所示的通信系统的基础上,以该通信系统为集中式MAP-T/MAP-E场景为例,如图2所示,第一通信设备101为MAP边界中继(MAP border relay,MAP BR)设备,第二通信设备102为宽带接入服务器(broadband remote access server,BRAS);或者,第一通信设备为BRAS,第二通信设备为MAP BR设备。图2中,MAP BR作为MAP域的边缘设备,也即中继设备,用于连接IPv4网络和IPv6网络,负责IPv4与IPv6封装/解封装。BRAS分配地址给MAP用户边缘(MAP customer edge,MAP CE)设备,MAP CE负责进行IPv4与IPv6封装/解封装,实现IPv4用户穿越IPv6网络访问IPv4网络的功能。需要说明的是,BRAS和MAP BR可为多个,图2仅以示出一个为例。报文的发送方向或者映射规则的学习方向可以是由BRAS至MAP BR,或者由MAP BR至BRAS。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 border relay) , MAP BR) device, the second communication device 102 is a broadband remote access server (BRAS); or, the first communication device is a BRAS, and the second communication device is a MAP BR device. In Fig. 2, the MAP BR, as the edge device of the MAP domain, that is, the relay device, is used to connect the IPv4 network and the IPv6 network, and is responsible for IPv4 and IPv6 encapsulation/decapsulation. The BRAS allocates addresses to MAP customer edge (MAP customer edge, MAP CE) devices, and the MAP CE is responsible for encapsulating/decapsulating IPv4 and IPv6, so as to realize the function of IPv4 users accessing the IPv4 network through the IPv6 network. It should be noted that there may be multiple BRASs and MAP BRs, and FIG. 2 only shows one as an example. The sending direction of the message or the learning direction of the mapping rule may be from BRAS to MAP BR, or from MAP BR to BRAS.

除了图2所示的应用场景外,本申请实施例提供的方法也适用于IPv4孤岛在IPv6网络中的互通场景。如图3所示,第一通信设备为第一服务商边缘(provider edge,PE)设备,第二通信设备为第二PE设备。通过在PE设备上部署MAP规则并通过边界网关协议(border gateway protocol,BGP)互相通告,实现IPv4孤岛穿越IPv6网络进行互通。其中,PE可以不止三个,图3仅以示出三个为例。报文的发送方向或者映射规则的学习方向可以是一个PE至另外的PE。In addition to the application scenario shown in FIG. 2 , the method provided by the embodiment of the present application is also applicable to the intercommunication scenario of the IPv4 island in the IPv6 network. As shown in FIG. 3 , the first communication device is a first provider edge (provider edge, PE) device, and the second communication device is a second PE device. By deploying MAP rules on PE devices and advertising each other through the border gateway protocol (BGP), IPv4 islands can communicate with each other across the IPv6 network. There may be more than three PEs, and FIG. 3 only shows three PEs as an example. The sending direction of the message or the learning direction of the mapping rule can be one PE to another PE.

接下来,以在第一通信设备上配置了第一映射规则,在第二通信设备上配置了第二映射规则,通过第一通信设备与第二通信设备的交互过程来实现映射规则的学习为例,对本申请实施例提供的获取映射规则的方法进行说明。参见图4,本申请实施例提供的获取映射规则的方法包括如下几个过程。Next, the first mapping rule is configured on the first communication device and the second mapping rule is configured on the second communication device, and the learning of the mapping rule is realized through the interaction process between the first communication device and the second communication device as For example, the method for acquiring the mapping rule provided by the embodiment of the present application will be described. Referring to FIG. 4 , the method for obtaining a mapping rule provided by an embodiment of the present application includes the following processes.

401,第一通信设备获取第一通信设备上配置的第一映射规则的信息,第一通信设备位于第一类型的网络,第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,第一类型的网络与第二类型的网络不同。401. The first communication device acquires information of a first mapping rule configured on the first communication device, the first communication device is located in a network of a first type, and the first mapping rule is used for addresses in the network of the first type and addresses of the second type. The address mapping between addresses in the network, the first type of network is different from the second type of network.

本申请实施例不对第一通信设备获取第一通信设备上配置的第一映射规则的方式进行限定,例如,在第一通信设备上手动配置第一映射规则后,可由第一通信设备对该第一映射规则进行存储,将第一映射规则存储在第一通信设备的存储空间中或者其他设备的存储空间中。第一通信设备可从对应的存储空间中获取第一通信设备上配置的第一映射规则。This embodiment of the present application does not limit the manner in which the first communication device acquires 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 can A mapping rule is stored, and the first mapping rule is stored in the storage space of the first communication device or the storage space of other devices. The first communication device may acquire the first mapping rule configured on the first communication device from the corresponding storage space.

另外,本申请实施例也不对第一映射规则的内容进行限定,能够实现IPv4地址和IPv6地址的映射即可。由于映射地址与端口(mapping address and port,MAP)技术通过一定的规则将IPv4地址封装和解封装IPv6映射为IPv6地址,从而实现IPv4用户穿越IPv6网络访问IPv4网络的目的。而MAP技术中无状态地对地址(address)和端口(port)对同一地址进行复用,根据报文格式又分为双重封装MAP-E和双重翻译MAP-T两种。MAP-T/MAP-E技术结合了无状态和双重翻译/封装,因而在技术性能、可靠性和客户的部署成本上都存在较大的优势。又由于MAP技术中有三种映射规则,分别为基本映射规则(basic mapping rule,BMR)、转发映射规则(forwarding mapping rule,FMR)和默认映射规则(default mapping rule,DMR)。因此,在一种可能的实现方式中,本申请实施例中的第一映射规则包括但不限于中的BMR、FMR和DMR中的至少一种。第一映射规则的信息包括基本映射规则BMR对应的地址信息、转发映射规则FMR对应的地址信息以及默认映射规则DMR对应的地址信息中的至少一种。In addition, the embodiment of the present application does not limit the content of the first mapping rule, and only needs to be able to implement the mapping between IPv4 addresses and IPv6 addresses. Since the mapping address and port (MAP) technology maps the IPv4 address encapsulation and decapsulation IPv6 to the IPv6 address through certain rules, the purpose of IPv4 users accessing the IPv4 network through the IPv6 network is realized. In the MAP technology, the same address is multiplexed with an address and a port in a stateless manner. According to the message format, it is divided into double encapsulation MAP-E and double translation MAP-T. MAP-T/MAP-E technology combines stateless and double translation/encapsulation, so there are great advantages in technical performance, reliability and customer's deployment cost. In addition, there are three mapping rules in the MAP technology, 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 this embodiment of the present application includes, but is not limited to, at least one of BMR, FMR, and DMR in . 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.

进一步地,无论第一映射规则是哪种映射规则,本申请实施例提供的方法中,可将第一映射规则的信息以路由的形式来表示。在一种可能的实现方式中,第一通信设备获取第一通信设备上配置的第一映射规则的信息,包括:第一通信设备基于第一映射规则生成MAP路由,将MAP路由作为第一映射规则的信息。示例性地,BMR对应的地址信息包括但不限于BMR对应的IPv6前缀、IPv6前缀长度、IPv4前缀、IPv4前缀长度、EA比特长度以及端口集标识(port-set ID,PSID)偏移量。FMR对应的地址信息包括但不限于FMR对应的IPv6前缀、IPv6前缀长度、IPv4前缀、IPv4前缀长度、EA比特长度以及PSID偏移量。DMR对应的地址信息包括但不限于DMR对应的IPv6前缀以及IPv6前缀长度。或者,DMR对应的地址信息包括但不限于BR设备对应的IPv6的地址以及IPv6地址前缀长度。Further, no matter what kind of mapping rule the first mapping rule is, in the method provided by the embodiment of the present application, the information of the first mapping rule can be represented in the form of routing. In a possible implementation manner, acquiring the information of the first mapping rule configured on the first communication device by the first communication device includes: the first communication device generates a MAP route based on the first mapping rule, and uses the MAP route as the first mapping rule information. Exemplarily, the address information corresponding to the BMR includes, but is not limited to, the IPv6 prefix, the IPv6 prefix length, the IPv4 prefix, the IPv4 prefix length, the EA bit length, and the port set ID (port-set ID, PSID) offset corresponding to the BMR. The address information corresponding to the FMR includes, but is not limited to, the IPv6 prefix corresponding to the FMR, the IPv6 prefix length, the IPv4 prefix, the IPv4 prefix length, the EA bit length, and the PSID offset. The address information corresponding to the DMR includes but is not limited to the IPv6 prefix corresponding to the DMR and the length of the IPv6 prefix. Alternatively, the address information corresponding to the DMR includes but is not limited to the IPv6 address corresponding to the BR device and the IPv6 address prefix length.

402,第一通信设备向第二通信设备发送第一报文,第一报文携带第一映射规则的信息,第二通信设备位于第一类型的网络。402. The first communication device sends a first packet to the second communication device, where the first packet carries information of the first mapping rule, and the second communication device is located in a network of the first type.

为了使得第二通信设备也能够学习到第一通信设备上配置的第一映射规则,第一通信设备可将第一通信设备上配置的第一映射规则的信息发送给第二通信设备。例如,第一通信设备通过发送报文的方式,将第一映射规则的信息发送给第二通信设备。在本申请实施例中,以通过第一报文携带第一映射规则的信息,第一通信设备向第二通信设备发送第一报文为例。在第一通信设备向第二通信设备发送第一报文之前,第一通信设备与第二通信设备先建立MAP邻居关系。In order to enable the second communication device to also 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 by sending a message. In the embodiment of the present application, it is taken as an example that the first communication device sends the first packet to the second communication device by using the first packet to carry the information of the first mapping rule. Before the first communication device sends the first packet to the second communication device, the first communication device and the second communication device first establish a MAP neighbor relationship.

在一种可能的实现方式中,第一通信设备与第二通信设备建立MAP邻居关系,包括:第一通信设备向第二通信设备发送携带第一MAP地址簇的报文;第一通信设备接收第二通信设备发送的携带第二MAP地址簇的报文。以通过BGP打开(Open)报文传输MAP地址簇为例,第一通信设备和第二通信设备可在BGP Open报文中增加MAP地址族能力,通过MAP能力协商后建立BGP MAP邻居。示例性地,BGP能力协商字段格式如图5所示。In a possible implementation manner, establishing a MAP neighbor relationship between the first communication device and the second communication device includes: the first communication device sends a packet carrying the first MAP address cluster to the second communication device; the first communication device receives The packet that is sent by the second communication device and carries the second MAP address cluster. Taking the transmission of the MAP address cluster through the BGP Open message as an example, the first communication device and the second communication device may add the MAP address family capability in the BGP Open message, and establish a BGP MAP neighbor after negotiating the MAP capability. Exemplarily, the format of the BGP capability negotiation field is shown in FIG. 5 .

其中,在能力通告(capabilities advertisement)下扩展字段,用于指示MAP地址族。则第一通信设备在BGP Open报文中的capabilities advertisement字段下携带第一MAP地址簇,将携带了第一MAP地址簇的BGP Open报文发送给第二通信设备。第二通信设备在BGP Open报文中的capabilities advertisement字段下携带第二MAP地址簇,将携带了第二MAP地址簇的BGP Open报文发送给第一通信设备。如此,在通告了地址簇之后,第一通信设备与第二通信设备建立MAP邻居关系。Among them, the extension field is used to indicate the MAP address family under the capabilities advertisement. Then, the first communication device carries the first MAP address cluster under the capabilities advertisement field in the BGP Open packet, and sends the BGP Open packet carrying the first MAP address cluster to the second communication device. The second communication device carries the second MAP address cluster under the capabilities advertisement field in the BGP Open message, and sends the BGP Open message carrying the second MAP address cluster to the first communication device. In this way, after announcing the address cluster, the first communication device establishes a MAP neighbor relationship with the second communication device.

在建立MAP邻居关系后,第一通信设备发送携带第一映射规则的信息的第一报文。示例性地,该第一报文还包括属性信息,属性信息包括MAP域类型和MAP域标识。可选地,属性信息还包括路由标识符以及路由目标。本申请实施例不对第一报文携带第一映射规则的信息以及属性信息的方式进行限定,包括但不限于如下两种。After establishing the MAP neighbor relationship, the first communication device sends a first packet carrying information of the first mapping rule. Exemplarily, the first packet further includes attribute information, where 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. This embodiment of the present application does not limit the manner in which the first packet carries the information of the first mapping rule and 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.

本申请实施例不对携带第一映射规则的信息的第一报文进行限定,示例性地,该第一报文为更新(update)报文。如图6所示,第一映射规则的信息以BGP路由的形式承载在update消息报文的网络层可达性信息(network layer reachability information,NLRI)字段中传递。update消息报文中NLRI字段包括前缀长度(prefix length)字段,承载了以BGP路由形式表示的第一映射规则的信息后,NLRI字段进行了扩展。一种可能的NLRI信息可按如图6所示的格式定义,其中除prefix length以外,其他为扩展的字段,扩展的字段的内容如图7所示,包括属性信息,该属性信息包括MAP域类型(MAP domain type)和MAP域标识(MAP domain ID)。还包括路由标识符(route distinguisher)以及路由目标(routetarget),例如虚拟专用网络(virtual private network,VPN)路由标识符和VPN路由目标。其中,MAP域类型包括MAP-T或MAP-E。路由标识符用来标识不同的路由,例如VPN路由标识符用来标识不同的VPN。路由目标用来控制路由信息的发布,例如VPN路由目标用来控制VPN路由信息的发布。This embodiment of the present application does not limit the first packet that carries the information of the first mapping rule. Exemplarily, the first packet is an update (update) packet. As shown in FIG. 6 , the information of the first mapping rule is carried in the network layer reachability information (network layer reachability information, NLRI) field of the update message and transmitted in the form of a BGP route. The NLRI field in the update message packet includes a prefix length (prefix length) field, and after carrying the information of the first mapping rule expressed in the form of a BGP route, the NLRI field is extended. A possible NLRI information can be defined in the format shown in Figure 6, in which, except for the prefix length, other fields are extended fields, and the content of the extended fields is shown in Figure 7, including attribute information, which includes the MAP field. Type (MAP domain type) and MAP domain identification (MAP domain ID). Also included are route distinguishers and 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 identifier is used to identify different routes, for example, the VPN route identifier is used to identify different VPNs. The routing target is used to control the publication of routing information, for example, the VPN routing target is used to control the publication of VPN routing information.

另外,图7所示的数据(data)字段以类型-长度-内容(type-length-value,TLV)形式携带第一映射规则的信息。例如,如果第一映射规则的信息包括BMR对应的地址信息,则BMR TLV格式如图8所示。In addition, the data (data) field shown in FIG. 7 carries the information of the first mapping rule in the form of type-length-content (type-length-value, TLV). 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:对应BMR规则,用于表示BMR对应的地址信息。以图2所示的通信系统为例,在MAP-CE上用于将IPv4用户报文进行网络地址转换(network address translation,NAT)4和IPv6翻译/封装,在MAP-BR上用于将IPv4地址从IPv6报文中解封装/解隧道,以及将回程流量的IPv4地址+端口(port)进行IPv6翻译和封装后,在MAP域中按照IPv6路由转发到MAP-CE上。BMR对应的地址信息包括:BMR规则对应的IPv6前缀(Rule-IPv6-prefix)、IPv6前缀长度(IPv6 prefix length)、IPv4前缀(Rule-IPv4-prefix)、EA比特长度(EA-bits-length)、PSID偏移量(port-set ID-offset),这些参数配置在MAP-CE上可以计算出共享的IPv4地址和端口序列,以及MAP-CE的IPv6地址从而实现IPv4地址与IPv6地址的映射。BMR TLV: corresponds to the BMR rule and is used to indicate the address information corresponding to the BMR. Taking the communication system shown in Fig. 2 as an example, on MAP-CE, for carrying out network address translation (network address translation, NAT) 4 and IPv6 translation/encapsulation with IPv4 user message, on MAP-BR, for carrying out IPv4 The address is decapsulated/de-tunneled from the IPv6 message, and the IPv4 address + port (port) of the backhaul traffic is translated and encapsulated in IPv6, and then forwarded to the MAP-CE according to the IPv6 route in the MAP domain. The address information corresponding to the BMR includes: the IPv6 prefix (Rule-IPv6-prefix) corresponding to the BMR rule, the IPv6 prefix length (IPv6 prefix length), the IPv4 prefix (Rule-IPv4-prefix), and the EA bit length (EA-bits-length) , PSID offset (port-set ID-offset), these parameters can be configured on the MAP-CE to calculate the shared IPv4 address and port sequence, as well as the IPv6 address of the MAP-CE to realize the mapping between the IPv4 address and the IPv6 address.

例如,如果第一映射规则的信息包括FMR对应的地址信息,则FMR TLV格式包括如下内容。FMR TLV:对应FMR规则,该FMR TLV用于携带FMR对应的地址信息,用于在网络中实现MAP-CE间的互访流量直接通信。需要说明的是,FMR和BMR可以是相同的,BMR TLV的结构如图8所示,即可以将BMR通过配置作为FMR。For example, if the information of the first mapping rule includes address information corresponding to the FMR, the FMR TLV format includes the following contents. FMR TLV: corresponds to the FMR rule, the FMR TLV is used to carry the address information corresponding to the FMR, and is used to realize the direct communication of the mutual access traffic between the MAP and CE in the network. It should be noted that the FMR and the BMR can be the same, and the structure of the BMR TLV is shown in FIG. 8 , that is, the BMR can be configured as the FMR.

例如,如果第一映射规则的信息包括DMR对应的地址信息,则DMR TLV格式如图9所示。For example, if the information of the first mapping rule includes address information corresponding to the DMR, the DMR TLV format is as shown in FIG. 9 .

DMR TLV:对应MAP-T中的DMR,DMR TLV携带DMR对应的映射信息,代表报文的目的IPv4地址为MAP域(domain)外的地址,通过BR进行转发到域外。DMR对应的地址信息含有两个参数Rule-IPv6-prefix和Rule-IPv4-prefix。Rule-IPv6-prefix的值是MAP BR的IPv6前缀,Rule-IPv4-prefix值是0.0.0.0/0,即在MAP-CE上匹配IPv4路由时作为默认路由适用的映射规则。在使用这条规则后,目的IPv6地址将通过DMR配置的Rule-IPv6-prefix+目的IPv4地址组成目的IPv6地址。DMR TLV: Corresponds to the DMR in MAP-T. The DMR TLV carries the mapping information corresponding to the DMR, and represents the destination IPv4 address of the packet is an address outside the MAP domain (domain), which is forwarded to the outside of the domain through the BR. The address information corresponding to the DMR contains two parameters, Rule-IPv6-prefix and Rule-IPv4-prefix. The value of Rule-IPv6-prefix is the IPv6 prefix of the MAP BR, and the value of Rule-IPv4-prefix is 0.0.0.0/0, that is, the mapping rule applied as the default route when matching IPv4 routes on the MAP-CE. After this rule is used, the destination IPv6 address will be composed of the DMR-configured Rule-IPv6-prefix+destination IPv4 address to form the destination IPv6 address.

例如,如果第一映射规则的信息包括DMR对应的地址信息,DMR对应的地址信息包括BR设备对应的地址信息,则BR地址(address)TLV格式如图10所示。For example, if the information of the first mapping rule includes the address information corresponding to the DMR, and the address information corresponding to the DMR includes the address information corresponding to the BR device, the BR address (address) TLV format is as shown in FIG. 10 .

BR Address TLV:对应MAP-E中的DMR,在MAP-E中MAP域外的目的地址(destinations outside the MAP domain)即为配置的MAP-BR的IPv6地址。BR Address TLV: Corresponding to the DMR in MAP-E, the destination address outside the MAP domain in MAP-E (destinations outside the MAP domain) is the IPv6 address of the configured MAP-BR.

第二种,第一映射规则的信息携带在第一报文的网络层可达性信息的字段中,属性信息携带在第一报文的扩展属性字段中。In the second type, the information of the first mapping rule is carried in the network layer reachability information field of the first packet, and the attribute information is carried in the extended attribute field of the first packet.

如图11所示,在NLRI中携带第一映射规则的信息,如BMR/FMR/DMR/BR address等内容,同时在update报文中增加一个扩展属性字段,如BGP MAP属性/扩展属性(community/extended community)字段,该属性/扩展属性字段用于携带属性信息。As shown in Figure 11, the information of the first mapping rule, such as BMR/FMR/DMR/BR address, is carried in the NLRI, and an extended attribute field, such as BGP MAP attribute/community attribute, is added to the update packet at the same time. /extended community) field, the attribute/extended attribute field is used to carry attribute information.

通过采用上述第一种或第二种携带第一映射规则的信息以及属性信息的方式,实现了第一映射规则的信息及属性信息既可以携带在同一个字段中,也可携带在不同字段中,携带方式更为灵活。By adopting the first or second method of carrying the information of the first mapping rule and the attribute information, the information and attribute information of the first mapping rule can be carried in the same field or in different fields. , the carrying way is more flexible.

403,第二通信设备接收第一通信设备发送的第一报文,根据第一报文中的第一映射规则的信息获取第一映射规则。403. The second communication device receives the first packet sent by the first communication device, and acquires the first mapping rule according to the information of the first mapping rule in the first packet.

第二通信设备接收第一通信设备发送的第一报文之前,第二通信设备与第一通信设备建立了MAP邻居关系,因而第二通信设备接收到第一报文后,由于第一报文携带第一映射规则的信息,因而第二通信设备能够根据第一报文中的第一映射规则的信息获取第一映射规则。Before the second communication device receives the first packet sent by the first communication device, the second communication device establishes a MAP neighbor relationship with the first communication device. Therefore, after the second communication device receives the first packet, because the first packet The information of the first mapping rule is carried, so the second communication device can acquire the first mapping rule according to the information of the first mapping rule in the first packet.

示例性地,第一映射规则的信息为基于第一映射规则生成的MAP路由;则第二通信设备根据第一映射规则的信息获取第一映射规则,包括:第二通信设备根据MAP路由获取第一映射规则。由于第二通信设备上配置了第二映射规则,且第二通信设备通过动态学习获取到了第一通信设备上配置的第一映射规则,因而第二通信设备能够实现源地址和目的地址在IPv4与IPv6之间的映射。Exemplarily, the information of the first mapping rule is a MAP route generated based on the first mapping rule; then the second communication device obtains the first mapping rule according to the information of the first mapping rule, including: the second communication device obtains the first mapping rule according to the MAP route. a mapping rule. Because the second mapping rule is configured on the second communication device, and the second communication device obtains the first mapping rule configured on the first communication device through dynamic learning, the second communication device can realize the source address and destination address between IPv4 and IPv4. Mapping between IPv6.

在一种可能的实现方式中,当第二通信设备为宽带接入服务器时,第二通信设备根据第一映射规则的信息获取第一映射规则之后,还包括:第二通信设备向第三通信设备发送第六报文,以使得第三通信设备根据第一映射规则执行第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;其中,第六报文携带第一映射规则的信息,第三通信设备为用户边缘CE设备。In a possible implementation manner, when the second communication device is a broadband access server, after acquiring the first mapping rule according to the information of the first mapping rule, the second communication device further includes: the second communication device communicates with the third communication device The device sends a sixth packet, so that the third communication device performs the address mapping between the address in the network of the first type and the address in the network of the second type according to the first mapping rule; wherein, the sixth packet carries the first information of a mapping rule, the third communication device is a user edge CE device.

本申请实施例提供的方法,通过动态学习通信设备上的映射规则,能够减少映射规则的配置和维护工作量,从而能够提高获取映射规则的效率,并降低维护成本。例如,通过MAP映射规则的动态学习功能,减少集中式MAP场景配置和维护工作量,从而能够提高获取映射规则的效率,并降低维护成本。此外,该方法不仅能够应用于IPv4孤岛在IPv6网络中的互通场景,实现IPv4孤岛穿越IPv6网络进行互通。The method provided by the embodiments of the present application can reduce the configuration and maintenance workload of the mapping rules by dynamically learning the mapping rules on the communication device, thereby improving the efficiency of acquiring the mapping rules and reducing the maintenance cost. For example, through the dynamic learning function of MAP mapping rules, the workload of centralized MAP scene configuration and maintenance can be reduced, thereby improving the efficiency of acquiring mapping rules and reducing maintenance costs. In addition, the method can not only be applied to the intercommunication scenario of IPv4 islands in the IPv6 network, but also realize the intercommunication of IPv4 islands across the IPv6 network.

在图4所示的第二通信设备动态学习第一通信设备上配置的第一映射规则的基础上,本申请实施例提供的方法还支持第一通信设备动态学习第二通信设备上配置的第二映射规则。参见图12,本申请实施例提供的方法包括如下几个过程。On the basis that the second communication device shown in FIG. 4 dynamically learns the first mapping rule configured on the first communication device, the method provided by this embodiment of the present application also supports the first communication device to dynamically learn the first mapping rule configured on the second communication device. Two mapping rules. Referring to FIG. 12 , the method provided by this embodiment of the present application includes the following processes.

401,第一通信设备获取第一通信设备上配置的第一映射规则的信息,第一通信设备位于第一类型的网络,第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,第一类型的网络与第二类型的网络不同。401. The first communication device acquires information of a first mapping rule configured on the first communication device, the first communication device is located in a network of a first type, and the first mapping rule is used for addresses in the network of the first type and addresses of the second type. The address mapping between addresses in the network, the first type of network is different from the second type of network.

402,第一通信设备向第二通信设备发送第一报文,第一报文携带第一映射规则的信息,第二通信设备位于第一类型的网络。402. The first communication device sends a first packet to the second communication device, where the first packet carries information of the first mapping rule, and the second communication device is located in a network of the first type.

403,第二通信设备接收第一通信设备发送的第一报文,根据第一报文中的第一映射规则的信息获取第一映射规则。403. The second communication device receives the first packet sent by the first communication device, and acquires the first mapping rule according to the information of the first mapping rule in the first packet.

需要说明的是,上述401-403的实现方式可参考上述图4中的401-403的相关描述,此处不再赘述。It should be noted that, for the implementation manner of the above-mentioned 401-403, reference may be made to the relevant description of the above-mentioned 401-403 in FIG. 4, which will not be repeated here.

404,第二通信设备向第一通信设备发送第二报文,第二报文携带第二通信设备上配置的第二映射规则的信息,第二映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射。404. The second communication device sends a second packet to the first communication device, where the second packet carries information of the second mapping rule configured on the second communication device, and the second mapping rule is used for the address in the first type of network Address mapping with addresses in the second type of network.

第二通信设备向第一通信设备发送第二报文之前,第二通信设备获取第二通信设备上配置的映射规则,进而获取第二映射规则的信息。本申请实施例不对第二通信设备获取第二通信设备上配置的第二映射规则的方式进行限定,例如,在第二通信设备上手动配置第二映射规则后,可由第二通信设备对该第二映射规则进行存储,将第二映射规则存储在第二通信设备的存储空间中或者其他设备的存储空间中。第二通信设备可从对应的存储空间中获取第二通信设备上配置的第二映射规则。Before the second communication device sends the second packet to the first communication device, the second communication device obtains the mapping rule configured on the second communication device, and further obtains information of the second mapping rule. This embodiment of the present application does not limit the manner in which the second communication device obtains the second mapping rule configured on the second communication device. For example, after manually configuring the second mapping rule on the second communication device, the second communication device can The second mapping rule is stored, and the second mapping rule is stored in the storage space of the second communication device or the storage space of other devices. The second communication device may acquire the second mapping rule configured on the second communication device from the corresponding storage space.

另外,本申请实施例也不对第二映射规则的内容进行限定,能够实现IPv4地址和IPv6地址的映射即可。在一种可能的实现方式中,本申请实施例中的第二映射规则包括但不限于中的BMR、FMR和DMR中的至少一种。第二映射规则的信息包括基本映射规则BMR对应的地址信息、转发映射规则FMR对应的地址信息以及默认映射规则DMR对应的地址信息中的至少一种。In addition, the embodiment of the present application does not limit the content of the second mapping rule, and only needs to be able to implement the mapping between IPv4 addresses and IPv6 addresses. In a possible implementation manner, the second mapping rule in this embodiment of the present application includes, but is not limited to, at least one of BMR, FMR, and DMR in . 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.

进一步地,无论第二映射规则是哪种映射规则,本申请实施例提供的方法中,可将第二映射规则的信息以路由的形式来表示。在一种可能的实现方式中,第二通信设备获取第二通信设备上配置的第二映射规则的信息,包括:第二通信设备基于第二映射规则生成MAP路由,将MAP路由作为第二映射规则的信息。示例性地,BMR对应的地址信息包括但不限于BMR对应的IPv6前缀、IPv6前缀长度、IPv4前缀、IPv4前缀长度、EA比特长度以及端口集标识(port-set ID,PSID)偏移量。FMR对应的地址信息包括但不限于FMR对应的IPv6前缀、IPv6前缀长度、IPv4前缀、IPv4前缀长度、EA比特长度以及PSID偏移量。DMR对应的地址信息包括但不限于DMR对应的IPv6前缀以及IPv6前缀长度。或者,DMR对应的地址信息包括但不限于BR设备对应的IPv6的地址以及IPv6地址前缀长度。Further, no matter what kind of mapping rule the second mapping rule is, in the method provided by the embodiment of the present application, the information of the second mapping rule can be represented in the form of routing. In a possible implementation manner, acquiring the information of the second mapping rule configured on the second communication device by the second communication device includes: the second communication device generates a MAP route based on the second mapping rule, and uses the MAP route as the second mapping rule information. Exemplarily, the address information corresponding to the BMR includes, but is not limited to, the IPv6 prefix, the IPv6 prefix length, the IPv4 prefix, the IPv4 prefix length, the EA bit length, and the port set ID (port-set ID, PSID) offset corresponding to the BMR. The address information corresponding to the FMR includes, but is not limited to, the IPv6 prefix corresponding to the FMR, the IPv6 prefix length, the IPv4 prefix, the IPv4 prefix length, the EA bit length, and the PSID offset. The address information corresponding to the DMR includes but is not limited to the IPv6 prefix corresponding to the DMR and the length of the IPv6 prefix. Alternatively, the address information corresponding to the DMR includes but is not limited to the IPv6 address corresponding to the BR device and the IPv6 address prefix length.

为了使得第一通信设备也能够学习到第二通信设备上配置的第二映射规则,第二通信设备可将第二通信设备上配置的第二映射规则的信息发送给第一通信设备。例如,第二通信设备通过发送报文的方式,将第二映射规则的信息发送给第一通信设备。在本申请实施例中,以通过第二报文携带第二映射规则的信息,第二通信设备向第一通信设备发送第二报文为例。在第二通信设备向第一通信设备发送第二报文之前,第二通信设备与第一通信设备先建立MAP邻居关系。建立MAP邻居关系的方式可参考图4中402的相关描述,此处不再赘述。In order for the first communication device to also 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 by sending a message. In the embodiment of the present application, the second communication device sends the second packet to the first communication device by using the second packet to carry the information of the second mapping rule as an example. Before the second communication device sends the second packet to the first communication device, the second communication device and the first communication device first establish a MAP neighbor relationship. For the manner of establishing the MAP neighbor relationship, reference may be made to the relevant description of 402 in FIG. 4 , which will not be repeated here.

另外,在建立MAP邻居关系后,第二通信设备发送携带第二映射规则的信息的第二报文。示例性地,该第二报文还包括属性信息,属性信息包括MAP域类型和MAP域标识。可选地,属性信息还包括路由标识符以及路由目标。本申请实施例不对第二报文携带第二映射规则的信息以及属性信息的方式进行限定,包括但不限于如下两种。In addition, after establishing the MAP neighbor relationship, the second communication device sends a second packet carrying information of the second mapping rule. Exemplarily, the second packet further includes attribute information, where 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. This embodiment of the present application does not limit the manner in which the second message carries the information of the second mapping rule and 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.

第二种,第二映射规则的信息携带在第二报文的网络层可达性信息的字段中,属性信息携带在第一报文的扩展属性字段中。In the second type, the information of the second mapping rule is carried in the network layer reachability information field of the second packet, and the attribute information is carried in the extended attribute field of the first packet.

关于第二报文携带第二映射规则的信息及属性信息的方式可参考第一报文携带第一映射规则的信息及属性信息的方式,此处不再赘述。Regarding the manner in which the second packet carries the information of the second mapping rule and the attribute information, reference may be made to the manner in which the first packet carries the information and attribute information of the first mapping rule, which will not be repeated here.

405,第一通信设备接收第二通信设备发送的第二报文,根据第二报文中的第二映射规则的信息获取第二映射规则。405. The first communication device receives the second packet sent by the second communication device, and acquires the second mapping rule according to the information of the second mapping rule in the second packet.

第一通信设备接收第二通信设备发送的第二报文之前,第二通信设备与第一通信设备建立了MAP邻居关系,因而第一通信设备接收到第二报文后,由于第二报文携带第二映射规则的信息,因而第一通信设备能够根据第二报文中的第二映射规则的信息获取第二映射规则。Before the first communication device receives the second packet sent by the second communication device, the second communication device establishes a MAP neighbor relationship with the first communication device. Therefore, after the first communication device receives the second packet, because the second packet The information of the second mapping rule is carried, so the first communication device can acquire the second mapping rule according to the information of the second mapping rule in the second packet.

示例性地,第二映射规则的信息为基于第二映射规则生成的MAP路由;则第一通信设备根据第二映射规则的信息获取第二映射规则,包括:第一通信设备根据MAP路由获取第二映射规则。由于第一通信设备上配置了第一映射规则,且第一通信设备通过动态学习获取到了第二通信设备上配置的第二映射规则,因而能够实现源地址和目的地址在IPv4与IPv6之间的映射。Exemplarily, the information of the second mapping rule is a MAP route generated based on the second mapping rule; then the first communication device obtains the second mapping rule according to the information of the second mapping rule, including: the first communication device obtains the first mapping rule according to the MAP route. Two mapping rules. Because the first mapping rule is configured on the first communication device, and the first communication device obtains the second mapping rule configured on the second communication device through dynamic learning, the source address and the destination address can be implemented between IPv4 and IPv6. map.

需要说明的是,无论是第一通信设备学习第二通信设备上配置的第二映射规则,还是第二通信设备学习第一通信设备上配置的第一映射规则,第一通信设备和第二通信设备均具有第一映射规则和第二映射规则后,可将该第一映射规则和第二映射规则作为路由表项进行存储,用于报文传输时触发地址映射。It should be noted that, whether the first communication device learns the second mapping rule configured on the second communication device or the second communication device learns the first mapping rule configured on the first communication device, the first communication device communicates with the second communication device. After the device has both the first mapping rule and the second mapping rule, the first mapping rule and the second mapping rule can be stored as routing table entries for triggering address mapping during packet transmission.

另外,上述401至403是第一通信设备向第二通信设备发送第一映射规则的信息,以使得第二通信设备学习第一通信设备上配置的第一映射规则的过程,404和405是第二通信设备向第一通信设备发送第二映射规则的信息,以使得第一通信设备学习第二通信设备上配置的第二映射规则的过程。除了先执行401-403,再执行404和405之外,还可先执行404和405,之后再执行401-403。本申请实施例不对第二通信设备学习第一通信设备上配置的第一映射规则的过程以及第一通信设备学习第二通信设备上配置的第二映射规则的过程的先后顺序进行限定。In addition, the above 401 to 403 are the processes in which the first communication device sends the 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 the first mapping rules. The second communication device sends the information of the second mapping rule to the first communication device, so that the first communication device learns the process of the second mapping rule configured on the second communication device. In addition to executing 401-403 first, and then executing 404 and 405, 404 and 405 can also be executed first, and then 401-403. This embodiment of the present application does not limit the sequence of the process for the second communication device to learn the first mapping rule configured on the first communication device and the process for the first communication device to learn the second mapping rule configured on the second communication device.

进一步地,在第一通信设备和第二通信设备均通过本申请实施例提供的方法动态学习到了对端的映射规则的情况下,第一通信设备和第二通信设备可实现IPv4网络与IPv6网络的互通。在此基础上,第一通信设备和第二通信设备可进行报文传输。报文传输的过程可如图12所示的如下步骤。Further, when both the first communication device and the second communication device dynamically learn the mapping rule of the opposite end through the method provided in the embodiment of the present application, the first communication device and the second communication device can realize the IPv4 network and the IPv6 network. Intercommunication. On this basis, the first communication device and the second communication device can perform message transmission. The process of message transmission can be as follows as shown in Figure 12.

406,第一通信设备获取第七报文,第七报文的源地址为第一IPv4地址,第七报文的目的地址为第二IPv4地址。406. The first communication device obtains a seventh packet, where the source address of the seventh packet is the first IPv4 address, and the destination address of the seventh packet is the second IPv4 address.

该第七报文是第一通信设备生成的报文,或者第一通信设备从上一跳接收到的报文,本申请实施例不对第七报文的类型及内容进行限定。以第一通信设备位于第一类型的网络,该第一类型的网络为IPv4网络,且第一通信设备上配置的第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射为例,第七报文的源地址为第一IPv4地址,第七报文的目的地址为第二IPv4地址。例如,第一IPv4地址为第一通信设备的地址,第二IPv4地址为第二通信设备的地址。The seventh packet is a packet generated by the first communication device, or a packet 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 packet. Suppose that the first communication device is located in a network of a first type, the network of the first type is an IPv4 network, and the first mapping rule configured on the first communication device is used for the mapping between the first IPv4 address and the first IPv6 address as: For example, the source address of the seventh packet is the first IPv4 address, and the destination address of the seventh packet is the second IPv4 address. For example, the first IPv4 address is the address of the first communication device, and the second IPv4 address is the address of the second communication device.

407,第一通信设备基于第一映射规则将第七报文的源地址由第一IPv4地址映射为第一IPv6地址,基于第二映射规则将第七报文的目的地址由第二IPv4地址映射为第二IPv6地址,得到第三报文。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 based on the second mapping rule. is the second IPv6 address, and obtains the third packet.

由于第七报文的目的地址为第二通信设备的地址,而第一通信设备与第二通信设备之间通过IPv6网络连接,为了由IPv4网络成功穿越IPv6网络,第一通信设备并不直接转发第七报文,而是先基于第一映射规则将第七报文的源地址由第一IPv4地址映射为第一IPv6地址,基于第二映射规则将第七报文的目的地址由第二IPv4地址映射为第二IPv6地址,得到第三报文。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 For the seventh packet, first map the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, and map the destination address of the seventh packet from the second IPv4 address based on the second mapping rule. The address is mapped to the second IPv6 address to obtain the third packet.

408,第一通信设备发送第三报文。408. The first communication device sends a third packet.

第一通信设备发送第三报文时,可查询路由表,确定下一跳。之后,第一通信设备将第三报文发送给第一通信设备的下一跳,按照报文传输的正常流程实现向目的地址的转发。其中,第三报文的源地址为第一IPv6地址,第三报文的目的地址为第二IPv6地址。因此,第三报文能够成功发送至IPv6网络,进而通过IPv6网络传输至第二通信设备。When sending the third packet, the first communication device may query the routing table to determine the next hop. After that, the first communication device sends the third packet to the next hop of the first communication device, and forwards the third packet to the destination address according to the normal flow of packet transmission. The source address of the third packet is the first IPv6 address, and the destination address of the third packet is the second IPv6 address. Therefore, the third packet can be successfully sent to the IPv6 network, and then transmitted to the second communication device through the IPv6 network.

409,第二通信设备接收第三报文,基于第一映射规则将第三报文的源地址由第一IPv6地址映射为第一IPv4地址,基于第二映射规则将第三报文的目的地址由第二IPv6地址映射为第二IPv4地址。409. The second communication device 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 based on the second mapping rule. The second IPv6 address is mapped to the second IPv4 address.

由于第三报文为IPv6报文,源地址和目的地址均为IPv6地址,而第二通信设备位于第二网络,也即IPv4网络,因而第二通信设备接收到第三报文后,可基于第一映射规则将第三报文的源地址由第一IPv6地址映射为第一IPv4地址,基于第二映射规则将第三报文的目的地址由第二IPv6地址映射为第二IPv4地址。Since the third packet is an IPv6 packet, the source address and destination address are both IPv6 addresses, and the second communication device is located on the second network, that is, the IPv4 network, after receiving the third packet, the second communication device can The first mapping rule maps the source address of the third packet from the first IPv6 address to the first IPv4 address, and the destination address of the third packet is mapped from the second IPv6 address to the second IPv4 address based on the second mapping rule.

以上仅以第一通信设备向第二通信设备发送报文为例进行说明,同理,第二通信设备也可按照同样原理向第一通信设备发送报文,该过程可如图12所示的如下过程。The above description only takes the first communication device sending a message to the second communication device as an example. Similarly, the second communication device can also send a message to the first communication device according to the same principle, and the process can be as shown in FIG. 12 . Process as follows.

410,第二通信设备获取第四报文,第四报文的源地址为第二IPv4地址,第四报文的目的地址为第一IPv4地址。410. The second communication device obtains a fourth packet, where 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.

该第四报文是第二通信设备生成的报文,或者第二通信设备从上一跳接收到的报文,本申请实施例不对第四报文的具体类型及内容进行限定。以第二通信设备位于第二网络,该第二网络为IPv4网络,且第二通信设备上配置的第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射为例,第四报文的源地址为第二IPv4地址,第四报文的目的地址为第一IPv4地址。例如,第二IPv4地址为第二通信设备的地址,第一IPv4地址为第一通信设备的地址。The fourth packet is a packet generated by the second communication device, or a packet received by the second communication device from the previous hop, and the embodiment of the present application does not limit the specific type and content of the fourth packet. Taking 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 the mapping between the second IPv4 address and the second IPv6 address as an example, the fourth The source address of the 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 the address of the second communication device, and the first IPv4 address is the address of the first communication device.

411,第二通信设备基于第一映射规则将第四报文的源地址由第二IPv4地址映射为第二IPv6地址,基于第二映射规则将第四报文的目的地址由第一IPv4地址映射为第一IPv6地址,得到第五报文。411. The second communication device maps the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, and maps the destination address of the fourth packet from the first IPv4 address based on the second mapping rule is the first IPv6 address, and a fifth packet is obtained.

由于第四报文的目的地址为第一通信设备的地址,而第一通信设备与第二通信设备之间通过IPv6网络连接,第二通信设备并不直接发送第四报文,为了由IPv4网络成功穿越IPv6网络,第二通信设备基于第一映射规则将第四报文的源地址由第二IPv4地址映射为第二IPv6地址,基于第二映射规则将第四报文的目的地址由第一IPv4地址映射为第一IPv6地址,得到第五报文。Since the destination address of the fourth packet is the address of the first communication device, and the first communication device and the second communication device are connected through an IPv6 network, the second communication device does not directly send the fourth packet. Successfully traversing the IPv6 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 to the second IPv6 address based on the second mapping rule. The IPv4 address is mapped to the first IPv6 address, and a fifth packet is obtained.

412,第二通信设备发送第五报文。412. The second communication device sends a fifth packet.

第二通信设备发送第五报文时,可查询路由表,确定下一跳。之后,第二通信设备将第五报文发送给第二通信设备的下一跳,按照报文传输的正常流程实现向目的地址的转发。其中,第五报文的源地址为第二IPv6地址,第五报文的目的地址为第一IPv6地址。因此,第五报文能够成功发送至IPv6网络,进而通过IPv6网络传输至第一通信设备。When sending the fifth packet, the second communication device may query the routing table to determine the next hop. After that, the second communication device sends the fifth packet to the next hop of the second communication device, and forwards the fifth packet to the destination address according to the normal flow of packet transmission. The source address of the fifth packet is the second IPv6 address, and the destination address of the fifth packet is the first IPv6 address. Therefore, the fifth packet can be successfully sent to the IPv6 network, and then transmitted to the first communication device through the IPv6 network.

413,第一通信设备接收第五报文,基于第二映射规则将第五报文的源地址由第二IPv6地址映射为第二IPv4地址,基于第一映射规则将第五报文的目的地址由第一IPv6地址映射为第一IPv4地址。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 based on the first mapping rule. The first IPv6 address is mapped to the first IPv4 address.

由于第五报文为IPv6报文,源地址和目的地址均为IPv6地址,而第一通信设备位于第一网络,也即IPv4网络,因而第一通信设备接收到第五报文后,可基于第二映射规则将第五报文的源地址由第二IPv6地址映射为第二IPv4地址,基于第一映射规则将第五报文的目的地址由第一IPv6地址映射为第一IPv4地址。Since the fifth packet is an IPv6 packet, the source address and destination address are both IPv6 addresses, and the first communication device is located on the first network, that is, the IPv4 network, after receiving the fifth packet, the first communication device can The second mapping rule maps the source address of the fifth packet from the second IPv6 address to the second IPv4 address, 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.

本申请实施例提供的方法,通过动态学习通信设备上的映射规则,能够减少映射规则的配置和维护工作量,从而能够提高获取映射规则的效率,并降低维护成本。The method provided by the embodiments of the present application can reduce the configuration and maintenance workload of the mapping rules by dynamically learning the mapping rules on the communication device, thereby improving the efficiency of acquiring the mapping rules and reducing the maintenance cost.

本申请实施例提供的方法可适用于MAP-T/MAP-E场景,例如,通过MAP映射规则的动态学习功能,减少集中式MAP场景配置和维护工作量,从而能够提高获取映射规则的效率,并降低维护成本。此外,该方法还能够应用于IPv4孤岛在IPv6网络中的互通场景,实现IPv4孤岛穿越IPv6网络进行互通。为了便于理解,接下来,以MAP场景为例,对本申请实施例提供的获取映射规则的方法进行举例说明。The methods provided in the embodiments of the present application can be applied to MAP-T/MAP-E scenarios. For example, by using the dynamic learning function of MAP mapping rules, the workload of configuring and maintaining centralized MAP scenarios can be reduced, thereby improving the efficiency of acquiring mapping rules. and reduce maintenance costs. In addition, the method can also be applied to the intercommunication scenario of the IPv4 island in the IPv6 network, so as to realize the intercommunication between the IPv4 island and the IPv6 network. For ease of understanding, the method for obtaining a mapping rule provided by the embodiment of the present application is illustrated by taking the MAP scenario as an example.

参见图13,在图2所示的集中式MAP-T/MAP-E场景基础上,图13以第一通信设备为BRAS,第二通信设备为MAP BR设备,BRAS和MAP BR设备位于IPv6网络为例,图13中,MAP BR作为MAP域的边缘设备,也即中继设备,用于连接IPv4网络和IPv6网络,负责IPv4与IPv6封装/解封装。BRAS分配地址给MAP CE,例如,BRAS给MAP CE下发MAP地址簇1.1.1.0/24以及2001:db8:1::/48,其中,1.1.1.0/24为IPv4地址(也即第一IPv4地址),2001:db8:1::/48为IPv6地址(也即第一IPv6地址)。MAP CE负责进行IPv4与IPv6封装/解封装,实现IPv4用户穿越IPv6网络访问IPv4网络的功能。另外,MAP BR侧也具有IPv4地址11.1.1.0/24(也即第二IPv4地址)以及IPv6地址2001:db8:2::/48(也即第二IPv6地址)两个地址簇。Referring to FIG. 13 , based on the centralized MAP-T/MAP-E scenario shown in FIG. 2 , in FIG. 13 , the first communication device is a BRAS, the second communication device is a MAP BR device, and the BRAS and MAP BR devices are located in the IPv6 network For example, in Fig. 13, the MAP BR acts as an edge device of the MAP domain, that is, a relay device, is used to connect the IPv4 network and the IPv6 network, and is responsible for IPv4 and IPv6 encapsulation/decapsulation. The BRAS allocates addresses to the MAP CE. For example, the BRAS delivers the MAP address clusters 1.1.1.0/24 and 2001:db8:1::/48 to the MAP CE, where 1.1.1.0/24 is the IPv4 address (that is, the first IPv4 address). address), 2001:db8:1::/48 is an IPv6 address (ie, the first IPv6 address). MAP CE is responsible for encapsulation/decapsulation of IPv4 and IPv6, so that IPv4 users can access IPv4 network through IPv6 network. In addition, the MAP BR side also has two address clusters of the IPv4 address 11.1.1.0/24 (that is, the second IPv4 address) and the IPv6 address 2001:db8:2::/48 (that is, the second IPv6 address).

此外,BRAS与MAP BR建立了MAP邻居关系。基于图13所示的通信系统,参见图14,本申请实施例提供的方法包括如下几个过程。In addition, the BRAS establishes a MAP neighbor relationship with the MAP BR. Based on the communication system shown in FIG. 13 , and referring to FIG. 14 , the method provided by the embodiment of the present application includes the following processes.

1401,BRAS获取BRAS上配置的第一映射规则的信息,第一映射规则用于IPv6网络的地址与IPv4网络的地址之间的地址映射。1401. The BRAS obtains information of a first mapping rule configured on the BRAS, where the first mapping rule is used for address mapping between addresses of the IPv6 network and addresses of the IPv4 network.

本申请实施例不对BRAS获取BRAS上配置的第一映射规则的方式进行限定,例如,在BRAS上手动配置第一映射规则后,可由BRAS对该第一映射规则进行存储,将第一映射规则存储在BRAS的存储空间中或者其他设备的存储空间中。BRAS可从对应的存储空间中获取BRAS上配置的第一映射规则。This embodiment of the present application does not limit the manner in which the BRAS obtains the first mapping rule configured on the BRAS. For example, after the first mapping rule is manually configured on the BRAS, the BRAS can store the first mapping rule and store the first mapping rule. In the storage space of the BRAS or the storage space of other devices. The BRAS may acquire the first mapping rule configured on the BRAS from the corresponding storage space.

另外,本申请实施例也不对第一映射规则的内容进行限定,能够实现IPv4地址和IPv6地址的映射即可。在一种可能的实现方式中,本申请实施例中的第一映射规则包括但不限于中的BMR、FMR和DMR中的至少一种。第一映射规则的信息包括基本映射规则BMR对应的地址信息、转发映射规则FMR对应的地址信息以及默认映射规则DMR对应的地址信息中的至少一种。In addition, the embodiment of the present application does not limit the content of the first mapping rule, and only needs to be able to implement the mapping between IPv4 addresses and IPv6 addresses. In a possible implementation manner, the first mapping rule in this embodiment of the present application includes, but is not limited to, at least one of BMR, FMR, and DMR in . 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.

该1401的实现方式可参考图4所示的401的相关描述,此处不再一一赘述。For the implementation of the 1401, reference may be made to the related description of the 401 shown in FIG. 4, and details are not repeated here.

1402,BRAS向MAP-BR发送第一报文,第一报文携带第一映射规则的信息。1402, the BRAS sends a first packet to the MAP-BR, where the first packet carries the information of the first mapping rule.

本申请实施例不对携带第一映射规则的信息的第一报文进行限定,示例性地,该第一报文为更新(update)报文。该1402的实现方式可参见图4所示的402的相关描述,此处不再一一赘述。This embodiment of the present application does not limit the first packet that carries the information of the first mapping rule. Exemplarily, the first packet is an update (update) packet. For an implementation manner of the 1402, reference may be made to the relevant description of the 402 shown in FIG. 4, which will not be repeated here.

1403,MAP-BR接收BRAS发送的第一报文,根据第一报文中的第一映射规则的信息获取第一映射规则。1403. The MAP-BR receives the first packet sent by the BRAS, and acquires the first mapping rule according to the information of the first mapping rule in the first packet.

该1403的实现方式可参见图4所示的403的相关描述,此处不再一一赘述。For an implementation manner of the 1403, reference may be made to the relevant description of the 403 shown in FIG. 4, and details are not repeated here.

1404,MAP-BR向BRAS发送第二报文,第二报文携带MAP-BR上配置的第二映射规则的信息,第二映射规则用于IPv4网络的地址与IPv6网络的地址之间的地址映射。1404, the MAP-BR sends a second packet to the BRAS, where the second packet carries the information of the second mapping rule configured on the MAP-BR, and the second mapping rule is used for the address between the address of the IPv4 network and the address of the IPv6 network map.

该1404的实现方式可参见图12所示的404的相关描述,此处不再一一赘述。For the implementation of the 1404, reference may be made to the relevant description of the 404 shown in FIG. 12, and details are not repeated here.

1405,BRAS接收MAP-BR发送的第二报文,根据第二报文中的第二映射规则的信息获取第二映射规则。1405. The BRAS receives the second packet sent by the MAP-BR, and acquires the second mapping rule according to the information of the second mapping rule in the second packet.

该1405的实现方式可参见图12所示的405的相关描述,此处不再一一赘述。For an implementation manner of the 1405, reference may be made to the relevant description of the 405 shown in FIG. 12, which will not be repeated here.

1406,BRAS向MAP CE发送第六报文,该第六报文携带第二映射规则的信息。1406, the BRAS sends a sixth packet to the MAP CE, where the sixth packet carries the information of the second mapping rule.

BRAS获取到第二映射规则后,将该第二映射规则的信息携带在第六报文中发送给MAP CE,使得MAP CE能够根据该第二映射规则的信息执行第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射。After acquiring the second mapping rule, the BRAS carries the information of the second mapping rule in a sixth packet and sends it to the MAP CE, so that the MAP CE can execute the address in the network of the first type according to the information of the second mapping rule Address mapping with addresses in the second type of network.

1407,MAP CE获取第七报文,第七报文的源地址为第一IPv4地址,第七报文的目的地址为第二IPv4地址。1407. The MAP CE obtains a seventh packet, where the source address of the seventh packet is the first IPv4 address, and the destination address of the seventh packet is the second IPv4 address.

该第七报文是MAP CE生成的报文,或者MAP CE从上一跳接收到的报文,本申请实施例不对第七报文的类型及内容进行限定。结合图13所示的通信系统,第一IPv4的地址为1.1.1.0/24,第一IPv6地址为2001:db8:1::/48,第二IPv4地址为11.1.1.0/24,第二IPv6地址为2001:db8:2::/48,因此,第七报文的源地址为1.1.1.0/24,第七报文的目的地址为11.1.1.0/24。该1407的实现方式可参见图12所示的406的相关描述,此处不再一一赘述。The seventh packet is a packet generated by the MAP CE, or a packet 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 packet. With reference to 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 11.1.1.0/24. The address is 2001:db8:2::/48. Therefore, the source address of the seventh packet is 1.1.1.0/24, and the destination address of the seventh packet is 11.1.1.0/24. For the implementation of the 1407, reference may be made to the relevant description of the 406 shown in FIG. 12, and details are not repeated here.

1408,MAP CE基于第一映射规则将第七报文的源地址由第一IPv4地址映射为第一IPv6地址,基于第二映射规则将第七报文的目的地址由第二IPv4地址映射为第二IPv6地址,得到第三报文。1408, MAP CE maps the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, and maps the destination address of the seventh packet from the second IPv4 address to the first IPv6 address based on the second mapping rule. The second IPv6 address is obtained, and the third packet is obtained.

结合图13所示的通信系统,第一IPv4的地址为1.1.1.0/24,第一IPv6地址为2001:db8:1::/48,第二IPv4地址为11.1.1.0/24,第二IPv6地址为2001:db8:2::/48,因此,MAPCE基于第一映射规则将第七报文的源地址由1.1.1.0/24映射为2001:db8:1::/48,基于第二映射规则将第七报文的目的地址由11.1.1.0/24映射为2001:db8:2::/48。如此,得到的第三报文可在IPv6网络中传输。With reference to 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 11.1.1.0/24. The address is 2001:db8:2::/48. Therefore, MAPCE 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. Based on the second mapping The rule maps the destination address of the seventh packet from 11.1.1.0/24 to 2001:db8:2::/48. In this way, the obtained third packet can be transmitted in the IPv6 network.

需要说明的是,在不同的网络场景中,该1408步骤中MAP CE对报文的处理过程有所不同。具体的,在MAP-T场景中,MAP CE将第一IPv4地址替换为第一IPv6地址,将第二IPv4地址替换为第二IPv6地址;而在MAP-E场景中,MAP CE在第一IPv4地址的外层添加第一IPv6地址,在第二IPv4地址的外层添加第二IPv6地址。It should be noted that, in different network scenarios, the MAP CE processes the packets differently in step 1408. Specifically, in the MAP-T scenario, the MAP CE replaces the first IPv4 address with the first IPv6 address, and replaces the second IPv4 address with the second IPv6 address; and in the MAP-E scenario, the MAP CE is in the first IPv4 address. The first IPv6 address is added to the outer layer of the address, and the second IPv6 address is added to the outer layer of the second IPv4 address.

该1408的实现方式可参见图12所示的407的相关描述,此处不再一一赘述。For an implementation manner of the 1408, reference may be made to the relevant description of the 407 shown in FIG. 12, and details are not repeated here.

1409,MAP CE发送第三报文。1409, the MAP CE sends a third packet.

该1409的实现方式可参见图12所示的408的相关描述,此处不再一一赘述。MAP CE先将该第三报文发送给BRAS,由该BRAS将该第三报文发送给MAP BR。For the implementation manner of the 1409, reference may be made to the relevant description of the 408 shown in FIG. 12, which will not be repeated here. The MAP CE first sends the third packet to the BRAS, and the BRAS sends the third packet to the MAP BR.

1410,BRAS发送第三报文。1410, the BRAS sends a third packet.

1411,MAP-BR接收第三报文,基于第一映射规则将第三报文的源地址由第一IPv6地址映射为第一IPv4地址,基于第二映射规则将第三报文的目的地址由第二IPv6地址映射为第二IPv4地址。1411, MAP-BR receives the third packet, maps the source address of the third packet from the first IPv6 address to the first IPv4 address based on the first mapping rule, and maps the destination address of the third packet from the first IPv6 address to the first IPv4 address based on the second mapping rule. The second IPv6 address is mapped to the second IPv4 address.

结合图13所示的通信系统,第一IPv4的地址为1.1.1.0/24,第一IPv6地址为2001:db8:1::/48,第二IPv4地址为11.1.1.0/24,第二IPv6地址为2001:db8:2::/48,因此,MAP-BR接收到第三报文后,基于第一映射规则将第三报文的源地址由2001:db8:1::/48映射为1.1.1.0/24,基于第二映射规则将第三报文的目的地址由2001:db8:2::/48映射为11.1.1.0/24。With reference to 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 11.1.1.0/24. The address is 2001:db8:2::/48. Therefore, after receiving the third packet, MAP-BR maps the source address of the third packet from 2001:db8:1::/48 to 1.1.1.0/24, 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.

需要说明的是,需要说明的是,在不同的网络场景中,该1411步骤中MAP-BR对报文的处理过程有所不同。具体的,在MAP-T场景中,MAP-BR将第一IPv6地址替换为第一IPv4地址,将第二IPv6地址替换为第二IPv4地址;而在MAP-E场景中,MAP-BR将第一IPv6地址删除而保留内层的第一IPv4地址,将第二IPv6地址删除而保留内层的第二IPv4地址。It should be noted that, in different network scenarios, the MAP-BR processes the packets differently in the step 1411. Specifically, in the MAP-T scenario, the MAP-BR replaces the first IPv6 address with the first IPv4 address, and replaces the second IPv6 address with the second IPv4 address; and in the MAP-E scenario, the MAP-BR replaces the first IPv6 address with the second IPv4 address. An IPv6 address is deleted and the first IPv4 address of the inner layer is retained, and the second IPv6 address is deleted and the second IPv4 address of the inner layer is retained.

该1411的实现方式可参见图12所示的409的相关描述,此处不再一一赘述。For the implementation manner of the 1411, reference may be made to the related description of the 409 shown in FIG. 12, which will not be repeated here.

结合图13所示的通信系统,参见图15,本申请实施例提供的方法包括如下几个过程。With reference to the communication system shown in FIG. 13 , and referring to FIG. 15 , the method provided by the embodiment of the present application includes the following processes.

1501,BRAS获取BRAS上配置的第一映射规则的信息,第一映射规则用于IPv4网络的地址与IPv6网络的地址之间的地址映射。1501 , the BRAS acquires information of a first mapping rule configured on the BRAS, where the first mapping rule is used for address mapping between addresses of the IPv4 network and addresses of the IPv6 network.

该1501的实现方式可参考图4所示的401的相关描述,此处不再一一赘述。For the implementation manner of the 1501, reference may be made to the related description of the 401 shown in FIG. 4, which will not be repeated here.

1502,BRAS向MAP-BR发送第一报文,第一报文携带第一映射规则的信息。1502. The BRAS sends a first packet to the MAP-BR, where the first packet carries the information of the first mapping rule.

该1502的实现方式可参见图4所示的402的相关描述,此处不再一一赘述。For an implementation manner of the 1502, reference may be made to the relevant description of the 402 shown in FIG. 4, which will not be repeated here.

1503,MAP-BR接收BRAS发送的第一报文,根据第一报文中的第一映射规则的信息获取第一映射规则。1503. The MAP-BR receives the first packet sent by the BRAS, and acquires the first mapping rule according to the information of the first mapping rule in the first packet.

该1503的实现方式可参见图4所示的403的相关描述,此处不再一一赘述。For an implementation manner of the 1503, reference may be made to the relevant description of the 403 shown in FIG. 4, which will not be repeated here.

1504,MAP-BR向BRAS发送第二报文,第二报文携带MAP-BR上配置的第二映射规则的信息,第二映射规则用于IPv4网络的地址与IPv6网络的地址之间的地址映射。1504, the MAP-BR sends a second packet to the BRAS, where the second packet carries the information of the second mapping rule configured on the MAP-BR, and the second mapping rule is used for the address between the address of the IPv4 network and the address of the IPv6 network map.

该1504的实现方式可参见图12所示的404的相关描述,此处不再一一赘述。For an implementation manner of the 1504, reference may be made to the related description of the 404 shown in FIG. 12, which will not be repeated here.

1505,BRAS接收MAP-BR发送的第二报文,根据第二报文中的第二映射规则的信息获取第二映射规则。1505. The BRAS receives the second packet sent by the MAP-BR, and acquires the second mapping rule according to the information of the second mapping rule in the second packet.

该1505的实现方式可参见图12所示的405的相关描述,此处不再一一赘述。For an implementation manner of the 1505, reference may be made to the related description of the 405 shown in FIG. 12, which will not be repeated here.

在一种可能的实现方式中,BRAS向MAP CE发送第六报文,该第六报文携带该第二映射规则的信息,使得MAP CE能够根据该第二映射规则执行第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射。In a possible implementation manner, the BRAS sends a sixth packet to the MAP CE, where the sixth packet carries the information of the second mapping rule, so that the MAP CE can perform the first type of network operation according to the second mapping rule Address mapping between addresses in the second type of networks and addresses in the second type of network.

1506,MAP-BR获取第四报文,第四报文的源地址为第二IPv4地址,第四报文的目的地址为第一IPv4地址。1506. The MAP-BR obtains a fourth packet, where 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.

结合图13所示的通信系统,第一IPv4的地址为1.1.1.0/24,第一IPv6地址为2001:db8:1::/48,第二IPv4地址为11.1.1.0/24,第二IPv6地址为2001:db8:2::/48,因此,第四报文的源地址为11.1.1.0/24,第四报文的目的地址为1.1.1.0/24。该1506的实现方式可参见图12所示的410的相关描述,此处不再一一赘述。With reference to 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 11.1.1.0/24. The address is 2001:db8:2::/48. Therefore, the source address of the fourth packet is 11.1.1.0/24, and the destination address of the fourth packet is 1.1.1.0/24. For the implementation manner of the 1506, reference may be made to the related description of the 410 shown in FIG. 12, which will not be repeated here.

1507,MAP-BR基于第一映射规则将第四报文的源地址由第二IPv4地址映射为第二IPv6地址,基于第二映射规则将第四报文的目的地址由第一IPv4地址映射为第一IPv6地址,得到第五报文。1507, 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 second IPv6 address based on the second mapping rule. The first IPv6 address is obtained, and the fifth packet is obtained.

结合图13所示的通信系统,第一IPv4的地址为1.1.1.0/24,第一IPv6地址为2001:db8:1::/48,第二IPv4地址为11.1.1.0/24,第二IPv6地址为2001:db8:2::/48,因此,MAP-BR基于第一映射规则将第四报文的源地址由11.1.1.0/24映射为2001:db8:2::/48,基于第二映射规则将第四报文的目的地址由1.1.1.0/24映射为2001:db8:1::/48。如此,得到的第五报文可在IPv6网络中传输。With reference to 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 11.1.1.0/24. The address is 2001:db8:2::/48. Therefore, MAP-BR maps the source address of the fourth packet from 11.1.1.0/24 to 2001:db8:2::/48 based on the first mapping rule. The second mapping rule maps the destination address of the fourth packet from 1.1.1.0/24 to 2001:db8:1::/48. In this way, the obtained fifth packet can be transmitted in the IPv6 network.

该1507的实现方式可参见图12所示的411的相关描述,此处不再一一赘述。For an implementation manner of the 1507, reference may be made to the relevant description of the 411 shown in FIG. 12, which will not be repeated here.

1508,MAP-BR发送第五报文。1508, the MAP-BR sends the fifth packet.

其中,第五报文的源地址为2001:db8:2::/48,第五报文的目的地址为2001:db8:1::/48。该1508的实现方式可参见图12所示的412的相关描述,此处不再一一赘述。The source address of the fifth packet is 2001:db8:2::/48, and the destination address of the fifth packet is 2001:db8:1::/48. For the implementation manner of the 1508, reference may be made to the relevant description of the 412 shown in FIG. 12, which will not be repeated here.

1509,BRAS接收第五报文,将第五报文发送给MAP CE。1509, the BRAS receives the fifth packet, and sends the fifth packet to the MAP CE.

1510,MAP CE接收第五报文,基于第二映射规则将第五报文的源地址由第二IPv6地址映射为第二IPv4地址,基于第一映射规则将第五报文的目的地址由第一IPv6地址映射为第一IPv4地址。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 second IPv4 address to the second IPv4 address based on the first mapping rule. An IPv6 address is mapped to the first IPv4 address.

结合图13所示的通信系统,第一IPv4的地址为1.1.1.0/24,第一IPv6地址为2001:db8:1::/48,第二IPv4地址为11.1.1.0/24,第二IPv6地址为2001:db8:2::/48,因此,MAPCE基于第二映射规则将第五报文的源地址由2001:db8:2::/48映射为11.1.1.0/24,基于第一映射规则将第五报文的目的地址由2001:db8:1::/48映射为1.1.1.0/24。With reference to 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 11.1.1.0/24. The address is 2001:db8:2::/48. Therefore, MAPCE 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. Based on the first mapping The rule maps the destination address of the fifth packet from 2001:db8:1::/48 to 1.1.1.0/24.

该1510的实现方式可参见图12所示的413的相关描述,此处不再一一赘述。For the implementation manner of the 1510, reference may be made to the relevant description of the 413 shown in FIG. 12, which will not be repeated here.

以上介绍了本申请实施例提供的获取映射规则的方法,与上述方法对应,本申请实施例还提供获取映射规则的装置。图16是本申请实施例提供的一种获取映射规则的装置的结构示意图,该装置应用于第一通信设备,该第一通信设备为上述图4、图12、图14、图15中任一附图所示的第一通信设备。基于图16所示的如下多个模块,该图16所示的获取映射规则的装置能够执行第一通信设备所执行的全部或部分操作。应理解到,该装置可以包括比所示模块更多的附加模块或者省略其中所示的一部分模块,本申请实施例对此并不进行限制。如图16所示,该装置包括:The method for acquiring a mapping rule provided by the embodiment of the present application has been described above. Corresponding to the above method, the embodiment of the present application further provides an apparatus for acquiring a mapping rule. FIG. 16 is a schematic structural diagram of an apparatus for obtaining a mapping rule provided by an embodiment of the present application, where the apparatus is applied to a first communication device, and the first communication device is any of the above-mentioned FIGS. 4 , 12 , 14 , and 15 The first communication device shown in the accompanying drawings. Based on the following multiple modules shown in FIG. 16 , the apparatus for acquiring mapping rules shown in FIG. 16 can perform all or part of the operations performed by the first communication device. It should be understood that the apparatus may include more additional modules than the shown modules or omit a part of the modules shown therein, which is not limited in this embodiment of the present application. As shown in Figure 16, the device includes:

第一接收模块1601,用于接收第二通信设备发送的第一报文,第一通信设备和第二通信设备位于第一类型的网络,第一报文携带第二通信设备上配置的第一映射规则的信息,第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,第一类型的网络与第二类型的网络不同;The first receiving module 1601 is configured to receive a first packet sent by a second communication device. The first communication device and the second communication device are located in the first type of network, and the first packet carries the first packet configured on the second communication device. Information on the mapping rule, the first mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network, and the first type of network is different from the second type of network;

第一获取模块1602,用于根据第一映射规则的信息获取第一映射规则。The first obtaining module 1602 is configured to obtain the first mapping rule according to the information of the first mapping rule.

在一种可能的实现方式中,第一映射规则的信息为基于第一映射规则生成的映射地址和端口MAP路由。In a possible implementation manner, the information of the first mapping rule is a mapping address and a port MAP route generated based on the first mapping rule.

在一种可能的实现方式中,该装置还包括:In a possible implementation, the device further includes:

建立模块,用于与第二通信设备建立MAP邻居关系。An establishing module is configured to establish a MAP neighbor relationship with the second communication device.

在一种可能的实现方式中,建立模块,用于向第二通信设备发送携带第一MAP地址簇的报文;接收第二通信设备发送的携带第二MAP地址簇的报文。In a possible implementation manner, the establishment module is configured to send a message carrying the first MAP address cluster to the second communication device; and receive a message carrying the second MAP address cluster sent by the second communication device.

在一种可能的实现方式中,第一报文还包括属性信息,属性信息包括映射地址和端口MAP域类型和MAP域标识。In a possible implementation manner, the first packet further includes attribute information, where the attribute information includes a mapping address, a port MAP field type, and a MAP field identifier.

在一种可能的实现方式中,属性信息还包括路由标识符以及路由目标。In a possible implementation manner, the attribute information further includes a route identifier and a route target.

在一种可能的实现方式中,第一映射规则的信息以及属性信息均携带在第一报文的网络层可达性信息NLRI的字段中。In a possible implementation manner, the information of the first mapping rule and the attribute information are both carried in the field of the network layer reachability information NLRI of the first packet.

在一种可能的实现方式中,第一映射规则的信息携带在第一报文的网络层可达性信息的字段中,属性信息携带在第一报文的扩展属性字段中。In a possible implementation manner, the information of the first mapping rule is carried in the network layer reachability information field of the first packet, and the attribute information is carried in the extended attribute field of the first packet.

在一种可能的实现方式中,映射规则的信息包括基本映射规则BMR对应的地址信息、转发映射规则FMR对应的地址信息以及默认映射规则DMR对应的地址信息中的至少一种。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.

在一种可能的实现方式中,BMR对应的地址信息包括BMR对应的互联网协议第6版IPv6前缀、IPv6前缀长度、互联网协议第4版IPv4前缀、IPv4前缀长度、EA比特长度以及端口集标识PSID偏移量。In a possible implementation manner, the address information corresponding to the BMR includes an Internet Protocol version 6 IPv6 prefix corresponding to the BMR, an IPv6 prefix length, an Internet Protocol version 4 IPv4 prefix, an IPv4 prefix length, an EA bit length, and a port set identifier PSID. Offset.

在一种可能的实现方式中,FMR对应的地址信息包括FMR对应的互联网协议第6版IPv6前缀、IPv6前缀长度、互联网协议第4版IPv4前缀、IPv4前缀长度、EA比特长度以及端口集标识PSID偏移量。In a possible implementation manner, the address information corresponding to the FMR includes the IPv6 prefix of the Internet Protocol version 6 corresponding to the FMR, the IPv6 prefix length, the IPv4 prefix of the Internet Protocol version 4, the IPv4 prefix length, the EA bit length, and the port set identifier PSID. Offset.

在一种可能的实现方式中,DMR对应的地址信息包括DMR对应的互联网协议第6版IPv6前缀以及IPv6前缀长度。In a possible implementation manner, the address information corresponding to the DMR includes an IPv6 prefix corresponding to the Internet Protocol Version 6 and an IPv6 prefix length corresponding to the DMR.

在一种可能的实现方式中,DMR对应的地址信息包括边界中继BR设备对应的互联网协议第6版IPv6的地址以及IPv6地址前缀长度。In a possible implementation manner, the address information corresponding to the DMR includes the IPv6 address of the Internet Protocol version 6 and the IPv6 address prefix length corresponding to the border relay BR device.

在一种可能的实现方式中,该装置还包括:In a possible implementation, the device further includes:

第一发送模块,用于向第二通信设备发送第二报文,第二报文携带第一通信设备上配置的第二映射规则的信息,第二映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,第二映射规则的信息用于第二通信设备获取第二映射规则。The first sending module is configured to send a second message to the second communication device, where the second message carries the information of the second mapping rule configured on the first communication device, and the second mapping rule is used for Address mapping between addresses and addresses in the second type of network, and the information of the second mapping rule is used by the second communication device to obtain the second mapping rule.

在一种可能的实现方式中,第一类型的网络为互联网协议第4版IPv4网络,第二类型的网络为互联网协议第6版IPv6网络,或者,第一类型的网络为互联网协议第6版IPv6网络,第二类型的网络为互联网协议第4版IPv4网络;In a possible implementation manner, the first type of network is an Internet Protocol version 4 IPv4 network, 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 network IPv6 network, the second type of network is the Internet Protocol Version 4 IPv4 network;

第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射,第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射。The first mapping rule is used for the mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for the mapping between the second IPv4 address and the second IPv6 address.

在一种可能的实现方式中,第一通信设备为MAP边界中继BR设备,第二通信设备为宽带接入服务器;In a possible implementation manner, the first communication device is a MAP border relay BR device, and the second communication device is a broadband access server;

或者,第一通信设备为宽带接入服务器,第二通信设备为MAP BR设备;Or, the first communication device is a broadband access server, and the second communication device is a MAP BR device;

或者,第一通信设备为第一服务商边缘PE设备,第二通信设备为第二PE设备。Alternatively, the first communication device is a first service provider edge PE device, and the second communication device is a second PE device.

在一种可能的实现方式中,该装置还包括:In a possible implementation, the device further includes:

第二接收模块,用于接收第三报文,第三报文的源地址为第一IPv6地址,第三报文的目的地址为第二IPv6地址;A second receiving module, configured to receive a third packet, where the source address of the third packet is the first IPv6 address, and the destination address of the third packet is the second IPv6 address;

第一映射模块,用于基于第一映射规则将第三报文的源地址由第一IPv6地址映射为第一IPv4地址,基于第二映射规则将第三报文的目的地址由第二IPv6地址映射为第二IPv4地址。The first mapping module is configured to map the source address of the third packet from the first IPv6 address to the first IPv4 address based on the first mapping rule, and map the destination address of the third packet from the second IPv6 address based on the second mapping rule. Mapped to the second IPv4 address.

在一种可能的实现方式中,该装置还包括:In a possible implementation, the device further includes:

第二获取模块,用于获取第四报文,第四报文的源地址为第二IPv4地址,第四报文的目的地址为第一IPv4地址;A second obtaining module, configured to obtain a fourth packet, where 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;

第二映射模块,用于基于第一映射规则将第四报文的源地址由第二IPv4地址映射为第二IPv6地址,基于第二映射规则将第四报文的目的地址由第一IPv4地址映射为第一IPv6地址,得到第五报文;The second mapping module is configured to map the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, and map the destination address of the fourth packet from the first IPv4 address based on the second mapping rule Mapping to the first IPv6 address to obtain the fifth packet;

第二发送模块,用于发送第五报文。The second sending module is used for sending the fifth message.

在一种可能的实现方式中,该装置还包括:In a possible implementation, the device further includes:

存储模块,用于将第一映射规则作为路由表项进行存储,路由表项用于传输报文。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.

在一种可能的实现方式中,当第一通信设备为宽带接入服务器时,该装置还包括:第三发送模块,用于向第三通信设备发送第六报文,以使得第三通信设备根据第一映射规则执行第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;其中,第六报文携带第一映射规则的信息,第三通信设备为用户边缘CE设备。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 the third communication device, so that the third communication device Execute address mapping between addresses in the network of the first type and addresses in the network of the second type according to the first mapping rule; wherein, the sixth packet carries the information of the first mapping rule, and the third communication device is the user edge CE equipment.

图17是本申请实施例提供的一种获取映射规则的装置的结构示意图,该装置应用于第一通信设备,该第一通信设备为上述图4、图12、图14、图15中任一附图所示的第一通信设备。基于图17所示的如下多个模块,该图17所示的获取映射规则的装置能够执行第一通信设备所执行的全部或部分操作。应理解到,该装置可以包括比所示模块更多的附加模块或者省略其中所示的一部分模块,本申请实施例对此并不进行限制。如图17所示,该装置包括:FIG. 17 is a schematic structural diagram of an apparatus for obtaining a mapping rule provided by an embodiment of the present application. The apparatus is applied to a first communication device, and the first communication device is any of the above-mentioned FIGS. 4 , 12 , 14 , and 15 The first communication device shown in the accompanying drawings. Based on the following multiple modules shown in FIG. 17 , the apparatus for acquiring mapping rules shown in FIG. 17 can perform all or part of the operations performed by the first communication device. It should be understood that the apparatus may include more additional modules than the shown modules or omit a part of the modules shown therein, which is not limited in this embodiment of the present application. As shown in Figure 17, the device includes:

第一获取模块1701,用于获取第一通信设备上配置的第一映射规则的信息,第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;The first obtaining module 1701 is configured to obtain the information of the first mapping rule configured on the first communication device, and the first mapping rule is used for the address between the address in the network of the first type and the address in the network of the second type map;

第一发送模块1702,用于向第二通信设备发送第一报文,第一报文携带第一映射规则的信息,第一映射规则的信息用于第二通信设备获取第一映射规则,第一通信设备和第二通信设备位于第一类型的网络,第一类型的网络与第二类型的网络不同。The first sending module 1702 is configured to send a first packet to the second communication device, where the first packet carries information of the first mapping rule, and the information of the first mapping rule is used by the second communication device to obtain the first mapping rule, and the first packet carries information of the first mapping rule. A communication device and a second communication device are located on a first type of network, the first type of network being different from the second type of network.

在一种可能的实现方式中,第一获取模块1701,用于基于第一映射规则生成映射地址和端口MAP路由,将MAP路由作为第一映射规则的信息。In a possible implementation manner, the first obtaining module 1701 is configured to generate a mapping address and a port MAP route based on the first mapping rule, and use the MAP route as the information of the first mapping rule.

在一种可能的实现方式中,该装置还包括:In a possible implementation, the device further includes:

第一接收模块,用于接收第二通信设备发送的第二报文,第二报文携带第二通信设备上配置的第二映射规则的信息,第二映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;The first receiving module is configured to receive a second packet sent by the second communication device, where the second packet carries information of the second mapping rule configured on the second communication device, and the second mapping rule is used in the first type of network address mapping between addresses in the second type of networks and addresses in networks of the second type;

第二获取模块,用于根据第二映射规则的信息获取第二映射规则。The second obtaining module is configured to obtain the second mapping rule according to the information of the second mapping rule.

在一种可能的实现方式中,第一类型的网络为互联网协议第4版IPv4网络,第二类型的网络为互联网协议第6版IPv6网络,或者,第一类型的网络为互联网协议第6版IPv6网络,第二类型的网络为互联网协议第4版IPv4网络;第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射,第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射。In a possible implementation manner, the first type of network is an Internet Protocol version 4 IPv4 network, 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 network IPv6 network, the second type of network is the Internet Protocol version 4 IPv4 network; the first mapping rule is used for the mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for the second IPv4 address and the second Mapping between IPv6 addresses.

在一种可能的实现方式中,第一通信设备为MAP边界中继BR设备,第二通信设备为宽带接入服务器;In a possible implementation manner, the first communication device is a MAP border relay BR device, and the second communication device is a broadband access server;

或者,第一通信设备为宽带接入服务器,第二通信设备为MAP BR设备;Or, the first communication device is a broadband access server, and the second communication device is a MAP BR device;

或者,第一通信设备为第一服务商边缘PE设备,第二通信设备为第二PE设备。Alternatively, the first communication device is a first service provider edge PE device, and the second communication device is a second PE device.

在一种可能的实现方式中,该装置还包括:In a possible implementation, the device further includes:

第三获取模块,用于获取第七报文,第七报文的源地址为第一IPv4地址,第七报文的目的地址为第二IPv4地址;a third obtaining module, configured to obtain a seventh packet, where the source address of the seventh packet is the first IPv4 address, and the destination address of the seventh packet is the second IPv4 address;

第一映射模块,用于基于第一映射规则将第七报文的源地址由第一IPv4地址映射为第一IPv6地址,基于第二映射规则将第七报文的目的地址由第二IPv4地址映射为第二IPv6地址,得到第三报文;The first mapping module is configured to map the source address of the seventh packet from the first IPv4 address to the first IPv6 address based on the first mapping rule, and map the destination address of the seventh packet from the second IPv4 address based on the second mapping rule. Mapping to the second IPv6 address to obtain the third packet;

第二发送模块,用于发送第三报文。The second sending module is used for sending the third message.

在一种可能的实现方式中,该装置,还包括:In a possible implementation, the device further includes:

第二接收模块,用于接收第五报文,第五报文的源地址为第二IPv6地址,第五报文的目的地址为第一IPv6地址;A second receiving module, configured to receive a fifth packet, where the source address of the fifth packet is the second IPv6 address, and the destination address of the fifth packet is the first IPv6 address;

第二映射模块,用于基于第二映射规则将第五报文的源地址由第二IPv6地址映射为第二IPv4地址,基于第一映射规则将第五报文的目的地址由第一IPv6地址映射为第一IPv4地址。The second mapping module is configured to map the source address of the fifth packet from the second IPv6 address to the second IPv4 address based on the second mapping rule, and map the destination address of the fifth packet from the first IPv6 address based on the first mapping rule Mapped to the first IPv4 address.

应理解的是,上述图16-图17提供的装置在实现其功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be understood that when the devices provided in the above Figures 16 to 17 realize their functions, only the division of the above-mentioned functional modules is used for illustration. In practical applications, the above-mentioned functions can be allocated as required. Different functional modules are completed. , that is, dividing the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.

上述实施例中的通信设备的具体硬件结构如图18所示的通信设备1800,包括收发器1801、处理器1802和存储器1803。收发器1801、处理器1802和存储器1803之间通过总线1804连接。其中,收发器1801用于接收报文和发送报文,存储器1803用于存放指令或程序代码,处理器1802用于调用存储器1803中的指令或程序代码使得通信设备执行上述方法实施例中通信设备的相关处理步骤。在具体实施例中,本申请实施例的通信设备1800可对应于上述各个方法实施例中的第一通信设备,通信设备1800中的处理器1802读取存储器1803中的指令或程序代码,使图18所示的通信设备1800能够执行第一通信设备所执行的全部或部分操作。The specific hardware structure of the communication device in the above-mentioned embodiment is as shown in FIG. The transceiver 1801 , the processor 1802 and the memory 1803 are connected through a bus 1804 . The transceiver 1801 is used to receive and send messages, the memory 1803 is used to store instructions or program codes, and the processor 1802 is used to call the instructions or program codes in the memory 1803 to cause the communication device to execute the communication device in the above method embodiments. related processing steps. In a specific embodiment, the communication device 1800 in this embodiment of the present application may correspond to the first communication device in each of the above method embodiments, and the processor 1802 in the communication device 1800 reads the instructions or program codes in the memory 1803, so that the The communication device 1800 shown at 18 is capable of performing all or part of the operations performed by the first communication device.

在具体实施例中,本申请实施例的通信设备1800可对应于上述各个方法实施例中的第二通信设备,通信设备1800中的处理器1802读取存储器1803中的指令或程序代码,使图18所示的通信设备1800能够执行第二通信设备所执行的全部或部分操作。In a specific embodiment, the communication device 1800 in this embodiment of the present application may correspond to the second communication device in each of the above method embodiments, and the processor 1802 in the communication device 1800 reads the instructions or program codes in the memory 1803, so that the The communication device 1800 shown at 18 is capable of performing all or part of the operations performed by the second communication device.

通信设备1800还可以对应于上述图16、图17所示的装置,例如,图16中所涉及的第一接收模块1601相当于收发器1801,第一获取模块1602相当于处理器1802。又例如,图17中所涉及的第一发送模块1702相当于收发器1801,第一获取模块1701相当于处理器1502。The communication device 1800 may also correspond to the apparatuses shown in FIG. 16 and FIG. 17 . For example, the first receiving module 1601 involved in FIG. 16 corresponds to the transceiver 1801 , and the first obtaining module 1602 corresponds to the processor 1802 . For another example, the first sending module 1702 involved in FIG. 17 is equivalent to the transceiver 1801 , and the first acquiring module 1701 is equivalent to the processor 1502 .

参见图19,图19示出了本申请一个示例性实施例提供的通信设备2000的结构示意图。图19所示的通信设备2000用于执行上述图4、图12、图14、图15中任一附图所示的获取映射规则的方法所涉及的操作。该通信设备2000例如是交换机、路由器等。Referring to FIG. 19, FIG. 19 shows a schematic structural diagram of a communication device 2000 provided by an exemplary embodiment of the present application. The communication device 2000 shown in FIG. 19 is configured to perform the operations involved in the method for acquiring a mapping rule shown in any of the above-mentioned FIGS. 4 , 12 , 14 , and 15 . The communication device 2000 is, for example, a switch, a router, or the like.

如图19所示,通信设备2000包括至少一个处理器2001、存储器2003以及至少一个通信接口2004。As shown in FIG. 19 , the communication device 2000 includes at least one processor 2001 , memory 2003 and at least one communication interface 2004 .

处理器2001例如是通用中央处理器(central processing unit,CPU)、数字信号处理器(digital signal processor,DSP)、网络处理器(network processer,NP)、图形处理器(Graphics Processing Unit,GPU)、神经网络处理器(neural-network processingunits,NPU)、数据处理单元(Data Processing Unit,DPU)、微处理器或者一个或多个用于实现本申请方案的集成电路。例如,处理器2001包括专用集成电路(application-specificintegrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。PLD例如是复杂可编程逻辑器件(complex programmable logic device,CPLD)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。其可以实现或执行结合本申请实施例公开内容所描述的各种逻辑方框、模块和电路。所述处理器也可以是实现计算功能的组合,例如包括一个或多个微处理器组合,DSP和微处理器的组合等等。The processor 2001 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processor (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 solution of the present application. For example, the processor 2001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute various logical blocks, modules and circuits described in connection with the disclosure of the embodiments of the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

可选的,通信设备2000还包括总线。总线用于在通信设备2000的各组件之间传送信息。总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图19中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。图19中通信设备2000的各组件之间除了采用总线连接,还可采用其他方式连接,本申请实施例不对各组件的连接方式进行限定。Optionally, the communication device 2000 further includes a bus. The bus is used to transfer information between the various components of the communication device 2000 . The bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (extended industry standard architecture, EISA for short) bus, or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is shown in FIG. 19, but it does not mean that there is only one bus or one type of bus. In addition to the bus connection, the components of the communication device 2000 in FIG. 19 may be connected in other ways, and the embodiment of the present application does not limit the connection ways of the components.

存储器2003例如是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其它类型的静态存储设备,又如是随机存取存储器(random access memory,RAM)或者可存储信息和指令的其它类型的动态存储设备,又如是电可擦可编程只读存储器(electrically erasable programmable read-only Memory,EEPROM)、只读光盘(compactdisc read-only memory,CD-ROM)或其它光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器2003例如是独立存在,并通过总线与处理器2001相连接。存储器2003也可以和处理器2001集成在一起。The memory 2003 is, for example, a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, or a random access memory (RAM) or a memory device that can store information and instructions. Other types of dynamic storage devices, such as electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by Any other medium accessed by the computer, but not limited to this. The memory 2003 exists independently, for example, and is connected to the processor 2001 through a bus. The memory 2003 may also be integrated with the processor 2001 .

通信接口2004使用任何收发器一类的装置,用于与其它设备或通信网络通信,通信网络可以为以太网、无线接入网(RAN)或无线局域网(wireless local area networks,WLAN)等。通信接口2004可以包括有线通信接口,还可以包括无线通信接口。具体的,通信接口2004可以为以太(Ethernet)接口、快速以太(Fast Ethernet,FE)接口、千兆以太(Gigabit Ethernet,GE)接口,异步传输模式(Asynchronous Transfer Mode,ATM)接口,无线局域网(wireless local area networks,WLAN)接口,蜂窝网络通信接口或其组合。以太网接口可以是光接口,电接口或其组合。在本申请实施例中,通信接口2004可以用于通信设备2000与其他设备进行通信。The communication interface 2004 uses any device such as a transceiver for communicating with other devices or a communication network, which may be Ethernet, a radio access network (RAN), or a wireless local area network (WLAN), or the like. 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 ( wireless local area networks, WLAN) interface, cellular network communication interface or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. In this embodiment of the present application, the communication interface 2004 may be used for the communication device 2000 to communicate with other devices.

在具体实现中,作为一种实施例,处理器2001可以包括一个或多个CPU,如图19中所示的CPU0和CPU1。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 19 . Each of these processors can 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 (eg, computer program instructions).

在具体实现中,作为一种实施例,通信设备2000可以包括多个处理器,如图19中所示的处理器2001和处理器2005。这些处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the communication device 2000 may include multiple processors, such as the processor 2001 and the processor 2005 as shown in FIG. 19 . Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).

在具体实现中,作为一种实施例,通信设备2000还可以包括输出设备和输入设备。输出设备和处理器2001通信,可以以多种方式来显示信息。例如,输出设备可以是液晶显示器(liquid crystal display,LCD)、发光二级管(light emitting diode,LED)显示设备、阴极射线管(cathode ray tube,CRT)显示设备或投影仪(projector)等。输入设备和处理器2001通信,可以以多种方式接收用户的输入。例如,输入设备可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an embodiment, the communication device 2000 may further include an output device and an input device. The output device communicates with the processor 2001 and can display information in 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, or the like. The input device communicates with the processor 2001 and can receive user input in various ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensor device, or the like.

在一些实施例中,存储器2003用于存储执行本申请方案的程序代码2010,处理器2001可以执行存储器2003中存储的程序代码2010。也即是,通信设备2000可以通过处理器2001以及存储器2003中的程序代码2010,来实现方法实施例提供的获取映射规则的方法。程序代码2010中可以包括一个或多个软件模块。可选地,处理器2001自身也可以存储执行本申请方案的程序代码或指令。In some embodiments, the memory 2003 is used to store the program code 2010 for executing the solutions of the present application, and the processor 2001 can execute the program code 2010 stored in the memory 2003 . That is, the communication device 2000 can use the processor 2001 and the program code 2010 in the memory 2003 to implement the method for acquiring a mapping rule provided by the method embodiment. One or more software modules may be included in the program code 2010 . Optionally, the processor 2001 itself may also store program codes or instructions for executing the solutions of the present application.

在具体实施例中,本申请实施例的通信设备2000可对应于上述各个方法实施例中的第一通信设备,通信设备2000中的处理器2001读取存储器2003中的程序代码2010或处理器2001自身存储的程序代码或指令,使图19所示的通信设备2000能够执行第一通信设备所执行的全部或部分操作。In a specific embodiment, the communication device 2000 in this embodiment of the present application may correspond to the first communication device in each of the above method embodiments, and the processor 2001 in the communication device 2000 reads the program code 2010 or the processor 2001 in the memory 2003 The self-stored program codes or instructions enable the communication device 2000 shown in FIG. 19 to perform all or part of the operations performed by the first communication device.

在具体实施例中,本申请实施例的通信设备2000可对应于上述各个方法实施例中的第二通信设备,通信设备2000中的处理器2001读取存储器2003中的程序代码2010或处理器2001自身存储的程序代码或指令,使图19所示的通信设备2000能够执行第二通信设备所执行的全部或部分操作。In a specific embodiment, the communication device 2000 in this embodiment of the present application may correspond to the second communication device in each of the above method embodiments, and the processor 2001 in the communication device 2000 reads the program code 2010 or the processor 2001 in the memory 2003 The self-stored program codes or instructions enable the communication device 2000 shown in FIG. 19 to perform all or part of the operations performed by the second communication device.

通信设备2000还可以对应于上述图16和图17所示的装置,图16和图17所示的装置中的每个功能模块采用通信设备2000的软件实现。换句话说,图16和图17所示的装置包括的功能模块为通信设备2000的处理器2001读取存储器2003中存储的程序代码2010后生成的。例如,图16中所涉及的第一接收模块1601相当于通信接口2004,第一获取模块1602相当于处理器2001和/或处理器2005。又例如,图17中所涉及的第一发送模块1702相当于通信接口2004,第一获取模块1701相当于处理器2001和/或处理器2005。The communication device 2000 may also correspond to the apparatuses shown in FIG. 16 and FIG. 17 , and each functional module in the apparatuses shown in FIG. 16 and FIG. 17 is implemented by software of the communication apparatus 2000 . In other words, the functional modules included in the apparatuses shown in FIG. 16 and FIG. 17 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 involved in FIG. 16 is equivalent to the communication interface 2004 , and the first acquiring module 1602 is equivalent to the processor 2001 and/or the processor 2005 . For another example, the first sending module 1702 involved in FIG. 17 is equivalent to the communication interface 2004 , and the first acquiring module 1701 is equivalent to the processor 2001 and/or the processor 2005 .

其中,图4、图12、图14、图15所示的获取映射规则的方法的各步骤通过通信设备2000的处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤,为避免重复,这里不再详细描述。4 , 12 , 14 , and 15 , each step of the method for obtaining a mapping rule is completed by an integrated logic circuit of hardware or an instruction in the form of software in the processor of the communication device 2000 . The steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware, which will not be described in detail here to avoid repetition.

参见图20,图20示出了本申请另一个示例性实施例提供的通信设备2100的结构示意图图20所示的通信设备2100用于执行上述图4、图12、图14、图15所示的获取映射规则的方法所涉及的全部或部分操作。该通信设备2100例如是交换机、路由器等,该通信设备2100可以由一般性的总线体系结构来实现。Referring to FIG. 20 , FIG. 20 shows a schematic structural diagram of a communication device 2100 provided by another exemplary embodiment of the present application. The communication device 2100 shown in FIG. 20 is used to perform the above-mentioned operations shown in FIG. 4 , FIG. 12 , FIG. 14 , and FIG. 15 . All or part of the operations involved in the method of getting the mapping rules. The communication device 2100 is, for example, a switch, a router, etc., and the communication device 2100 can be implemented by a general bus architecture.

如图20所示,通信设备2100包括:主控板2110和接口板2130。As shown in FIG. 20 , the communication device 2100 includes: a main control board 2110 and an interface board 2130 .

主控板也称为主处理单元(main processing unit,MPU)或路由处理卡(routeprocessor card),主控板2110用于对通信设备2100中各个组件的控制和管理,包括路由计算、设备管理、设备维护、协议处理功能。主控板2110包括:中央处理器2111和存储器2112。The main control board is also called the main processing unit (MPU) or the route processor card (route processor card). Equipment maintenance, protocol processing functions. The main control board 2110 includes: a central processing unit 2111 and a memory 2112 .

接口板2130也称为线路接口单元卡(line processing unit,LPU)、线卡(linecard)或业务板。接口板2130用于提供各种业务接口并实现数据包的转发。业务接口包括而不限于以太网接口、POS(Packet over SONET/SDH)接口等,以太网接口例如是灵活以太网业务接口(Flexible Ethernet Clients,FlexE Clients)。接口板2130包括:中央处理器2131网络处理器2132、转发表项存储器2134和物理接口卡(ph10sical interface card,PIC)2133。The interface board 2130 is also referred to as a line processing unit (LPU), a line card (linecard) or a service board. The interface board 2130 is used to provide various service interfaces and realize data packet forwarding. The service interface includes, but is not limited to, an Ethernet interface, a POS (Packet over SONET/SDH) interface, etc. The Ethernet interface is, for example, a flexible Ethernet service interface (Flexible Ethernet Clients, FlexE Clients). The interface board 2130 includes: a central processing unit 2131 , a network processor 2132 , a forwarding table entry memory 2134 and a physical interface card (ph10sical interface card, PIC) 2133 .

接口板2130上的中央处理器2131用于对接口板2130进行控制管理并与主控板2110上的中央处理器2111进行通信。The central processing unit 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processing unit 2111 on the main control board 2110 .

网络处理器2132用于实现报文的发送处理。网络处理器2132的形态可以是转发芯片。转发芯片可以是网络处理器(network processor,NP)。在一些实施例中,转发芯片可以通过专用集成电路(application-specific integrated circuit,ASIC)或现场可编程门阵列(field programmable gate array,FPGA)实现。具体而言,网络处理器2132用于基于转发表项存储器2134保存的转发表转发接收到的报文,如果报文的目的地址为通信设备2100的地址,则将该报文上送至CPU(如中央处理器2131)处理;如果报文的目的地址不是通信设备2100的地址,则根据该目的地址从转发表中查找到该目的地址对应的下一跳和出接口,将该报文转发到该目的地址对应的出接口。其中,上行报文的处理可以包括:报文入接口的处理,转发表查找;下行报文的处理可以包括:转发表查找等等。在一些实施例中,中央处理器也可执行转发芯片的功能,比如基于通用CPU实现软件转发,从而接口板中不需要转发芯片。The network processor 2132 is used to realize the sending process of the message. The form of the network processor 2132 may be 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 the forwarding table stored in the forwarding table entry memory 2134. If the destination address of the message is the address of the communication device 2100, the message is sent to the CPU ( Such as processing by the central processing unit 2131); if the destination address of the message is not the address of the communication device 2100, the next hop and outbound interface corresponding to the destination address are found from the forwarding table according to the destination address, and the message is forwarded to The outbound interface corresponding to the destination address. Wherein, the processing of the uplink message may include: processing of the incoming interface of the message, and forwarding table lookup; the processing of the downlink message may include: forwarding table lookup, and so on. In some embodiments, the central processing unit can also perform the function of a forwarding chip, for example, software forwarding is implemented based on a general-purpose CPU, so that a forwarding chip is not required in the interface board.

物理接口卡2133用于实现物理层的对接功能,原始的流量由此进入接口板2130,以及处理后的报文从该物理接口卡2133发出。物理接口卡2133也称为子卡,可安装在接口板2130上,负责将光电信号转换为报文并对报文进行合法性检查后转发给网络处理器2132处理。在一些实施例中,中央处理器2131也可执行网络处理器2132的功能,比如基于通用CPU实现软件转发,从而物理接口卡2133中不需要网络处理器2132。The physical interface card 2133 is used to realize the interconnection function of the physical layer, the original traffic enters the interface board 2130 through this, and the processed packets are sent from the physical interface card 2133 . The physical interface card 2133 is also called a daughter card, which can be installed on the interface board 2130, and is responsible for converting the photoelectric signal into a message, and after checking the validity of the message, it is forwarded to the network processor 2132 for processing. In some embodiments, the central processing unit 2131 can also perform the functions of the network processor 2132 , such as implementing software forwarding based on a general-purpose CPU, so that the network processor 2132 is not required in the physical interface card 2133 .

可选地,通信设备2100包括多个接口板,例如通信设备2100还包括接口板2140,接口板2140包括:中央处理器2141、网络处理器2142、转发表项存储器2144和物理接口卡2143。接口板2140中各部件的功能和实现方式与接口板2130相同或相似,在此不再赘述。Optionally, the communication device 2100 includes multiple interface boards. For example, the communication device 2100 further includes an interface board 2140 . The interface board 2140 includes a central processing unit 2141 , a network processor 2142 , a forwarding table entry storage 2144 and a physical interface card 2143 . The functions and implementation manners of the components in the interface board 2140 are the same as or similar to those of the interface board 2130, and will not be repeated here.

可选地,通信设备2100还包括交换网板2120。交换网板2120也可以称为交换网板单元(switch fabric unit,SFU)。在通信设备有多个接口板的情况下,交换网板2120用于完成各接口板之间的数据交换。例如,接口板2130和接口板2140之间可以通过交换网板2120通信。Optionally, the communication device 2100 further includes a switch fabric board 2120 . The switch fabric unit 2120 may also be referred to as a switch fabric unit (switch fabric unit, SFU). In the case that the communication device has multiple interface boards, the switching network 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 through the switch fabric board 2120 .

主控板2110和接口板耦合。例如。主控板2110、接口板2130和接口板2140,以及交换网板2120之间通过系统总线与系统背板相连实现互通。在一种可能的实现方式中,主控板2110和接口板2130及接口板2140之间建立进程间通信协议(inter-processcommunication,IPC)通道,主控板2110和接口板2130及接口板2140之间通过IPC通道进行通信。The main control board 2110 is coupled with the interface board. E.g. The main control board 2110, the interface board 2130, the interface board 2140, and the switching network board 2120 are connected to the system backplane through a system bus to achieve 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. communicate through the IPC channel.

在逻辑上,通信设备2100包括控制面和转发面,控制面包括主控板2110和中央处理器2111,转发面包括执行转发的各个组件,比如转发表项存储器2134、物理接口卡2133和网络处理器2132。控制面执行路由器、生成转发表、处理信令和协议报文、配置与维护通信设备的状态等功能,控制面将生成的转发表下发给转发面,在转发面,网络处理器2132基于控制面下发的转发表对物理接口卡2133收到的报文查表转发。控制面下发的转发表可以保存在转发表项存储器2134中。在有些实施例中,控制面和转发面可以完全分离,不在同一通信设备上。Logically, the communication device 2100 includes a control plane and a forwarding plane, the control plane includes a main control board 2110 and a central processing unit 2111, and the forwarding plane includes various components that perform forwarding, such as forwarding entry storage 2134, physical interface card 2133, and network processing device 2132. The control plane performs functions such as routers, generating forwarding tables, processing signaling and protocol packets, and configuring and maintaining the status of communication devices. The control plane issues the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 2132 controls the The following forwarding table forwards the packets received by the physical interface card 2133 by looking up the table. 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 forwarding plane may be completely separated and not on the same communication device.

值得说明的是,主控板可能有一块或多块,有多块的时候可以包括主用主控板和备用主控板。接口板可能有一块或多块,通信设备的数据处理能力越强,提供的接口板越多。接口板上的物理接口卡也可以有一块或多块。交换网板可能没有,也可能有一块或多块,有多块的时候可以共同实现负荷分担冗余备份。在集中式转发架构下,通信设备可以不需要交换网板,接口板承担整个系统的业务数据的处理功能。在分布式转发架构下,通信设备可以有至少一块交换网板,通过交换网板实现多块接口板之间的数据交换,提供大容量的数据交换和处理能力。所以,分布式架构的通信设备的数据接入和处理能力要大于集中式架构的通信设备。可选地,通信设备的形态也可以是只有一块板卡,即没有交换网板,接口板和主控板的功能集成在该一块板卡上,此时接口板上的中央处理器和主控板上的中央处理器在该一块板卡上可以合并为一个中央处理器,执行两者叠加后的功能,这种形态通信设备的数据交换和处理能力较低(例如,低端交换机或路由器等通信设备)。具体采用哪种架构,取决于具体的组网部署场景,此处不做任何限定。It is worth noting that there may be one or more main control boards, and when there are multiple main control boards, they may include the main main control board and the backup main control board. There may be one or more interface boards. The stronger the data processing capability of the communication device, the more interface boards are provided. There can also be one or more physical interface cards on the interface board. There may be no switch fabric boards, or there may be one or more boards. When there are multiple boards, load sharing and redundancy backup can be implemented together. Under the centralized forwarding architecture, the communication device does not need to switch the network board, and the interface board is responsible for the processing function of the service data of the entire system. Under the distributed forwarding architecture, a communication device may have at least one switching network board, and the switching network board realizes data exchange between multiple interface boards, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of the communication devices of the distributed architecture are greater than those of the communication devices of the centralized architecture. Optionally, the form of the communication device can also be that there is only one board, that is, there is no switching network board, and the functions of the interface board and the main control board are integrated on this board. The central processing unit on the board can be combined into a central processing unit on this board to perform the functions of the two superimposed, the data exchange and processing capacity of this form of communication equipment is low (for example, low-end switches or routers, etc. communication device). The specific architecture used depends on the specific networking deployment scenario, and there is no restriction here.

在具体实施例中,通信设备2100对应于上述图16所示的应用于第二通信设备的获取映射规则的装置。在一些实施例中,图16所示的第一接收模块1601相当于通信设备2100中的物理接口卡2133或物理接口卡2143。图16所示的第一获取模块1602相当于通信设备2100中的中央处理器2111、网络处理器2132和网络处理器2142中的至少一个。In a specific embodiment, the communication device 2100 corresponds to the apparatus for obtaining a mapping rule that is applied to the second communication device shown in FIG. 16 . In some embodiments, the first receiving module 1601 shown in FIG. 16 is equivalent to the physical interface card 2133 or the physical interface card 2143 in the communication device 2100 . The first acquisition module 1602 shown in FIG. 16 is equivalent to at least one of the central processor 2111 , the network processor 2132 and the network processor 2142 in the communication device 2100 .

在一些实施例中,通信设备2100还对应于上述图17所示的应用于第一通信设备的获取映射规则的装置。在一些实施例中,图17所示的第一发送模块1702相当于通信设备2100中的物理接口卡2133或物理接口卡2143。图17所示的第一获取模块1701相当于通信设备2100中的中央处理器2111、网络处理器2132和网络处理器2142中的至少一个。其中,中央处理器2111、网络处理器2132和网络处理器2142中的至少一个是指中央处理器2111、网络处理器2132和网络处理器2142中的任意一个,或者多个构成任意组合。In some embodiments, the communication device 2100 also corresponds to the apparatus for obtaining a mapping rule that is applied to the first communication device shown in FIG. 17 . In some embodiments, the first sending module 1702 shown in FIG. 17 is equivalent to the physical interface card 2133 or the physical interface card 2143 in the communication device 2100 . The first acquisition module 1701 shown in FIG. 17 is equivalent to at least one of the central processor 2111 , the network processor 2132 and the network processor 2142 in the communication device 2100 . Wherein, 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 thereof.

基于上述图18、图19及图20所示的通信设备,本申请实施例还提供了一种通信系统,该通信系统包括:第一通信设备及第二通信设备。可选的,第一通信设备为图18所示的通信设备1500或图19所示的通信设备2000或图20所示的通信设备2100,第二通信设备为图18所示的通信设备1500或图19所示的通信设备2000或图20所示的通信设备2100。Based on the communication devices shown in FIG. 18 , FIG. 19 , and FIG. 20 , an embodiment of the present application further provides a communication system, where the communication system includes: a first communication device and a second communication device. Optionally, the first communication device is the communication device 1500 shown in FIG. 18 or 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 or The communication device 2000 shown in FIG. 19 or the communication device 2100 shown in FIG. 20 .

第一通信设备及第二通信设备所执行的方法可参见上述图4、图12、图14、图15所示的获取映射规则的方法实施例的相关描述,此处不再加以赘述。For the methods performed by the first communication device and the second communication device, reference may be made to the related descriptions of the method embodiments for obtaining mapping rules shown in the above-mentioned FIG. 4 , FIG. 12 , FIG. 14 , and FIG.

应理解的是,上述处理器可以是中央处理器(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。值得说明的是,处理器可以是支持进阶精简指令集机器(advanced RISC machines,ARM)架构的处理器。It should be understood that the above-mentioned processor may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (digital signal processing, DSP), application specific integrated circuits (application specific integrated circuits, ASIC), field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor or the like. It should be noted that the processor may be a processor supporting an advanced RISC machines (ARM) architecture.

进一步地,在一种可选的实施例中,上述存储器可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。Further, in an optional embodiment, the above-mentioned memory may include read-only memory and random access memory, and provide instructions and data to the processor. The memory may also include non-volatile random access memory. For example, the memory may also store device type information.

该存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用。例如,静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic random access memory,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data dateSDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(directrambus RAM,DR RAM)。The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory may be random access memory (RAM), which acts as an external cache. By way of example and not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access Memory (double data date SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (directrambus RAM, DR RAM).

还提供了一种计算机可读存储介质,存储介质中存储有至少一条程序指令或代码,所述程序指令或代码由处理器加载并执行时以使计算机实现如上图4、图12、图14、图15任一所示的获取映射规则的方法。A computer-readable storage medium is also provided, and at least one program instruction or code is stored in the storage medium, and when the program instruction or code is loaded and executed by the processor, the computer realizes the above Figure 4, Figure 12, Figure 14, The method for obtaining a mapping rule shown in any one of FIG. 15 .

本申请提供了一种计算机程序,当计算机程序被计算机执行时,可以使得处理器或计算机执行上述方法实施例中对应的各个步骤和/或流程。The present application provides a computer program. When the computer program is executed by a computer, the processor or the computer can execute the corresponding steps and/or processes in the foregoing method embodiments.

提供了一种芯片,包括处理器,用于从存储器中调用并运行所述存储器中存储的指令,使得安装有所述芯片的通信设备执行上述各方面中的方法。A chip is provided, including a processor for invoking and executing instructions stored in a memory, so that a communication device on which the chip is installed performs the methods in the above-mentioned aspects.

提供另一种芯片,包括:输入接口、输出接口、处理器和存储器,所述输入接口、输出接口、所述处理器以及所述存储器之间通过内部连接通路相连,所述处理器用于执行所述存储器中的代码,当所述代码被执行时,所述处理器用于执行上述各方面中的方法。Another chip is provided, including: an input interface, an output interface, a processor, and a memory, the input interface, the output interface, the processor, and the memory are connected through an internal connection path, and the processor is used to execute all The code in the memory, when the code is executed, the processor is configured to perform the methods of the above aspects.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid StateDisk)等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can 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. The computer program instructions, when loaded and executed on a computer, result in whole or in part of the processes or functions described herein. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid StateDisk), among others.

以上所述的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本申请的具体实施方式而已,并不用于限定本申请的保护范围,凡在本申请的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above descriptions are only specific embodiments of the present application, and are not intended to limit the The protection scope, any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present application shall be included within the protection scope of the present application.

本领域普通技术人员可以意识到,结合本文中所公开的实施例中描述的各方法步骤和模块,能够以软件、硬件、固件或者其任意组合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各实施例的步骤及组成。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that, in combination with the method steps and modules described in the embodiments disclosed herein, they can be implemented in software, hardware, firmware or any combination thereof, in order to clearly illustrate the interoperability of hardware and software Alternatively, the steps and components of each embodiment have been generally described in terms of their functions in the foregoing description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Persons of ordinary skill in the art may use different methods of implementing the described functionality for each particular application, but such implementations should not be considered beyond the scope of this application.

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,该程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium can be read-only memory, magnetic disk or optical disk, etc.

当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机程序指令。作为示例,本申请实施例的方法可以在机器可执行指令的上下文中被描述,机器可执行指令诸如包括在目标的真实或者虚拟处理器上的器件中执行的程序模块中。一般而言,程序模块包括例程、程序、库、对象、类、组件、数据结构等,其执行特定的任务或者实现特定的抽象数据结构。在各实施例中,程序模块的功能可以在所描述的程序模块之间合并或者分割。用于程序模块的机器可执行指令可以在本地或者分布式设备内执行。在分布式设备中,程序模块可以位于本地和远程存储介质二者中。When implemented in software, it can 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. As an example, the methods of the embodiments of the present application may be described in the context of machine-executable instructions, such as included in program modules executed in a device on a target's real or virtual processor. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform particular tasks or implement particular abstract data structures. In various embodiments, the functionality of the program modules may be combined or divided among the described program modules. 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 storage media.

用于实现本申请实施例的方法的计算机程序代码可以用一种或多种编程语言编写。这些计算机程序代码可以提供给通用计算机、专用计算机或其他可编程的数据处理装置的处理器,使得程序代码在被计算机或其他可编程的数据处理装置执行的时候,引起在流程图和/或框图中规定的功能/操作被实施。程序代码可以完全在计算机上、部分在计算机上、作为独立的软件包、部分在计算机上且部分在远程计算机上或完全在远程计算机或服务器上执行。Computer program code for implementing the methods of the embodiments of the present application may be written in one or more programming languages. Such computer program code may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus such that the program code, when executed by the computer or other programmable data processing apparatus, causes the flowchart and/or block diagrams The functions/operations specified in are implemented. 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 related data may be carried by any suitable carrier to enable a device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, 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.

机器可读介质可以是包含或存储用于或有关于指令执行系统、装置或设备的程序的任何有形介质。机器可读介质可以是机器可读信号介质或机器可读存储介质。机器可读介质可以包括但不限于电子的、磁的、光学的、电磁的、红外的或半导体系统、装置或设备,或其任意合适的组合。机器可读存储介质的更详细示例包括带有一根或多根导线的电气连接、便携式计算机磁盘、硬盘、随机存储存取器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或闪存)、光存储设备、磁存储设备,或其任意合适的组合。A machine-readable medium may be any tangible medium that contains or stores a program for 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. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination thereof. More detailed examples of machine-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only Memory (EPROM or flash memory), optical storage devices, magnetic storage devices, or any suitable combination thereof.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、设备和模块的具体工作过程,可以参见前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described systems, devices and modules, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,该模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、设备或模块的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or Integration into another system, or some features can be ignored, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or modules, and may also be electrical, mechanical or other forms of connection.

该作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solutions of the embodiments of the present application.

另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以是两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.

该集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例中方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application are essentially or part of contributions to the prior art, or all or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: U disk, removable hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .

本申请中术语“第一”“第二”等字样用于对作用和功能基本相同的相同项或相似项进行区分,应理解,“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系,也不对数量和执行顺序进行限定。还应理解,尽管以下描述使用术语第一、第二等来描述各种元素,但这些元素不应受术语的限制。这些术语只是用于将一元素与另一元素区别分开。例如,在不脱离各种所述示例的范围的情况下,第一边缘网络设备可以被称为第二边缘网络设备,并且类似地,第二边缘网络设备可以被称为第一边缘网络设备。第一边缘网络和设备和第二边缘网络设备都可以是边缘网络设备,并且在某些情况下,可以是单独且不同的边缘网络设备。In this application, the terms "first", "second" and other words are used to distinguish the same or similar items with basically the same function and function, and it should be understood that between "first", "second" and "nth" There are no logical or timing dependencies, and no restrictions on the number and execution order. It will also be understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are 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 various described examples. Both the first edge network and device and the second edge network device may be edge network devices, and in some cases, may be separate and distinct edge network devices.

还应理解,在本申请的各个实施例中,各个过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should also be understood that, in each embodiment of the present application, the size of the sequence number of each process does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not be used in the embodiment of the present application. Implementation constitutes any limitation.

本申请中术语“至少一个”的含义是指一个或多个,本申请中术语“多个”的含义是指两个或两个以上,例如,多个第二报文是指两个或两个以上的第二报文。本文中术语“系统”和“网络”经常可互换使用。In this application, the meaning of the term "at least one" refers to one or more, and the meaning of the term "plurality" in this application refers to two or more. For example, a plurality of second messages refers to two or more more than one second message. The terms "system" and "network" are often used interchangeably herein.

应理解,在本文中对各种所述示例的描述中所使用的术语只是为了描述特定示例,而并非旨在进行限制。如在对各种所述示例的描述和所附权利要求书中所使用的那样,单数形式“一个(“a”,“an”)”和“该”旨在也包括复数形式,除非上下文另外明确地指示。It is to be understood that the terminology used in describing the various described examples herein is for the purpose of describing particular examples 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 dictates otherwise. clearly instructed.

还应理解,术语“包括”(也称“includes”、“including”、“comprises”和/或“comprising”)当在本说明书中使用时指定存在所陈述的特征、整数、步骤、操作、元素、和/或部件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元素、部件、和/或其分组。It will also be understood that the term "includes" (also referred to as "includes", "including", "comprises" and/or "comprising") when used in this specification designates 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 groupings thereof.

还应理解,术语“若”和“如果”可被解释为意指“当...时”(“when”或“upon”)或“响应于确定”或“响应于检测到”。类似地,根据上下文,短语“若确定...”或“若检测到[所陈述的条件或事件]”可被解释为意指“在确定...时”或“响应于确定...”或“在检测到[所陈述的条件或事件]时”或“响应于检测到[所陈述的条件或事件]”。It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, depending on the context, the phrases "if it is determined..." or "if the [stated condition or event] is detected" can be interpreted to mean "when determining..." or "in response to determining... ” or “on detection of [recited condition or event]” or “in response to detection of [recited condition or event]”.

应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。It should be understood that determining B according to A does not mean that B is only determined according to A, and B may also be determined according to A and/or other information.

还应理解,说明书通篇中提到的“一个实施例”、“一实施例”、“一种可能的实现方式”意味着与实施例或实现方式有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”、“一种可能的实现方式”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。It should also be understood that references throughout the specification to "one embodiment," "an embodiment," and "one possible implementation" mean that a particular feature, structure, or characteristic associated with the embodiment or implementation is included herein. in at least one embodiment of the application. Thus, appearances of "in one embodiment" or "in an embodiment" or "one possible implementation" in various places throughout this specification are not necessarily necessarily 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.一种获取映射规则的方法,其特征在于,所述方法包括:1. a method for obtaining mapping rules, is characterized in that, described method comprises: 第一通信设备接收第二通信设备发送的第一报文,所述第一通信设备和所述第二通信设备位于第一类型的网络,所述第一报文携带所述第二通信设备上配置的第一映射规则的信息,所述第一映射规则用于所述第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射,所述第一类型的网络与所述第二类型的网络不同;A first communication device receives a first packet sent by a second communication device, the first communication device and the second communication device are located on a network of a first type, and the first packet is carried on the second communication device Information about the configured first mapping rule, the first mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network, the first type of network and the second type of network is different; 所述第一通信设备根据所述第一映射规则的信息获取所述第一映射规则。The first communication device acquires the first mapping rule according to the information of the first mapping rule. 2.根据权利要求1所述的方法,其特征在于,所述第一映射规则的信息为基于所述第一映射规则生成的映射地址和端口MAP路由。2 . The method according to 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 . 3.根据权利要求1或2所述的方法,其特征在于,所述第一通信设备接收第二通信设备发送的第一报文之前,还包括: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: 所述第一通信设备与所述第二通信设备建立MAP邻居关系。The first communication device establishes a MAP neighbor relationship with the second communication device. 4.根据权利要求3所述的方法,其特征在于,所述第一通信设备与所述第二通信设备建立MAP邻居关系,包括:4. The method according to claim 3, wherein establishing a MAP neighbor relationship between the first communication device and the second communication device comprises: 所述第一通信设备向所述第二通信设备发送携带第一MAP地址簇的报文;sending, by the first communication device, a message carrying the first MAP address cluster to the second communication device; 所述第一通信设备接收所述第二通信设备发送的携带第二MAP地址簇的报文。The first communication device receives the packet that is sent by the second communication device and carries the second MAP address cluster. 5.根据权利要求1-4任一所述的方法,其特征在于,所述第一报文还包括属性信息,所述属性信息包括MAP域类型和MAP域标识。5 . The method according to claim 1 , wherein the first packet further includes attribute information, and the attribute information includes a MAP field type and a MAP field identifier. 6 . 6.根据权利要求5所述的方法,其特征在于,所述属性信息还包括路由标识符以及路由目标。6. The method of claim 5, wherein the attribute information further comprises a route identifier and a route target. 7.根据权利要求5或6所述的方法,其特征在于,所述第一映射规则的信息以及所述属性信息均携带在所述第一报文的网络层可达性信息NLRI的字段中。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.根据权利要求5或6所述的方法,其特征在于,所述第一映射规则的信息携带在所述第一报文的NLRI的字段中,所述属性信息携带在所述第一报文的扩展属性字段中。8. The method according to claim 5 or 6, wherein the information of the first mapping rule is carried in an NLRI field of the first packet, and the attribute information is carried in the first packet in the Extended Attributes field of the text. 9.根据权利要求1-8任一所述的方法,其特征在于,所述第一映射规则的信息包括基本映射规则BMR对应的地址信息、转发映射规则FMR对应的地址信息以及默认映射规则DMR对应的地址信息中的至少一种。9. The method according to any one of claims 1-8, wherein the information of the first mapping rule comprises address information corresponding to a basic mapping rule BMR, address information corresponding to a forwarding mapping rule FMR, and a default mapping rule DMR At least one of the corresponding address information. 10.根据权利要求9所述的方法,其特征在于,所述BMR对应的地址信息包括所述BMR对应的互联网协议第6版IPv6前缀、IPv6前缀长度、互联网协议第4版IPv4前缀、IPv4前缀长度、EA比特长度以及端口集标识PSID偏移量。10. The method according to 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, and an IPv4 prefix corresponding to the BMR. Length, EA bit length, and Port Set Identifier PSID Offset. 11.根据权利要求9或10所述的方法,其特征在于,所述FMR对应的地址信息包括所述FMR对应的IPv6前缀、IPv6前缀长度、IPv4前缀、IPv4前缀长度、EA比特长度以及端口集标识PSID偏移量。11. The method according to claim 9 or 10, wherein the address information corresponding to the FMR comprises an IPv6 prefix corresponding to the FMR, an IPv6 prefix length, an IPv4 prefix, an IPv4 prefix length, an EA bit length and a port set Identifies the PSID offset. 12.根据权利要求9-11任一所述的方法,其特征在于,所述DMR对应的地址信息包括所述DMR对应的IPv6前缀以及IPv6前缀长度。The method according to any one of claims 9-11, wherein the address information corresponding to the DMR includes an IPv6 prefix and an IPv6 prefix length corresponding to the DMR. 13.根据权利要求9-11任一所述的方法,其特征在于,所述DMR对应的地址信息包括边界中继BR设备对应的IPv6的地址以及IPv6地址前缀长度。The method according to any one of claims 9-11, wherein the address information corresponding to the DMR comprises an IPv6 address and an IPv6 address prefix length corresponding to a border relay BR device. 14.根据权利要求1-13任一所述的方法,其特征在于,所述方法还包括:14. The method according to any one of claims 1-13, wherein the method further comprises: 所述第一通信设备向所述第二通信设备发送第二报文,所述第二报文携带所述第一通信设备上配置的第二映射规则的信息,所述第二映射规则用于所述第一类型的网络中的地址与所述第二类型的网络中的地址之间的地址映射,所述第二映射规则的信息用于所述第二通信设备获取所述第二映射规则。The first communication device sends a second packet to the second communication device, where the second packet carries the information of the second mapping rule configured on the first communication device, and the second mapping rule is used for address mapping between addresses in the network of the first type and addresses in the network of the second type, the information of the second mapping rule is used by the second communication device to obtain the second mapping rule . 15.根据权利要求1-14任一所述的方法,其特征在于,所述第一类型的网络为IPv4网络,所述第二类型的网络为IPv6网络,或者,所述第一类型的网络为IPv6网络,所述第二类型的网络为IPv4网络;The method according to any one of claims 1-14, wherein the network of the first type is an IPv4 network, the network of the second type is an IPv6 network, or the network of the first type is an IPv6 network, and the second type of network is an IPv4 network; 所述第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射,所述第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射。The first mapping rule is used for the mapping between the first IPv4 address and the first IPv6 address, and the second mapping rule is used for the mapping between the second IPv4 address and the second IPv6 address. 16.根据权利要求1-15任一所述的方法,其特征在于,所述第一通信设备为MAP BR设备,所述第二通信设备为宽带接入服务器;16. The method according to any one of claims 1-15, wherein the first communication device is a MAP BR device, and the second communication device is a broadband access server; 或者,所述第一通信设备为宽带接入服务器,所述第二通信设备为MAP BR设备;Alternatively, the first communication device is a broadband access server, and the second communication device is a MAP BR device; 或者,所述第一通信设备为第一服务商边缘PE设备,所述第二通信设备为第二PE设备。Alternatively, the first communication device is a first service provider edge PE device, and the second communication device is a second PE device. 17.根据权利要求1-16任一所述的方法,其特征在于,所述第一通信设备根据所述第一映射规则的信息获取所述第一映射规则之后,还包括:17. The method according to any one of claims 1-16, wherein after the first communication device acquires the first mapping rule according to the information of the first mapping rule, the method further comprises: 所述第一通信设备接收第三报文,所述第三报文的源地址为第一IPv6地址,所述第三报文的目的地址为第二IPv6地址;the first communication device receives a third packet, the source address of the third packet is the first IPv6 address, and the destination address of the third packet is the second IPv6 address; 所述第一通信设备基于所述第一映射规则将所述第三报文的源地址由所述第一IPv6地址映射为第一IPv4地址,基于所述第二映射规则将所述第三报文的目的地址由所述第二IPv6地址映射为所述第二IPv4地址。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 third packet based on the second mapping rule. The destination address of the text is mapped from the second IPv6 address to the second IPv4 address. 18.根据权利要求1-17任一所述的方法,其特征在于,所述第一通信设备根据所述第一映射规则的信息获取所述第一映射规则之后,还包括:18. The method according to any one of claims 1-17, wherein after the first communication device acquires the first mapping rule according to the information of the first mapping rule, the method further comprises: 所述第一通信设备获取第四报文,所述第四报文的源地址为第二IPv4地址,所述第四报文的目的地址为第一IPv4地址;obtaining, by the first communication device, a fourth packet, where 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; 所述第一通信设备基于所述第一映射规则将所述第四报文的源地址由所述第二IPv4地址映射为第二IPv6地址,基于所述第二映射规则将所述第四报文的目的地址由所述第一IPv4地址映射为所述第一IPv6地址,得到第五报文;The first communication device maps the source address of the fourth packet from the second IPv4 address to the second IPv6 address based on the first mapping rule, and maps the fourth packet based on the second mapping rule. The destination address of the message is mapped to the first IPv6 address by the first IPv4 address, and the fifth message is obtained; 所述第一通信设备发送所述第五报文。The first communication device sends the fifth message. 19.根据权利要求1-17任一项所述的方法,其特征在于,当所述第一通信设备为宽带接入服务器时,所述第一通信设备根据所述第一映射规则的信息获取所述第一映射规则之后,还包括:The method according to any one of claims 1-17, wherein when the first communication device is a broadband access server, the first communication device obtains information according to the first mapping rule After the first mapping rule, it also includes: 所述第一通信设备向第三通信设备发送第六报文,以使得所述第三通信设备根据所述第一映射规则执行所述第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;The first communication device sends a sixth packet to the third communication device, so that the third communication device executes the address in the network of the first type and the network of the second type according to the first mapping rule. address mapping between addresses; 其中,所述第六报文携带所述第一映射规则的信息,所述第三通信设备为用户边缘CE设备。Wherein, the sixth packet carries the information of the first mapping rule, and the third communication device is a user edge CE device. 20.根据权利要求1-19任一所述的方法,其特征在于,所述第一通信设备根据所述第一映射规则的信息获取所述第一映射规则之后,还包括:20. The method according to any one of claims 1-19, wherein after the first communication device acquires the first mapping rule according to the information of the first mapping rule, the method further comprises: 所述第一通信设备将所述第一映射规则作为路由表项进行存储,所述路由表项用于传输报文。The first communication device stores the first mapping rule as a routing table entry, and the routing table entry is used to transmit a message. 21.一种获取映射规则的方法,其特征在于,所述方法包括:21. A method for obtaining a mapping rule, wherein the method comprises: 第一通信设备获取所述第一通信设备上配置的第一映射规则的信息,所述第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;The first communication device acquires information of a first mapping rule configured on the first communication device, where the first mapping rule is used for an address between an address in a network of the first type and an address in a network of the second type map; 所述第一通信设备向第二通信设备发送第一报文,所述第一报文携带所述第一映射规则的信息,所述第一映射规则的信息用于所述第二通信设备获取所述第一映射规则,所述第一通信设备和所述第二通信设备位于所述第一类型的网络,所述第一类型的网络与所述第二类型的网络不同。The first communication device sends a first packet to the second communication device, where the first packet carries the information of the first mapping rule, and the information of the first mapping rule is used for the second communication device to acquire According to 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.根据权利要求21所述的方法,其特征在于,所述第一通信设备获取所述第一通信设备上配置的第一映射规则的信息,包括:22. The method according to claim 21, wherein obtaining, by the first communication device, information of the first mapping rule configured on the first communication device, comprising: 所述第一通信设备基于所述第一映射规则生成映射地址和端口MAP路由,将所述MAP路由作为所述第一映射规则的信息。The first communication device generates a mapping address and a port MAP route based on the first mapping rule, and uses the MAP route as information of the first mapping rule. 23.根据权利要求21或22所述的方法,其特征在于,所述方法还包括:23. The method according to claim 21 or 22, wherein the method further comprises: 所述第一通信设备接收所述第二通信设备发送的第二报文,所述第二报文携带所述第二通信设备上配置的第二映射规则的信息,所述第二映射规则用于所述第一类型的网络中的地址与所述第二类型的网络中的地址之间的地址映射;The first communication device receives a second packet sent by the second communication device, where the second packet carries information about the second mapping rule configured on the second communication device, and the second mapping rule uses an address mapping between addresses in the first type of network and addresses in the second type of network; 所述第一通信设备根据所述第二映射规则的信息获取所述第二映射规则。The first communication device acquires the second mapping rule according to the information of the second mapping rule. 24.根据权利要求23所述的方法,其特征在于,所述第一类型的网络为互联网协议第4版IPv4网络,所述第二类型的网络为互联网协议第6版IPv6网络,或者,所述第一类型的网络为IPv6网络,所述第二类型的网络为IPv4网络;所述第一映射规则用于第一IPv4地址和第一IPv6地址之间的映射,所述第二映射规则用于第二IPv4地址和第二IPv6地址之间的映射。24. The method according to 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 all The network of the first type is an IPv6 network, and the network of the second type is an 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 first IPv4 address and the first IPv6 address. mapping between the second IPv4 address and the second IPv6 address. 25.根据权利要求21-24任一所述的方法,其特征在于,所述第一通信设备为MAP边界中继BR设备,所述第二通信设备为宽带接入服务器;25. The method according to any one 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; 或者,所述第一通信设备为宽带接入服务器,所述第二通信设备为MAP BR设备;Alternatively, the first communication device is a broadband access server, and the second communication device is a MAP BR device; 或者,所述第一通信设备为第一服务商边缘PE设备,所述第二通信设备为第二PE设备。Alternatively, the first communication device is a first service provider edge PE device, and the second communication device is a second PE device. 26.根据权利要求21-25任一所述的方法,其特征在于,所述第一通信设备根据所述第二映射规则的信息生成所述第二映射规则之后,还包括:26. The method according to any one of claims 21-25, wherein after the first communication device generates the second mapping rule according to the information of the second mapping rule, the method further comprises: 所述第一通信设备获取第七报文,所述第七报文的源地址为第一IPv4地址,所述第七报文的目的地址为第二IPv4地址;The first communication device obtains a seventh packet, where the source address of the seventh packet is the first IPv4 address, and the destination address of the seventh packet is the second IPv4 address; 所述第一通信设备基于所述第一映射规则将所述第七报文的源地址由所述第一IPv4地址映射为第一IPv6地址,基于所述第二映射规则将所述第七报文的目的地址由所述第二IPv4地址映射为所述第二IPv6地址,得到第三报文;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 seventh packet based on the second mapping rule. The destination address of the message is mapped to the second IPv6 address by the second IPv4 address to obtain a third message; 所述第一通信设备发送所述第三报文。The first communication device sends the third message. 27.根据权利要求21-26任一所述的方法,其特征在于,所述第一通信设备根据所述第二映射规则的信息生成所述第二映射规则之后,还包括:27. The method according to any one 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: 所述第一通信设备接收第五报文,所述第五报文的源地址为第二IPv6地址,所述第五报文的目的地址为第一IPv6地址;The first communication device receives a fifth packet, where the source address of the fifth packet is the second IPv6 address, and the destination address of the fifth packet is the first IPv6 address; 所述第一通信设备基于所述第二映射规则将所述第五报文的源地址由所述第二IPv6地址映射为第二IPv4地址,基于所述第一映射规则将所述第五报文的目的地址由所述第一IPv6地址映射为所述第一IPv4地址。The first communication device maps the source address of the fifth packet from the second IPv6 address to a second IPv4 address based on the second mapping rule, and maps the fifth packet based on the first mapping rule. The destination address of the text is mapped from the first IPv6 address to the first IPv4 address. 28.一种获取映射规则的装置,其特征在于,所述装置应用于第一通信设备,包括:28. An apparatus for obtaining a mapping rule, wherein the apparatus is applied to a first communication device, 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 network of a first type, and the first packet carries the second communication device Information about the first mapping rule configured on the communication device, the first mapping rule is used for address mapping between addresses in the first type of network and addresses in the second type of network, the first type of The network is different from the network of the second type; 第一获取模块,用于根据所述第一映射规则的信息获取所述第一映射规则。A first obtaining module, configured to obtain the first mapping rule according to the information of the first mapping rule. 29.根据权利要求28所述的装置,其特征在于,所述装置,还包括:29. The apparatus of claim 28, wherein the apparatus further comprises: 建立模块,用于与所述第二通信设备建立映射地址和端口MAP邻居关系。An establishment module, configured to establish a mapping address and port MAP neighbor relationship with the second communication device. 30.根据权利要求28或29所述的装置,其特征在于,所述装置还包括:30. The apparatus of claim 28 or 29, wherein the apparatus further comprises: 第一发送模块,用于向所述第二通信设备发送第二报文,所述第二报文携带所述第一通信设备上配置的第二映射规则的信息,所述第二映射规则用于所述第一类型的网络中的地址与所述第二类型的网络中的地址之间的地址映射,所述第二映射规则的信息用于所述第二通信设备获取所述第二映射规则。A first sending module, configured to send a second packet to the second communication device, where the second packet carries the information of the second mapping rule configured on the first communication device, and the second mapping rule uses address mapping between addresses in the network of the first type and addresses in the network of the second type, the information of the second mapping rule is used by the second communication device to obtain the second mapping rule. 31.根据权利要求28-30任一所述的装置,其特征在于,所述装置,还包括:31. The device according to any one of claims 28-30, wherein the device further comprises: 第二接收模块,用于接收第三报文,所述第三报文的源地址为第一IPv6地址,所述第三报文的目的地址为第二IPv6地址;A second receiving module, configured to receive a third packet, where the source address of the third packet is the first IPv6 address, and the destination address of the third packet is the second IPv6 address; 第一映射模块,用于基于所述第一映射规则将所述第三报文的源地址由所述第一IPv6地址映射为第一IPv4地址,基于所述第二映射规则将所述第三报文的目的地址由所述第二IPv6地址映射为所述第二IPv4地址。A first mapping module, configured to map the source address of the third packet from the first IPv6 address to a first IPv4 address based on the first mapping rule, and map the third packet based on the second mapping rule The destination address of the packet is mapped from the second IPv6 address to the second IPv4 address. 32.根据权利要求28-31任一所述的装置,其特征在于,所述装置,还包括:32. The device according to any one of claims 28-31, wherein the device further comprises: 第二获取模块,用于获取第四报文,所述第四报文的源地址为第二IPv4地址,所述第四报文的目的地址为第一IPv4地址;A second obtaining module, configured to obtain a fourth packet, where 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; 第二映射模块,用于基于所述第一映射规则将所述第四报文的源地址由所述第二IPv4地址映射为第二IPv6地址,基于所述第二映射规则将所述第四报文的目的地址由所述第一IPv4地址映射为所述第一IPv6地址,得到第五报文;A second mapping module, configured to map the source address of the fourth packet from the second IPv4 address to a second IPv6 address based on the first mapping rule, and map the fourth packet based on the second mapping rule The destination address of the message is mapped to the first IPv6 address by the first IPv4 address, and a fifth message is obtained; 第二发送模块,用于发送所述第五报文。The second sending module is configured to send the fifth message. 33.一种获取映射规则的装置,其特征在于,所述装置包括:33. A device for acquiring mapping rules, wherein the device comprises: 第一获取模块,用于获取所述第一通信设备上配置的第一映射规则的信息,所述第一映射规则用于第一类型的网络中的地址与第二类型的网络中的地址之间的地址映射;The first obtaining module is used to obtain the information of the first mapping rule configured on the first communication device, and the first mapping rule is used for the address in the network of the first type and the address in the network of the second type. address mapping between; 第一发送模块,用于向第二通信设备发送第一报文,所述第一报文携带所述第一映射规则的信息,所述第一映射规则的信息用于所述第二通信设备获取所述第一映射规则,所述第一通信设备和所述第二通信设备位于所述第一类型的网络,所述第一类型的网络与所述第二类型的网络不同。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 The first mapping rule is acquired, 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. 34.根据权利要求33所述的装置,其特征在于,所述装置还包括:34. The apparatus of claim 33, wherein the apparatus further comprises: 第一接收模块,用于接收所述第二通信设备发送的第二报文,所述第二报文携带所述第二通信设备上配置的第二映射规则的信息,所述第二映射规则用于所述第一类型的网络中的地址与所述第二类型的网络中的地址之间的地址映射;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, the second mapping rule for address mapping between addresses in the first type of network and addresses in the second type of network; 第二获取模块,用于根据所述第二映射规则的信息获取所述第二映射规则。A second obtaining module, configured to obtain the second mapping rule according to the information of the second mapping rule. 35.根据权利要求33或34所述的装置,其特征在于,所述装置还包括:35. The apparatus of claim 33 or 34, wherein the apparatus further comprises: 第三获取模块,用于获取第七报文,所述第七报文的源地址为第一IPv4地址,所述第七报文的目的地址为第二IPv4地址;A third obtaining module, configured to obtain a seventh packet, where the source address of the seventh packet is the first IPv4 address, and the destination address of the seventh packet is the second IPv4 address; 第一映射模块,用于基于所述第一映射规则将所述第七报文的源地址由所述第一IPv4地址映射为第一IPv6地址,基于所述第二映射规则将所述第七报文的目的地址由所述第二IPv4地址映射为所述第二IPv6地址,得到第三报文;A first mapping module, configured to map the source address of the seventh packet from the first IPv4 address to a first IPv6 address based on the first mapping rule, and map the seventh packet based on the second mapping rule The destination address of the message is mapped to the second IPv6 address by the second IPv4 address, to obtain a third message; 第二发送模块,用于发送所述第三报文。The second sending module is configured to send the third message. 36.根据权利要求33-35任一所述的装置,其特征在于,所述装置,还包括:36. The device according to any one of claims 33-35, wherein the device further comprises: 第二接收模块,用于接收第五报文,所述第五报文的源地址为第二IPv6地址,所述第五报文的目的地址为第一IPv6地址;A second receiving module, configured to receive a fifth packet, where the source address of the fifth packet is the second IPv6 address, and the destination address of the fifth packet is the first IPv6 address; 第二映射模块,用于基于所述第二映射规则将所述第五报文的源地址由所述第二IPv6地址映射为第二IPv4地址,基于所述第一映射规则将所述第五报文的目的地址由所述第一IPv6地址映射为所述第一IPv4地址。a second mapping module, configured to map the source address of the fifth packet from the second IPv6 address to a second IPv4 address based on the second mapping rule, and map the fifth packet based on the first mapping rule The destination address of the packet is mapped from the first IPv6 address to the first IPv4 address. 37.一种通信设备,其特征在于,所述通信设备包括:处理器,所述处理器与存储器耦合,所述存储器中存储有至少一条程序指令或代码,所述至少一条程序指令或代码由所述处理器加载并执行,以使所述通信设备实现权利要求1-27中任一所述的获取映射规则的方法。37. A communication device, characterized in that the communication device comprises: a processor, the processor is coupled to a memory, and the memory stores at least one program instruction or code, the at least one program instruction or code is The processor loads and executes, so that the communication device implements the method for obtaining a mapping rule according to any one of claims 1-27. 38.一种获取映射规则的系统,其特征在于,所述系统包括第一通信设备和第二通信设备,所述第一通信设备用于执行所述权利要求1-20中任一所述的第一通信设备所涉及的获取映射规则的方法,所述第二通信设备用于执行所述权利要求21-27中任一所述的第二通信设备所涉及的获取映射规则的方法。38. A system for acquiring mapping rules, characterized in that the system comprises a first communication device and a second communication device, and the first communication device is configured to execute the method described in any one of claims 1-20. A method for acquiring a mapping rule involving a first communication device, the second communication device being configured to execute the method for acquiring a mapping rule involving a second communication device according to any one of claims 21-27. 39.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有至少一条程序指令或代码,所述程序指令或代码由处理器加载并执行时以使计算机实现如权利要求1-27中任一所述的获取映射规则的方法。39. A computer-readable storage medium, characterized in that, at least one program instruction or code is stored in the computer-readable storage medium, and when the program instruction or code is loaded and executed by a processor, the computer realizes the right The method for obtaining a mapping rule described in any one of requirements 1-27.
CN202011282640.8A 2020-11-16 2020-11-16 Method, apparatus, device, system and readable storage medium for obtaining mapping rules Pending CN114513485A (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

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, apparatus, device, system and readable storage medium for obtaining mapping rules

Country Status (1)

Country Link
CN (1) CN114513485A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116527629A (en) * 2023-05-18 2023-08-01 中国电信股份有限公司北京研究院 Address mapping method based on IPv6 inter-domain route expansion and related equipment
WO2024011982A1 (en) * 2022-07-12 2024-01-18 华为技术有限公司 Message forwarding method, system, network device, storage medium and program product
CN118869588A (en) * 2023-04-28 2024-10-29 中国电信股份有限公司 Data processing method, device, equipment and medium
CN119232699A (en) * 2023-06-29 2024-12-31 华为技术有限公司 Communication method, device and communication system
CN119342032A (en) * 2024-10-22 2025-01-21 中国移动通信有限公司研究院 Communication method, device, storage medium and computer program product

Cited By (5)

* 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
CN118869588A (en) * 2023-04-28 2024-10-29 中国电信股份有限公司 Data processing method, device, equipment and medium
CN116527629A (en) * 2023-05-18 2023-08-01 中国电信股份有限公司北京研究院 Address mapping method based on IPv6 inter-domain route expansion and related equipment
CN119232699A (en) * 2023-06-29 2024-12-31 华为技术有限公司 Communication method, device and communication system
CN119342032A (en) * 2024-10-22 2025-01-21 中国移动通信有限公司研究院 Communication method, device, storage medium and computer program product

Similar Documents

Publication Publication Date Title
CN112165725B (en) Message processing methods and equipment
CN114513485A (en) Method, apparatus, device, system and readable storage medium for obtaining mapping rules
CN110999265B (en) Manage network connectivity between cloud computing service endpoints and virtual machines
US10205698B1 (en) Source-dependent address resolution
CN108293022B (en) Method, device and system for transmitting message
WO2022001835A1 (en) Method and apparatus for sending message, and network device, system and storage medium
WO2022057753A1 (en) Message processing method and related device
CN111800326A (en) Message transmission method and device, processing node and storage medium
CN113660164A (en) A message forwarding method and network device
US20240275722A1 (en) Packet forwarding method and apparatus, device, and storage medium
CN115426305A (en) Message processing method, device and system
JP2024504845A (en) Packet processing method and related equipment
CN113726915A (en) Network system, message transmission method therein and related device
WO2022068744A1 (en) Method for obtaining message header information and generating message, device, and storage medium
WO2022117018A1 (en) Packet transmission method and apparatus
WO2022111666A1 (en) Route advertisement method, apparatus, and system
WO2022007749A1 (en) Data transmission method and apparatus
US12021825B2 (en) Network address translation (NAT) devices configured to resolve NAT state synchronization issues
US11743180B2 (en) System and method for routing traffic onto an MPLS network
CN114826898A (en) Cross-host communication method, device, equipment, system and readable storage medium
CN115473765A (en) Message transmission method, device and system
CN116781618A (en) Route generation method, data message forwarding method and device
CN117527693A (en) Message forwarding method, device, system and storage medium
WO2023179457A1 (en) Method, apparatus and system for identifying service connection, and storage medium
WO2022042403A1 (en) Method for generating routing information, method for sending location information, method for forwarding message, and device

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