CN110830354A - Data forwarding method, device, equipment and storage medium - Google Patents

Data forwarding method, device, equipment and storage medium Download PDF

Info

Publication number
CN110830354A
CN110830354A CN201810899867.3A CN201810899867A CN110830354A CN 110830354 A CN110830354 A CN 110830354A CN 201810899867 A CN201810899867 A CN 201810899867A CN 110830354 A CN110830354 A CN 110830354A
Authority
CN
China
Prior art keywords
private network
label
network address
prefix
prefix label
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.)
Granted
Application number
CN201810899867.3A
Other languages
Chinese (zh)
Other versions
CN110830354B (en
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 CN201810899867.3A priority Critical patent/CN110830354B/en
Publication of CN110830354A publication Critical patent/CN110830354A/en
Application granted granted Critical
Publication of CN110830354B publication Critical patent/CN110830354B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • 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

Landscapes

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

Abstract

本发明实施例公开了一种数据转发方法、装置、设备及存储介质,其中,所述方法包括:第一设备在该第一设备的转发路径表中查找与私网地址关联的第一前缀标签,该第一设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签,该第一设备将该第一前缀标签、数据内容以及该私网地址封装成第一数据报文,该第一设备将所述第一数据报文发送至第一前缀标签对应的第二设备,第一数据报文用于得到第二数据报文,第二数据报文由第二前缀标签、数据内容以及私网地址封装得到,第二前缀标签与私网地址关联,可实现基站侧网关与无线业务侧网关之间的数据转发。

Figure 201810899867

Embodiments of the present invention disclose a data forwarding method, apparatus, device, and storage medium, wherein the method includes: a first device searches a forwarding path table of the first device for a first prefix label associated with a private network address , the forwarding path table of the first device includes one or more private network addresses, and a prefix label associated with each private network address, the first device uses the first prefix label, data content and the private network address. encapsulated into a first data packet, the first device sends the first data packet to a second device corresponding to the first prefix label, the first data packet is used to obtain a second data packet, and the second data packet The text is encapsulated by the second prefix label, the data content and the private network address. The second prefix label is associated with the private network address, which can realize data forwarding between the base station side gateway and the wireless service side gateway.

Figure 201810899867

Description

数据转发方法、装置、设备及存储介质Data forwarding method, device, device and storage medium

技术领域technical field

本发明涉及移动通信技术,尤其涉及一种数据转发方法、装置、设备及存储介质。The present invention relates to mobile communication technologies, and in particular, to a data forwarding method, apparatus, device and storage medium.

背景技术Background technique

无线接入网IP化(Internet Protocol Radio Access Network,IPRAN)是针对IP(Internet Protocol,网络协议)化基站回传应用场景进行优化定制的路由器/交换机整体解决方案,随着网络IP化不断地推进,IPRAN对于移动网络来说变得越来越重要。在IPRAN组网中,通常基站侧网关与无线业务侧网关通过建立端到端的路由,以实现基站侧网关与无线业务侧网关之间的数据转发,但是,在基站侧网关与无线业务侧网关之间通过前缀标签转发数据时,若目的前缀标签不在基站侧网关或无线业务侧网关的本地转发路径表中时,则无法实现数据的转发,导致用户无法接收到需要的数据。因此如何有效实现地基站侧网关与无线业务侧网关之间的数据转发是当前亟待解决的问题。IP-based wireless access network (Internet Protocol Radio Access Network, IPRAN) is a router/switch integrated solution optimized and customized for IP (Internet Protocol, network protocol) base station backhaul application scenarios. With the continuous advancement of network IP , IPRAN is becoming more and more important for mobile networks. In IPRAN networking, usually the base station side gateway and the wireless service side gateway establish an end-to-end route to realize data forwarding between the base station side gateway and the wireless service side gateway. However, between the base station side gateway and the wireless service side gateway If the destination prefix label is not in the local forwarding path table of the base station-side gateway or wireless service-side gateway when data is forwarded through the prefix label, the data cannot be forwarded, and the user cannot receive the required data. Therefore, how to effectively realize the data forwarding between the base station side gateway and the wireless service side gateway is an urgent problem to be solved at present.

发明内容SUMMARY OF THE INVENTION

本发明提供一种数据转发方法、装置、设备及存储介质,可通过替换前缀标签,实现基站侧网关与无线业务侧网关之间的数据转发。The present invention provides a data forwarding method, device, equipment and storage medium, which can realize data forwarding between a base station side gateway and a wireless service side gateway by replacing prefix labels.

第一方面,本发明实施例提供了一种数据转发方法,该方法包括:第一设备在该第一设备的转发路径表中查找与私网地址关联的第一前缀标签,该第一设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签,该第一设备将该第一前缀标签、数据内容以及该私网地址封装成第一数据报文,该第一设备将所述第一数据报文发送至第一前缀标签对应的第二设备,第一数据报文用于得到第二数据报文,第二数据报文由第二前缀标签、数据内容以及私网地址封装得到,第二前缀标签与私网地址关联。In a first aspect, an embodiment of the present invention provides a data forwarding method. The method includes: a first device searches a forwarding path table of the first device for a first prefix label associated with a private network address, and the first device's The forwarding path table includes one or more private network addresses and a prefix label associated with each private network address, and the first device encapsulates the first prefix label, data content and the private network address into a first datagram message, the first device sends the first data message to the second device corresponding to the first prefix label, the first data message is used to obtain the second data message, and the second data message is sent by the second prefix label , the data content and the private network address are encapsulated, and the second prefix label is associated with the private network address.

在该技术方案中,第一设备可以在第一设备的路径转发表中查找第一设备到达私网地址的下一跳地址(即第一前缀标签),将第一前缀标签、私网地址及待发送的数据内容封装成第一数据报文,将第一数据报文发送至第一前缀标签对应的第二设备,第二设备可以在第二设备的转发路径表中查找第二设备达到私网地址的下一跳地址(即第二前缀标签),将第二数据报文中的第一前缀标签替换为第二前缀标签得到第二数据报文,第二设备将第二数据报文发送至第二前缀标签对应的第三设备,可通过交换前缀标签的方式实现第一设备与第三设备之间的数据转发,可以解决在第三设备的前缀标签不在第一设备的转发路径表中时,第一设备与第三设备之间不能实现转发数据的问题。In this technical solution, the first device may search the path forwarding table of the first device for the next hop address (ie, the first prefix label) of the first device reaching the private network address, and combine the first prefix label, the private network address and the The data content to be sent is encapsulated into a first data packet, and the first data packet is sent to the second device corresponding to the first prefix label. The second device can search the forwarding path table of the second device for the second device to reach the private The next hop address of the network address (that is, the second prefix label), replace the first prefix label in the second data packet with the second prefix label to obtain the second data packet, and the second device sends the second data packet To the third device corresponding to the second prefix label, data forwarding between the first device and the third device can be realized by exchanging prefix labels, which can solve the problem that the prefix label of the third device is not in the forwarding path table of the first device. , the problem of forwarding data between the first device and the third device cannot be realized.

可选的,第一设备建立与所述第二设备的第一虚拟专用网络邻居关系,第一设备接收第二设备通过第一邻居关系发送的VPN路由信息,路由信息包括第二设备的第一前缀标签、私网地址及RT,若RT与第一设备中的转发路径表中的RT相同,则第一设备将第一前缀标签与私网地址记录到第一设备中的转发路径表中。Optionally, the first device establishes a first virtual private network neighbor relationship with the second device, the first device receives VPN routing information sent by the second device through the first neighbor relationship, and the routing information includes the first neighbor relationship of the second device. Prefix label, private network address, and RT. If RT is the same as RT in the forwarding path table in the first device, the first device records the first prefix label and the private network address in the forwarding path table in the first device.

在该技术方案中,第一设备可以将第二设备发送的路由信息记录到第一设备转发路径表中,可实现第一设备到第二设备的分段IGP路由,不需要建立端到端的路由,可降低设备的路由量,并降低设备的路由压力,使IGP部署方案更加灵活。In this technical solution, the first device can record the routing information sent by the second device in the forwarding path table of the first device, which can implement segmented IGP routing from the first device to the second device without establishing an end-to-end route , which can reduce the routing volume of the device and reduce the routing pressure of the device, making the IGP deployment scheme more flexible.

第二方面,本发明实施例提供了另一种数据转发方法,该方法包括:第二设备接收第一设备发送至私网地址的第一数据报文,对第一数据报文进行解析,得到私网地址、第一前缀标签,及数据内容,第一前缀标签为第二设备的标签;第二设备获取与所述私网地址关联的第二前缀标签,第二设备将第一数据报文中的第一前缀标签替换为第二前缀标签得到第二数据报文;并将第二数据报文发送至第二前缀标签对应的第三设备。In a second aspect, an embodiment of the present invention provides another data forwarding method. The method includes: a second device receives a first data packet sent by a first device to a private network address, parses the first data packet, and obtains The private network address, the first prefix label, and the data content, where the first prefix label is the label of the second device; the second device obtains the second prefix label associated with the private network address, and the second device sends the first data packet The first prefix label is replaced with the second prefix label to obtain the second data packet; and the second data packet is sent to the third device corresponding to the second prefix label.

在技术方案中,第二设备接收第一设备的发送至私网地址的第一数据报文,并在第二设备的转发路径表中查找第二设备达到私网地址的下一跳地址(即第二前缀标签),将第二数据报文中的第一前缀标签替换为第二前缀标签得到第二数据报文,第二设备将第二数据报文发送至第二前缀标签对应的第三设备,可通过交换前缀标签的方式实现第一设备与第三设备之间的数据转发,可以解决在第三设备的前缀标签不在第一设备的转发路径表中时,第一设备与第三设备之间不能实现转发数据的问题。In the technical solution, the second device receives the first data packet sent by the first device to the private network address, and searches the forwarding path table of the second device for the next hop address of the second device reaching the private network address (ie second prefix label), replace the first prefix label in the second data packet with the second prefix label to obtain the second data packet, and the second device sends the second data packet to the third data packet corresponding to the second prefix label The device can realize data forwarding between the first device and the third device by exchanging prefix labels, which can solve the problem that when the prefix label of the third device is not in the forwarding path table of the first device, the first device and the third device The problem of forwarding data between them cannot be realized.

可选的,在第二设备的转发路径表中查找与私网地址关联的第二前缀标签,第二设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签;或者根据所述第一前缀标签计算得到所述第二前缀标签。Optionally, look up the second prefix label associated with the private network address in the forwarding path table of the second device, and the forwarding path table of the second device includes one or more private network addresses and each private network address. the associated prefix label; or the second prefix label is obtained by calculating according to the first prefix label.

该技术方案中,第二设备可以通过第二设备的转发路径表或根据第一前缀标签计算得到第二前缀标签,以便于将数据内容发送至第二前缀标签对应的第三设备。In this technical solution, the second device can obtain the second prefix label through the forwarding path table of the second device or calculate according to the first prefix label, so as to send the data content to the third device corresponding to the second prefix label.

可选的,第二设备建立第三设备与第二设备的第二邻居关系,接收第三设备通过第二邻居关系发送的第三设备的VPN路由信息,路由信息包括私网地址及第二前缀标签,第二设备将第三设备的VPN路由信息记录到第二设备的转发路径表中。Optionally, the second device establishes a second neighbor relationship between the third device and the second device, and receives VPN routing information of the third device sent by the third device through the second neighbor relationship, where the routing information includes the private network address and the second prefix. label, the second device records the VPN routing information of the third device into the forwarding path table of the second device.

在该技术方案中,第二设备可以将第三设备的VPN路由信息记录到第二设备的转发路径表中,可实现第一设备到第三设备的分段IGP路由,不需要建立端到端的路由,可降低设备的路由量,并降低设备的路由压力,使IGP部署方案更加灵活。In this technical solution, the second device can record the VPN routing information of the third device into the forwarding path table of the second device, so that segmented IGP routes from the first device to the third device can be implemented without establishing an end-to-end Routing can reduce the routing volume of the device and reduce the routing pressure of the device, making the IGP deployment scheme more flexible.

可选的,第二设备建立第一设备与第二设备的第一邻居关系,将第三设备的VPN路由信息中的第二前缀标签替换为第二设备的第一前缀标签,得到修改后的VPN路由信息,通过所述第一邻居关系将修改后的VPN路由信息发送至所述第一设备,修改后的VPN路由信息用于在路由目标RT与第一设备的转发路径表中的RT相同时,第一设备将第一前缀标签及私网地址记录到第一设备的转发路径表中。Optionally, the second device establishes the first neighbor relationship between the first device and the second device, replaces the second prefix label in the VPN routing information of the third device with the first prefix label of the second device, and obtains the modified VPN routing information, the modified VPN routing information is sent to the first device through the first neighbor relationship, and the modified VPN routing information is used to match the routing target RT with the RT in the forwarding path table of the first device. At the same time, the first device records the first prefix label and the private network address in the forwarding path table of the first device.

在技术方案中,第二设备可以将第三设备的VPN路由信息中的第二前缀标签替换为第二设备的第一前缀标签,得到修改后的路由信息,将修改后的路由信息发送至第一设备,可实现第一设备到第二设备的分段IGP路由,不需要建立端到端的路由,可降低设备的路由量,并降低设备的路由压力,使IGP部署方案更加灵活。In the technical solution, the second device can replace the second prefix label in the VPN routing information of the third device with the first prefix label of the second device, obtain the modified routing information, and send the modified routing information to the third device. One device can implement segmented IGP routing from the first device to the second device without establishing an end-to-end route, which can reduce the routing volume of the device and reduce the routing pressure of the device, making the IGP deployment scheme more flexible.

可选的,第二设备接收对所述第二设备的标签配置请求,配置请求携带交换类型的标签;第二设备将交换类的标签作为第一前缀标签,根据第一前缀标签对第二设备进行配置。Optionally, the second device receives a label configuration request for the second device, and the configuration request carries the label of the switching type; the second device uses the label of the switching type as the first prefix label, and configures the second device according to the first prefix label. to configure.

在该技术方案中,第二设备可以对第二设备配置交换类型的标签,以便于第一设备与第二设备之间实现分段IGP路由,以及第二设备与第三设备之间实现分段IGP路由。In this technical solution, the second device can configure a switch type label for the second device, so as to implement segmented IGP routing between the first device and the second device, and to implement segmentation between the second device and the third device IGP routing.

第三方面,本发明实施例提供了一种数据转发装置,所述装置包括:In a third aspect, an embodiment of the present invention provides a data forwarding apparatus, and the apparatus includes:

查找模块,用于在所述第一设备的转发路径表中查找与私网地址关联的第一前缀标签,所述第一设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签。A search module, configured to search for a first prefix label associated with a private network address in a forwarding path table of the first device, where the forwarding path table of the first device includes one or more private network addresses, and The prefix label associated with each private network address.

封装模块,用于将所述第一前缀标签、数据内容以及所述私网地址封装成第一数据报文。An encapsulation module, configured to encapsulate the first prefix label, data content and the private network address into a first data packet.

发送模块,用于将所述第一数据报文发送至所述第一前缀标签对应的第二设备,所述第一数据报文用于得到第二数据报文,所述第二数据报文由第二前缀标签、所述数据内容以及所述私网地址封装得到,所述第二前缀标签与所述私网地址关联。a sending module, configured to send the first data packet to the second device corresponding to the first prefix label, where the first data packet is used to obtain a second data packet, the second data packet It is obtained by encapsulating the second prefix label, the data content and the private network address, and the second prefix label is associated with the private network address.

第四方面,本发明实施例提供了另一种数据转发装置,所述装置包括:In a fourth aspect, an embodiment of the present invention provides another data forwarding apparatus, the apparatus comprising:

接收模块,用于接收所述第一设备发送至私网地址的第一数据报文。The receiving module is configured to receive the first data message sent by the first device to the private network address.

解析模块,用于对所述第一数据报文进行解析,得到所述私网地址、第一前缀标签,及数据内容,所述第一前缀标签为所述第二设备的标签。A parsing module, configured to parse the first data packet to obtain the private network address, a first prefix label, and data content, where the first prefix label is a label of the second device.

获取模块,用于获取与所述私网地址关联的第二前缀标签。an obtaining module, configured to obtain the second prefix label associated with the private network address.

替换模块,用于将所述第一数据报文中的第一前缀标签替换为所述第二前缀标签得到第二数据报文;并将所述第二数据报文发送至所述第二前缀标签对应的第三设备。A replacement module, configured to replace the first prefix label in the first data packet with the second prefix label to obtain a second data packet; and send the second data packet to the second prefix The third device corresponding to the label.

第五方面,本发明实施例提供了一种网络设备,所述网络设备包括至少一个处理器、存储器及存储在所述存储器上并可被所述至少一个处理器执行的指令,其特征在于,所述至少一个处理器执行所述指令,以实现权第一方面所述的数据转发方法。In a fifth aspect, an embodiment of the present invention provides a network device, the network device includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, characterized in that: The at least one processor executes the instructions to implement the data forwarding method described in the first aspect.

第六方面,本发明实施例提供了另一种网络设备,所述网络设备包括至少一个处理器、存储器及存储在所述存储器上并可被所述至少一个处理器执行的指令,其特征在于,所述至少一个处理器执行所述指令,以实现权利要求第二方面所述的数据转发方法。In a sixth aspect, an embodiment of the present invention provides another network device, the network device includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, characterized in that , the at least one processor executes the instructions to implement the data forwarding method according to the second aspect of the claim.

第七方面,本发明实施例提供了一种计算机可读存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器实现第一方面及第二方面所述的数据转发方法。In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, and the computer program includes program instructions, and the program instructions are executed by a processor. The processor is made to implement the data forwarding method described in the first aspect and the second aspect.

第八方面,本发明实施例提供了一种计算机程序产品,其特征在于,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机实现第一方面及第二方面所述的数据转发方法。In an eighth aspect, an embodiment of the present invention provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to implement The data forwarding methods described in the first aspect and the second aspect.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对本发明实施例中所需要使用的附图进行说明。In order to describe the technical solutions in the embodiments of the present invention more clearly, the accompanying drawings required in the embodiments of the present invention will be described below.

图1是本发明实施例提供的一种数据转发系统的结构示意图;1 is a schematic structural diagram of a data forwarding system provided by an embodiment of the present invention;

图2是本发明实施例提供的一种数据转发方法的流程示意图;2 is a schematic flowchart of a data forwarding method according to an embodiment of the present invention;

图3是本发明实施例提供的另一种数据转发系统的结构示意图;3 is a schematic structural diagram of another data forwarding system provided by an embodiment of the present invention;

图4是本发明实施例提供的又一种数据转发系统的结构示意图;4 is a schematic structural diagram of another data forwarding system provided by an embodiment of the present invention;

图5是本发明实施例提供的一种数据转发装置的结构示意图;5 is a schematic structural diagram of a data forwarding apparatus provided by an embodiment of the present invention;

图6是本发明实施例提供的另一种数据转发装置的结构示意图;6 is a schematic structural diagram of another data forwarding apparatus provided by an embodiment of the present invention;

图7是本发明实施例提供的一种网络设备的结构示意图;7 is a schematic structural diagram of a network device provided by an embodiment of the present invention;

图8是本发明实施例提供的一种网络设备的结构示意图。FIG. 8 is a schematic structural diagram of a network device according to an embodiment of the present invention.

具体实施方式Detailed ways

下面结合本发明实施例中的附图对本发明实施例进行描述。The embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.

本发明实施例中的转发设备可以是指交换机、路由器或其他网络设备,控制面设备可以是指控制器,控制器可以是指服务器,还可以是指其他设备。The forwarding device in this embodiment of the present invention may refer to a switch, a router, or other network devices, the control plane device may refer to a controller, the controller may refer to a server, and may also refer to other devices.

为了更好理解本发明实施例提供的一种数据转发方法、装置及设备,下面先描述本发明实施例的系统架构。In order to better understand the data forwarding method, apparatus, and device provided by the embodiments of the present invention, the system architecture of the embodiments of the present invention is first described below.

请参见图1,图1是本发明实施例提供的一种数据转发系统的架构示意图,该数据转发系统的架构可包括第一设备、第二设备及第三设备,在一个实施例中,第一设备可以为无线业务侧网关(Radio Service Gateway,RSG),第二设备可以为汇聚侧网关(Aggregation Site Gateway,ASG),第三设备可以为基站侧网关(Cell Site Gateway,CSG)。在另一个实施例中,第一设备可以基站侧网关,第二设备可以为汇聚侧网关,第三设备可以为无线业务侧网关。其中,RSG用于连接运营商中心机房;ASG用于汇聚接入层的网络流量;CSG是指接入环设备,用于连接无线基站以及企业的室外无线网关(CustomerPremises Equipment,CPE)。Please refer to FIG. 1. FIG. 1 is a schematic diagram of the architecture of a data forwarding system provided by an embodiment of the present invention. The architecture of the data forwarding system may include a first device, a second device, and a third device. In one embodiment, the first device One device may be a Radio Service Gateway (RSG), the second device may be an Aggregation Site Gateway (ASG), and the third device may be a Cell Site Gateway (CSG). In another embodiment, the first device may be a base station side gateway, the second device may be an aggregation side gateway, and the third device may be a wireless service side gateway. Among them, the RSG is used to connect the operator's central computer room; the ASG is used to aggregate the network traffic of the access layer; the CSG refers to the access ring equipment, which is used to connect the wireless base station and the enterprise's outdoor wireless gateway (Customer Premises Equipment, CPE).

图1中以第一设备为RSG,第二设备为ASG,第三设备为CSG进行说明,基于该数据转发系统可以实现本发明实施例的一种数据转发方法,具体的,在RSG向CSG发送数据时,RSG可以从RSG的转发路径表中查找与CSG的私网地址关联的第一前缀标签,将第一前缀标签、私网地址及待发送的数据内容封装成第一数据报文,将第一数据报文发送至第一前缀标签对应的第二设备(即ASG)。ASG接收到第二数据报文时,在ASG的转发路径表中查找与私网地址关联的第二前缀标签,并将第一数据报文的第一前缀标签替换为第二前缀标签,得到第二数据报文,将第二数据报文发送至第二前缀标签对应的第三设备(即CSG),CSG接收第二数据报文,确定该私网地址与CSG的私网地址相同,确定该第二数据报文是发送给CSG。可以通过交换前缀标签的方式实现CSG及RSG之间的数据转发,可以解决当目的私网地址不在RSG的转发路径表时,数据内容无法转发的问题。In FIG. 1 , the first device is the RSG, the second device is the ASG, and the third device is the CSG. Based on the data forwarding system, a data forwarding method according to an embodiment of the present invention can be implemented. Specifically, the RSG sends the data to the CSG. When sending data, the RSG can look up the first prefix label associated with the private network address of the CSG from the forwarding path table of the RSG, and encapsulate the first prefix label, the private network address, and the data content to be sent into a first data packet, and The first data packet is sent to the second device (ie, the ASG) corresponding to the first prefix label. When the ASG receives the second data packet, it searches the forwarding path table of the ASG for the second prefix label associated with the private network address, and replaces the first prefix label of the first data packet with the second prefix label to obtain the first prefix label. Two data packets, send the second data packet to the third device (ie CSG) corresponding to the second prefix label, the CSG receives the second data packet, determines that the private network address is the same as the private network address of the CSG, and determines that the private network address is the same as that of the CSG. The second data packet is sent to the CSG. The data forwarding between the CSG and the RSG can be realized by exchanging prefix labels, which can solve the problem that the data content cannot be forwarded when the destination private network address is not in the forwarding path table of the RSG.

基于上述对一种数据转发系统的架构的描述,本发明实施例提供一种数据转发方法,请参见图2,该方法应用于图1所示的数据转发系统,该系统包括第一设备、第二设备及第三设备,该方法包括:Based on the above description of the architecture of a data forwarding system, an embodiment of the present invention provides a data forwarding method. Please refer to FIG. 2. The method is applied to the data forwarding system shown in FIG. 1. The system includes a first device, a second Second device and third device, the method includes:

S101、第二设备建立第三设备与所述第二设备的第二邻居关系。S101. The second device establishes a second neighbor relationship between the third device and the second device.

为了接收第三设备的虚拟专用网络(Virtual Private Network,VPN)路由信息,第二设备建立第三设备与第二设备的第二邻居关系,该第二邻居关系可以是由第二设备主动建立的,也可以是由第二设备被动建立的。In order to receive the virtual private network (Virtual Private Network, VPN) routing information of the third device, the second device establishes a second neighbor relationship between the third device and the second device, and the second neighbor relationship may be actively established by the second device , or it can be passively established by the second device.

在一个实施例中,该第二邻居关系可以是由第二设备主动建立的。第二设备可以向第三设备发送建立第二邻居关系请求,该请求包括第二设备的属性信息,第三设备接收到该请求,并向第二设备发送反馈信息,若该反馈信息中包括第二设备的属性信息及第三设备的属性信息,则第三设备与所述第二设备的第二邻居关系建立成功。In one embodiment, the second neighbor relationship may be actively established by the second device. The second device may send a request for establishing a second neighbor relationship to the third device, where the request includes attribute information of the second device, and the third device receives the request and sends feedback information to the second device, if the feedback information includes the first The attribute information of the second device and the attribute information of the third device indicate that the second neighbor relationship between the third device and the second device is successfully established.

其中,第二邻居关系可以是指基于IPv6的内部边界网关协议(Internal BorderGateway Protocol,IBGP)的对等peer关系,属性信息可以包括设备标识等。The second neighbor relationship may refer to an IPv6-based internal border gateway protocol (Internal Border Gateway Protocol, IBGP) peer relationship, and the attribute information may include device identifiers and the like.

举例来说,如图3所示,第一设备为RSG、第二设备为ASG,第三设备为CSG,ASG可以向CSG发送建立第二邻居关系请求,该请求包括ASG的设备标识,CSG接收到该请求,并向ASG发送反馈信息,若该反馈信息中包括CSG的设备标识及ASG的设备标识,则CSG与ASG成功建立IBGP peer关系。For example, as shown in FIG. 3 , the first device is the RSG, the second device is the ASG, and the third device is the CSG. The ASG may send a request for establishing a second neighbor relationship to the CSG, where the request includes the device identifier of the ASG, and the CSG receives the request. The request is received, and feedback information is sent to the ASG. If the feedback information includes the device ID of the CSG and the device ID of the ASG, the CSG and the ASG successfully establish the IBGP peer relationship.

在另一个实施例中,该第二邻居关系可以是由第二设备被动建立的。第三设备可以向第二设备发送建立第二邻居关系请求,该请求包括第三设备的属性信息,第二设备接收到该请求,并向第三设备发送反馈信息,若该反馈信息中包括第二设备的属性信息及第三设备的属性信息,则第三设备与第二设备的第二邻居关系建立成功。In another embodiment, the second neighbor relationship may be passively established by the second device. The third device may send a request for establishing a second neighbor relationship to the second device, where the request includes attribute information of the third device, and the second device receives the request and sends feedback information to the third device, if the feedback information includes the first The attribute information of the second device and the attribute information of the third device indicate that the second neighbor relationship between the third device and the second device is successfully established.

S102、第三设备通过该第二邻居关系向第二设备发送该第三设备的VPN路由信息,该路由信息包括该私网地址及第二前缀标签。S102. The third device sends VPN routing information of the third device to the second device through the second neighbor relationship, where the routing information includes the private network address and the second prefix label.

第二设备与第三设备可以属于同一个内部网关协议(Interior GatewayProtocol,IGP)域内,为了实现第二设备与第三设备之间的分段IGP路由,第三设备可以将第三设备的Loopback(环回接口,即私网地址)路由引入到第二设备上,即第三设备将第三设备的VPN路由信息发送给第二设备,具体的,第三设备向第二设备通过该第二邻居关系发送该第三设备的VPN路由信息,该路由信息包括该私网地址及第二前缀标签。此时第二设备可以查看第三设备的Loopback IP,实现了第二设备到第三设备的分段IGP路由,即第二设备到第三设备的分段IPv6路由(IPv6Segment Routing,SRv6)隧道打通,分段SRv6隧道就打通就是指第二设备可以根据第三设备的路由信息向第三设备发送数据,即通过第三设备的Loopback IP向第三设备发送数据。The second device and the third device may belong to the same Interior Gateway Protocol (IGP) domain. In order to implement segmented IGP routing between the second device and the third device, the third device may convert the Loopback ( The loopback interface (that is, the private network address) route is imported to the second device, that is, the third device sends the VPN routing information of the third device to the second device. Specifically, the third device sends the second device to the second device through the second neighbor The relationship sends VPN routing information of the third device, where the routing information includes the private network address and the second prefix label. At this time, the second device can view the Loopback IP of the third device, and the segmented IGP route from the second device to the third device is implemented, that is, the segmented IPv6 routing (IPv6 Segment Routing, SRv6) tunnel from the second device to the third device is opened. If the segmented SRv6 tunnel is opened, it means that the second device can send data to the third device according to the routing information of the third device, that is, send data to the third device through the Loopback IP of the third device.

在步骤S102之前还包括:第三设备接收对第三设备的标签配置请求,该配置请求携带端点标签;第三设备将端点标签作为第二前缀标签,根据第二前缀标签对第三设备进行配置。Before step S102, the method further includes: the third device receives a label configuration request to the third device, and the configuration request carries the endpoint label; the third device uses the endpoint label as the second prefix label, and configures the third device according to the second prefix label .

为了实现分段IGP路由,用户可以对第三设备进行配置,第三设备接收对第三设备的标签配置请求,该配置请求携带端点标签;第三设备将端点标签作为第二前缀标签,根据第二前缀标签对第三设备进行配置,与第三设备建立邻居关系的设备可以根据第二前缀标签向第三设备发送数据。In order to implement segmented IGP routing, the user can configure the third device, and the third device receives a label configuration request for the third device, and the configuration request carries the endpoint label; the third device uses the endpoint label as the second prefix label, according to the The second prefix label configures the third device, and the device that establishes a neighbor relationship with the third device can send data to the third device according to the second prefix label.

其中,端点标签可以是指骨干网边缘路由器(Provider Edge Router,PE)类型的端点标签。The endpoint label may refer to an endpoint label of a backbone network edge router (Provider Edge Router, PE) type.

S103、该第二设备将该第三设备的VPN路由信息记录到第二设备的转发路径表中。S103. The second device records the VPN routing information of the third device into the forwarding path table of the second device.

第二设备可以接收第三设备的VPN路由信息,并将该第二设备将该第三设备的VPN路由信息记录到第二设备的转发路径表中。第二设备的转发路径表包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签,与私网地址关联的标签可以是指下一跳地址,即从第二设备到达私网地址(即第三设备)的下一跳地址。The second device may receive the VPN routing information of the third device, and record the VPN routing information of the third device in the forwarding path table of the second device by the second device. The forwarding path table of the second device includes one or more private network addresses, and a prefix label associated with each private network address. The label associated with the private network address may refer to the next hop The next hop address of the private network address (that is, the third device).

举例来说,如图3所示,CSG的私网地址为80.81.1.0,第二前缀标签为2001:1::FF:FF29,ASG接收CSG的路由信息,将CSG的路由信息记录到ASG的转发路径表中,ASG可以以表格的形式描述该ASG的转发路径表,如表1所示,表1中的2001:1::FF:FF29是指第二前缀标签,80.81.1.0是指私网地址。For example, as shown in Figure 3, the private network address of the CSG is 80.81.1.0, the second prefix label is 2001:1::FF:FF29, the ASG receives the routing information of the CSG, and records the routing information of the CSG to the ASG's In the forwarding path table, the ASG can describe the forwarding path table of the ASG in the form of a table, as shown in Table 1. In Table 1, 2001:1::FF:FF29 refers to the second prefix label, and 80.81.1.0 refers to the private web address.

表1:Table 1:

前缀标签prefix tag 2001:1::FF:FF292001:1::FF:FF29 私网地址private network address 80.81.1.080.81.1.0

S104、第二设备建立第一设备与第二设备的第一邻居关系。S104. The second device establishes a first neighbor relationship between the first device and the second device.

为了将第三设备的VPN路由信息转发给第一设备,第二设备可以建立第一设备与第二设备的第一邻居关系,该第一邻居关系可以是由第二设备主动建立的,也可以是由第二设备被动建立的。In order to forward the VPN routing information of the third device to the first device, the second device may establish a first neighbor relationship between the first device and the second device. The first neighbor relationship may be actively established by the second device, or it may be is passively established by the second device.

在一个实施例中,该第一邻居关系可以是由第二设备主动建立的。第二设备可以向第一设备发送建立第一邻居关系请求,该请求包括第二设备的属性信息,第一设备接收到该请求,并向第二设备发送反馈信息,若该反馈信息中包括第二设备的属性信息及第一设备的属性信息,则第一设备与所述第二设备的第一邻居关系建立成功。In one embodiment, the first neighbor relationship may be actively established by the second device. The second device may send a request for establishing a first neighbor relationship to the first device, where the request includes attribute information of the second device, and the first device receives the request and sends feedback information to the second device, if the feedback information includes the first device The attribute information of the second device and the attribute information of the first device indicate that the first neighbor relationship between the first device and the second device is successfully established.

举例来说,如图3所示,ASG可以向RSG发送建立第二邻居关系请求,该请求包括ASG的属性信息,RSG接收到该请求,并向ASG发送反馈信息,若该反馈信息中包括RSG的属性信息及ASG的属性信息,则RSG与ASG成功建立IBGP peer关系。For example, as shown in FIG. 3 , the ASG may send a request for establishing a second neighbor relationship to the RSG, where the request includes attribute information of the ASG, and the RSG receives the request and sends feedback information to the ASG, if the feedback information includes the RSG attribute information and the attribute information of the ASG, the RSG and the ASG successfully establish the IBGP peer relationship.

在另一个实施例中,该第一邻居关系可以是由第二设备被动建立的。第一设备可以向第二设备发送建立第一邻居关系请求,该请求包括第一设备的属性信息,第二设备接收到该请求,并向第一设备发送反馈信息,若该反馈信息中包括第二设备的属性信息及第一设备的属性信息,则第一设备与第二设备的第一邻居关系建立成功。In another embodiment, the first neighbor relationship may be passively established by the second device. The first device may send a request for establishing a first neighbor relationship to the second device, where the request includes attribute information of the first device, and the second device receives the request and sends feedback information to the first device, if the feedback information includes the first device. The attribute information of the second device and the attribute information of the first device indicate that the first neighbor relationship between the first device and the second device is successfully established.

其中,第一邻居关系可以是指基于IPv6的IBGP peer关系,属性信息可以包括设备标识等。Wherein, the first neighbor relationship may refer to an IPv6-based IBGP peer relationship, and the attribute information may include a device identifier and the like.

S105、第二设备将第三设备的VPN路由信息中的第二前缀标签替换为第二设备的第一前缀标签,得到修改后的VPN路由信息。S105. The second device replaces the second prefix label in the VPN routing information of the third device with the first prefix label of the second device to obtain modified VPN routing information.

在步骤S105之前还包括:第二设备接收对第二设备的标签配置请求,配置请求携带交换类型的标签;第二设备将交换类的标签作为第一前缀标签,根据第一前缀标签对第二设备进行配置。Before step S105, the method further includes: the second device receives a label configuration request to the second device, and the configuration request carries the label of the switching type; the second device uses the label of the switching type as the first prefix label, and configures the second device according to the first prefix label device to configure.

为了实现分段IGP路由,用户可以对第二设备进行配置,第二设备接收对第二设备的标签配置请求,配置请求携带交换类型的标签,第二设备将交换类的标签作为第一前缀标签,根据第一前缀标签对第二设备进行配置,与第二设备建立邻居关系的设备可以根据第一前缀标签向第二设备发送数据。In order to implement segmented IGP routing, the user can configure the second device, the second device receives a label configuration request to the second device, the configuration request carries the label of the switching type, and the second device uses the label of the switching class as the first prefix label , the second device is configured according to the first prefix label, and the device that establishes a neighbor relationship with the second device can send data to the second device according to the first prefix label.

其中,该交互类型的标签可以是指在VPN实例下配置的传输虚拟专用网络transit-vpn地址,或是指定义的一种用于交换的标签end-sw sid。The label of the interaction type may refer to the transit-vpn address of the virtual private network configured under the VPN instance, or a defined label end-sw sid for switching.

S106、第二设备通过所述第一邻居关系将该修改后的VPN路由信息发送至第一设备,修改后的VPN路由信息用于在路由目标RT与所述第一设备的转发路径表中的RT相同时,第一设备将所述第一前缀标签及私网地址记录到第一设备的转发路径表中。S106. The second device sends the modified VPN routing information to the first device through the first neighbor relationship, and the modified VPN routing information is used for the forwarding path table between the routing target RT and the first device. When the RTs are the same, the first device records the first prefix label and the private network address in the forwarding path table of the first device.

第一设备与第二设备可以属于同一个IGP域内,为了实现第一设备与第二设备之间的分段IGP路由,第二设备可以将修改后的路由信息引入到第一设备上,具体的,第二设备向第一设备通过该第一邻居关系发送该修改后的VPN路由信息,该修改后的路由信息包括该私网地址及第一前缀标签。实现了第二设备到第一设备的分段IGP路由,即第一设备到第二设备的分段SRv6隧道打通,分段SRv6隧道就打通就是指第一设备到达第三设备的下一跳为第二设备。The first device and the second device may belong to the same IGP domain. In order to implement segmented IGP routing between the first device and the second device, the second device may import the modified routing information to the first device. , the second device sends the modified VPN routing information to the first device through the first neighbor relationship, where the modified routing information includes the private network address and the first prefix label. The segmented IGP route from the second device to the first device is implemented, that is, the segmented SRv6 tunnel from the first device to the second device is opened, and the segmented SRv6 tunnel is opened, which means that the next hop from the first device to the third device is second device.

S107、在路由目标(Route-Target,RT)与第一设备的转发路径表中的RT相同时,第一设备将第一前缀标签及私网地址记录到第一设备的转发路径表中。S107. When the route target (Route-Target, RT) is the same as the RT in the forwarding path table of the first device, the first device records the first prefix label and the private network address in the forwarding path table of the first device.

第一设备接收修改后的路由信息,将修改后的路由信息中的RT值与第一设备中的转发路径表中的RT值进行比对,若不相同,则表明第三设备发布的数据不是第一设备所需要的,第一设备可以不记录私网地址及第一前缀标签;若相同,则表明第三设备发布的数据是第一设备所需要的,第一设备可以将私网地址及第一前缀标签记录到第一设备的转发路径表中。The first device receives the modified routing information, and compares the RT value in the modified routing information with the RT value in the forwarding path table in the first device. If they are not the same, it indicates that the data published by the third device is not. If required by the first device, the first device may not record the private network address and the first prefix label; if they are the same, it indicates that the data published by the third device is required by the first device, and the first device may record the private network address and the first prefix label. The first prefix label is recorded in the forwarding path table of the first device.

举例来说,若第一前缀标签为2001:2::41,若修改后的路由信息中RT与RSG的转发路径表中的RT值相同,RSG将修改后的路由信息记录到RSG的转发路径表中,RSG可以以表格的形式描述该RSG的转发路径表,如表2所示,表2中的2001:2::41是指第一前缀标签,80.81.1.0是指私网地址。For example, if the first prefix label is 2001:2::41, if the RT value in the modified routing information is the same as the RT value in the forwarding path table of the RSG, the RSG records the modified routing information in the forwarding path of the RSG. In the table, the RSG may describe the forwarding path table of the RSG in the form of a table, as shown in Table 2. In Table 2, 2001:2::41 refers to the first prefix label, and 80.81.1.0 refers to the private network address.

表2:Table 2:

前缀标签prefix tag 2001:2::412001:2::41 私网地址private network address 80.81.1.080.81.1.0

S108、第一设备在所述第一设备的转发路径表中查找与私网地址关联的第一前缀标签。S108. The first device searches the forwarding path table of the first device for the first prefix label associated with the private network address.

在第一设备需要向私网地址对应的第三设备发送数据时,第一设备可以在第一设备的转发路径表中查找与该私网地址关联的第一前缀标签,第一前缀标签可以是指到达私网地址对应的第三设备的下一跳地址,对于第一设备而言,第一设备可以将第一前缀标签当作目的地址。When the first device needs to send data to the third device corresponding to the private network address, the first device may look up the first prefix label associated with the private network address in the forwarding path table of the first device, and the first prefix label may be Refers to the next hop address to the third device corresponding to the private network address. For the first device, the first device can use the first prefix label as the destination address.

S109、第一设备将第一前缀标签、数据内容以及私网地址封装成第一数据报文。S109. The first device encapsulates the first prefix label, the data content, and the private network address into a first data packet.

第一设备可以将第一前缀标签、数据内容及私网地址封装成第一数据报文,具体的,按照IPv6报文的格式将第一前缀标签、数据内容即私网地址封装成第一数据报文。The first device can encapsulate the first prefix label, the data content and the private network address into a first data packet, and specifically, encapsulate the first prefix label, the data content, that is, the private network address, into the first data packet according to the format of the IPv6 packet. message.

举例来说,如图4所示,数据转发系统中第一设备为RSG、第二设备为ASG,第三设备为CSG,假设私网地址为80.81.1.0,RSG可以根据私网地址查找如表2所示的RSG的转发路径表,得到与私网地址关联的第一前缀标签,第一前缀标签为2001:2::41,RSG将2001:2::41、数据内容以及80.81.1.0封装成第一数据报文。For example, as shown in Figure 4, in the data forwarding system, the first device is the RSG, the second device is the ASG, and the third device is the CSG. Assuming that the private network address is 80.81.1.0, the RSG can search the table according to the private network address. In the forwarding path table of the RSG shown in 2, the first prefix label associated with the private network address is obtained. The first prefix label is 2001:2::41, and the RSG encapsulates 2001:2::41, data content and 80.81.1.0 into the first data packet.

S110、第一设备将第一数据报文发送至第一前缀标签对应的第二设备。S110. The first device sends the first data packet to the second device corresponding to the first prefix label.

S111、第二设备对第一数据报文进行解析,得到私网地址、第一前缀标签,及数据内容,第一前缀标签为所述第二设备的标签。S111. The second device parses the first data packet to obtain a private network address, a first prefix label, and data content, where the first prefix label is a label of the second device.

第二设备接收第一数据报文,并对第一数据报文进行解析,得到私网地址、第一前缀标签及数据内容。The second device receives the first data packet, and parses the first data packet to obtain the private network address, the first prefix label, and the data content.

S112、获取与私网地址关联的第二前缀标签。S112. Acquire a second prefix label associated with the private network address.

为了将数据内容分段转发至第二前缀标签对应的第三设备,终端可以获取获取与所述私网地址关联的第二前缀标签。In order to forward the data content segments to the third device corresponding to the second prefix label, the terminal may acquire the second prefix label associated with the private network address.

步骤S112包括:第二设备在所述第二设备的转发路径表中查找与所述私网地址关联的第二前缀标签,所述第二设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签;或者第二设备根据第一前缀标签计算得到第二前缀标签。Step S112 includes: the second device searches a forwarding path table of the second device for a second prefix label associated with the private network address, where the forwarding path table of the second device includes one or more private networks address, and a prefix label associated with each private network address; or the second device calculates and obtains the second prefix label according to the first prefix label.

举例来说,如图4所示,RSG将第一数据报文发送至第一前缀标签对应的ASG,ASG对第一数据报文进行解析,得到私网地址、第一前缀标志及数据内容,在如表1所示的ASG的转发路径表中查找与第一前缀标签关联的第二前缀标签,该第二前缀标签为2001:1::FF:FF29。For example, as shown in FIG. 4 , the RSG sends the first data packet to the ASG corresponding to the first prefix label, and the ASG parses the first data packet to obtain the private network address, the first prefix flag and the data content, The second prefix label associated with the first prefix label is searched in the forwarding path table of the ASG as shown in Table 1, where the second prefix label is 2001:1::FF:FF29.

再举例来说,预先可以为第二设置配置序列号opcode,第二设备可以根据第二前缀标签计算得到第一前缀标签,即在第一前缀标签上加上序列号,得到第二前缀标签。For another example, the serial number opcode may be configured for the second setting in advance, and the second device may obtain the first prefix label by calculating according to the second prefix label, that is, adding the serial number to the first prefix label to obtain the second prefix label.

其中,由于第二设备上的路由量特别大,若为每个路由配置一个序列号,则给第二设备带来较大的存储压力及计算压力,为了给第二设备降低压力,可以基于peer来配置序列号。Among them, since the amount of routes on the second device is particularly large, if a serial number is configured for each route, it will bring greater storage pressure and calculation pressure to the second device. In order to reduce the pressure on the second device, the peer-based to configure the serial number.

S113、第二设备将所述第一数据报文中的第一前缀标签替换为第二前缀标签得到第二数据报文;并将第二数据报文发送至第二前缀标签对应的第三设备。S113. The second device replaces the first prefix label in the first data packet with a second prefix label to obtain a second data packet; and sends the second data packet to a third device corresponding to the second prefix label .

在步骤S112~S113中,为了将数据内容发送至第三设备,第二设备在第二设备的转发路径表中查找与私网地址关联的第二前缀标签,将第一数据报文中的第一前缀标签替换为第二前缀标签得到第二数据报文,并将第二数据报文发送至第二前缀标签对应的第三设备,第三设备接收第二数据报文,并将第二数据报文中的私网地址与第三设备的私网地址进行比对,若对比结果确定第二数据报文中的私网地址与第三设备的私网地址相同,则第三设备解析第二数据报文得到数据内容。In steps S112-S113, in order to send the data content to the third device, the second device searches the forwarding path table of the second device for the second prefix label associated with the private network address, and converts the first prefix in the first data packet to the second prefix label associated with the private network address. A prefix label is replaced with a second prefix label to obtain a second data packet, and the second data packet is sent to the third device corresponding to the second prefix label. The third device receives the second data packet and sends the second data packet to the second data packet. The private network address in the packet is compared with the private network address of the third device. If the comparison result determines that the private network address in the second data packet is the same as the private network address of the third device, the third device parses the second data packet. The data message gets the data content.

举例来说,如图4中,ASG进行前缀标签互换,具体的,ASG将第一数据报文中的2001:2::41(第一前缀标签)替换为2001:1::FF:FF29(第二前缀标签),得到第二数据报文,将第二数据报文发送至CSG,CSG对第二数据报文进行解析得到数据内容。For example, as shown in Figure 4, the ASG performs prefix label exchange. Specifically, the ASG replaces 2001:2::41 (the first prefix label) in the first data packet with 2001:1::FF:FF29 (Second prefix label), obtain the second data packet, send the second data packet to the CSG, and the CSG parses the second data packet to obtain the data content.

本发明实施例中,第三设备将第三设备的路由信息发送给第二设备,第二设备将第三设备的路由信息记录到第二设备中转发路径表中,实现了第一设备到第三设备的分段IGP路由,不需要建立端到端的路由,可降低设备的路由量,并降低设备的路由压力,使IGP部署方案更加灵活,第二设备将第三设备中的第二前缀标签替换为第一前缀标签,得到修改后的路由信息,将修改后的路由信息发送给第一设备,第一设备将修改后的路由信息记录到第一设备的转发路径表中,可实现第一设备到第二设备的分段IGP路由,不需要建立端到端的路由,可降低设备的路由量,并降低设备的路由压力,使IGP部署方案更加灵活。另外,第一设备可以从第一设备的转发路径表中查找与私网地址关联的第一前缀标签,将第一前缀标签、私网地址及待发送的数据内容封装成第一数据报文,将第一数据报文发送至第一前缀标签对应的第二设备。第二设备接收到第二数据报文时,获取与私网地址关联的第二前缀标签,并将第一数据报文的第一前缀标签替换为第二前缀标签,得到第二数据报文,将第二数据报文发送至第二前缀标签对应的第三设备,第三设备接收第二数据报文,确定该私网地址与第三设备的私网地址相同,确定该第二数据报文是发送给第三设备。在目的私网地址的前缀标签(即第三设备的前缀标签)不在第一设备的转发路径表中时,可以通过交换前缀标签的方式实现数据内容的转发,可以解决当目的私网地址不在第一设备的转发路径表时,数据内容无法转发的问题。In the embodiment of the present invention, the third device sends the routing information of the third device to the second device, and the second device records the routing information of the third device in the forwarding path table in the second device, so that the first device to the second device is realized. The segmented IGP route of the three devices does not need to establish an end-to-end route, which can reduce the routing volume of the device and reduce the routing pressure of the device, making the IGP deployment scheme more flexible. The second device labels the second prefix in the third device Replace with the first prefix label, obtain the modified routing information, send the modified routing information to the first device, and the first device records the modified routing information in the forwarding path table of the first device, which can realize the first The segmented IGP route from the device to the second device does not need to establish an end-to-end route, which can reduce the routing volume of the device and reduce the routing pressure of the device, making the IGP deployment scheme more flexible. In addition, the first device may look up the first prefix label associated with the private network address from the forwarding path table of the first device, and encapsulate the first prefix label, the private network address, and the data content to be sent into a first data packet, Send the first data packet to the second device corresponding to the first prefix label. When receiving the second data packet, the second device obtains the second prefix label associated with the private network address, and replaces the first prefix label of the first data packet with the second prefix label to obtain the second data packet, Send the second data packet to the third device corresponding to the second prefix label, the third device receives the second data packet, determines that the private network address is the same as the private network address of the third device, and determines the second data packet is sent to a third device. When the prefix label of the destination private network address (that is, the prefix label of the third device) is not in the forwarding path table of the first device, the data content can be forwarded by exchanging prefix labels, which can solve the problem when the destination private network address is not in the first device's forwarding path table. When the forwarding path table of a device is used, the data content cannot be forwarded.

请参见图5,为本发明实施例提供的一种数据转发装置的结构示意图,所述数据转发装置为图2所述实施例中的第一设备。本实施例中所描述的数据转发装置,应用于网络设备,所述装置包括:Please refer to FIG. 5 , which is a schematic structural diagram of a data forwarding apparatus according to an embodiment of the present invention, where the data forwarding apparatus is the first device in the embodiment shown in FIG. 2 . The data forwarding apparatus described in this embodiment is applied to network equipment, and the apparatus includes:

查找模块501,用于在所述第一设备的转发路径表中查找与私网地址关联的第一前缀标签,所述第一设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签。A search module 501, configured to search for a first prefix label associated with a private network address in a forwarding path table of the first device, where the forwarding path table of the first device includes one or more private network addresses, and The prefix label associated with each private network address.

封装模块502,用于将所述第一前缀标签、数据内容以及所述私网地址封装成第一数据报文。The encapsulation module 502 is configured to encapsulate the first prefix label, the data content and the private network address into a first data packet.

发送模块503,用于将所述第一数据报文发送至所述第一前缀标签对应的第二设备,所述第一数据报文用于得到第二数据报文,所述第二数据报文由第二前缀标签、所述数据内容以及所述私网地址封装得到,所述第二前缀标签与所述私网地址关联。A sending module 503, configured to send the first data packet to a second device corresponding to the first prefix label, where the first data packet is used to obtain a second data packet, the second data packet The text is obtained by encapsulating the second prefix label, the data content and the private network address, and the second prefix label is associated with the private network address.

可选的,建立模块504,用于建立与所述第二设备的第一虚拟专用网络邻居关系。Optionally, the establishing module 504 is configured to establish a first virtual private network neighbor relationship with the second device.

可选的,接收模块505,用于接收所述第二设备通过所述第一邻居关系发送的VPN路由信息,所述路由信息包括所述第二设备的第一前缀标签、所述私网地址及RT。Optionally, the receiving module 505 is configured to receive VPN routing information sent by the second device through the first neighbor relationship, where the routing information includes the first prefix label of the second device, the private network address and RT.

可选的,记录模块506,用于若所述RT与所述第一设备中的转发路径表中的RT相同,则将所述第一前缀标签与所述私网地址记录到所述第一设备中的转发路径表中。Optionally, the recording module 506 is configured to record the first prefix label and the private network address in the first device if the RT is the same as the RT in the forwarding path table in the first device. in the forwarding path table in the device.

本发明实施例中,第一设备可以从第一设备的转发路径表中查找与私网地址关联的第一前缀标签,将第一前缀标签、私网地址及待发送的数据内容封装成第一数据报文,将第一数据报文发送至第一前缀标签对应的第二设备。第二设备接收到第二数据报文时,在的第二设备的发路径表中查找与私网地址关联的第二前缀标签,并将第一数据报文的第一前缀标签替换为第二前缀标签,得到第二数据报文,将第二数据报文发送至第二前缀标签对应的第三设备,第三设备接收第二数据报文,确定该私网地址与第三设备的私网地址相同,确定该第二数据报文是发送给第三设备。在目的私网地址的前缀标签(即第三设备的前缀标签)不在第一设备的转发路径表中时,可以通过交换前缀标签的方式实现数据内容的转发,可以解决当目的私网地址不在第一设备的转发路径表时,数据内容无法转发的问题。In this embodiment of the present invention, the first device may look up the first prefix label associated with the private network address from the forwarding path table of the first device, and encapsulate the first prefix label, the private network address, and the data content to be sent into the first prefix label, the private network address, and the data content to be sent. data packet, sending the first data packet to the second device corresponding to the first prefix label. When the second device receives the second data packet, it searches the routing table of the second device for the second prefix label associated with the private network address, and replaces the first prefix label of the first data packet with the second prefix label. Prefix label, obtain the second data packet, send the second data packet to the third device corresponding to the second prefix label, the third device receives the second data packet, and determines the private network address and the private network of the third device. The addresses are the same, and it is determined that the second data packet is sent to the third device. When the prefix label of the destination private network address (that is, the prefix label of the third device) is not in the forwarding path table of the first device, the data content can be forwarded by exchanging prefix labels, which can solve the problem when the destination private network address is not in the first device's forwarding path table. When the forwarding path table of a device is used, the data content cannot be forwarded.

请参见图6,为本发明实施例提供的另一种数据转发装置的结构示意图,所述数据转发装置为图2所述实施例中的第二设备。本实施例中所描述的数据转发装置,应用于网络设备,所述装置包括:Referring to FIG. 6 , it is a schematic structural diagram of another data forwarding apparatus according to an embodiment of the present invention, where the data forwarding apparatus is the second device in the embodiment shown in FIG. 2 . The data forwarding apparatus described in this embodiment is applied to network equipment, and the apparatus includes:

接收模块601,用于接收所述第一设备发送至私网地址的第一数据报文。The receiving module 601 is configured to receive a first data packet sent by the first device to a private network address.

解析模块602,用于对所述第一数据报文进行解析,得到所述私网地址、第一前缀标签,及数据内容,所述第一前缀标签为所述第二设备的标签。The parsing module 602 is configured to parse the first data packet to obtain the private network address, a first prefix label, and data content, where the first prefix label is a label of the second device.

获取模块603,用于获取与所述私网地址关联的第二前缀标签。The obtaining module 603 is configured to obtain the second prefix label associated with the private network address.

替换模块604,用于将所述第一数据报文中的第一前缀标签替换为所述第二前缀标签得到第二数据报文;并将所述第二数据报文发送至所述第二前缀标签对应的第三设备。A replacement module 604, configured to replace the first prefix label in the first data packet with the second prefix label to obtain a second data packet; and send the second data packet to the second data packet The third device corresponding to the prefix label.

可选的,所述获取模块603,具体用于在所述第二设备的转发路径表中查找与所述私网地址关联的第二前缀标签,所述第二设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签;或者根据所述第一前缀标签计算得到所述第二前缀标签。Optionally, the obtaining module 603 is specifically configured to look up the second prefix label associated with the private network address in the forwarding path table of the second device, where the forwarding path table of the second device includes a or more than one private network address, and a prefix label associated with each private network address; or the second prefix label is obtained by calculating according to the first prefix label.

可选的,建立模块605,用于建立所述第三设备与所述第二设备的第二邻居关系。Optionally, the establishing module 605 is configured to establish a second neighbor relationship between the third device and the second device.

可选的,所述接收模块601,还用于接收所述第三设备通过所述第二邻居关系发送的所述第三设备的VPN路由信息,所述路由信息包括所述私网地址及所述第二前缀标签。Optionally, the receiving module 601 is further configured to receive VPN routing information of the third device sent by the third device through the second neighbor relationship, where the routing information includes the private network address and all Describe the second prefix tag.

可选的,记录模块606,用于将所述第三设备的VPN路由信息记录到所述第二设备的转发路径表中。Optionally, the recording module 606 is configured to record the VPN routing information of the third device into the forwarding path table of the second device.

可选的,所述建立模块605,还用于建立所述第一设备与所述第二设备的第一邻居关系。Optionally, the establishing module 605 is further configured to establish a first neighbor relationship between the first device and the second device.

可选的,所述替换模块604,还用于将所述第三设备的VPN路由信息中的第二前缀标签替换为所述第二设备的第一前缀标签,得到修改后的VPN路由信息。Optionally, the replacement module 604 is further configured to replace the second prefix label in the VPN routing information of the third device with the first prefix label of the second device to obtain the modified VPN routing information.

可选的,发送模块607,用于通过所述第一邻居关系将所述修改后的VPN路由信息发送至所述第一设备,所述修改后的VPN路由信息用于在所述路由目标RT与所述第一设备的转发路径表中的RT相同时,所述第一设备将所述第一前缀标签及所述私网地址记录到所述第一设备的转发路径表中。Optionally, the sending module 607 is configured to send the modified VPN routing information to the first device through the first neighbor relationship, where the modified VPN routing information is used for the routing target RT. When the RT is the same as the RT in the forwarding path table of the first device, the first device records the first prefix label and the private network address in the forwarding path table of the first device.

可选的,所述接收模块601,用于接收对所述第二设备的标签配置请求,所述配置请求携带交换类型的标签。Optionally, the receiving module 601 is configured to receive a label configuration request to the second device, where the configuration request carries a label of a switching type.

可选的,配置模块608,用于将所述交换类的标签作为所述第一前缀标签,根据所述第一前缀标签对所述第二设备进行配置。Optionally, the configuration module 608 is configured to use the label of the switching class as the first prefix label, and configure the second device according to the first prefix label.

本发明实施例中,第一设备可以从第一设备的转发路径表中查找与私网地址关联的第一前缀标签,将第一前缀标签、私网地址及待发送的数据内容封装成第一数据报文,将第一数据报文发送至第一前缀标签对应的第二设备。第二设备接收到第二数据报文时,获取与私网地址关联的第二前缀标签,并将第一数据报文的第一前缀标签替换为第二前缀标签,得到第二数据报文,将第二数据报文发送至第二前缀标签对应的第三设备,第三设备接收第二数据报文,确定该私网地址与第三设备的私网地址相同,确定该第二数据报文是发送给第三设备。在目的私网地址的前缀标签(即第三设备的前缀标签)不在第一设备的转发路径表中时,可以通过交换前缀标签的方式实现数据内容的转发,可以解决当目的私网地址不在第一设备的转发路径表时,数据内容无法转发的问题。In this embodiment of the present invention, the first device may look up the first prefix label associated with the private network address from the forwarding path table of the first device, and encapsulate the first prefix label, the private network address, and the data content to be sent into the first prefix label, the private network address, and the data content to be sent. data packet, sending the first data packet to the second device corresponding to the first prefix label. When receiving the second data packet, the second device obtains the second prefix label associated with the private network address, and replaces the first prefix label of the first data packet with the second prefix label to obtain the second data packet, Send the second data packet to the third device corresponding to the second prefix label, the third device receives the second data packet, determines that the private network address is the same as the private network address of the third device, and determines the second data packet is sent to a third device. When the prefix label of the destination private network address (that is, the prefix label of the third device) is not in the forwarding path table of the first device, the data content can be forwarded by exchanging prefix labels, which can solve the problem when the destination private network address is not in the first device's forwarding path table. When the forwarding path table of a device is used, the data content cannot be forwarded.

请参见图7,为本发明实施例提供的一种网络设备的结构示意图,该网络设备可以是指上述实施例中的第一设备,该网络设备包括:包括处理器701、存储器702、通信接口703和电源704,所述处理器701、存储器702、通信接口703和电源704通过总线相互连接。Please refer to FIG. 7 , which is a schematic structural diagram of a network device according to an embodiment of the present invention. The network device may refer to the first device in the foregoing embodiment, and the network device includes: a processor 701 , a memory 702 , and a communication interface 703 and a power supply 704, the processor 701, the memory 702, the communication interface 703 and the power supply 704 are connected to each other through a bus.

处理器701可以是一个或多个CPU,在处理器701是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU,处理器701。The processor 701 may be one or more CPUs, and in the case where the processor 701 is one CPU, the CPU may be a single-core CPU, or a multi-core CPU, the processor 701 .

存储器702包括但不限于是RAM、ROM)、EPROM、CD-ROM,该存储器702用于存储指令、操作系统、各种应用及数据。The memory 702 includes, but is not limited to, RAM, ROM), EPROM, CD-ROM, and is used to store instructions, operating systems, various applications, and data.

上述通信接口703与其他网络设备相连。例如,通信接口703包括多个接口,分别与多个网络设备相连接。通信接口703可以是有线接口,无线接口或其组合。有线接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线接口例如可以为无线局域网(英文:wireless local area network,缩写:WLAN)接口,蜂窝网络接口或其组合。The above-mentioned communication interface 703 is connected to other network devices. For example, the communication interface 703 includes a plurality of interfaces, which are respectively connected with a plurality of network devices. Communication interface 703 may be a wired interface, a wireless interface, or a combination thereof. The wired interface can be, for example, an Ethernet interface. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. For example, the wireless interface may be a wireless local area network (English: wireless local area network, abbreviation: WLAN) interface, a cellular network interface or a combination thereof.

电源704,用于为网络设备进行供电。The power supply 704 is used to supply power to the network device.

上述存储器702还用于存储程序指令。上述处理器701可以调用上述存储器702存储的程序指令,实现如本申请上述各实施例所示的数据转发方法。The aforementioned memory 702 is also used to store program instructions. The above-mentioned processor 701 may call the program instructions stored in the above-mentioned memory 702 to implement the data forwarding methods shown in the above-mentioned embodiments of the present application.

基于同一发明构思,本发明实施例中提供的网络设备解决问题的原理与本发明方法实施例相似,因此该网络设备的实施以及有益效果可以参见以及有益效果,为简洁描述,在这里不再赘述。Based on the same inventive concept, the principle of solving the problem of the network device provided in the embodiment of the present invention is similar to that of the method embodiment of the present invention. Therefore, the implementation and beneficial effects of the network device can be referred to and the beneficial effects. For the sake of brevity, they will not be repeated here. .

请参见图8,为本发明实施例提供的一种网络设备的结构示意图,该网络设备可以是指上述实施例中的第二设备。该网络设备包括:包括处理器801、存储器802、通信接口803和电源804,所述处理器801、存储器802、通信接口803和电源804通过总线相互连接。Please refer to FIG. 8 , which is a schematic structural diagram of a network device according to an embodiment of the present invention, where the network device may refer to the second device in the foregoing embodiment. The network device includes a processor 801, a memory 802, a communication interface 803 and a power supply 804, and the processor 801, the memory 802, the communication interface 803 and the power supply 804 are connected to each other through a bus.

处理器801可以是一个或多个CPU,在处理器801是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU,处理器801。The processor 801 may be one or more CPUs. In the case where the processor 801 is one CPU, the CPU may be a single-core CPU or a multi-core CPU, the processor 801 .

存储器802包括但不限于是RAM、ROM)、EPROM、CD-ROM,该存储器802用于存储指令、操作系统、各种应用及数据。The memory 802 includes, but is not limited to, RAM, ROM), EPROM, and CD-ROM, and the memory 802 is used to store instructions, operating systems, various applications, and data.

上述通信接口803与网络设备相连。例如,通信接口803包括多个接口,分别与多个终端相连或者与转发面设备相连接。通信接口803可以是有线接口,无线接口或其组合。有线接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线接口例如可以为无线局域网(英文:wireless local area network,缩写:WLAN)接口,蜂窝网络接口或其组合。The above-mentioned communication interface 803 is connected to the network device. For example, the communication interface 803 includes a plurality of interfaces, which are respectively connected with a plurality of terminals or with a forwarding plane device. Communication interface 803 may be a wired interface, a wireless interface, or a combination thereof. The wired interface can be, for example, an Ethernet interface. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. For example, the wireless interface may be a wireless local area network (English: wireless local area network, abbreviation: WLAN) interface, a cellular network interface or a combination thereof.

电源804,用于为控制面设备进行供电。The power supply 804 is used to supply power to the control plane device.

上述存储器802还用于存储程序指令。上述处理器801可以调用上述存储器802存储的程序指令,实现如本申请上述各实施例所示的数据转发方法。The above-mentioned memory 802 is also used to store program instructions. The above-mentioned processor 801 may call the program instructions stored in the above-mentioned memory 802 to implement the data forwarding methods shown in the above-mentioned embodiments of the present application.

基于同一发明构思,本发明实施例中提供的网络设备解决问题的原理与本发明方法实施例相似,因此该该网络设备的实施以及有益效果可以参见以及有益效果,为简洁描述,在这里不再赘述。Based on the same inventive concept, the principle of solving the problem of the network device provided in the embodiment of the present invention is similar to that of the method embodiment of the present invention. Therefore, the implementation and beneficial effects of the network device can be referred to and the beneficial effects are not described here for brevity. Repeat.

本发明还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序解决问题的实施方式以及有益效果可以参见上述图2的数据转发方法的实施方式以及有益效果,重复之处不再赘述。The present invention also provides a computer-readable storage medium on which a computer program is stored. For the implementation and beneficial effects of the program for solving problems, reference may be made to the above-mentioned implementation and beneficial effects of the data forwarding method in FIG. 2 . Repeat.

本发明实施还提供了一种计算机程序产品,该计算机程序产品包括存储了计算机程序的非易失性计算机可读存储介质,该计算机程序被执行时使计算机执行上述图2对应实施例中的数据转发方法的步骤,该计算机程序产品解决问题的实施方式以及有益效果可以参见上述图2的数据包处理方法的实施方式以及有益效果,重复之处不再赘述。The implementation of the present invention also provides a computer program product, the computer program product includes a non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed, the computer executes the data in the above-mentioned embodiment corresponding to FIG. 2 . For the steps of the forwarding method, the implementation manner and beneficial effect of the computer program product for solving the problem, reference may be made to the implementation manner and beneficial effect of the data packet processing method in FIG.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,上述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。Those of ordinary skill in the art can understand that all or part of the process in the method of the above embodiment can be implemented by instructing the relevant hardware through a computer program, and the above program can be stored in a computer-readable storage medium, and the program is in During execution, it may include the processes of the embodiments of the above-mentioned methods.

Claims (18)

1.一种数据转发方法,其特征在于,所述方法包括:1. a data forwarding method, is characterized in that, described method comprises: 第一设备在所述第一设备的转发路径表中查找与私网地址关联的第一前缀标签,所述第一设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签;The first device looks up the first prefix label associated with the private network address in the forwarding path table of the first device, where the forwarding path table of the first device includes one or more private network addresses, and is associated with each private network address. The prefix label associated with the private network address; 所述第一设备将所述第一前缀标签、数据内容以及所述私网地址封装成第一数据报文;The first device encapsulates the first prefix label, the data content and the private network address into a first data packet; 所述第一设备将所述第一数据报文发送至所述第一前缀标签对应的第二设备,所述第一数据报文用于得到第二数据报文,所述第二数据报文由第二前缀标签、所述数据内容以及所述私网地址封装得到,所述第二前缀标签与所述私网地址关联。The first device sends the first data packet to the second device corresponding to the first prefix label, where the first data packet is used to obtain a second data packet, and the second data packet It is obtained by encapsulating the second prefix label, the data content and the private network address, and the second prefix label is associated with the private network address. 2.根据权利要求1所述的方法,其特征在于,所述第一设备的转发路径表中还包括路由目标Route-Target,所述第一设备在所述第一设备的转发路径表中查找与私网地址关联的第一前缀标签之前,还包括:2. The method according to claim 1, wherein the forwarding path table of the first device further includes a routing target Route-Target, and the first device searches the forwarding path table of the first device for Before the first prefix label associated with the private network address, it also includes: 所述第一设备建立与所述第二设备的第一虚拟专用网络邻居关系;establishing, by the first device, a first virtual private network neighbor relationship with the second device; 所述第一设备接收所述第二设备通过所述第一邻居关系发送的虚拟专用网络VirtualPrivate Network路由信息,所述路由信息包括所述第二设备的第一前缀标签、所述私网地址及RT;The first device receives virtual private network routing information sent by the second device through the first neighbor relationship, where the routing information includes the first prefix label of the second device, the private network address, and RT; 若所述RT与所述第一设备中的转发路径表中的RT相同,则所述第一设备将所述第一前缀标签与所述私网地址记录到所述第一设备中的转发路径表中。If the RT is the same as the RT in the forwarding path table in the first device, the first device records the first prefix label and the private network address in the forwarding path in the first device in the table. 3.一种数据转发方法,其特征在于,所述方法包括:3. A data forwarding method, wherein the method comprises: 第二设备接收所述第一设备发送至私网地址的第一数据报文;The second device receives the first data packet sent by the first device to the private network address; 所述第二设备对所述第一数据报文进行解析,得到所述私网地址、第一前缀标签,及数据内容,所述第一前缀标签为所述第二设备的标签;The second device parses the first data packet to obtain the private network address, a first prefix label, and data content, where the first prefix label is a label of the second device; 所述第二设备获取与所述私网地址关联的第二前缀标签;obtaining, by the second device, a second prefix label associated with the private network address; 所述第二设备将所述第一数据报文中的第一前缀标签替换为所述第二前缀标签得到第二数据报文;并将所述第二数据报文发送至所述第二前缀标签对应的第三设备。The second device replaces the first prefix label in the first data packet with the second prefix label to obtain a second data packet; and sends the second data packet to the second prefix The third device corresponding to the label. 4.根据权利要求3所述的方法,其特征在于,所述第二设备获取与所述私网地址关联的第二前缀标签,包括:4. The method according to claim 3, wherein obtaining, by the second device, a second prefix label associated with the private network address, comprising: 第二设备在所述第二设备的转发路径表中查找与所述私网地址关联的第二前缀标签,所述第二设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签;The second device looks up the second prefix label associated with the private network address in the forwarding path table of the second device, where the forwarding path table of the second device includes one or more private network addresses, and The prefix label associated with each private network address; 或者第二设备根据所述第一前缀标签计算得到所述第二前缀标签。Or the second device calculates and obtains the second prefix label according to the first prefix label. 5.根据权利要求3所述的方法,其特征在于,所述第二设备对所述第一数据报文进行解析,得到所述私网地址、第一前缀标签,及数据内容,所述第一前缀标签为所述第二设备的标签之前,还包括:5. The method according to claim 3, wherein the second device parses the first data packet to obtain the private network address, the first prefix label, and the data content, and the first Before a prefix label is the label of the second device, it further includes: 所述第二设备建立所述第三设备与所述第二设备的第二邻居关系;establishing, by the second device, a second neighbor relationship between the third device and the second device; 所述第二设备接收所述第三设备通过所述第二邻居关系发送的所述第三设备的VPN路由信息,所述路由信息包括所述私网地址及所述第二前缀标签;receiving, by the second device, VPN routing information of the third device sent by the third device through the second neighbor relationship, where the routing information includes the private network address and the second prefix label; 所述第二设备将所述第三设备的VPN路由信息记录到所述第二设备的转发路径表中。The second device records the VPN routing information of the third device into the forwarding path table of the second device. 6.根据权利要求5所述的方法,其特征在于,所述第三设备的VPN路由信息还包括路由目标RT,所述将所述第三设备的VPN路由信息记录到所述第二设备的转发路径表中之后,还包括:6 . The method according to claim 5 , wherein the VPN routing information of the third device further includes a routing target RT, and the VPN routing information of the third device is recorded in the second device. 7 . After the forwarding path table, it also includes: 所述第二设备建立所述第一设备与所述第二设备的第一邻居关系;establishing, by the second device, a first neighbor relationship between the first device and the second device; 所述第二设备将所述第三设备的VPN路由信息中的第二前缀标签替换为所述第二设备的第一前缀标签,得到修改后的VPN路由信息;The second device replaces the second prefix label in the VPN routing information of the third device with the first prefix label of the second device to obtain the modified VPN routing information; 所述第二设备通过所述第一邻居关系将所述修改后的VPN路由信息发送至所述第一设备,所述修改后的VPN路由信息用于在所述路由目标RT与所述第一设备的转发路径表中的RT相同时,所述第一设备将所述第一前缀标签及所述私网地址记录到所述第一设备的转发路径表中。The second device sends the modified VPN routing information to the first device through the first neighbor relationship, where the modified VPN routing information is used to communicate between the routing target RT and the first device. When the RTs in the forwarding path table of the device are the same, the first device records the first prefix label and the private network address in the forwarding path table of the first device. 7.根据权利要求3-6任一项所述的方法,其特征在于,还包括:7. The method according to any one of claims 3-6, further comprising: 所述第二设备接收对所述第二设备的标签配置请求,所述配置请求携带交换类型的标签;receiving, by the second device, a label configuration request to the second device, where the configuration request carries a switch-type label; 所述第二设备将所述交换类的标签作为所述第一前缀标签,根据所述第一前缀标签对所述第二设备进行配置。The second device uses the label of the switching class as the first prefix label, and configures the second device according to the first prefix label. 8.一种数据转发装置,其特征在于,所述装置包括:8. A data forwarding device, wherein the device comprises: 查找模块,用于在所述第一设备的转发路径表中查找与私网地址关联的第一前缀标签,所述第一设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签;A search module, configured to search for a first prefix label associated with a private network address in a forwarding path table of the first device, where the forwarding path table of the first device includes one or more private network addresses, and The prefix label associated with each private network address; 封装模块,用于将所述第一前缀标签、数据内容以及所述私网地址封装成第一数据报文;an encapsulation module, configured to encapsulate the first prefix label, data content and the private network address into a first data packet; 发送模块,用于将所述第一数据报文发送至所述第一前缀标签对应的第二设备,所述第一数据报文用于得到第二数据报文,所述第二数据报文由第二前缀标签、所述数据内容以及所述私网地址封装得到,所述第二前缀标签与所述私网地址关联。a sending module, configured to send the first data packet to the second device corresponding to the first prefix label, where the first data packet is used to obtain a second data packet, the second data packet It is obtained by encapsulating the second prefix label, the data content and the private network address, and the second prefix label is associated with the private network address. 9.根据权利要求8所述的装置,其特征在于,所述第一设备的转发路径表中还包括路由目标RT,所述装置还包括:9. The apparatus according to claim 8, wherein the forwarding path table of the first device further comprises a routing target RT, and the apparatus further comprises: 建立模块,用于建立与所述第二设备的第一虚拟专用网络邻居关系;establishing a module for establishing a first virtual private network neighbor relationship with the second device; 接收模块,用于接收所述第二设备通过所述第一邻居关系发送的VPN路由信息,所述路由信息包括所述第二设备的第一前缀标签、所述私网地址及RT;a receiving module, configured to receive VPN routing information sent by the second device through the first neighbor relationship, where the routing information includes the first prefix label of the second device, the private network address, and RT; 记录模块,用于若所述RT与所述第一设备中的转发路径表中的RT相同,则将所述第一前缀标签与所述私网地址记录到所述第一设备中的转发路径表中。A recording module, configured to record the first prefix label and the private network address to the forwarding path in the first device if the RT is the same as the RT in the forwarding path table in the first device in the table. 10.一种数据转发装置,其特征在于,所述装置包括:10. A data forwarding device, characterized in that the device comprises: 接收模块,用于接收所述第一设备发送至私网地址的第一数据报文;a receiving module, configured to receive the first data message sent by the first device to the private network address; 解析模块,用于对所述第一数据报文进行解析,得到所述私网地址、第一前缀标签,及数据内容,所述第一前缀标签为所述第二设备的标签;a parsing module, configured to parse the first data packet to obtain the private network address, a first prefix label, and data content, where the first prefix label is a label of the second device; 获取模块,用于获取与所述私网地址关联的第二前缀标签;an obtaining module for obtaining the second prefix label associated with the private network address; 在所述第二设备的转发路径表中查找与所述私网地址关联的第二前缀标签,所述第二设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签;Look up the second prefix label associated with the private network address in the forwarding path table of the second device, where the forwarding path table of the second device includes one or more private network addresses, and each private network address is associated with The prefix label associated with the network address; 替换模块,用于将所述第一数据报文中的第一前缀标签替换为所述第二前缀标签得到第二数据报文;并将所述第二数据报文发送至所述第二前缀标签对应的第三设备。A replacement module, configured to replace the first prefix label in the first data packet with the second prefix label to obtain a second data packet; and send the second data packet to the second prefix The third device corresponding to the label. 11.根据权利要求10所述的装置,其特征在于,包括:11. The apparatus of claim 10, comprising: 所述获取模块,具体用于在所述第二设备的转发路径表中查找与所述私网地址关联的第二前缀标签,所述第二设备的转发路径表中包括一个或一个以上的私网地址,及与每个私网地址关联的前缀标签;The obtaining module is specifically configured to look up the second prefix label associated with the private network address in the forwarding path table of the second device, where the forwarding path table of the second device includes one or more private network addresses. network addresses, and prefix labels associated with each private network address; 或者根据所述第一前缀标签计算得到所述第二前缀标签。Or the second prefix label is obtained by calculating according to the first prefix label. 12.根据权利要求10所述的装置,其特征在于,12. The apparatus of claim 10, wherein: 所述装置还包括:The device also includes: 建立模块,用于建立所述第三设备与所述第二设备的第二邻居关系;establishing a module for establishing a second neighbor relationship between the third device and the second device; 所述接收模块,还用于接收所述第三设备通过所述第二邻居关系发送的所述第三设备的VPN路由信息,所述路由信息包括所述私网地址及所述第二前缀标签;The receiving module is further configured to receive VPN routing information of the third device sent by the third device through the second neighbor relationship, where the routing information includes the private network address and the second prefix label ; 记录模块,用于将所述第三设备的VPN路由信息记录到所述第二设备的转发路径表中。A recording module, configured to record the VPN routing information of the third device into the forwarding path table of the second device. 13.根据权利要求12所述的装置,其特征在于,13. The apparatus of claim 12, wherein 所述建立模块,还用于建立所述第一设备与所述第二设备的第一邻居关系;The establishing module is further configured to establish a first neighbor relationship between the first device and the second device; 所述替换模块,还用于将所述第三设备的VPN路由信息中的第二前缀标签替换为所述第二设备的第一前缀标签,得到修改后的VPN路由信息;The replacement module is further configured to replace the second prefix label in the VPN routing information of the third device with the first prefix label of the second device to obtain the modified VPN routing information; 所述装置还包括:The device also includes: 发送模块,用于通过所述第一邻居关系将所述修改后的VPN路由信息发送至所述第一设备,所述修改后的VPN路由信息用于在所述路由目标RT与所述第一设备的转发路径表中的RT相同时,所述第一设备将所述第一前缀标签及所述私网地址记录到所述第一设备的转发路径表中。A sending module, configured to send the modified VPN routing information to the first device through the first neighbor relationship, where the modified VPN routing information is used to communicate between the routing target RT and the first device When the RTs in the forwarding path table of the device are the same, the first device records the first prefix label and the private network address in the forwarding path table of the first device. 14.根据权利要求10-13任一项所述的装置,其特征在于,14. The device according to any one of claims 10-13, characterized in that, 所述接收模块,用于接收对所述第二设备的标签配置请求,所述配置请求携带交换类型的标签;The receiving module is configured to receive a label configuration request to the second device, where the configuration request carries a switch type label; 所述装置还包括:The device also includes: 配置模块,用于将所述交换类的标签作为所述第一前缀标签,根据所述第一前缀标签对所述第二设备进行配置。A configuration module, configured to use the label of the switching class as the first prefix label, and configure the second device according to the first prefix label. 15.一种网络设备,所述网络设备包括至少一个处理器、存储器及存储在所述存储器上并可被所述至少一个处理器执行的指令,其特征在于,所述至少一个处理器执行所述指令,以实现权利要求1或2中任一项所述的数据转发方法的步骤。15. A network device, the network device comprising at least one processor, a memory, and instructions stored on the memory and executable by the at least one processor, wherein the at least one processor executes the to implement the steps of the data forwarding method according to any one of claims 1 or 2. 16.一种网络设备,所述网络设备包括至少一个处理器、存储器及存储在所述存储器上并可被所述至少一个处理器执行的指令,其特征在于,所述至少一个处理器执行所述指令,以执行权利要求3至7中任一项所述的数据转发方法的步骤。16. A network device, the network device comprising at least one processor, a memory, and instructions stored on the memory and executable by the at least one processor, wherein the at least one processor executes the to execute the steps of the data forwarding method according to any one of claims 3 to 7. 17.一种计算机可读存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1至7中任一项所述的数据转发方法的步骤。17. A computer-readable storage medium, wherein the computer storage medium stores a computer program, the computer program comprising program instructions, the program instructions, when executed by a processor, cause the processor to execute as claimed The steps of the data forwarding method of any one of requirements 1 to 7 are required. 18.一种计算机程序产品,其特征在于,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机执行权利要求1至7中任一项所述的数据转发方法的步骤。18. A computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to execute any one of claims 1 to 7 The steps of the data forwarding method described in item.
CN201810899867.3A 2018-08-08 2018-08-08 Data forwarding method, device, equipment and storage medium Active CN110830354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810899867.3A CN110830354B (en) 2018-08-08 2018-08-08 Data forwarding method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810899867.3A CN110830354B (en) 2018-08-08 2018-08-08 Data forwarding method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110830354A true CN110830354A (en) 2020-02-21
CN110830354B CN110830354B (en) 2021-12-03

Family

ID=69540838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810899867.3A Active CN110830354B (en) 2018-08-08 2018-08-08 Data forwarding method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110830354B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114520839A (en) * 2022-02-23 2022-05-20 河北稳控科技有限公司 Data forwarding method, controller and data forwarding equipment
WO2023159975A1 (en) * 2022-02-28 2023-08-31 中兴通讯股份有限公司 Network scheduling method, network device, and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101090355A (en) * 2007-07-24 2007-12-19 杭州华三通信技术有限公司 Method, system and equipment for establishing label switching path of virtual private network tunnel
CN101572669A (en) * 2009-05-27 2009-11-04 中兴通讯股份有限公司 Transmitting method of VPN message as well as allocating and deleting method of the router marks thereof
US20150003463A1 (en) * 2013-06-28 2015-01-01 Futurewei Technologies, Inc. Multiprotocol Label Switching Transport for Supporting a Very Large Number of Virtual Private Networks
CN106713137A (en) * 2015-11-13 2017-05-24 中国电信股份有限公司 VPN method based on segment routing and SDN technology and device and system thereof
CN107026796A (en) * 2016-02-01 2017-08-08 华为技术有限公司 A kind of VPN route advertising methods, stream compression forwarding method and relevant device
CN107770063A (en) * 2016-08-17 2018-03-06 中兴通讯股份有限公司 Message forwarding method and device
CN107959613A (en) * 2016-10-18 2018-04-24 华为技术有限公司 Message forwarding method and device
CN108259341A (en) * 2017-12-06 2018-07-06 新华三技术有限公司 A kind of prefix label distribution method and SDN controllers

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101090355A (en) * 2007-07-24 2007-12-19 杭州华三通信技术有限公司 Method, system and equipment for establishing label switching path of virtual private network tunnel
CN101572669A (en) * 2009-05-27 2009-11-04 中兴通讯股份有限公司 Transmitting method of VPN message as well as allocating and deleting method of the router marks thereof
US20150003463A1 (en) * 2013-06-28 2015-01-01 Futurewei Technologies, Inc. Multiprotocol Label Switching Transport for Supporting a Very Large Number of Virtual Private Networks
CN106713137A (en) * 2015-11-13 2017-05-24 中国电信股份有限公司 VPN method based on segment routing and SDN technology and device and system thereof
CN107026796A (en) * 2016-02-01 2017-08-08 华为技术有限公司 A kind of VPN route advertising methods, stream compression forwarding method and relevant device
CN107770063A (en) * 2016-08-17 2018-03-06 中兴通讯股份有限公司 Message forwarding method and device
CN107959613A (en) * 2016-10-18 2018-04-24 华为技术有限公司 Message forwarding method and device
CN108259341A (en) * 2017-12-06 2018-07-06 新华三技术有限公司 A kind of prefix label distribution method and SDN controllers

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YONGLE1: "对RIB、FIB、LIB、LFIB的一些理解", 《51CTO博客》 *
茶乡浪子: "深入理解MPLS标签动作及应用示例", 《CSDN博客》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114520839A (en) * 2022-02-23 2022-05-20 河北稳控科技有限公司 Data forwarding method, controller and data forwarding equipment
CN114520839B (en) * 2022-02-23 2024-05-31 河北稳控科技有限公司 Data forwarding method, controller and data forwarding device
WO2023159975A1 (en) * 2022-02-28 2023-08-31 中兴通讯股份有限公司 Network scheduling method, network device, and readable storage medium

Also Published As

Publication number Publication date
CN110830354B (en) 2021-12-03

Similar Documents

Publication Publication Date Title
US11463353B2 (en) Methods and apparatus for use in providing transport and data center segmentation in a mobile network
CN109756425B (en) Multicast forwarding method, device and BFR
US9107151B2 (en) Wireless system with split control plane and data plane
EP2708001B1 (en) Label switched routing to connect low power network domains
US10530736B2 (en) Method and apparatus for forwarding generic routing encapsulation packets at a network address translation gateway
CN102724118B (en) Label distribution method and device
CN107968750B (en) Message transmission method, device and node
CN104579954B (en) The cross-domain retransmission method of message, device and communication equipment
CN101534209B (en) A method and device for sending multicast messages
CN109218456B (en) Method and device for processing aging time of MAC address table
CN101764751A (en) Method, system and equipment for forwarding roaming messages for wireless user terminal travelling across VLAN
CN112583690A (en) Tunnel configuration method, device, system, equipment and storage medium
EP4191966A1 (en) Method and device for processing data message, storage medium, and electronic device
WO2017058908A1 (en) Generating service-optimized paths based on enhanced eigrp telemetry
CN110830354B (en) Data forwarding method, device, equipment and storage medium
US20240195657A1 (en) Message sending method and apparatus, message receiving method and apparatus, and storage medium
CN102025599A (en) Method and system of initiating communication, forwarding information and data message and route configuration
US20150098457A1 (en) Enabling internet protocol connectivity across multi-hop mobile wireless networks via a service oriented architecture
CN113285877B (en) A control method and related device for message forwarding
WO2022228090A1 (en) Path learning method and device, service node, and storage medium
CN103997459A (en) Communication initiation, information/data message forwarding and routing configuration method/system
Campos et al. Network infrastructure extension using 802.1 D‐based wireless mesh networks
CN115460138B (en) Network intercommunication method and device
CN115460140B (en) Network intercommunication method and device
CN115460141B (en) Network intercommunication method 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
GR01 Patent grant
GR01 Patent grant