[go: up one dir, main page]

CN116319536B - Data transmission method and device based on SDWAN active/standby links, electronic equipment and storage medium - Google Patents

Data transmission method and device based on SDWAN active/standby links, electronic equipment and storage medium Download PDF

Info

Publication number
CN116319536B
CN116319536B CN202211727250.6A CN202211727250A CN116319536B CN 116319536 B CN116319536 B CN 116319536B CN 202211727250 A CN202211727250 A CN 202211727250A CN 116319536 B CN116319536 B CN 116319536B
Authority
CN
China
Prior art keywords
sdwan
metric value
link
target
uplink
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.)
Active
Application number
CN202211727250.6A
Other languages
Chinese (zh)
Other versions
CN116319536A (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.)
China Telecom Cloud Technology Co Ltd
Original Assignee
China Telecom Cloud Technology 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 China Telecom Cloud Technology Co Ltd filed Critical China Telecom Cloud Technology Co Ltd
Priority to CN202211727250.6A priority Critical patent/CN116319536B/en
Publication of CN116319536A publication Critical patent/CN116319536A/en
Application granted granted Critical
Publication of CN116319536B publication Critical patent/CN116319536B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明实施例提供了一种基于SDWAN主备链路的数据传输方法、装置、电子设备和存储介质,包括在第一OSPF和第一BGP进行路由双向重发布时,获取SDWAN主链路的第一度量值;在第二OSPF和第二BGP进行路由双向重发布时,获取SDWAN备链路的第二度量值;对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;采用所述目标SDWAN链路进行数据传输。通过本发明实施例支持SDWAN客户端发布OSPF路由到云端内,并重发布进BGP路由中,实现双向重发布操作,实现SDWAN主备链路功能;使得可以采用SDWAN主备链路进行数据传输。

The embodiment of the present invention provides a data transmission method, device, electronic device and storage medium based on SDWAN primary and backup links, including obtaining a first metric value of the SDWAN primary link when the first OSPF and the first BGP perform bidirectional redistribution of routes; obtaining a second metric value of the SDWAN backup link when the second OSPF and the second BGP perform bidirectional redistribution of routes; comparing the first metric value and the second metric value, determining a target SDWAN link from the SDWAN primary link and the SDWAN backup link; and using the target SDWAN link for data transmission. The embodiment of the present invention supports the SDWAN client to publish OSPF routes to the cloud, and redistribute them into BGP routes, implements bidirectional redistribution operations, and implements the SDWAN primary and backup link functions; so that the SDWAN primary and backup links can be used for data transmission.

Description

基于SDWAN主备链路的数据传输方法、装置、电子设备和存储 介质Data transmission method, device, electronic device and storage medium based on SDWAN primary and backup links

技术领域Technical Field

本发明涉及网络数据处理技术领域,特别是涉及一种基于SDWAN主备链路的数据传输方法、一种基于SDWAN主备链路的数据传输装置、一种电子设备和一种存储介质。The present invention relates to the field of network data processing technology, and in particular to a data transmission method based on SDWAN primary and backup links, a data transmission device based on SDWAN primary and backup links, an electronic device and a storage medium.

背景技术Background technique

由于SDWAN(Software Defined Wide Area Network,软件定义广域网)客户需求的增加,更多的SDWAN客户要求链路的有主备链路保护的功能,进而来保障客户高质量网络服务。由于客户业务的增多,越来越多客户利用OSPF(Open Shortest Path First,开放式最短路径优先)来发布路由,且也有一部分用户要求LTE(Long Term Evolution,长期演进)作为WAN(Wide Area Network,广域网)网络故障时的备用链路。而传统SDWAN双机旁挂方案一般利用VRRP(Virtual Router Redundancy Protocol,虚拟路由器冗余协议)实现,或者单独的OSPF或者单独BGP(Border Gateway Protocol,边界网关协议)协议实现链路主备方案,如果客户需要发布OSPF路由,且POP(Post Office Protocol,邮局协议)侧只支持BGP路由协议的场景,传统的主备链路方案就不能满足该需求。Due to the increase in SDWAN (Software Defined Wide Area Network) customer demand, more SDWAN customers require the link to have the function of primary and backup link protection, thereby ensuring high-quality network services for customers. Due to the increase in customer services, more and more customers use OSPF (Open Shortest Path First) to publish routes, and some users also require LTE (Long Term Evolution) as a backup link in the event of a WAN (Wide Area Network) network failure. The traditional SDWAN dual-machine bypass solution is generally implemented using VRRP (Virtual Router Redundancy Protocol), or a separate OSPF or a separate BGP (Border Gateway Protocol) protocol to implement the link primary and backup solution. If the customer needs to publish OSPF routes and the POP (Post Office Protocol) side only supports the BGP routing protocol, the traditional primary and backup link solution cannot meet this demand.

发明内容Summary of the invention

鉴于上述问题,提出了本发明实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种基于SDWAN主备链路的数据传输方法、一种基于SDWAN主备链路的数据传输装置、一种电子设备和一种存储介质。In view of the above problems, embodiments of the present invention are proposed to provide a data transmission method based on SDWAN primary and backup links, a data transmission device based on SDWAN primary and backup links, an electronic device and a storage medium that overcome the above problems or at least partially solve the above problems.

在本发明的第一个方面,本发明实施例公开了一种基于SDWAN主备链路的数据传输方法,SDWAN主链路包括第一开放式最短路径优先协议OSPF和第一边界网关协议BGP,SDWAN备链路包括第二OSPF和第二BGP,所述方法包括:In a first aspect of the present invention, an embodiment of the present invention discloses a data transmission method based on a SDWAN primary and backup link, wherein the SDWAN primary link includes a first open shortest path first protocol OSPF and a first border gateway protocol BGP, and the SDWAN backup link includes a second OSPF and a second BGP, and the method includes:

在所述第一OSPF和所述第一BGP进行路由双向重发布时,获取所述SDWAN主链路的第一度量值;When the first OSPF and the first BGP perform bidirectional republishing of routes, obtaining a first metric value of the SDWAN primary link;

在所述第二OSPF和所述第二BGP进行路由双向重发布时,获取所述SDWAN备链路的第二度量值;When the second OSPF and the second BGP perform bidirectional republishing of routes, obtaining a second metric value of the SDWAN backup link;

对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;Comparing the first metric value with the second metric value, determining a target SDWAN link from the SDWAN primary link and the SDWAN backup link;

采用所述目标SDWAN链路进行数据传输。The target SDWAN link is used for data transmission.

可选地,所述SDWAN主链路还包括主链路内核,所述SDWAN备链路还包括备链路内核;所述方法还包括:Optionally, the SDWAN main link further includes a main link kernel, and the SDWAN backup link further includes a backup link kernel; the method further includes:

将所述第一OSPF映射到所述主链路内核,建立主链路OSPF邻居;Mapping the first OSPF to the primary link kernel to establish a primary link OSPF neighbor;

将所述第二OSPF映射到所述备链路内核,建立备链路OSPF邻居。The second OSPF is mapped to the backup link kernel to establish a backup link OSPF neighbor.

可选地,所述方法还包括:Optionally, the method further comprises:

基于所述第一BGP,建立主链路BGP邻居;Based on the first BGP, establish a primary link BGP neighbor;

基于所述第二BGP,建立备链路BGP邻居。Based on the second BGP, a backup link BGP neighbor is established.

可选地,所述方法还包括:Optionally, the method further comprises:

控制所述主链路BGP邻居向所述主链路OSPF邻居发布路由,和控制所述主链路OSPF邻居向所述主链路BGP邻居发布路由,以使所述第一OSPF和所述第一BGP进行路由双向重发布;Control the main link BGP neighbor to publish routes to the main link OSPF neighbor, and control the main link OSPF neighbor to publish routes to the main link BGP neighbor, so that the first OSPF and the first BGP perform bidirectional re-publishing of routes;

控制所述备链路BGP邻居向所述备链路OSPF邻居发布路由,和控制所述备链路OSPF邻居向所述备链路BGP邻居发布路由,以使所述第二OSPF和所述第二BGP进行路由双向重发布。The backup link BGP neighbor is controlled to publish routes to the backup link OSPF neighbor, and the backup link OSPF neighbor is controlled to publish routes to the backup link BGP neighbor, so that the second OSPF and the second BGP perform bidirectional republishing of routes.

可选地,所述方法还包括:Optionally, the method further comprises:

接收更新路由信息;Receive updated routing information;

依据所述更新路由信息更新所述主链路OSPF邻居和所述备链路OSPF邻居。The primary link OSPF neighbor and the backup link OSPF neighbor are updated according to the updated routing information.

可选地,所述方法还包括:Optionally, the method further comprises:

在所述目标SDWAN链路中,路由双向重发布时引入预设路由策略。In the target SDWAN link, a preset routing strategy is introduced when the routes are bidirectionally redistributed.

可选地,所述路由策略包括边界标签值,所述在所述目标SDWAN链路中,路由双向重发布时引入预设路由策略的步骤包括:Optionally, the routing policy includes a boundary label value, and the step of introducing a preset routing policy when bidirectionally redistributing routing in the target SDWAN link includes:

在所述目标SDWAN链路中,路由双向重发布时引入路由标识,所述路由标识携带路由标签值;In the target SDWAN link, a route identifier is introduced when the route is bidirectionally redistributed, and the route identifier carries a route label value;

依据所述路由标签值和所述边界标签值,引入所述路由标识对应的路由。The route corresponding to the routing identifier is introduced according to the routing label value and the boundary label value.

可选地,所述依据所述路由标签值和所述边界标签值,引入所述路由标识对应的路由的步骤包括:Optionally, the step of introducing the route corresponding to the routing identifier according to the routing label value and the boundary label value includes:

判断所述路由标签值和所述边界标签值是否相同;Determining whether the routing label value and the boundary label value are the same;

当所述路由标签值和所述边界标签值相同时,拒绝引入所述路由标识对应的路由;When the routing label value is the same as the boundary label value, refusing to import the route corresponding to the routing identifier;

当所述路由标签值和所述边界标签值不相同时,引入所述路由标识对应的路由。When the routing label value and the boundary label value are different, the route corresponding to the routing identifier is introduced.

可选地,所述第一度量值包括第一上行度量值和第一下行度量值,所述第二度量值包括第二上行度量值和第二下行度量值;所述对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路的步骤包括:Optionally, the first metric value includes a first uplink metric value and a first downlink metric value, and the second metric value includes a second uplink metric value and a second downlink metric value; and the step of comparing the first metric value and the second metric value to determine the target SDWAN link from the SDWAN main link and the SDWAN backup link includes:

对比所述第一上行度量值和所述第二上行度量值,确定目标上行度量值;Comparing the first uplink metric value with the second uplink metric value to determine a target uplink metric value;

对比所述第一下行度量值和所述第二下行度量值,确定目标下行度量值;Comparing the first downlink metric value with the second downlink metric value to determine a target downlink metric value;

确定所述目标上行度量值对应的SDWAN上行链路为目标SDWAN链路的上行链路;其中,所述目标上行度量值对应的SDWAN上行链路为所述SDWAN主链路的上行链路或所述SDWAN备链路的上行链路;Determine that the SDWAN uplink corresponding to the target uplink metric value is the uplink of the target SDWAN link; wherein the SDWAN uplink corresponding to the target uplink metric value is the uplink of the SDWAN primary link or the uplink of the SDWAN backup link;

确定所述目标下行度量值对应的SDWAN下行链路为目标SDWAN链路的下行链路;其中,所述目标下行度量值对应的SDWAN下行链路为所述SDWAN主链路的下行链路或所述SDWAN备链路的下行链路。Determine that the SDWAN downlink corresponding to the target downlink metric value is the downlink of the target SDWAN link; wherein, the SDWAN downlink corresponding to the target downlink metric value is the downlink of the SDWAN main link or the downlink of the SDWAN backup link.

可选地,所述对比所述第一上行度量值和所述第二上行度量值,确定目标上行度量值的步骤包括:Optionally, the step of comparing the first uplink metric value with the second uplink metric value to determine a target uplink metric value includes:

判断所述第一上行度量值和所述第二上行度量值的大小关系;Determine a magnitude relationship between the first uplink metric value and the second uplink metric value;

当所述第一上行度量值小于所述第二上行度量值时,确定所述第一上行度量值为所述目标上行度量值;When the first uplink metric value is less than the second uplink metric value, determining the first uplink metric value to be the target uplink metric value;

当所述第二上行度量值小于所述第一上行度量值时,确定所述第二度量值为所述目标上行度量值。When the second uplink metric value is less than the first uplink metric value, the second metric value is determined to be the target uplink metric value.

可选地,所述对比所述第一下行度量值和所述第二下行度量值,确定目标下行度量值的步骤包括:Optionally, the step of comparing the first downlink metric value with the second downlink metric value to determine a target downlink metric value includes:

判断所述第一下行度量值和所述第二下行度量值的大小关系;Determine a magnitude relationship between the first downlink metric value and the second downlink metric value;

当所述第一下行度量值小于所述第二下行度量值时,确定所述第一下行度量值为所述目标下行度量值;When the first downlink metric value is less than the second downlink metric value, determining the first downlink metric value to be the target downlink metric value;

当所述第二下行度量值小于所述第一下行度量值时,确定所述第二度量值为所述目标下行度量值。When the second downlink metric value is less than the first downlink metric value, the second metric value is determined to be the target downlink metric value.

可选地,所述采用所述目标SDWAN链路进行数据传输的步骤包括:Optionally, the step of using the target SDWAN link to transmit data includes:

采用所述目标SDWAN链路的下行链路与预设用户侧设备进行数据传输;Using the downlink of the target SDWAN link to perform data transmission with a preset user-side device;

采用所述目标SDWAN链路的上行链路与预设云侧设备进行数据传输。The uplink of the target SDWAN link is used to transmit data with the preset cloud-side device.

在本发明的第二个方面,本发明实施例公开了一种基于SDWAN主备链路的数据传输装置,SDWAN主链路包括第一开放式最短路径优先协议OSPF和第一边界网关协议BGP,SDWAN备链路包括第二OSPF和第二BGP,所述装置包括:In a second aspect of the present invention, an embodiment of the present invention discloses a data transmission device based on a SDWAN primary and backup link, wherein the SDWAN primary link includes a first open shortest path first protocol OSPF and a first border gateway protocol BGP, and the SDWAN backup link includes a second OSPF and a second BGP, and the device includes:

第一获取模块,用于在所述第一OSPF和所述第一BGP进行路由双向重发布时,获取所述SDWAN主链路的第一度量值;A first acquisition module, used for acquiring a first metric value of the SDWAN primary link when the first OSPF and the first BGP perform bidirectional republishing of routes;

第二获取模块,用于在所述第二OSPF和所述第二BGP进行路由双向重发布时,获取所述SDWAN备链路的第二度量值;A second acquisition module is used to obtain a second metric value of the SDWAN backup link when the second OSPF and the second BGP perform bidirectional re-publishing of routes;

对比模块,用于对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;A comparison module, configured to compare the first metric value and the second metric value, and determine a target SDWAN link from the SDWAN primary link and the SDWAN backup link;

传输模块,用于采用所述目标SDWAN链路进行数据传输。A transmission module is used to use the target SDWAN link to transmit data.

在本发明的第三个方面,本发明实施例公开了一种电子设备,包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如上所述的基于SDWAN主备链路的数据传输方法的步骤。In the third aspect of the present invention, an embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the data transmission method based on the SDWAN primary and backup links as described above.

在本发明的第四个方面,本发明实施例公开了一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如上所述的基于SDWAN主备链路的数据传输方法的步骤。In a fourth aspect of the present invention, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data transmission method based on the SDWAN primary and backup links as described above are implemented.

本发明实施例包括以下优点:The embodiments of the present invention include the following advantages:

本发明实施例通过在第一OSPF和第一BGP进行路由双向重发布时,获取SDWAN主链路的第一度量值;在第二OSPF和第二BGP进行路由双向重发布时,获取SDWAN备链路的第二度量值;对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;采用所述目标SDWAN链路进行数据传输。通过OSPF和BGP进行数据传输,支持SDWAN客户端发布OSPF路由到云端内,并重发布进BGP路由中,实现双向重发布操作,实现SDWAN主备链路功能;使得可以采用SDWAN主备链路进行数据传输。The embodiment of the present invention obtains the first metric value of the SDWAN primary link when the first OSPF and the first BGP perform bidirectional republishing of routes; obtains the second metric value of the SDWAN backup link when the second OSPF and the second BGP perform bidirectional republishing of routes; compares the first metric value with the second metric value, determines the target SDWAN link from the SDWAN primary link and the SDWAN backup link; and uses the target SDWAN link for data transmission. Data transmission is performed through OSPF and BGP, supporting the SDWAN client to publish OSPF routes to the cloud, and republish them into BGP routes, realizing bidirectional republishing operations, and realizing the SDWAN primary and backup link functions; so that the SDWAN primary and backup links can be used for data transmission.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本发明的一种基于SDWAN主备链路的数据传输方法实施例的步骤流程图;FIG1 is a flowchart of an embodiment of a data transmission method based on SDWAN primary and standby links of the present invention;

图2是本发明的另一种基于SDWAN主备链路的数据传输方法实施例的步骤流程图;FIG2 is a flowchart of another embodiment of a data transmission method based on SDWAN primary and standby links of the present invention;

图3本发明的一种基于SDWAN主备链路的软件架构示意图;FIG3 is a schematic diagram of a software architecture based on SDWAN active/standby links of the present invention;

图4本发明的一种基于SDWAN主备链路的路由连接示意图;FIG4 is a schematic diagram of a routing connection based on SDWAN primary and backup links of the present invention;

图5本发明的一种基于SDWAN主备链路的硬件连接示意图;FIG5 is a schematic diagram of a hardware connection based on SDWAN primary and backup links of the present invention;

图6本发明的一种基于SDWAN主备链路的路由策略示意图;FIG6 is a schematic diagram of a routing strategy based on SDWAN primary and backup links of the present invention;

图7本发明的一种数据转发示意图;FIG7 is a schematic diagram of data forwarding according to the present invention;

图8本发明的一种基于SDWAN主备链路的LAN侧链路故障示意图;FIG8 is a schematic diagram of a LAN side link failure based on the SDWAN primary and backup links of the present invention;

图9是本发明的一种基于SDWAN主备链路的数据传输装置实施例的结构框图。FIG9 is a structural block diagram of an embodiment of a data transmission device based on SDWAN primary and backup links of the present invention.

具体实施方式Detailed ways

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

参照图1,示出了本发明的一种基于SDWAN主备链路的数据传输方法实施例的步骤流程图,SDWAN主链路包括第一开放式最短路径优先协议OSPF和第一边界网关协议BGP,SDWAN备链路包括第二OSPF和第二BGP。1 , a flow chart of the steps of an embodiment of a data transmission method based on a SDWAN primary and backup link of the present invention is shown, wherein the SDWAN primary link includes a first open shortest path first protocol OSPF and a first border gateway protocol BGP, and the SDWAN backup link includes a second OSPF and a second BGP.

在本发明实施例中,SDWAN主备链路即包括SDWAN主链路和SDWAN备链路两种;其中,SDWAN主链路为一条,SDWAN备链路至少为一条,且SDWAN备链路为两条或以上时,对于SDWAN备链路的备份优先级不作限定。In an embodiment of the present invention, the SDWAN primary and backup links include two types: an SDWAN primary link and an SDWAN backup link; wherein, when there is one SDWAN primary link, there is at least one SDWAN backup link, and when there are two or more SDWAN backup links, there is no limitation on the backup priority of the SDWAN backup link.

SDWAN主链路包括第一OSPF和第一BGP,SDWAN备链路包括第二OSPF和第二BGP。第一OSPF和第二OSPF为同一种OSPF协议,而第一OSPF为部署于SDWAN主链路上的OSPF协议,第二OSPF为部署于SDWAN备链路上的OSPF协议。相应地,第一BGP和第二BGP也为同一种BGP协议,而第一BGP为部署于SDWAN主链路上的BGP协议,第二BGP为部署于SDWAN备链路上的OSPF协议。The SDWAN main link includes the first OSPF and the first BGP, and the SDWAN backup link includes the second OSPF and the second BGP. The first OSPF and the second OSPF are the same OSPF protocol, and the first OSPF is the OSPF protocol deployed on the SDWAN main link, and the second OSPF is the OSPF protocol deployed on the SDWAN backup link. Correspondingly, the first BGP and the second BGP are also the same BGP protocol, and the first BGP is the BGP protocol deployed on the SDWAN main link, and the second BGP is the OSPF protocol deployed on the SDWAN backup link.

所述基于SDWAN主备链路的数据传输方法具体可以包括如下步骤:The data transmission method based on the SDWAN primary and backup links may specifically include the following steps:

步骤101,在所述第一OSPF和所述第一BGP进行路由双向重发布时,获取所述SDWAN主链路的第一度量值;Step 101, when the first OSPF and the first BGP perform bidirectional route redistribution, obtain a first metric value of the SDWAN primary link;

SDWAN主链路的第一OSPF和第一BGP在进行路由双向重发布,即第一OSPF向第一BGP发送路由信息,第一BPG也向第一OSPF发送路由信息时,SDWAN主链路之间的路由信息中携带有SDWAN主链路的第一度量值,该第一度量值表征着SDWAN主链路的使用优先级。When the first OSPF and the first BGP of the SDWAN main link are performing bidirectional route redistribution, that is, the first OSPF sends routing information to the first BGP, and the first BGP also sends routing information to the first OSPF, the routing information between the SDWAN main links carries the first metric value of the SDWAN main link, and the first metric value represents the usage priority of the SDWAN main link.

步骤102,在所述第二OSPF和所述第二BGP进行路由双向重发布时,获取所述SDWAN备链路的第二度量值;Step 102: when the second OSPF and the second BGP perform bidirectional redistribution of routes, obtain a second metric value of the SDWAN backup link;

SDWAN备链路的第二OSPF和第二BGP在进行路由双向重发布,即第二OSPF向第二BGP发送路由信息,第二BPG也向第二OSPF发送路由信息时,SDWAN备链路之间的路由信息中携带有SDWAN备链路的第二度量值,该第二度量值表征着SDWAN备链路的使用优先级。When the second OSPF and the second BGP of the SDWAN backup link are performing bidirectional route redistribution, that is, the second OSPF sends routing information to the second BGP, and the second BGP also sends routing information to the second OSPF, the routing information between the SDWAN backup links carries the second metric value of the SDWAN backup link, and the second metric value represents the usage priority of the SDWAN backup link.

步骤103,对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;Step 103, comparing the first metric value and the second metric value, and determining a target SDWAN link from the SDWAN primary link and the SDWAN backup link;

将第一度量值和第二度量值进行对比,确定第一度量值和第二度量值之间的大小关系,从而对SDWAN主链路和SDWAN备链路中的数据传输链路进行筛选,确定出目标SDWAN链路。The first metric value and the second metric value are compared to determine the size relationship between the first metric value and the second metric value, so as to screen the data transmission links in the SDWAN main link and the SDWAN backup link to determine the target SDWAN link.

步骤104,采用所述目标SDWAN链路进行数据传输。Step 104: Use the target SDWAN link to transmit data.

在确定目标SDWAN链路后,可以采用该目标SDWAN链路进行发送报文等数据传输操作。After determining the target SDWAN link, the target SDWAN link can be used to perform data transmission operations such as sending messages.

本发明实施例通过在第一OSPF和第一BGP进行路由双向重发布时,获取SDWAN主链路的第一度量值;在第二OSPF和第二BGP进行路由双向重发布时,获取SDWAN备链路的第二度量值;对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;采用所述目标SDWAN链路进行数据传输。通过OSPF和BGP进行数据传输,支持SDWAN客户端发布OSPF路由到云端内,并重发布进BGP路由中,实现双向重发布操作,实现SDWAN主备链路功能;使得可以采用SDWAN主备链路进行数据传输。The embodiment of the present invention obtains the first metric value of the SDWAN primary link when the first OSPF and the first BGP perform bidirectional republishing of routes; obtains the second metric value of the SDWAN backup link when the second OSPF and the second BGP perform bidirectional republishing of routes; compares the first metric value with the second metric value, determines the target SDWAN link from the SDWAN primary link and the SDWAN backup link; and uses the target SDWAN link for data transmission. Data transmission is performed through OSPF and BGP, supporting the SDWAN client to publish OSPF routes to the cloud, and republish them into BGP routes, realizing bidirectional republishing operations, and realizing the SDWAN primary and backup link functions; so that the SDWAN primary and backup links can be used for data transmission.

参照图2,示出了本发明的另一种基于SDWAN主备链路的数据传输方法实施例的步骤流程图,SDWAN主链路包括主链路内核、第一开放式最短路径优先协议OSPF和第一边界网关协议BGP,SDWAN备链路包括备链路内核、第二OSPF和第二BGP。其中,第一OSPF和第二OSPF为同一种OSPF协议;第一BGP和第二BGP为同一种BGP协议;主链路内核和备链路内核也相同;即SDWAN主链路和SDWAN备链路为两条架构相同的SDWAN链路。具体地,可以参照图3,SDWAN主链路和SDWAN备链路具有相同的软件架构,包括:内核、VPP(数据层)、OSPF、BGP和ZEBRA(访问层中间件)。内核中创建有LTE数据转发接口PPP(Point to Point Protocol,点对点协议)0,内核默认路由出口为该PPP0,VPP侧通过tap(接口)0口实现VPP与内核的数据转发。Referring to Figure 2, a flow chart of the steps of another embodiment of a data transmission method based on the SDWAN main and standby links of the present invention is shown. The SDWAN main link includes a main link kernel, a first open shortest path first protocol OSPF and a first border gateway protocol BGP, and the SDWAN standby link includes a standby link kernel, a second OSPF and a second BGP. Among them, the first OSPF and the second OSPF are the same OSPF protocol; the first BGP and the second BGP are the same BGP protocol; the main link kernel and the standby link kernel are also the same; that is, the SDWAN main link and the SDWAN standby link are two SDWAN links with the same architecture. Specifically, referring to Figure 3, the SDWAN main link and the SDWAN standby link have the same software architecture, including: kernel, VPP (data layer), OSPF, BGP and ZEBRA (access layer middleware). An LTE data forwarding interface PPP (Point to Point Protocol) 0 is created in the kernel, and the kernel default routing exit is PPP0, and the VPP side implements data forwarding between VPP and the kernel through the tap (interface) 0 port.

OSPF,VPP中LOOP0口添加OSPF业务,并可以将OSPF映射到内核,此时FRR(FastReroute,快速重路由)通过该映射接口与客户侧建立OSPF邻居,还可以引入路由策略和metric(度量)值发布到BGP协议中,其中,主用链路配置较小的metric值,备用配置较大的metric值。OSPF, add OSPF service to the LOOP0 port in VPP, and map OSPF to the kernel. At this time, FRR (FastReroute) establishes OSPF neighbors with the client side through the mapping interface, and can also introduce routing policies and metric values to the BGP protocol. The primary link is configured with a smaller metric value, and the backup link is configured with a larger metric value.

ZEBRA,可以在学习到路由之后同步到内核,内核再通过netlink(网络)消息通知VPP的路由信息的添加和删除。ZEBRA can synchronize the learned routes to the kernel, which then notifies VPP of the addition and deletion of routing information through netlink (network) messages.

BGP,与POP建立IBGP邻居,然后默认发布进OSPF,同样引入路由策略和metric发布到OSPF协议中。BGP establishes an IBGP neighbor relationship with the POP, and then publishes it to OSPF by default. It also introduces routing policies and metrics and publishes them to the OSPF protocol.

所述基于SDWAN主备链路的数据传输方法具体可以包括如下步骤:The data transmission method based on the SDWAN primary and backup links may specifically include the following steps:

步骤201,将所述第一OSPF映射到所述主链路内核,建立主链路OSPF邻居;Step 201, mapping the first OSPF to the primary link kernel, and establishing a primary link OSPF neighbor;

在实际应用中,可以将SDWAN主链路中的第一OSPF映射到主链路内核,生成OSPF映射接口,使得SDWAN主链路的SDWAN设备通过该OSPF映射接口与客户侧设备连接,建立主链路OSPF邻居。In actual applications, the first OSPF in the SDWAN main link can be mapped to the main link kernel to generate an OSPF mapping interface, so that the SDWAN device of the SDWAN main link is connected to the client-side device through the OSPF mapping interface to establish a main link OSPF neighbor.

步骤202,将所述第二OSPF映射到所述备链路内核,建立备链路OSPF邻居;Step 202, mapping the second OSPF to the backup link kernel, and establishing a backup link OSPF neighbor;

可以将SDWAN备链路中的第二OSPF映射到备链路内核,生成OSPF映射接口,使得SDWAN备链路的SDWAN设备通过该OSPF映射接口与客户侧设备连接,建立备链路OSPF邻居。The second OSPF in the SDWAN backup link can be mapped to the backup link kernel to generate an OSPF mapping interface, so that the SDWAN device of the SDWAN backup link is connected to the client-side device through the OSPF mapping interface to establish a backup link OSPF neighbor.

其中,建立主链路OSPF邻居和建立备链路OSPF邻居的客户侧设备为同一设备,以使SDWAN主链路和SDWAN备链路实现双路旁挂。Among them, the client-side device for establishing the main link OSPF neighbor and the client-side device for establishing the backup link OSPF neighbor are the same device, so that the SDWAN main link and the SDWAN backup link can achieve dual-path bypass.

步骤203,基于所述第一BGP,建立主链路BGP邻居;Step 203: Establishing a primary link BGP neighbor based on the first BGP;

在实际应用中,可以将SDWAN主链路中的第一BGP与POP侧设备建立主链路BGP邻居;实现SDWAN主链路的上行链路的连接。In actual applications, the first BGP in the SDWAN main link can establish a main link BGP neighbor with the POP side device to achieve the connection of the uplink of the SDWAN main link.

步骤204,基于所述第二BGP,建立备链路BGP邻居;Step 204: Establish a backup link BGP neighbor based on the second BGP;

可以将SDWAN备链路中的第二BGP与POP侧设备建立备链路BGP邻居;实现SDWAN备链路的上行链路的连接。The second BGP in the SDWAN backup link can establish a backup link BGP neighbor with the POP side device to achieve the connection of the uplink of the SDWAN backup link.

其中,与建立主链路BGP邻居和建立备链路BGP邻居的POP侧设备为同一设备。The POP-side device for establishing the primary link BGP neighbor and the backup link BGP neighbor is the same device.

在SDWAN主链路建立好主链路OSPF邻居和主链路BGP邻居;SDWAN备链路建立好备链路OSPF邻居和备链路BGP邻居。其连接示意可以参照图4,SDWAN客户端(即uCPE1、uCPE2)在总部网络都通过OSPF发布总部内部的路由信息通过SDWAN设备的BGP协议将路由信息发布到域云内,还可以与其他分支的SDWAN设备进行互联。On the SDWAN main link, establish the main link OSPF neighbor and the main link BGP neighbor; on the SDWAN backup link, establish the backup link OSPF neighbor and the backup link BGP neighbor. The connection diagram can be seen in Figure 4. The SDWAN client (i.e. uCPE1, uCPE2) publishes the routing information inside the headquarters through OSPF in the headquarters network. The routing information is published to the domain cloud through the BGP protocol of the SDWAN device, and can also be interconnected with the SDWAN devices in other branches.

步骤205,控制所述主链路BGP邻居向所述主链路OSPF邻居发布路由,和控制所述主链路OSPF邻居向所述主链路BGP邻居发布路由,以使所述第一OSPF和所述第一BGP进行路由双向重发布;Step 205, controlling the main link BGP neighbor to publish routes to the main link OSPF neighbor, and controlling the main link OSPF neighbor to publish routes to the main link BGP neighbor, so that the first OSPF and the first BGP perform bidirectional republishing of routes;

在SDWAN主链路建立网络邻居完成后,即SDWAN主链路中,基于BGP的上行链路和基于OSPF的下行链路连接完成。此时,可以控制主链路BGP邻居向主链路OSPF邻居发布路由,即将路由从云端通过第一BGP向用户端发送;并且控制主链路OSPF邻居向主链路BGP邻居发布路由,即将路由从用户端通过第一OSPF向云端发送,此时第一OSPF和第一BGP都进行路由向对端发送,即第一OSPF和第一BGP进行路由双向重发布。After the SDWAN main link completes the establishment of network neighbors, that is, in the SDWAN main link, the BGP-based uplink and OSPF-based downlink connections are completed. At this time, the main link BGP neighbor can be controlled to publish routes to the main link OSPF neighbor, that is, to send routes from the cloud to the user end through the first BGP; and the main link OSPF neighbor can be controlled to publish routes to the main link BGP neighbor, that is, to send routes from the user end to the cloud through the first OSPF. At this time, both the first OSPF and the first BGP send routes to the other end, that is, the first OSPF and the first BGP perform bidirectional re-publishing of routes.

步骤206,控制所述备链路BGP邻居向所述备链路OSPF邻居发布路由,和控制所述备链路OSPF邻居向所述备链路BGP邻居发布路由,以使所述第二OSPF和所述第二BGP进行路由双向重发布;Step 206, controlling the backup link BGP neighbor to publish routes to the backup link OSPF neighbor, and controlling the backup link OSPF neighbor to publish routes to the backup link BGP neighbor, so that the second OSPF and the second BGP perform bidirectional republishing of routes;

在SDWAN备链路建立网络邻居完成后,即SDWAN备链路中,基于BGP的上行链路和基于OSPF的下行链路连接完成。此时,可以控制备链路BGP邻居向备链路OSPF邻居发布路由,即将路由从云端通过第二BGP向用户端发送;并且控制备链路OSPF邻居向备链路BGP邻居发布路由,即将路由从用户端通过第二OSPF向云端发送,此时第二OSPF和第二BGP都进行路由向对端发送,即第二OSPF和第二BGP进行路由双向重发布。After the SDWAN backup link completes the establishment of network neighbors, that is, in the SDWAN backup link, the BGP-based uplink and OSPF-based downlink connections are completed. At this time, the backup link BGP neighbor can be controlled to publish routes to the backup link OSPF neighbor, that is, to send routes from the cloud to the user end through the second BGP; and the backup link OSPF neighbor can be controlled to publish routes to the backup link BGP neighbor, that is, to send routes from the user end to the cloud through the second OSPF. At this time, both the second OSPF and the second BGP send routes to the other end, that is, the second OSPF and the second BGP perform bidirectional re-publishing of routes.

步骤207,在所述第一OSPF和所述第一BGP进行路由双向重发布时,获取所述SDWAN主链路的第一度量值;Step 207: When the first OSPF and the first BGP perform bidirectional redistribution of routes, obtain a first metric value of the SDWAN primary link;

由于在SDWAN主链路中引入了metric值,该metric值即为第一度量值,其在第一OSPF和第一BGP之间发送路由时产生,即可以在第一OSPF和第一BGP进行路由双向重发布时,获取SDWAN主链路的第一度量值。Since the metric value is introduced in the SDWAN main link, the metric value is the first metric value, which is generated when sending routes between the first OSPF and the first BGP. That is, the first metric value of the SDWAN main link can be obtained when the first OSPF and the first BGP perform bidirectional redistribution of routes.

步骤208,在所述第二OSPF和所述第二BGP进行路由双向重发布时,获取所述SDWAN备链路的第二度量值;Step 208: When the second OSPF and the second BGP perform bidirectional republishing of routes, obtain a second metric value of the SDWAN backup link;

在SDWAN备链路中同样引入了metric值,该metric值即为第二度量值,其在第二OSPF和第二BGP之间发送路由时产生,即可以在第二OSPF和第二一BGP进行路由双向重发布时,获取SDWAN备链路的第二度量值。A metric value is also introduced in the SDWAN backup link. The metric value is the second metric value, which is generated when sending routes between the second OSPF and the second BGP. That is, the second metric value of the SDWAN backup link can be obtained when the second OSPF and the second BGP perform bidirectional redistribution of routes.

步骤209,对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;Step 209, comparing the first metric value and the second metric value, and determining a target SDWAN link from the SDWAN primary link and the SDWAN backup link;

将第一度量值和第二度量值进行对比,确定出SDWAN主链路的上下行链路和SDWAN备链路的上下行链路中进行数据传输的链路为目标SDWAN链路。The first metric value and the second metric value are compared to determine that the link for data transmission in the uplink and downlink of the SDWAN main link and the uplink and downlink of the SDWAN backup link is the target SDWAN link.

具体地,所述第一度量值包括第一上行度量值和第一下行度量值,所述第二度量值包括第二上行度量值和第二下行度量值;所述对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路的步骤包括:Specifically, the first metric value includes a first uplink metric value and a first downlink metric value, and the second metric value includes a second uplink metric value and a second downlink metric value; and the step of comparing the first metric value and the second metric value to determine the target SDWAN link from the SDWAN primary link and the SDWAN backup link includes:

子步骤S2091,对比所述第一上行度量值和所述第二上行度量值,确定目标上行度量值;Sub-step S2091, comparing the first uplink metric value and the second uplink metric value to determine a target uplink metric value;

在本发明实施例中,第一度量值包括第一上行度量值和第一下行度量值。第一上行度量值即为SDWAN上行主链路的度量值,第一下行度量值即为SDWAN下行主链路的度量值。第二度量值包括第二上行度量值和第二下行度量值。第二上行度量值即为SDWAN上行备链路的度量值,第二下行度量值即为SDWAN下行备链路的度量值。In an embodiment of the present invention, the first metric value includes a first uplink metric value and a first downlink metric value. The first uplink metric value is the metric value of the SDWAN uplink main link, and the first downlink metric value is the metric value of the SDWAN downlink main link. The second metric value includes a second uplink metric value and a second downlink metric value. The second uplink metric value is the metric value of the SDWAN uplink backup link, and the second downlink metric value is the metric value of the SDWAN downlink backup link.

可以对比第一上行度量值和第二上行度量值,对SDWAN上行主链路和SDWAN上行备链路进行筛选,确定出目标上行度量值。The first uplink metric value and the second uplink metric value can be compared to screen the SDWAN uplink main link and the SDWAN uplink backup link to determine the target uplink metric value.

进一步地,所述对比所述第一上行度量值和所述第二上行度量值,确定目标上行度量值的步骤包括:判断所述第一上行度量值和所述第二上行度量值的大小关系;当所述第一上行度量值小于所述第二上行度量值时,确定所述第一上行度量值为所述目标上行度量值;当所述第二上行度量值小于所述第一上行度量值时,确定所述第二度量值为所述目标上行度量值。Furthermore, the step of comparing the first uplink metric value and the second uplink metric value to determine a target uplink metric value includes: judging the size relationship between the first uplink metric value and the second uplink metric value; when the first uplink metric value is smaller than the second uplink metric value, determining the first uplink metric value to be the target uplink metric value; when the second uplink metric value is smaller than the first uplink metric value, determining the second metric value to be the target uplink metric value.

在实际应用中,可以判断第一上行度量值和第二上行度量值的大小关系;其中,大小比对的方式可以是作差法,作比法,数轴法等等;本发明实施例不作限定。当第一上行度量值小于第二上行度量值时,确定第一上行度量值为目标上行度量值;当第二上行度量值小于第一上行度量值时,确定第二度量值为目标上行度量值。即确定第一上行度量值和第二上行度量值中较小的一个作为目标上行度量值。In practical applications, the magnitude relationship between the first uplink metric value and the second uplink metric value can be determined; wherein, the magnitude comparison method can be a difference method, a comparison method, a number axis method, etc.; the embodiment of the present invention is not limited. When the first uplink metric value is less than the second uplink metric value, the first uplink metric value is determined to be the target uplink metric value; when the second uplink metric value is less than the first uplink metric value, the second metric value is determined to be the target uplink metric value. That is, the smaller of the first uplink metric value and the second uplink metric value is determined as the target uplink metric value.

子步骤S2092,对比所述第一下行度量值和所述第二下行度量值,确定目标下行度量值;Sub-step S2092, comparing the first downlink metric value and the second downlink metric value to determine a target downlink metric value;

对比第一下行度量值和第二下行度量值,对SDWAN下行主链路和SDWAN下行备链路进行筛选,确定出目标下行度量值。The first downlink metric value is compared with the second downlink metric value, the SDWAN downlink main link and the SDWAN downlink backup link are screened, and the target downlink metric value is determined.

进一步地,所述对比所述第一下行度量值和所述第二下行度量值,确定目标下行度量值的步骤包括:判断所述第一下行度量值和所述第二下行度量值的大小关系;当所述第一下行度量值小于所述第二下行度量值时,确定所述第一下行度量值为所述目标下行度量值;当所述第二下行度量值小于所述第一下行度量值时,确定所述第二度量值为所述目标下行度量值。Further, the step of comparing the first downlink metric value and the second downlink metric value to determine the target downlink metric value includes: judging the size relationship between the first downlink metric value and the second downlink metric value; when the first downlink metric value is smaller than the second downlink metric value, determining the first downlink metric value as the target downlink metric value; when the second downlink metric value is smaller than the first downlink metric value, determining the second metric value as the target downlink metric value.

可以判断第一下行度量值和第二下行度量值的大小关系;其中,大小比对的方式可以是作差法,作比法,数轴法等等;并且可以与第一上行度量值和第二上行度量值的对比方式相同,也可以不同;本发明实施例不作限定。当第一下行度量值小于第二下行度量值时,确定第一下行度量值为目标下行度量值;当第二下行度量值小于第一下行度量值时,确定第二度量值为目标下行度量值。即确定第一下行度量值和第二下行度量值中较小的一个作为目标下行度量值。The magnitude relationship between the first downlink metric value and the second downlink metric value can be determined; wherein, the magnitude comparison method can be a difference method, a comparison method, a number axis method, etc.; and can be the same as the comparison method of the first uplink metric value and the second uplink metric value, or can be different; the embodiment of the present invention is not limited. When the first downlink metric value is less than the second downlink metric value, the first downlink metric value is determined to be the target downlink metric value; when the second downlink metric value is less than the first downlink metric value, the second metric value is determined to be the target downlink metric value. That is, the smaller of the first downlink metric value and the second downlink metric value is determined as the target downlink metric value.

子步骤S2093,确定所述目标上行度量值对应的SDWAN上行链路为目标SDWAN链路的上行链路;其中,所述目标上行度量值对应的SDWAN上行链路为所述SDWAN主链路的上行链路或所述SDWAN备链路的上行链路;Sub-step S2093, determining that the SDWAN uplink corresponding to the target uplink metric value is the uplink of the target SDWAN link; wherein the SDWAN uplink corresponding to the target uplink metric value is the uplink of the SDWAN primary link or the uplink of the SDWAN backup link;

确定目标上行度量值后,即可以确定目标上行度量值对应的SDWAN上行链路为目标SDWAN链路的上行链路。即当目标上行度量值是第一上行度量值时,目标上行度量值对应的SDWAN上行链路为SDWAN主链路的上行链路。当目标上行度量值是第二上行度量值时,目标上行度量值对应的SDWAN上行链路为SDWAN备链路的上行链路。After determining the target uplink metric value, the SDWAN uplink corresponding to the target uplink metric value can be determined as the uplink of the target SDWAN link. That is, when the target uplink metric value is the first uplink metric value, the SDWAN uplink corresponding to the target uplink metric value is the uplink of the SDWAN main link. When the target uplink metric value is the second uplink metric value, the SDWAN uplink corresponding to the target uplink metric value is the uplink of the SDWAN backup link.

子步骤S2094,确定所述目标下行度量值对应的SDWAN下行链路为目标SDWAN链路的下行链路;其中,所述目标下行度量值对应的SDWAN下行链路为所述SDWAN主链路的下行链路或所述SDWAN备链路的下行链路。Sub-step S2094, determining that the SDWAN downlink corresponding to the target downlink metric value is the downlink of the target SDWAN link; wherein, the SDWAN downlink corresponding to the target downlink metric value is the downlink of the SDWAN main link or the downlink of the SDWAN backup link.

确定目标下行度量值后,即可以确定目标下行度量值对应的SDWAN下行链路为目标SDWAN链路的下行链路。即当目标下行度量值是第一下行度量值时,目标下行度量值对应的SDWAN下行链路为SDWAN主链路的下行链路。当目标下行度量值是第二下行度量值时,目标下行度量值对应的SDWAN下行链路为SDWAN备链路的下行链路。After determining the target downlink metric value, the SDWAN downlink corresponding to the target downlink metric value can be determined as the downlink of the target SDWAN link. That is, when the target downlink metric value is the first downlink metric value, the SDWAN downlink corresponding to the target downlink metric value is the downlink of the SDWAN main link. When the target downlink metric value is the second downlink metric value, the SDWAN downlink corresponding to the target downlink metric value is the downlink of the SDWAN backup link.

步骤210,采用所述目标SDWAN链路进行数据传输;Step 210, using the target SDWAN link for data transmission;

确定目标SDWAN链路,采用目标SDWAN链路进行数据传输;实现在SEWAN中路由发布,通过主备链路减少故障发生概率。Determine the target SDWAN link and use it for data transmission; implement route publishing in SEWAN and reduce the probability of failure through primary and backup links.

具体地,所述采用所述目标SDWAN链路进行数据传输的步骤包括:采用所述目标SDWAN链路的下行链路与预设用户侧设备进行数据传输;采用所述目标SDWAN链路的上行链路与预设云侧设备进行数据传输。Specifically, the step of using the target SDWAN link for data transmission includes: using the downlink of the target SDWAN link to transmit data with a preset user-side device; using the uplink of the target SDWAN link to transmit data with a preset cloud-side device.

在确定出目标SDWAN链路的上行链路和目标SDWAN链路的下行链路后,可以采用目标SDWAN链路的下行链路与预设用户侧设备进行数据传输;通过目标SDWAN链路的下行链路与预设用户侧设备进行数据交互。可以采用目标SDWAN链路的下行链路与预设云侧设备进行数据传输;通过目标SDWAN链路的上行链路与预设云侧设备进行数据交互。After determining the uplink of the target SDWAN link and the downlink of the target SDWAN link, the downlink of the target SDWAN link can be used to transmit data with the preset user-side device; data interaction can be performed with the preset user-side device through the downlink of the target SDWAN link. The downlink of the target SDWAN link can be used to transmit data with the preset cloud-side device; data interaction can be performed with the preset cloud-side device through the uplink of the target SDWAN link.

可以参照图5,SDWAN主链路和SDWAN备链路中的上行链路与云端连接,SDWAN主链路和SDWAN备链路中的下行链路与用户端连接,从两条上行链路中确定目标SDWAN链路的上行链路,与云端进行数据交互;从两条下行链路中确定目标SDWAN链路的下行链路,与用户端进行数据交互。Referring to Figure 5, the uplinks in the SDWAN main link and the SDWAN backup link are connected to the cloud, and the downlinks in the SDWAN main link and the SDWAN backup link are connected to the user end. The uplink of the target SDWAN link is determined from the two uplinks, and data is interacted with the cloud; the downlink of the target SDWAN link is determined from the two downlinks, and data is interacted with the user end.

步骤211,在所述目标SDWAN链路中,路由双向重发布时引入预设路由策略;Step 211, in the target SDWAN link, a preset routing policy is introduced when routing is bidirectionally redistributed;

在实际应用中,双向重发布会因SDWAN主链路会从学习到云内发布到备用设备的路由,可能会导致设备部分路由学习错误,此时可以获取路由策略,通过路由策略防止形成路由环路,避免路由错误的现象发生。在目标SDWAN链路中路由双向重发布时,引入路由策略,确定目标SDWAN链路不会形成路由环路。In actual applications, bidirectional re-publishing may cause some device route learning errors because the SDWAN main link will learn the routes published to the backup device in the cloud. At this time, you can obtain the routing policy to prevent the formation of routing loops and avoid routing errors. When the route is bidirectionally re-published in the target SDWAN link, introduce the routing policy to ensure that the target SDWAN link will not form a routing loop.

在本发明的一可选实施例中,所述路由策略包括边界标签值,所述在所述目标SDWAN链路中,路由双向重发布时引入预设路由策略的步骤包括:In an optional embodiment of the present invention, the routing policy includes a boundary label value, and the step of introducing a preset routing policy when bidirectionally redistributing routing in the target SDWAN link includes:

子步骤S2121,在所述目标SDWAN链路中,路由双向重发布时引入路由标识,所述路由标识携带路由标签值;Sub-step S2121, in the target SDWAN link, a route identifier is introduced when the route is bidirectionally redistributed, and the route identifier carries a route label value;

在实际应用中,从云端学到的路由会打上tag(标签)标记,再次发布进BGP时,禁止学习和发布带该tag值的路由,因此,路由策略可以包括边界标签值(tag值)。In actual applications, the routes learned from the cloud will be marked with a tag. When they are published into BGP again, learning and publishing routes with this tag value is prohibited. Therefore, the routing policy can include a boundary label value (tag value).

在目标SDWAN链路中,路由双向重发布时引入目标SDWAN链路每部分发送的路由标识,其中,还路由标识携带路由标签值,路由标签值与tag值的表示方式相同。In the target SDWAN link, the route identifier sent by each part of the target SDWAN link is introduced when the route is bidirectionally republished, wherein the route identifier also carries the route label value, and the route label value is expressed in the same way as the tag value.

子步骤S2122,依据所述路由标签值和所述边界标签值,引入所述路由标识对应的路由。Sub-step S2122: importing the route corresponding to the routing identifier according to the routing label value and the boundary label value.

根据路由标签值和边界标签值的关系,确定是否引入路由标识对应的路由。Whether to import the route corresponding to the route identifier is determined based on the relationship between the route label value and the boundary label value.

具体地,所述依据所述路由标签值和所述边界标签值,引入所述路由标识对应的路由的步骤包括:判断所述路由标签值和所述边界标签值是否相同;当所述路由标签值和所述边界标签值相同时,拒绝引入所述路由标识对应的路由;当所述路由标签值和所述边界标签值不相同时,引入所述路由标识对应的路由。Specifically, the step of introducing the route corresponding to the routing identifier based on the routing label value and the boundary label value includes: determining whether the routing label value and the boundary label value are the same; when the routing label value and the boundary label value are the same, refusing to introduce the route corresponding to the routing identifier; when the routing label value and the boundary label value are different, introducing the route corresponding to the routing identifier.

将路由标签值和边界标签值进行对比,确定两者是否具有相同的值。当路由标签值和边界标签值相同时,即接入该路由会形成环线,拒绝引入路由标识对应的路由;当路由标签值和边界标签值不相同时,即接入该路由不会形成环线,可以引入路由标识对应的路由。Compare the route label value and the boundary label value to determine whether they have the same value. If the route label value and the boundary label value are the same, accessing the route will form a loop, and the route corresponding to the route identifier is rejected; if the route label value and the boundary label value are different, accessing the route will not form a loop, and the route corresponding to the route identifier can be introduced.

具体可以参照图6,主用SDWAN设备对应SDWAN主链路的可以从BGP虚线标注部分学习到路由信息,也可以从实线标注的流程学习到云内的路由,此时引入路由策略:从BGP学习到的路由打上tag标记,再禁止带该tag值的路由重发布进BGP协议中。Specifically, please refer to Figure 6. The main SDWAN device corresponding to the SDWAN main link can learn the routing information from the BGP dotted line part, and can also learn the routing in the cloud from the solid line process. At this time, the routing policy is introduced: the routes learned from BGP are marked with tags, and the routes with this tag value are prohibited from being republished into the BGP protocol.

在本发明的一可选实施例中,所述方法还包括:In an optional embodiment of the present invention, the method further includes:

步骤S1,接收更新路由信息;Step S1, receiving updated routing information;

当有与SDWAN主链路和SDWAN备链路连接的用户侧设备新增或删除时,会生成更新路由信息,此时可以接收该更新路由信息。When user-side devices connected to the SDWAN primary link and SDWAN backup link are added or deleted, updated routing information will be generated, and the updated routing information can be received at this time.

步骤S2,依据所述更新路由信息更新所述主链路OSPF邻居和所述备链路OSPF邻居。Step S2: updating the primary link OSPF neighbor and the backup link OSPF neighbor according to the updated routing information.

SDWAN主链路中的第一OSPF和SDWAN备链路中的第二OSPF,可以根据更新路由信息中的内容,对建立连接的用户侧设备进行新增或者删除,以更新主链路OSPF邻居和备链路OSPF邻居。The first OSPF in the SDWAN main link and the second OSPF in the SDWAN backup link can add or delete user-side devices that establish connections based on the content in the updated routing information to update the main link OSPF neighbors and the backup link OSPF neighbors.

此外,上行链路可以基于LTE进行数据转发,可以参照图7,上述软件架构的VPP中的LAN(Local Area Network)口数据收包;报文送到报文内网关bvi的LOOP0口,LOOP0口入口的报文查找路由根据目的IP时对端子网指向ipsec口;ipsec封装后添加新IP头,继续查找路由;查找路由、走默认路由经LOOP0方往tap0;内核tap0收包后查找路由走默认路由发往ppp0.最终从LTE发送出去。内核下需要关闭回程路由检查,来保证回程数据能正常通过内核发往VPP。In addition, the uplink can forward data based on LTE. For example, refer to Figure 7. The LAN (Local Area Network) port in the VPP of the above software architecture receives data packets; the message is sent to the LOOP0 port of the gateway bvi in the message. The message at the entrance of the LOOP0 port searches for a route and points the destination IP to the opposite subnet at the ipsec port; after ipsec encapsulation, a new IP header is added and the route search continues; the route is searched and the default route is taken through LOOP0 to tap0; after receiving the packet, the kernel tap0 searches for a route and takes the default route to ppp0. Finally, it is sent out from LTE. The kernel needs to turn off the return route check to ensure that the return data can be sent to the VPP normally through the kernel.

为了可以清楚切换SDWAN主备链路的过程,举例进行说明:In order to make the process of switching the SDWAN primary and backup links clear, an example is given to illustrate:

链路正常情况可以参照图5。For normal link conditions, please refer to Figure 5.

上行链路:客户侧会从主备SDWAN设备(SDWAN主链路)上学习到云内或者互联盒子的路由,由于主用metric值较小,所以客户侧会优先选用主用SDWAN设备。Uplink: The client side will learn the routes in the cloud or the Internet box from the primary and backup SDWAN devices (SDWAN primary link). Since the primary metric value is smaller, the client side will give priority to the primary SDWAN device.

下行链路:POP侧也会因为BGP发布时的metric值选择主用SDWAN设备。Downlink: The POP side will also select the primary SDWAN device based on the metric value published by BGP.

(2)当主用设备LAN侧链路故障时,如图8所示,(2) When the LAN link of the primary device fails, as shown in Figure 8,

上行链路:如果是LAN链路状态宕机,客户端会立马感知到LAN侧断开,如果是网络不通,客户端会在OSPF的dead time(死亡时间)超时感知到lan侧业务断开,此时会优选备用SDWAN设备(SDWAN备链路)。Uplink: If the LAN link status is down, the client will immediately sense the LAN side disconnection. If the network is unavailable, the client will sense the LAN side service disconnection when the OSPF dead time times out. At this time, the backup SDWAN device (SDWAN backup link) will be preferred.

下行链路:主用SDWAN设备同样会在LAN链路状态宕机时立即感知,如果是网络不通,则在OSPF的dead time超时感知到LAN侧业务断开,然后将路由信息同步到BGP中发布给POP。POP感知后同样切换到备用SDWAN设备。Downlink: The active SDWAN device will also immediately sense when the LAN link status is down. If the network is unavailable, it will sense that the LAN service is disconnected when the OSPF dead time times out, and then synchronize the routing information to BGP and publish it to the POP. After the POP senses it, it will also switch to the standby SDWAN device.

当主用设备LTE链路故障时:When the LTE link of the active device fails:

上行链路:主用SDWAN设备会在BGP的timeout(超时)时间内感知到LTE链路故障,通过OSPF发布进客户侧,客户端感知后选择备用SDWAN盒子。Uplink: The primary SDWAN device will sense the LTE link failure within the BGP timeout period and publish it to the client side through OSPF. After sensing, the client selects the backup SDWAN box.

下行链路:POP会在BGP的timeout时间内感知LTE链路故障、此时POP会选择备用SDWAN盒子。Downlink: POP will sense LTE link failure within the BGP timeout period, and then POP will select a backup SDWAN box.

当业务跑在备用链路上时,主用链路完全恢复时,数据业务会切回主用链路。When the service is running on the backup link, when the primary link is fully restored, the data service will be switched back to the primary link.

本发明实施例相比传统的VRRP实现主备以及单独的OSPF的路由协议或BGP路由协议实现主备链路的方案相比,本发明实施例应用了BGP协议保证传统接入POP方式不变的情况,又能支持LAN侧OSPF路由的发布。通过引入路由策略实现双向路由重发布方案具有兼容性较高、与其他FRR软件架构的设备都可兼容。Compared with the traditional VRRP to realize the master-slave and the separate OSPF routing protocol or BGP routing protocol to realize the master-slave link, the embodiment of the present invention uses the BGP protocol to ensure that the traditional access POP mode remains unchanged, and can support the release of OSPF routes on the LAN side. The bidirectional route redistribution solution is highly compatible by introducing routing policies and is compatible with devices with other FRR software architectures.

需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

参照图9,示出了本发明的一种基于SDWAN主备链路的数据传输装置实施例的结构框图,SDWAN主链路包括第一开放式最短路径优先协议OSPF和第一边界网关协议BGP,SDWAN备链路包括第二OSPF和第二BGP。所述基于SDWAN主备链路的数据传输装置具体可以包括如下模块:9, a structural block diagram of an embodiment of a data transmission device based on the SDWAN primary and backup links of the present invention is shown, wherein the SDWAN primary link includes a first open shortest path first protocol OSPF and a first border gateway protocol BGP, and the SDWAN backup link includes a second OSPF and a second BGP. The data transmission device based on the SDWAN primary and backup links may specifically include the following modules:

第一获取模块901,用于在所述第一OSPF和所述第一BGP进行路由双向重发布时,获取所述SDWAN主链路的第一度量值;The first acquisition module 901 is used to obtain the first metric value of the SDWAN primary link when the first OSPF and the first BGP perform bidirectional route redistribution;

第二获取模块902,用于在所述第二OSPF和所述第二BGP进行路由双向重发布时,获取所述SDWAN备链路的第二度量值;The second acquisition module 902 is used to obtain the second metric value of the SDWAN backup link when the second OSPF and the second BGP perform bidirectional re-publishing of routes;

对比模块903,用于对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;A comparison module 903 is used to compare the first metric value and the second metric value, and determine a target SDWAN link from the SDWAN primary link and the SDWAN backup link;

传输模块904,用于采用所述目标SDWAN链路进行数据传输。The transmission module 904 is used to use the target SDWAN link to transmit data.

在本发明的一可选实施例中,所述SDWAN主链路还包括主链路内核,所述SDWAN备链路还包括备链路内核;所述装置还包括:In an optional embodiment of the present invention, the SDWAN main link further includes a main link kernel, and the SDWAN backup link further includes a backup link kernel; the device further includes:

第一建立模块,用于将所述第一OSPF映射到所述主链路内核,建立主链路OSPF邻居;A first establishing module, used for mapping the first OSPF to the primary link kernel to establish a primary link OSPF neighbor;

第二建立模块,用于将所述第二OSPF映射到所述备链路内核,建立备链路OSPF邻居。The second establishing module is used to map the second OSPF to the backup link kernel and establish a backup link OSPF neighbor.

在本发明的一可选实施例中,所述装置还包括:In an optional embodiment of the present invention, the device further comprises:

第三建立模块,用于基于所述第一BGP,建立主链路BGP邻居;A third establishing module, used to establish a primary link BGP neighbor based on the first BGP;

第四建立模块,用于基于所述第二BGP,建立备链路BGP邻居。The fourth establishing module is used to establish a backup link BGP neighbor based on the second BGP.

在本发明的一可选实施例中,所述装置还包括:In an optional embodiment of the present invention, the device further comprises:

第一控制模块,用于控制所述主链路BGP邻居向所述主链路OSPF邻居发布路由,和控制所述主链路OSPF邻居向所述主链路BGP邻居发布路由,以使所述第一OSPF和所述第一BGP进行路由双向重发布;A first control module, used for controlling the main link BGP neighbor to publish routes to the main link OSPF neighbor, and controlling the main link OSPF neighbor to publish routes to the main link BGP neighbor, so that the first OSPF and the first BGP perform bidirectional re-publishing of routes;

第二控制模块,用于控制所述备链路BGP邻居向所述备链路OSPF邻居发布路由,和控制所述备链路OSPF邻居向所述备链路BGP邻居发布路由,以使所述第二OSPF和所述第二BGP进行路由双向重发布。The second control module is used to control the backup link BGP neighbor to publish routes to the backup link OSPF neighbor, and control the backup link OSPF neighbor to publish routes to the backup link BGP neighbor, so that the second OSPF and the second BGP perform bidirectional re-publishing of routes.

在本发明的一可选实施例中,所述装置还包括:In an optional embodiment of the present invention, the device further comprises:

接收模块,用于接收更新路由信息;A receiving module, used for receiving updated routing information;

更新模块,用于依据所述更新路由信息更新所述主链路OSPF邻居和所述备链路OSPF邻居。An updating module is used to update the primary link OSPF neighbor and the backup link OSPF neighbor according to the updated routing information.

在本发明的一可选实施例中,所述装置还包括:In an optional embodiment of the present invention, the device further comprises:

第三获取模块,用于获取路由策略;The third acquisition module is used to acquire the routing strategy;

执行模块,用于在所述目标SDWAN链路中执行所述路由策略。An execution module is used to execute the routing policy in the target SDWAN link.

在本发明的一可选实施例中,所述路由策略包括边界标签值,所述执行模块包括:In an optional embodiment of the present invention, the routing strategy includes a boundary label value, and the execution module includes:

读取子模块,用于在所述目标SDWAN链路中,读取路由标识,所述路由标识携带路由标签值;A reading submodule, configured to read a routing identifier in the target SDWAN link, wherein the routing identifier carries a routing label value;

接入子模块,用于依据所述路由标签值和所述边界标签值,引入所述路由标识对应的路由。The access submodule is used to introduce the route corresponding to the routing identifier according to the routing label value and the boundary label value.

在本发明的一可选实施例中,所述接入子模块包括:In an optional embodiment of the present invention, the access submodule includes:

第一判断单元,用于判断所述路由标签值和所述边界标签值是否相同;A first judging unit, configured to judge whether the routing label value and the boundary label value are the same;

拒绝单元,用于当所述路由标签值和所述边界标签值相同时,拒接所述路由标识对应的路由;a rejecting unit, configured to reject the route corresponding to the routing identifier when the routing label value is the same as the boundary label value;

接入单元,用于当所述路由标签值和所述边界标签值不相同时,引入所述路由标识对应的路由。The access unit is used to introduce the route corresponding to the routing identifier when the routing label value and the boundary label value are different.

在本发明的一可选实施例中,所述第一度量值包括第一上行度量值和第一下行度量值,所述第二度量值包括第二上行度量值和第二下行度量值;所述对比模块903包括:In an optional embodiment of the present invention, the first metric value includes a first uplink metric value and a first downlink metric value, and the second metric value includes a second uplink metric value and a second downlink metric value; and the comparison module 903 includes:

第一对比子模块,用于对比所述第一上行度量值和所述第二上行度量值,确定目标上行度量值;A first comparison submodule, configured to compare the first uplink metric value with the second uplink metric value to determine a target uplink metric value;

第二对比子模块,用于对比所述第一下行度量值和所述第二下行度量值,确定目标下行度量值;A second comparison submodule, configured to compare the first downlink metric value with the second downlink metric value to determine a target downlink metric value;

上行链路确定子模块,用于确定所述目标上行度量值对应的SDWAN上行链路为目标SDWAN链路的上行链路;其中,所述目标上行度量值对应的SDWAN上行链路为所述SDWAN主链路的上行链路或所述SDWAN备链路的上行链路;An uplink determination submodule, used to determine that the SDWAN uplink corresponding to the target uplink metric value is the uplink of the target SDWAN link; wherein the SDWAN uplink corresponding to the target uplink metric value is the uplink of the SDWAN primary link or the uplink of the SDWAN backup link;

下行链路确定子模块,用于确定所述目标下行度量值对应的SDWAN下行链路为目标SDWAN链路的下行链路;其中,所述目标下行度量值对应的SDWAN下行链路为所述SDWAN主链路的下行链路或所述SDWAN备链路的下行链路。The downlink determination submodule is used to determine that the SDWAN downlink corresponding to the target downlink metric value is the downlink of the target SDWAN link; wherein, the SDWAN downlink corresponding to the target downlink metric value is the downlink of the SDWAN main link or the downlink of the SDWAN backup link.

在本发明的一可选实施例中,所述第一对比子模块包括:In an optional embodiment of the present invention, the first comparison submodule includes:

第二判断单元,用于判断所述第一上行度量值和所述第二上行度量值的大小关系;A second judging unit, configured to judge a magnitude relationship between the first uplink metric value and the second uplink metric value;

第一上行度量值确定单元,用于当所述第一上行度量值小于所述第二上行度量值时,确定所述第一上行度量值为所述目标上行度量值;A first uplink metric value determining unit, configured to determine that the first uplink metric value is the target uplink metric value when the first uplink metric value is less than the second uplink metric value;

第二上行度量值确定单元,用于当所述第二上行度量值小于所述第一上行度量值时,确定所述第二度量值为所述目标上行度量值。A second uplink metric value determining unit is configured to determine the second uplink metric value as the target uplink metric value when the second uplink metric value is smaller than the first uplink metric value.

在本发明的一可选实施例中,所述第二对比子模块包括:In an optional embodiment of the present invention, the second comparison submodule includes:

第三判断单元,用于判断所述第一下行度量值和所述第二下行度量值的大小关系;A third judgment unit, used to judge the magnitude relationship between the first downlink metric value and the second downlink metric value;

第一下行度量值确定单元,用于当所述第一下行度量值小于所述第二下行度量值时,确定所述第一下行度量值为所述目标下行度量值;A first downlink metric value determining unit, configured to determine that the first downlink metric value is the target downlink metric value when the first downlink metric value is less than the second downlink metric value;

第二下行度量值确定单元,用于当所述第二下行度量值小于所述第一下行度量值时,确定所述第二度量值为所述目标下行度量值。The second downlink metric value determining unit is configured to determine the second downlink metric value as the target downlink metric value when the second downlink metric value is smaller than the first downlink metric value.

在本发明的一可选实施例中,所述传输模块904包括:In an optional embodiment of the present invention, the transmission module 904 includes:

上行传输子模块,用于采用所述目标SDWAN链路的下行链路与预设用户侧设备进行数据传输;An uplink transmission submodule, used to use the downlink of the target SDWAN link to transmit data with a preset user-side device;

下行传输子模块,用于采用所述目标SDWAN链路的上行链路与预设云侧设备进行数据传输。The downlink transmission submodule is used to use the uplink of the target SDWAN link to transmit data with the preset cloud-side device.

对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

本发明实施例还提供了一种电子设备,包括:An embodiment of the present invention further provides an electronic device, including:

处理器和存储介质,所述存储介质存储有所述处理器可执行的计算机程序,当电子设备运行时,所述处理器执行所述计算机程序,以执行如本发明实施例任一项所述的方法。具体实现方式和技术效果与方法实施例部分类似,这里不再赘述。A processor and a storage medium, wherein the storage medium stores a computer program executable by the processor, and when the electronic device is running, the processor executes the computer program to perform the method as described in any one of the embodiments of the present invention. The specific implementation method and technical effect are similar to those of the method embodiment, and will not be repeated here.

存储介质可以包括随机存取存储器(Random Access Memory,简称RAM),也可以包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。可选的,存储介质还可以是至少一个位于远离前述处理器的存储装置。The storage medium may include a random access memory (RAM) or a non-volatile memory, such as at least one disk storage. Optionally, the storage medium may also be at least one storage device located away from the aforementioned processor.

上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application SpecificIntegrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

本发明实施例还提供了一种计算机可读存储介质,所述存储介质上存储有计算机程序,所述计算机程序被处理器运行时执行如本发明实施例任一项所述的方法。具体实现方式和技术效果与方法实施例部分类似,这里不再赘述。The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to execute the method as described in any one of the embodiments of the present invention. The specific implementation method and technical effect are similar to those of the method embodiment, and will not be repeated here.

本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

本领域内的技术人员应明白,本发明实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

本发明实施例是参照根据本发明实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The embodiments of the present invention are described with reference to the flowcharts and/or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the processes and/or boxes in the flowchart and/or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate a device for implementing the functions specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

以上对本发明所提供的一种基于SDWAN主备链路的数据传输方法、装置、电子设备和存储介质,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The above is a detailed introduction to a data transmission method, device, electronic device and storage medium based on the SDWAN primary and backup links provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims (15)

1.一种基于SDWAN主备链路的数据传输方法,其特征在于,SDWAN主链路包括第一开放式最短路径优先协议OSPF和第一边界网关协议BGP,SDWAN备链路包括第二OSPF和第二BGP,所述方法包括:1. A data transmission method based on SDWAN primary and backup links, characterized in that the SDWAN primary link includes a first open shortest path first protocol OSPF and a first border gateway protocol BGP, and the SDWAN backup link includes a second OSPF and a second BGP, and the method includes: 在所述第一OSPF和所述第一BGP进行路由双向重发布时,获取所述SDWAN主链路的第一度量值;When the first OSPF and the first BGP perform bidirectional republishing of routes, obtaining a first metric value of the SDWAN primary link; 在所述第二OSPF和所述第二BGP进行路由双向重发布时,获取所述SDWAN备链路的第二度量值;When the second OSPF and the second BGP perform bidirectional republishing of routes, obtaining a second metric value of the SDWAN backup link; 对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;Comparing the first metric value with the second metric value, determining a target SDWAN link from the SDWAN primary link and the SDWAN backup link; 采用所述目标SDWAN链路进行数据传输。The target SDWAN link is used for data transmission. 2.根据权利要求1所述的方法,其特征在于,所述SDWAN主链路还包括主链路内核,所述SDWAN备链路还包括备链路内核;所述方法还包括:2. The method according to claim 1, characterized in that the SDWAN main link further includes a main link kernel, and the SDWAN backup link further includes a backup link kernel; the method further includes: 将所述第一OSPF映射到所述主链路内核,建立主链路OSPF邻居;Mapping the first OSPF to the primary link kernel to establish a primary link OSPF neighbor; 将所述第二OSPF映射到所述备链路内核,建立备链路OSPF邻居。The second OSPF is mapped to the backup link kernel to establish a backup link OSPF neighbor. 3.根据权利要求2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 2, characterized in that the method further comprises: 基于所述第一BGP,建立主链路BGP邻居;Based on the first BGP, establish a primary link BGP neighbor; 基于所述第二BGP,建立备链路BGP邻居。Based on the second BGP, a backup link BGP neighbor is established. 4.根据权利要求3所述的方法,其特征在于,所述方法还包括:4. The method according to claim 3, characterized in that the method further comprises: 控制所述主链路BGP邻居向所述主链路OSPF邻居发布路由,和控制所述主链路OSPF邻居向所述主链路BGP邻居发布路由,以使所述第一OSPF和所述第一BGP进行路由双向重发布;Control the main link BGP neighbor to publish routes to the main link OSPF neighbor, and control the main link OSPF neighbor to publish routes to the main link BGP neighbor, so that the first OSPF and the first BGP perform bidirectional re-publishing of routes; 控制所述备链路BGP邻居向所述备链路OSPF邻居发布路由,和控制所述备链路OSPF邻居向所述备链路BGP邻居发布路由,以使所述第二OSPF和所述第二BGP进行路由双向重发布。The backup link BGP neighbor is controlled to publish routes to the backup link OSPF neighbor, and the backup link OSPF neighbor is controlled to publish routes to the backup link BGP neighbor, so that the second OSPF and the second BGP perform bidirectional republishing of routes. 5.根据权利要求2所述的方法,其特征在于,所述方法还包括:5. The method according to claim 2, characterized in that the method further comprises: 接收更新路由信息;Receive updated routing information; 依据所述更新路由信息更新所述主链路OSPF邻居和所述备链路OSPF邻居。The primary link OSPF neighbor and the backup link OSPF neighbor are updated according to the updated routing information. 6.根据权利要求1所述的方法,其特征在于,所述方法还包括:6. The method according to claim 1, characterized in that the method further comprises: 在所述目标SDWAN链路中,路由双向重发布时引入预设路由策略。In the target SDWAN link, a preset routing strategy is introduced when the routes are bidirectionally redistributed. 7.根据权利要求6所述的方法,其特征在于,所述路由策略包括边界标签值,所述在所述目标SDWAN链路中,路由双向重发布时引入预设路由策略的步骤包括:7. The method according to claim 6, characterized in that the routing policy includes a boundary label value, and the step of introducing a preset routing policy when bidirectionally redistributing the routing in the target SDWAN link comprises: 在所述目标SDWAN链路中,路由双向重发布时引入路由标识,所述路由标识携带路由标签值;In the target SDWAN link, a route identifier is introduced when the route is bidirectionally redistributed, and the route identifier carries a route label value; 依据所述路由标签值和所述边界标签值,引入所述路由标识对应的路由。The route corresponding to the routing identifier is introduced according to the routing label value and the boundary label value. 8.根据权利要求7所述的方法,其特征在于,所述依据所述路由标签值和所述边界标签值,引入所述路由标识对应的路由的步骤包括:8. The method according to claim 7, wherein the step of introducing the route corresponding to the routing identifier according to the routing label value and the boundary label value comprises: 判断所述路由标签值和所述边界标签值是否相同;Determining whether the routing label value and the boundary label value are the same; 当所述路由标签值和所述边界标签值相同时,拒绝引入所述路由标识对应的路由;When the routing label value is the same as the boundary label value, refusing to import the route corresponding to the routing identifier; 当所述路由标签值和所述边界标签值不相同时,引入所述路由标识对应的路由。When the routing label value and the boundary label value are different, the route corresponding to the routing identifier is introduced. 9.根据权利要求1所述的方法,其特征在于,所述第一度量值包括第一上行度量值和第一下行度量值,所述第二度量值包括第二上行度量值和第二下行度量值;所述对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路的步骤包括:9. The method according to claim 1, characterized in that the first metric value includes a first uplink metric value and a first downlink metric value, and the second metric value includes a second uplink metric value and a second downlink metric value; the step of comparing the first metric value and the second metric value and determining the target SDWAN link from the SDWAN primary link and the SDWAN backup link comprises: 对比所述第一上行度量值和所述第二上行度量值,确定目标上行度量值;Comparing the first uplink metric value with the second uplink metric value to determine a target uplink metric value; 对比所述第一下行度量值和所述第二下行度量值,确定目标下行度量值;Comparing the first downlink metric value with the second downlink metric value to determine a target downlink metric value; 确定所述目标上行度量值对应的SDWAN上行链路为目标SDWAN链路的上行链路;其中,所述目标上行度量值对应的SDWAN上行链路为所述SDWAN主链路的上行链路或所述SDWAN备链路的上行链路;Determine that the SDWAN uplink corresponding to the target uplink metric value is the uplink of the target SDWAN link; wherein the SDWAN uplink corresponding to the target uplink metric value is the uplink of the SDWAN primary link or the uplink of the SDWAN backup link; 确定所述目标下行度量值对应的SDWAN下行链路为目标SDWAN链路的下行链路;其中,所述目标下行度量值对应的SDWAN下行链路为所述SDWAN主链路的下行链路或所述SDWAN备链路的下行链路。Determine that the SDWAN downlink corresponding to the target downlink metric value is the downlink of the target SDWAN link; wherein, the SDWAN downlink corresponding to the target downlink metric value is the downlink of the SDWAN main link or the downlink of the SDWAN backup link. 10.根据权利要求9所述的方法,其特征在于,所述对比所述第一上行度量值和所述第二上行度量值,确定目标上行度量值的步骤包括:10. The method according to claim 9, wherein the step of comparing the first uplink metric value with the second uplink metric value to determine a target uplink metric value comprises: 判断所述第一上行度量值和所述第二上行度量值的大小关系;Determine a magnitude relationship between the first uplink metric value and the second uplink metric value; 当所述第一上行度量值小于所述第二上行度量值时,确定所述第一上行度量值为所述目标上行度量值;When the first uplink metric value is less than the second uplink metric value, determining the first uplink metric value to be the target uplink metric value; 当所述第二上行度量值小于所述第一上行度量值时,确定所述第二度量值为所述目标上行度量值。When the second uplink metric value is less than the first uplink metric value, the second metric value is determined to be the target uplink metric value. 11.根据权利要求9所述的方法,其特征在于,所述对比所述第一下行度量值和所述第二下行度量值,确定目标下行度量值的步骤包括:11. The method according to claim 9, wherein the step of comparing the first downlink metric value with the second downlink metric value to determine a target downlink metric value comprises: 判断所述第一下行度量值和所述第二下行度量值的大小关系;Determine a magnitude relationship between the first downlink metric value and the second downlink metric value; 当所述第一下行度量值小于所述第二下行度量值时,确定所述第一下行度量值为所述目标下行度量值;When the first downlink metric value is less than the second downlink metric value, determining the first downlink metric value to be the target downlink metric value; 当所述第二下行度量值小于所述第一下行度量值时,确定所述第二度量值为所述目标下行度量值。When the second downlink metric value is less than the first downlink metric value, the second metric value is determined to be the target downlink metric value. 12.根据权利要求9所述的方法,其特征在于,所述采用所述目标SDWAN链路进行数据传输的步骤包括:12. The method according to claim 9, wherein the step of using the target SDWAN link for data transmission comprises: 采用所述目标SDWAN链路的下行链路与预设用户侧设备进行数据传输;Using the downlink of the target SDWAN link to perform data transmission with a preset user-side device; 采用所述目标SDWAN链路的上行链路与预设云侧设备进行数据传输。The uplink of the target SDWAN link is used to transmit data with the preset cloud-side device. 13.一种基于SDWAN主备链路的数据传输装置,其特征在于,SDWAN主链路包括第一开放式最短路径优先协议OSPF和第一边界网关协议BGP,SDWAN备链路包括第二OSPF和第二BGP,所述装置包括:13. A data transmission device based on SDWAN primary and backup links, characterized in that the SDWAN primary link includes a first open shortest path first protocol OSPF and a first border gateway protocol BGP, and the SDWAN backup link includes a second OSPF and a second BGP, and the device includes: 第一获取模块,用于在所述第一OSPF和所述第一BGP进行路由双向重发布时,获取所述SDWAN主链路的第一度量值;A first acquisition module, used for acquiring a first metric value of the SDWAN primary link when the first OSPF and the first BGP perform bidirectional republishing of routes; 第二获取模块,用于在所述第二OSPF和所述第二BGP进行路由双向重发布时,获取所述SDWAN备链路的第二度量值;A second acquisition module is used to obtain a second metric value of the SDWAN backup link when the second OSPF and the second BGP perform bidirectional republishing of routes; 对比模块,用于对比所述第一度量值和所述第二度量值,从所述SDWAN主链路和所述SDWAN备链路中,确定出目标SDWAN链路;A comparison module, configured to compare the first metric value and the second metric value, and determine a target SDWAN link from the SDWAN primary link and the SDWAN backup link; 传输模块,用于采用所述目标SDWAN链路进行数据传输。A transmission module is used to use the target SDWAN link to transmit data. 14.一种电子设备,其特征在于,包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至12中任一项所述的基于SDWAN主备链路的数据传输方法的步骤。14. An electronic device, characterized in that it comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the data transmission method based on the SDWAN primary and backup links are implemented as described in any one of claims 1 to 12. 15.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如权利要求1至12中任一项所述的基于SDWAN主备链路的数据传输方法的步骤。15. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the data transmission method based on the SDWAN primary and backup links as described in any one of claims 1 to 12 are implemented.
CN202211727250.6A 2022-12-30 2022-12-30 Data transmission method and device based on SDWAN active/standby links, electronic equipment and storage medium Active CN116319536B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211727250.6A CN116319536B (en) 2022-12-30 2022-12-30 Data transmission method and device based on SDWAN active/standby links, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211727250.6A CN116319536B (en) 2022-12-30 2022-12-30 Data transmission method and device based on SDWAN active/standby links, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116319536A CN116319536A (en) 2023-06-23
CN116319536B true CN116319536B (en) 2024-07-30

Family

ID=86776867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211727250.6A Active CN116319536B (en) 2022-12-30 2022-12-30 Data transmission method and device based on SDWAN active/standby links, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116319536B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119583424A (en) * 2024-12-03 2025-03-07 天翼云科技有限公司 Method, device, computer equipment and storage medium for subnet access to public network

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102082782A (en) * 2009-11-30 2011-06-01 中国移动通信集团河南有限公司 Method and relevant equipment for introducing external route to OSPF (Open Shortest Path First Interior Gateway Protocol) network
CN115499363A (en) * 2022-11-18 2022-12-20 南京易科腾信息技术有限公司 Route updating method, system, storage medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8265058B2 (en) * 2004-02-05 2012-09-11 Ericsson Ab Method and an apparatus for route selection in routing protocols

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102082782A (en) * 2009-11-30 2011-06-01 中国移动通信集团河南有限公司 Method and relevant equipment for introducing external route to OSPF (Open Shortest Path First Interior Gateway Protocol) network
CN115499363A (en) * 2022-11-18 2022-12-20 南京易科腾信息技术有限公司 Route updating method, system, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN116319536A (en) 2023-06-23

Similar Documents

Publication Publication Date Title
US12445324B2 (en) Single node and multiple node datastore architecture in a network routing environment
US11876717B2 (en) Flow-based load balancing
US9736263B2 (en) Temporal caching for ICN
US8432791B1 (en) Network route injections
US11121963B2 (en) Best path computation offload in a network computing environment
CN113489640B (en) Message forwarding method, device and gateway system
CN116319536B (en) Data transmission method and device based on SDWAN active/standby links, electronic equipment and storage medium
JP6307031B2 (en) Route reflector and route control method of route reflector
US12261919B2 (en) Service insertion in a computer network using dynamic service path selection
JP7680547B2 (en) Optimal Path Computation Offloading in Network Computing Environments
TW202232920A (en) Best path computation offload in a network computing environment and non-transitory computer readable storage media
Liao Diversifying The Internet

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
CB02 Change of applicant information

Address after: 100007 room 205-32, floor 2, building 2, No. 1 and No. 3, qinglonghutong a, Dongcheng District, Beijing

Applicant after: Tianyiyun Technology Co.,Ltd.

Address before: 100093 Floor 4, Block E, Xishan Yingfu Business Center, Haidian District, Beijing

Applicant before: Tianyiyun Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant