[go: up one dir, main page]

CN115632986A - Path load balancing method and system - Google Patents

Path load balancing method and system Download PDF

Info

Publication number
CN115632986A
CN115632986A CN202211079482.5A CN202211079482A CN115632986A CN 115632986 A CN115632986 A CN 115632986A CN 202211079482 A CN202211079482 A CN 202211079482A CN 115632986 A CN115632986 A CN 115632986A
Authority
CN
China
Prior art keywords
path
transmitted
data packet
preselected
packet
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
CN202211079482.5A
Other languages
Chinese (zh)
Other versions
CN115632986B (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.)
Peng Cheng Laboratory
Original Assignee
Peng Cheng Laboratory
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 Peng Cheng Laboratory filed Critical Peng Cheng Laboratory
Priority to CN202211079482.5A priority Critical patent/CN115632986B/en
Publication of CN115632986A publication Critical patent/CN115632986A/en
Application granted granted Critical
Publication of CN115632986B publication Critical patent/CN115632986B/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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • 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/12Shortest path evaluation
    • H04L45/125Shortest path evaluation based on throughput or bandwidth
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath

Landscapes

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

Abstract

The invention relates to the technical field of data flow, in particular to a path load balancing method and a path load balancing system. The method comprises the steps of firstly calculating the residual bandwidth of each preselected path, and then selecting a target path from each preselected path according to the size of the residual bandwidth. When the newly arrived current data packet to be transmitted is different from the data packet transmitted at the last moment, the current data packet to be transmitted is transmitted on a new target path instead of transmitting the current data packet to be transmitted by using a historical path. The invention selects one path to transmit the new current data packet to be transmitted according to the residual bandwidth of each path, thereby realizing the load balance of each path. In addition, the invention does not reselect the transmission path for each data packet, but only selects a new target path for the current data packet to be transmitted, which is different from the transmitted data packet, so as to prevent the data packet received by the receiving end from being out of sequence easily caused by putting the same data packet on different paths for transmission.

Description

一种路径负载均衡方法和系统A method and system for path load balancing

技术领域technical field

本发明涉及数据流技术领域,具体是涉及一种路径负载均衡方法和系统。The invention relates to the technical field of data flow, in particular to a path load balancing method and system.

背景技术Background technique

在多路径传输的条件下,网络不对称的情况十分常见(路径即链路,用于传输数据流,网络不对称即产生数据流的网络在不同的时间段产生的数据流不一样),例如:异构网络,中间网络设备失效或者链路故障等。此外由于网络上业务的多样性造成不同的流具有不同的流量特征,比如应用流量的到达时间、流量分布、流量大小和持续时间等,这些不同特征的流对于网络的需求也不同。给数据流分配的路径如何适应具有多种不同特征流量混合的复杂网络环境是一个极其重要的挑战,不恰当负载均衡(负载均衡即让每个路径负载的数据流大小达到均衡)策略,会导致部分链路空闲而剩余链路拥塞甚至丢包,或者引起单个流的报文在汇聚点乱序增加处理时延,此外还需具有感知链路是否失效的能力,以便及时将原本调度到失效链路的流量调度给可用链路。Under the condition of multi-path transmission, the situation of network asymmetry is very common (the path is the link, which is used to transmit the data flow, and the network asymmetry means that the data flow generated by the network that generates the data flow is different in different time periods), for example : Heterogeneous network, failure of intermediate network equipment or link failure, etc. In addition, due to the diversity of services on the network, different flows have different traffic characteristics, such as the arrival time of application traffic, traffic distribution, traffic size, and duration. These flows with different characteristics have different requirements on the network. How to adapt the paths allocated to data flows to a complex network environment with a variety of different traffic characteristics is an extremely important challenge. Improper load balancing (load balancing means to balance the size of data flows loaded by each path) strategy will lead to Some links are idle and the rest of the links are congested or even packet loss, or the packets of a single flow are out of order at the rendezvous point to increase the processing delay. In addition, it is necessary to have the ability to sense whether the link is invalid, so as to timely schedule the original link to the failed link Route traffic is scheduled to available links.

综上所述,现有的路径负载均衡易造成路径拥堵。To sum up, the existing path load balancing is easy to cause path congestion.

因此,现有技术还有待改进和提高。Therefore, the prior art still needs to be improved and improved.

发明内容Contents of the invention

为解决上述技术问题,本发明提供了一种路径负载均衡方法和系统,解决了现有的路径负载均衡易造成路径拥堵的问题。In order to solve the above technical problems, the present invention provides a path load balancing method and system, which solves the problem that the existing path load balancing easily causes path congestion.

为实现上述目的,本发明采用了以下技术方案:To achieve the above object, the present invention adopts the following technical solutions:

第一方面,本发明提供一种路径负载均衡方法,其中,包括:In a first aspect, the present invention provides a path load balancing method, which includes:

计算各个预选路径的剩余带宽;Calculating the remaining bandwidth of each preselected path;

依据各个所述预选路径的剩余带宽,从各个所述预选路径筛选出目标路径;Screening out a target path from each of the pre-selected paths according to the remaining bandwidth of each of the pre-selected paths;

将差异信息满足设定条件的当前待传输数据包所对应的路径由历史路径切换至所述目标路径,所述差异信息用于表征所述当前待传输数据包与已传输数据包之间的差异,所述历史路径为所述已传输数据包的路径。switch the path corresponding to the current data packet to be transmitted whose difference information satisfies the set condition from the historical path to the target path, the difference information is used to characterize the difference between the current data packet to be transmitted and the transmitted data packet , the historical path is the path of the transmitted data packet.

在一种实现方式中,各个所述预选路径的筛选方式包括:In an implementation manner, the screening manner of each of the preselected paths includes:

向各个待选路径发送若干探测数据包;Send several probe data packets to each candidate path;

计算各个所述待选路径将接收的若干所述探测数据包转送至同一目标终端所使用的探测时长和/或所对应的丢包率;Calculating the detection duration and/or the corresponding packet loss rate used by each of the candidate paths to transfer the received detection data packets to the same target terminal;

依据各个所述待选路径所对应的所述探测时长和/或所述丢包率,从各个所述待选路径中筛选出各个所述预选路径。Each of the pre-selected paths is selected from each of the candidate paths according to the detection duration and/or the packet loss rate corresponding to each of the candidate paths.

在一种实现方式中,所述计算各个预选路径的剩余带宽,包括:In an implementation manner, the calculating the remaining bandwidth of each pre-selected path includes:

统计各个所述预选路径在测量周期内的已接收数据包的数量和已发送数据包的数量;Counting the number of received data packets and the number of sent data packets of each of the preselected paths within the measurement period;

依据各个所述预选路径的所述已接收数据包的数量和所述已发送数据包的数量以及所述测量周期,计算各个所述预选路径的剩余带宽。Calculate the remaining bandwidth of each of the pre-selected paths according to the number of received data packets and the number of sent data packets of each of the pre-selected paths and the measurement period.

在一种实现方式中,所述依据各个所述预选路径的所述已接收数据包的数量和所述已发送数据包的数量以及所述测量周期,计算各个所述预选路径的剩余带宽,包括:In an implementation manner, calculating the remaining bandwidth of each of the pre-selected paths according to the number of received data packets and the number of sent data packets of each of the pre-selected paths and the measurement period includes :

依据所述已接收数据包的数量和每个所述已接收数据包的比特值,得到各个所述预选路径的接收字节数;Obtaining the number of bytes received by each of the preselected paths according to the number of received data packets and the bit value of each received data packet;

依据所述已发送数据包的数量和每个所述已发送数据包的比特值,得到各个所述预选路径的发送字节数;Obtain the number of bytes sent for each of the preselected paths according to the number of sent data packets and the bit value of each sent data packet;

将所述接收字节数与所述发送字节数之和除以所述测量周期,得到中间结果;dividing the sum of the number of bytes received and the number of bytes sent by the measurement period to obtain an intermediate result;

将各个所述预选路径的原始带宽减去所述中间结果,得到各个所述预选路径的剩余带宽。The intermediate result is subtracted from the original bandwidth of each of the pre-selected paths to obtain the remaining bandwidth of each of the pre-selected paths.

在一种实现方式中,所述测量周期的计算方式包括:In an implementation manner, the calculation method of the measurement period includes:

计算数据包在各个所述待选路径上的各个往返时延;Calculate each round-trip delay of the data packet on each of the candidate paths;

依据各个所述往返时延和各个所述待选路径构成的路径总数,得到所述测量周期。The measurement period is obtained according to each of the round-trip delays and the total number of paths formed by each of the candidate paths.

在一种实现方式中,所述依据各个所述预选路径的剩余带宽,从各个所述预选路径筛选出目标路径,包括:In an implementation manner, the filtering out target paths from each of the pre-selected paths according to the remaining bandwidth of each of the pre-selected paths includes:

比较各个所述预选路径的剩余带宽,将最大剩余带宽所在的预选路径作为所述目标路径。The remaining bandwidth of each of the pre-selected paths is compared, and the pre-selected path with the largest remaining bandwidth is used as the target path.

在一种实现方式中,所述将差异信息满足设定条件的当前待传输数据包所对应的路径由历史路径切换至所述目标路径,所述差异信息用于表征所述当前待传输数据包与已传输数据包之间的差异,所述历史路径为所述已传输数据包的路径,包括:In an implementation manner, the path corresponding to the current data packet to be transmitted whose difference information satisfies the set condition is switched from the historical path to the target path, and the difference information is used to characterize the current data packet to be transmitted The difference between the transmitted data packet and the historical path is the path of the transmitted data packet, including:

计算所述差异信息中的所述当前待传输数据包所在的数据流与所述已传输数据包所在的数据流之间的流差异;calculating the flow difference between the data flow where the current data packet to be transmitted is located and the data flow where the transmitted data packet is located in the difference information;

当所述流差异满足所述设定条件中的两条相异数据流,将所述当前待传输数据的路径由历史路径切换值所述目标目标路径。When the flow difference satisfies the two different data flows in the set condition, switching the path of the current data to be transmitted from the historical path to the target path.

在一种实现方式中,所述计算所述差异信息中的所述当前待传输数据包所在的数据流与所述已传输数据包所在的数据流之间的流差异,包括:In an implementation manner, the calculating the flow difference between the data flow where the current data packet to be transmitted in the difference information is located and the data flow where the transmitted data packet is located includes:

计算所述当前待传输数据包的报文标识和所述已传输数据包的报文标识,所述报文标识用于表征数据流标签;Calculating the packet identifier of the currently to-be-transmitted data packet and the packet identifier of the transmitted data packet, where the packet identifier is used to represent a data flow label;

依据所述当前待传输数据包的报文标识和所述已传输数据包的报文标识,计算所述当前待传输数据包所在的数据流与所述已传输数据包所在的数据流之间的流差异。According to the message identifier of the current data packet to be transmitted and the message identifier of the transmitted data packet, calculate the difference between the data stream where the current data packet is to be transmitted and the data stream where the transmitted data packet is located flow difference.

在一种实现方式中,所述将差异信息满足设定条件的当前待传输数据包所对应的路径由历史路径切换至所述目标路径,所述差异信息用于表征所述当前待传输数据包与已传输数据包之间的差异,所述历史路径为所述已传输数据包的路径,包括:In an implementation manner, the path corresponding to the current data packet to be transmitted whose difference information satisfies the set condition is switched from the historical path to the target path, and the difference information is used to characterize the current data packet to be transmitted The difference between the transmitted data packet and the historical path is the path of the transmitted data packet, including:

当所述当前待传输数据包与所述已传输数据包属于同一个数据流,统计所述当前待传输数据包到达包处理器的时刻与所述已传输数据包到达包处理器的时刻之间的时间间隔;When the current data packet to be transmitted and the transmitted data packet belong to the same data stream, count the time between the time when the current data packet to be transmitted arrives at the packet processor and the time when the transmitted data packet arrives at the packet processor time interval;

当所述时间间隔大于所述设定条件中的时间阈值时,将所述当前待传输数据包的路径由历史路径切换至所述目标路径。When the time interval is greater than the time threshold in the set condition, switch the path of the currently to-be-transmitted data packet from the historical path to the target path.

第二方面,本发明实施例还提供一种路径均衡负载系统,其中,所述系统包括如下组成部分:In the second aspect, the embodiment of the present invention also provides a path balancing load system, wherein the system includes the following components:

控制器,用于计算各个预选路径的剩余带宽和依据各个所述预选路径的剩余带宽,从各个所述预选路径筛选出目标路径;a controller, configured to calculate the remaining bandwidth of each pre-selected path and filter out a target path from each of the pre-selected paths according to the remaining bandwidth of each of the pre-selected paths;

包处理器,与所述控制器双向电连接,用于将差异信息满足设定条件的当前待传输数据包所对应的路径由历史路径切换至所述目标路径。The packet processor is bidirectionally electrically connected to the controller, and is used to switch the path corresponding to the currently to-be-transmitted data packet whose difference information satisfies the set condition from the historical path to the target path.

在一种实现方式中,所述控制器包括:In one implementation, the controller includes:

拓扑监测模块,用于监测产生数据包的内部网络的网络拓扑;The topology monitoring module is used to monitor the network topology of the internal network generating the data packet;

链路探测模块,用于向各个待选路径发送若干探测数据包,所述待选路径包含所述预选路径;A link detection module, configured to send several detection packets to each candidate path, the candidate path including the pre-selected path;

链路分析模块,与所述链路探测模块双向电连接,用于根据所述探测数据包在各个所述待选路径上的传送情况分析各个所述待选路径的质量;A link analysis module, bidirectionally electrically connected to the link detection module, configured to analyze the quality of each of the candidate paths according to the transmission status of the detection data packets on each of the candidate paths;

路径决策模块,与所述链路分析模块双向电连接,用于根据各个所述待选路径的质量,得到预选路径,以及根据预选路径的剩余带宽,得到目标路径。The path decision module is electrically connected bidirectionally with the link analysis module, and is used to obtain a preselected path according to the quality of each of the candidate paths, and obtain a target path according to the remaining bandwidth of the preselected path.

第三方面,本发明实施例还提供一种终端设备,其中,所述终端设备包括存储器、处理器及存储在所述存储器中并可在所述处理器上运行的路径负载均衡程序,所述处理器执行所述路径负载均衡程序时,实现上述所述的路径负载均衡方法的步骤。In a third aspect, an embodiment of the present invention further provides a terminal device, wherein the terminal device includes a memory, a processor, and a path load balancing program stored in the memory and operable on the processor, the When the processor executes the path load balancing program, the steps of the path load balancing method described above are implemented.

第四方面,本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有路径负载均衡程序,所述路径负载均衡程序被处理器执行时,实现上述所述的路径负载均衡方法的步骤。In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a path load balancing program is stored on the computer-readable storage medium, and when the path load balancing program is executed by a processor, the above-mentioned The steps of the path load balancing method.

有益效果:本发明首先计算各个预选路径的剩余带宽,然后根据剩余带宽大小,从各个预选路径中挑选出目标路径。当新到达的当前待传输数据包与上一时刻已传输数据包不同,就不使用历史路径传送当前待传输数据包了,而是在新的目标路径传输当前待传输数据包。通过上述分析可知,本发明根据各个路径的剩余带宽选择其中一个路径传输新的当前待传输数据包,从而实现各个路径的负载均衡。而且本发明并不是针对每个数据包都是重新选择传输路径,而是只针对不同于已传输数据包的当前待传输数据包选择新的目标路径,这是为了防止将相同的数据包放在不同的路径上传输易造成接收端接收的数据包失序。Beneficial effects: the present invention first calculates the remaining bandwidth of each pre-selected path, and then selects a target path from each pre-selected path according to the size of the remaining bandwidth. When the newly arrived current data packet to be transmitted is different from the data packet transmitted at the last moment, the current data packet to be transmitted is not transmitted using the historical path, but the current data packet to be transmitted is transmitted on the new target path. It can be seen from the above analysis that the present invention selects one of the paths to transmit a new data packet currently to be transmitted according to the remaining bandwidth of each path, so as to realize load balancing of each path. And the present invention is not all to re-select the transmission path for each data packet, but only selects a new target path for the current data packet to be transmitted different from the transmitted data packet, which is to prevent the same data packet from being placed in the Transmission on different paths can easily cause out-of-sequence data packets received by the receiving end.

附图说明Description of drawings

图1为本发明的整体流程图;Fig. 1 is the overall flowchart of the present invention;

图2为本发明实施例中的网络部署示意图;FIG. 2 is a schematic diagram of network deployment in an embodiment of the present invention;

图3为本发明实施例中的负载均衡系统的结构图;FIG. 3 is a structural diagram of a load balancing system in an embodiment of the present invention;

图4为本发明实施例中的实现负载均衡的流程图;FIG. 4 is a flow chart of implementing load balancing in an embodiment of the present invention;

图5为本发明实施例提供的终端设备的内部结构原理框图。FIG. 5 is a functional block diagram of an internal structure of a terminal device provided by an embodiment of the present invention.

具体实施方式Detailed ways

以下结合实施例和说明书附图,对本发明中的技术方案进行清楚、完整地描述。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the present invention are clearly and completely described below in conjunction with the embodiments and the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

经研究发现,在多路径传输的条件下,网络不对称的情况十分常见(路径即链路,用于传输数据流,网络不对称即产生数据流的网络在不同的时间段产生的数据流不一样),例如:异构网络,中间网络设备失效或者链路故障等。此外由于网络上业务的多样性造成不同的流具有不同的流量特征,比如应用流量的到达时间、流量分布、流量大小和持续时间等,这些不同特征的流对于网络的需求也不同。给数据流分配的路径如何适应具有多种不同特征流量混合的复杂网络环境是一个极其重要的挑战,不恰当负载均衡(负载均衡即让每个路径负载的数据流大小达到均衡)策略,会导致部分链路空闲而剩余链路拥塞甚至丢包,或者引起单个流的报文在汇聚点乱序增加处理时延,此外还需具有感知链路是否失效的能力,以便及时将原本调度到失效链路的流量调度给可用链路。After research, it is found that under the condition of multi-path transmission, the situation of network asymmetry is very common (the path is the link, which is used to transmit the data flow, and the network asymmetry means that the data flow generated by the network that generates the data flow is different in different time periods. Same), for example: heterogeneous network, failure of intermediate network equipment or link failure, etc. In addition, due to the diversity of services on the network, different flows have different traffic characteristics, such as the arrival time of application traffic, traffic distribution, traffic size, and duration. These flows with different characteristics have different requirements on the network. How to adapt the paths allocated to data flows to a complex network environment with a variety of different traffic characteristics is an extremely important challenge. Improper load balancing (load balancing means to balance the size of data flows loaded by each path) strategy will lead to Some links are idle and the rest of the links are congested or even packet loss, or the packets of a single flow are out of order at the rendezvous point to increase the processing delay. In addition, it is necessary to have the ability to sense whether the link is invalid, so as to timely schedule the original link to the failed link Route traffic is scheduled to available links.

为解决上述技术问题,本发明提供了一种路径负载均衡方法和系统,解决了现有的路径负载均衡易造成路径拥堵的问题。具体实施时,首先计算各个预选路径的剩余带宽,然后根据剩余带宽筛选出目标路径,最后将与已传输数据包存在差异的当前待传输数据包在目标路径上进行传输,从而解决路径拥堵的问题。In order to solve the above technical problems, the present invention provides a path load balancing method and system, which solves the problem that the existing path load balancing easily causes path congestion. In the specific implementation, first calculate the remaining bandwidth of each pre-selected path, then filter out the target path according to the remaining bandwidth, and finally transmit the current data packet to be transmitted that is different from the transmitted data packet on the target path, so as to solve the problem of path congestion .

举例说明,如图2所示,需要将内部网络的数据流(视频流或音频流)以数据包的形式经预选路径传输至外部网络。当数据流的其中一个数据包(当前待传输数据包,记为数据包A)到达P4交换机(包处理器)时,先通过P4交换机判断数据包A和数据包B是否存在差异(所谓差异就是这两个数据包是否是属于同一个数据流,如果属于同一个数据流,那么这两个数据包是不是又属于同一个包集合,包集合中的数据包到达P4交换机的时间间隔都小于设定的时间阈值),如果存在差异,就不再用之前传输数据包B的路径传输数据包A。此时就需要根据各个路径的剩余带宽,将最大剩余带宽的路径作为目标路径传输数据包A。相反如果在剩余带宽小的路径上传输数据包A,就会加剧该路径的拥堵,因此本实施例均衡了各个路径的负载而降低拥堵。另外,本实施例并没有改变与数据包B相同的其它数据包的传输路径,而是将其保持与数据包B相同的路径,从而便于外部网络接收到该数据包将其与数据包B归纳在一起。For example, as shown in FIG. 2 , the data stream (video stream or audio stream) of the internal network needs to be transmitted to the external network through a pre-selected path in the form of data packets. When one of the data packets of the data stream (the current data packet to be transmitted, denoted as data packet A) arrives at the P4 switch (packet processor), it is first judged by the P4 switch whether there is a difference between the data packet A and the data packet B (the so-called difference is Do these two data packets belong to the same data flow? If they belong to the same data flow, do these two data packets belong to the same packet set? A predetermined time threshold), if there is a difference, the data packet A is no longer transmitted over the path used to transmit the data packet B. At this time, it is necessary to use the path with the largest remaining bandwidth as the target path to transmit the data packet A according to the remaining bandwidth of each path. On the contrary, if the data packet A is transmitted on a path with a small remaining bandwidth, the congestion of the path will be aggravated. Therefore, this embodiment balances the load of each path to reduce the congestion. In addition, this embodiment does not change the transmission path of other data packets that are the same as data packet B, but keeps them on the same path as data packet B, so that the external network can receive the data packet and summarize it with data packet B together.

示例性系统exemplary system

本实施例提供一种路径均衡负载系统,如图3所示,该系统包括如下组成部分:This embodiment provides a path balancing load system, as shown in Figure 3, the system includes the following components:

控制器,用于计算各个预选路径的剩余带宽和依据各个所述预选路径的剩余带宽,从各个所述预选路径筛选出目标路径;a controller, configured to calculate the remaining bandwidth of each pre-selected path and filter out a target path from each of the pre-selected paths according to the remaining bandwidth of each of the pre-selected paths;

包处理器(P4交换机),与所述控制器双向电连接,用于将差异信息满足设定条件的当前待传输数据包所对应的路径由历史路径切换至所述目标路径。The packet processor (P4 switch) is electrically connected to the controller bidirectionally, and is used to switch the path corresponding to the currently to-be-transmitted data packet whose difference information satisfies the set condition from the historical path to the target path.

在一个实施例中,控制器包括:In one embodiment, the controller includes:

拓扑监测模块,用于监测产生数据包的内部网络的网络拓扑;The topology monitoring module is used to monitor the network topology of the internal network generating the data packets;

链路探测模块,用于向各个待选路径发送若干探测数据包,所述待选路径包含所述预选路径;A link detection module, configured to send several detection packets to each candidate path, the candidate path including the pre-selected path;

链路分析模块,与所述链路探测模块双向电连接,用于根据所述探测数据包在各个所述待选路径上的传送情况分析各个所述待选路径的质量;A link analysis module, bidirectionally electrically connected to the link detection module, configured to analyze the quality of each of the candidate paths according to the transmission status of the detection data packets on each of the candidate paths;

路径决策模块,与所述链路分析模块双向电连接,用于根据各个所述待选路径的质量,得到预选路径,以及根据预选路径的剩余带宽,得到目标路径。The path decision module is electrically connected bidirectionally with the link analysis module, and is used to obtain a preselected path according to the quality of each of the candidate paths, and obtain a target path according to the remaining bandwidth of the preselected path.

在一个实施例中,P4交换机和控制器是在SDN架构下实现图2中的各个路径负载均衡的,控制器负责采集图2中的网络拓扑信息和进行链路探测(探测各个路径是否适合传送数据包)以及计算各个链路的时延。而P4交换机负责转将控制器针对数据包制定的转发逻辑实施在各个路径上。In one embodiment, the P4 switch and the controller realize the load balancing of each path in FIG. 2 under the SDN architecture, and the controller is responsible for collecting the network topology information in FIG. 2 and performing link detection (detecting whether each path is suitable for transmitting data packets) and calculate the delay of each link. The P4 switch is responsible for implementing the forwarding logic formulated by the controller for the data packets on each path.

控制器和P4交换机共同作用实现各个路径的负载均衡的过程如下:The process of the controller and the P4 switch working together to achieve load balancing of each path is as follows:

拓扑监测模块负责交换机端口启停或链路断开,实时的更新整个网络(内部网络)的拓扑,此外该模块还维护网络拓扑中节点对之间的多路径信息,将多路径情况传递给链路探测模块和链路分析模块。The topology monitoring module is responsible for starting and stopping the switch port or disconnecting the link, and updating the topology of the entire network (internal network) in real time. In addition, this module also maintains the multipath information between node pairs in the network topology, and transmits the multipath information to the link Road detection module and link analysis module.

链路探测模块负责以固定周期(测量周期)发送一组探测数据包探测所有路径的质量,它通过packet-in(数据包发送单元)和packet-out(数据包接收单元)实现探测数据包的发送与接收,记录发送时间戳和外部网络侧的交换机接收到探测数据包的时间戳,统计发送和外部网络侧的交换机实际接收到的数据包的数目,并将结果传递给链路分析模块。The link detection module is responsible for sending a set of detection data packets to detect the quality of all paths with a fixed period (measurement period). Sending and receiving, recording the sending time stamp and the time stamp of the probe data packet received by the switch on the external network side, counting the number of data packets actually received by the switch on the sending and external network side, and passing the result to the link analysis module.

链路分析模块通过链路探测模块发送和接收的时间戳计算RTT(探测数据包在路径上的往返时间),通过发送和实际接收的包的数目计算丢包率,依据RTT和丢包率来分析链路质量以便及时发现故障链路并重新调度流量。在路径决策模块中通过获取一个测量周期内P4交换机的counter数据(各个路径发送和接收的字节数)计算各个路径的剩余带宽,并结合链路分析模块的结果进行流量调度(对到达P4交换机的数据包选择剩余带宽大的路径)。The link analysis module calculates the RTT (the round-trip time of the detection data packet on the path) through the timestamp sent and received by the link detection module, and calculates the packet loss rate by the number of packets sent and actually received, and calculates the packet loss rate according to the RTT and packet loss rate. Analyze link quality to detect faulty links and reschedule traffic in time. In the path decision-making module, the remaining bandwidth of each path is calculated by obtaining the counter data (the number of bytes sent and received by each path) of the P4 switch in a measurement period, and combined with the results of the link analysis module to perform traffic scheduling (for arriving at the P4 switch select the path with the largest remaining bandwidth).

本实施例在数据平面利用P4交换机实现了基于flowlet(数据包集合)的转发逻辑。flowlet检测模块先根据每个数据包的包头做哈希运算,对于网络层为ipv4报文根据五元组(IP源地址、IP目的地址、TCP源端口、TCP目的端口、协议类型)进行哈希,对于网络层为ipv6的报文采用流标签进行哈希。之后根据flowlet超时阈值检测同一网络流中数据包之间的时间间隔,当检测到时间间隔大于超时阈值(时间阈值)时,表明出现了一个新的flowlet,flowlet调度步骤根据交换机各端口的剩余带宽最大优先原则对下一个flowlet进行调度。In this embodiment, the forwarding logic based on flowlet (a collection of data packets) is realized by using a P4 switch on the data plane. The flowlet detection module first performs a hash operation based on the header of each data packet, and performs hashing on the network layer for ipv4 packets according to the five-tuple (IP source address, IP destination address, TCP source port, TCP destination port, protocol type) , for packets whose network layer is ipv6, the flow label is used for hashing. Afterwards, the time interval between data packets in the same network flow is detected according to the flowlet timeout threshold. When the detected time interval is greater than the timeout threshold (time threshold), it indicates that a new flowlet has appeared. The flowlet scheduling step is based on the remaining bandwidth of each port of the switch The principle of maximum priority schedules the next flowlet.

示例性方法exemplary method

本实施例的路径负载均衡方法可应用于终端设备中,所述终端设备可为具有计算功能的终端产品,比如电脑等。在本实施例中,如图1中所示,所述路径负载均衡方法具体包括如下步骤S100、S200、S300:The path load balancing method in this embodiment can be applied to a terminal device, and the terminal device can be a terminal product with a computing function, such as a computer. In this embodiment, as shown in FIG. 1, the path load balancing method specifically includes the following steps S100, S200, and S300:

S100,计算各个预选路径的剩余带宽。S100. Calculate the remaining bandwidth of each preselected path.

步骤S100包括两部分,第一部分:从图2中的各个待选路径中筛选质量好的路径作为出预选路径;第二部分:计算各个预选路径的剩余带宽。Step S100 includes two parts, the first part: selecting paths with good quality from each candidate path in Fig. 2 as the pre-selected path; the second part: calculating the remaining bandwidth of each pre-selected path.

第一部分包括如下步骤S101、S102和S103:The first part includes the following steps S101, S102 and S103:

S101,向各个待选路径发送若干探测数据包。S101. Send several detection data packets to each candidate path.

S102,计算各个所述待选路径将接收的若干所述探测数据包转送至同一目标终端所使用的探测时长和/或所对应的丢包率。S102. Calculate the probing duration and/or the corresponding packet loss rate used by each of the candidate paths to forward the received several probing data packets to the same target terminal.

S103,依据各个所述待选路径所对应的所述探测时长和/或所述丢包率,从各个所述待选路径中筛选出各个所述预选路径。S103. Select each of the preselected paths from each of the candidate paths according to the detection duration and/or the packet loss rate corresponding to each of the candidate paths.

控制器的链路探测模块经P4交换机向图2中各个待选路径都分别发送若干探测数据包,比如十个探测数据包。在P4交换机中,通过P4程序在每个表项添加一个计数器counter,计数器counter记录探测数据包到达P4交换机的时间(发送时间),探测数据包经待选路径到达外部网络侧的交换机时,外侧交换机发送反馈指令,计数器counter记录P4交换机接收到该反馈指令的时间(接收时间),根据发送时间和接收时间就可以计算出探测数据包在待选路径上的探测时长。P4交换机的计数器counter会记录其接收了十个数据包,外部网络侧的交换机上的计数器也会记录其接收了多少个数据包,假如外侧交换机只接收到了八个数据包,那么丢包率就是百分之二十。如果一个待选路径的探测时长很大而且丢包率也很大,那么这个待选路径就是质量差的路径,就不能用其进行数据包传送。因此需要将质量差待选路径的流表从P4交换机中删除,以此使得P4交换机只保留质量好的待选路径(预选路径)的流表。The link detection module of the controller sends several detection data packets, for example, ten detection data packets, to each candidate path in FIG. 2 via the P4 switch. In the P4 switch, a counter is added to each entry through the P4 program. The counter records the time when the detection data packet arrives at the P4 switch (transmission time). When the detection data packet reaches the switch on the external network side through the path to be selected, the external The switch sends a feedback command, and the counter records the time when the P4 switch receives the feedback command (receiving time). According to the sending time and receiving time, the detection duration of the detection data packet on the path to be selected can be calculated. The counter of the P4 switch will record that it has received ten data packets, and the counter on the switch on the external network side will also record how many data packets it has received. If the external switch only receives eight data packets, then the packet loss rate is twenty percent. If the detection duration of a candidate path is long and the packet loss rate is also large, then the candidate path is of poor quality and cannot be used for data packet transmission. Therefore, the flow table of the path to be selected with poor quality needs to be deleted from the P4 switch, so that the P4 switch only retains the flow table of the path to be selected with good quality (preselected path).

第二部分包括如下步骤S104至S108:The second part includes the following steps S104 to S108:

S104,统计各个所述预选路径在测量周期T内的已接收数据包的数量和已发送数据包的数量。S104. Count the number of received data packets and the number of sent data packets of each of the preselected paths within the measurement period T.

在一个实施例中,测量周期T的计算过程如下:In one embodiment, the calculation process of the measurement period T is as follows:

计算数据包在各个所述待选路径上的各个往返时延;依据各个所述往返时延和各个所述待选路径构成的路径总数,得到所述测量周期T。calculating each round-trip delay of the data packet on each of the candidate paths; and obtaining the measurement period T according to each of the round-trip delays and the total number of paths formed by each of the candidate paths.

Figure BDA0003833126740000091
Figure BDA0003833126740000091

RTTi为数据包在第i个待选路径上的往返时延,N为路径总数,

Figure BDA0003833126740000092
为对N开方后下取整,T的单位为秒。RTT i is the round-trip delay of the data packet on the i-th candidate path, N is the total number of paths,
Figure BDA0003833126740000092
It is rounded down after the square root of N, and the unit of T is seconds.

S105,依据所述已接收数据包的数量和每个所述已接收数据包的比特值,得到各个所述预选路径的接收字节数RX_Bytes。S105. Obtain the number of received bytes RX_Bytes of each preselected path according to the number of received data packets and the bit value of each received data packet.

已接收数据包的数量乘以每个数据包的比特大小就是RX_Bytes。The number of received packets multiplied by the bit size of each packet is RX_Bytes.

S106,依据所述已发送数据包的数量和每个所述已发送数据包的比特值,得到各个所述预选路径的发送字节数。S106. According to the number of sent data packets and the bit value of each sent data packet, obtain the number of sent bytes of each of the preselected paths.

已发送数据包的数量乘以每个数据包的比特大小就是TX_Bytes。The number of packets sent multiplied by the bit size of each packet is TX_Bytes.

S107,将所述接收字节数与所述发送字节数之和除以所述测量周期,得到中间结果。S107. Divide the sum of the number of received bytes and the number of sent bytes by the measurement period to obtain an intermediate result.

S108,将各个所述预选路径的原始带宽减去所述中间结果,得到各个所述预选路径的剩余带宽。S108. Subtract the intermediate result from the original bandwidth of each of the pre-selected paths to obtain the remaining bandwidth of each of the pre-selected paths.

剩余带宽=BW-(RX_Bytes+TX_Bytes)/T,其中(RX_Bytes+TX_Bytes)/T为中间结果。Remaining bandwidth=BW-(RX_Bytes+TX_Bytes)/T, where (RX_Bytes+TX_Bytes)/T is an intermediate result.

在一个实施例中,若测量周期内计算出的剩余带宽与上个测量周期计算出的剩余带宽偏差达到20%则认为存在状态变化链路,更新path_rem_bw寄存器数组。In one embodiment, if the difference between the remaining bandwidth calculated in the measurement period and the remaining bandwidth calculated in the previous measurement period reaches 20%, it is considered that there is a state change link, and the path_rem_bw register array is updated.

S200,依据各个所述预选路径的剩余带宽,从各个所述预选路径筛选出目标路径。S200. Select a target path from each of the pre-selected paths according to the remaining bandwidth of each of the pre-selected paths.

本实施例中,将剩余带宽最大的预选路径作为目标路径,然后将当前待传输数据包经该目标路径从内部网络传送到外部网络。选择最大的剩余带宽所在的路径传送数据包,能够使得该路径的带宽得到充分利用,从而和其它路径的带宽实现了均衡。In this embodiment, the preselected path with the largest remaining bandwidth is used as the target path, and then the current data packet to be transmitted is transmitted from the internal network to the external network via the target path. Selecting the path with the largest remaining bandwidth to transmit the data packet can make the bandwidth of the path fully utilized, thereby achieving balance with the bandwidth of other paths.

S300,将差异信息满足设定条件的当前待传输数据包所对应的路径由历史路径切换至所述目标路径,所述差异信息用于表征所述当前待传输数据包与已传输数据包之间的差异,所述历史路径为所述已传输数据包的路径。S300, switch the path corresponding to the current data packet to be transmitted whose difference information satisfies the set condition from the historical path to the target path, the difference information is used to represent the difference between the current data packet to be transmitted and the transmitted data packet difference, the historical path is the path of the transmitted data packet.

步骤S300包括两部分:第一部分判断当前待传输数据包是不是需要采用目标路径进行传输,第二部分如果不需要采用目标路径上传输就在历史路径上传输,否则就在目标路径上传输。Step S300 includes two parts: the first part judges whether the current data packet to be transmitted needs to be transmitted on the target path, and the second part transmits on the historical path if it does not need to be transmitted on the target path, or transmits on the target path.

步骤S300的第一部分包括如下步骤:The first part of step S300 includes the following steps:

S301,计算所述当前待传输数据包的报文标识和所述已传输数据包的报文标识,所述报文标识用于表征数据流标签。S301. Calculate the packet identifier of the currently to-be-transmitted data packet and the packet identifier of the transmitted data packet, where the packet identifier is used to represent a data flow label.

本实施例中,P4交换机接收到当前待传输数据包时,对该数据包的包头标识信息进行哈希运算到报文标识(包括数据包来源的网络IP地址、数据包需要发送至的网络IP地址、源端口、目的端口以及协议类型)。In this embodiment, when the P4 switch receives the current data packet to be transmitted, the header identification information of the data packet is hashed to the message identification (including the network IP address of the data packet source, the network IP address to which the data packet needs to be sent) address, source port, destination port, and protocol type).

S302,依据所述当前待传输数据包的报文标识和所述已传输数据包的报文标识,计算所述当前待传输数据包所在的数据流与所述已传输数据包所在的数据流之间的流差异。S302. According to the message identifier of the currently to-be-transmitted data packet and the message identifier of the transmitted data packet, calculate the difference between the data stream where the current to-be-transmitted data packet is located and the data stream where the transmitted data packet is located flow difference between them.

当两个数据包的报文标识不同时,就说明两个数据包不属于同一个数据流,即两个数据包所在的数据流存在差异,因此需要给当前待传输数据包重新选择路径进行传输,以使得各个路径的负载均衡。When the message identifiers of the two data packets are different, it means that the two data packets do not belong to the same data flow, that is, the data flows of the two data packets are different, so it is necessary to reselect the path for the current data packet to be transmitted for transmission , so that the load of each path is balanced.

在另一个实施例中,两个数据包是否存在差异不仅体现在两个数据包是否属于同一数据流还体现在两个数据包到达P4交换机的时间间隔,如果时间间隔很大,则说明这两个数据包不属于同一个数据包集合flowlet,或者说即使两个数据包属于同一个数据流,但是前后两个数据包到达P4交换机的时间间隔太大,也需要给当前待传输数据包重新选择目标路径。该实施例包括如下步骤:In another embodiment, whether there is a difference between the two data packets is not only reflected in whether the two data packets belong to the same data flow but also in the time interval between the arrival of the two data packets at the P4 switch. If the time interval is large, it means that the two data packets The two data packets do not belong to the same data packet set flowlet, or even if the two data packets belong to the same data flow, but the time interval between the two data packets arriving at the P4 switch is too large, the current data packet to be transmitted needs to be reselected Target path. This embodiment comprises the steps:

S303,当所述当前待传输数据包与所述已传输数据包属于同一个数据流,统计所述当前待传输数据包到达包处理器的时刻与所述已传输数据包到达包处理器的时刻之间的时间间隔。S303. When the current data packet to be transmitted and the transmitted data packet belong to the same data stream, count the time when the current data packet to be transmitted arrives at the packet processor and the time when the transmitted data packet arrives at the packet processor time interval between.

S304,当所述时间间隔大于所述设定条件中的时间阈值时,将所述当前待传输数据包的路径由历史路径切换至所述目标路径。S304. When the time interval is greater than the time threshold in the set condition, switch the path of the currently to-be-transmitted data packet from the historical path to the target path.

通过上述步骤S301至S304判断出了当前待传输数据包是否需要重新选择路径传输,之后就执行步骤S300的第二部分:如果当前待传输数据包与已传输数据包不存在差异,则不需要重新选择路径传输时,就用上一个数据包所在的路径继续传输当前待传输数据包,如果当前待传输数据包与已传输数据包存在差异,就用步骤S200筛选的目标路径传输当前待传输数据包。Through the above steps S301 to S304, it is judged whether the current data packet to be transmitted needs to be re-selected for transmission, and then the second part of step S300 is executed: if there is no difference between the current data packet to be transmitted and the transmitted data packet, then there is no need to re-route. When selecting a path for transmission, the path where the last packet is located continues to transmit the current packet to be transmitted, if there is a difference between the current packet to be transmitted and the transmitted packet, the target path filtered by step S200 is used to transmit the current packet to be transmitted .

下面以图4为例,说明本发明的路径负载均衡整体过程:The following takes Figure 4 as an example to illustrate the overall process of path load balancing in the present invention:

本发明在数据面(P4交换机)设置四个寄存器:flowlet_lasttime记录流中上一个数据包到达交换机的时间,flowlet_id用来标识flowlet,path_rem_bw记录链路对应的剩余带宽,next_hop记录最优路径的端口,即剩余带宽最大。详细步骤如下:The present invention sets four registers on the data plane (P4 switch): flowlet_lasttime records the time when the last data packet in the flow arrives at the switch, flowlet_id is used to identify the flowlet, path_rem_bw records the remaining bandwidth corresponding to the link, next_hop records the port of the optimal path, That is, the remaining bandwidth is the largest. The detailed steps are as follows:

(一)启动控制器和P4交换机,完成初始化工作,保持二者正常长连接。(1) Start the controller and P4 switch, complete the initialization work, and maintain the normal long connection between the two.

(二)对接收到的数据包的包头标识信息进行哈希运算得到报文的标识,IPv4报文的标识信息是五元组,即报文头中携带的源IP地址、目的IP地址、源端口、目的端口以及协议类型,IPv6报文的标识信息是流标签。(2) Carry out hash operation to the packet header identification information of the received data packet to obtain the identification of the message. The identification information of the IPv4 message is a five-tuple, that is, the source IP address, the destination IP address, the source IP address, and the source IP address carried in the packet header. Port, destination port, and protocol type, the identification information of the IPv6 packet is the flow label.

(三)控制器组装探测报文包含序列号,发送时间戳。通过packet-in定时批量发送探测报文到对端,然后对端返回通过packet-out接收,记录接收时间戳和接收报文数目,探测报文为自己组装的ping报文。(3) The controller assembles the detection message including the sequence number and sends the time stamp. Send detection messages in batches to the peer end regularly through packet-in, and then the peer end returns to receive through packet-out, records the received timestamp and the number of received messages, and the detection message is a ping message assembled by itself.

(四)在步骤(三)中若出现未接收到返回的探测包或者大量丢包或者计算出的RTT明显上升到不能正常使用的情况表明对应链路失效,若此链路正在使用则立即删除流表并在可用路径中选择剩余带宽最大的作为流量出口重新下发流表;若链路后续恢复正常则重新计入有效链路。(4) In step (3), if the return detection packet is not received or a large number of packets are lost, or the calculated RTT obviously rises to the point that it cannot be used normally, it indicates that the corresponding link is invalid. If the link is in use, delete it immediately The flow table is selected and the flow table with the largest remaining bandwidth is selected among the available paths as the traffic outlet to re-deliver the flow table; if the link returns to normal later, it will be re-counted as a valid link.

(五)利用P4交换机的counter记录流经每个端口的数据包的个数和比特大小。在一个测量周期T内,可以得到通过端口的数据包的字节数为发送字节数与接收字节数之和:TX_Bytes+RX_Bytes。然后可以得到剩余带宽为:BW–(TX_Bytes+RX_Bytes)/T;其中BW为链路的带宽,TX_Bytes为对应端口的发送字节数,RX_Bytes为对应端口的接收字节数,T为测量周期。(5) Use the counter of the P4 switch to record the number and bit size of data packets flowing through each port. In a measurement period T, the number of bytes of data packets passing through the port can be obtained as the sum of the number of sent bytes and the number of received bytes: TX_Bytes+RX_Bytes. Then the remaining bandwidth can be obtained as: BW–(TX_Bytes+RX_Bytes)/T; where BW is the bandwidth of the link, TX_Bytes is the number of bytes sent by the corresponding port, RX_Bytes is the number of bytes received by the corresponding port, and T is the measurement period.

(六)在步骤(五)中若测量周期内计算出的剩余带宽与上个测量周期计算出的剩余带宽偏差达到20%则认为存在状态变化链路,更新path_rem_bw寄存器数组。(6) In step (5), if the difference between the remaining bandwidth calculated in the measurement period and the remaining bandwidth calculated in the previous measurement period reaches 20%, it is considered that there is a state change link, and the path_rem_bw register array is updated.

(七)判断接收到的数据包的包头标识信息进行哈希运算后是否在flowlet_id寄存器数组中存在匹配项。(7) Judging whether there is a matching item in the flowlet_id register array after the header identification information of the received data packet is hashed.

(八)若在flowlet_id寄存器数组中存在匹配项,则通过P4交换机的standard_metadata获取当前时间戳与flowlet_lasttime寄存器数组内记录的时间戳作差,计算时间间隔。(8) If there is a matching item in the flowlet_id register array, the difference between the current timestamp and the timestamp recorded in the flowlet_lasttime register array is obtained through the standard_metadata of the P4 switch, and the time interval is calculated.

(九)判断步骤(六)中的时间间隔是否大于设定的flowlet的阈值。(9) Judging whether the time interval in step (6) is greater than the set flowlet threshold.

(十)若步骤(六)中的时间间隔不大于设定的flowlet的阈值,则可以判定该报文是属于同一flowlet,将接收该报文的时间戳记录到对应的flowlet_lasttime寄存器数组项中。(10) If the time interval in step (6) is not greater than the threshold of the set flowlet, then it can be determined that the message belongs to the same flowlet, and the timestamp of receiving the message is recorded in the corresponding flowlet_lasttime register array item.

(十一)按照与该flowlet的上一个报文转发路径转发该报文。(11) Forwarding the message according to the previous message forwarding path with the flowlet.

(十二)若步骤(七)中不存在匹配项,表示出现了新的流。(12) If there is no matching item in step (7), it means that a new stream appears.

(十三)对于步骤(九)出现同一流的数据包间隔大于flowlet阈值,将flowlet_id寄存器数组中对应项的值增加1,且更新flowlet_lasttime寄存器数组项为接收该报文的时间戳;对于步骤(十)对数据包的包头标识信息进行哈希运算后新增属于该流的flowlet_id寄存器数组和flowlet_lasttime寄存器数组。(13) For step (nine), the packet interval of the same flow is greater than the flowlet threshold, increase the value of the corresponding item in the flowlet_id register array by 1, and update the flowlet_lasttime register array item to receive the timestamp of the message; for step ( 10) Adding a flowlet_id register array and a flowlet_lasttime register array belonging to the flow after performing a hash operation on the packet header identification information of the data packet.

(十四):读取path_rem_bw寄存器数组,选择剩余带宽最大的链路作为流量出口。(14): read the path_rem_bw register array, and select the link with the largest remaining bandwidth as the flow exit.

综上,本发明首先计算各个预选路径的剩余带宽,然后根据剩余带宽大小,从各个预选路径中挑选出目标路径。当新到达的当前待传输数据包与上一时刻已传输数据包不同,就不使用历史路径传送当前待传输数据包了,而是在新的目标路径传输当前待传输数据包。通过上述分析可知,本发明根据各个路径的剩余带宽选择其中一个路径传输新的当前待传输数据包,从而实现各个路径的负载均衡。而且本发明并不是针对每个数据包都是重新选择传输路径,而是只针对不同于已传输数据包的当前待传输数据包选择新的目标路径,这是为了防止将相同的数据包放在不同的路径上传输易造成接收端接收的数据包失序。To sum up, the present invention first calculates the remaining bandwidth of each pre-selected path, and then selects a target path from each pre-selected path according to the size of the remaining bandwidth. When the newly arrived current data packet to be transmitted is different from the data packet transmitted at the last moment, the current data packet to be transmitted is not transmitted using the historical path, but the current data packet to be transmitted is transmitted on the new target path. It can be seen from the above analysis that the present invention selects one of the paths to transmit a new data packet currently to be transmitted according to the remaining bandwidth of each path, so as to realize load balancing of each path. And the present invention is not all to re-select the transmission path for each data packet, but only selects a new target path for the current data packet to be transmitted different from the transmitted data packet, which is to prevent the same data packet from being placed in the Transmission on different paths can easily cause out-of-sequence data packets received by the receiving end.

另外,本发明通过SDN架构和可编程数据面的技术,能够依据链路状态及时将流调度到最合理的路径上,充分利用链路资源并减少链路拥塞,且大大降低了在汇聚端由于包乱序带来的处理时延。In addition, through the SDN architecture and programmable data plane technology, the present invention can timely schedule the flow to the most reasonable path according to the link status, make full use of link resources and reduce link congestion, and greatly reduce the Processing delay caused by out-of-order packets.

基于上述实施例,本发明还提供了一种终端设备,其原理框图可以如图5所示。该终端设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏、温度传感器。其中,该终端设备的处理器用于提供计算和控制能力。该终端设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该终端设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种路径负载均衡方法。该终端设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该终端设备的温度传感器是预先在终端设备内部设置,用于检测内部设备的运行温度。Based on the foregoing embodiments, the present invention further provides a terminal device, the functional block diagram of which may be shown in FIG. 5 . The terminal equipment includes a processor, a memory, a network interface, a display screen, and a temperature sensor connected through a system bus. Wherein, the processor of the terminal device is used to provide calculation and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the terminal device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, a path load balancing method is implemented. The display screen of the terminal device may be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the terminal device is pre-set inside the terminal device for detecting the operating temperature of the internal device.

本领域技术人员可以理解,图5中示出的原理框图,仅仅是与本发明方案相关的部分结构的框图,并不构成对本发明方案所应用于其上的终端设备的限定,具体的终端设备以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the functional block diagram shown in Figure 5 is only a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the terminal equipment to which the solution of the present invention is applied. The specific terminal equipment It is possible to include more or fewer components than shown in the figures, or to combine certain components, or to have a different arrangement of components.

在一个实施例中,提供了一种终端设备,终端设备包括存储器、处理器及存储在存储器中并可在处理器上运行的路径负载均衡程序,处理器执行双路径负载均衡程序时,实现如下操作指令:In one embodiment, a terminal device is provided. The terminal device includes a memory, a processor, and a path load balancing program stored in the memory and operable on the processor. When the processor executes the dual-path load balancing program, the implementation is as follows Operation instructions:

计算各个预选路径的剩余带宽;Calculating the remaining bandwidth of each preselected path;

依据各个所述预选路径的剩余带宽,从各个所述预选路径筛选出目标路径;Screening out a target path from each of the pre-selected paths according to the remaining bandwidth of each of the pre-selected paths;

将差异信息满足设定条件的当前待传输数据包所对应的路径由历史路径切换至所述目标路径,所述差异信息用于表征所述当前待传输数据包与已传输数据包之间的差异,所述历史路径为所述已传输数据包的路径。switch the path corresponding to the current data packet to be transmitted whose difference information satisfies the set condition from the historical path to the target path, the difference information is used to characterize the difference between the current data packet to be transmitted and the transmitted data packet , the historical path is the path of the transmitted data packet.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本发明所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any reference to memory, storage, database or other media used in the various embodiments provided by the present invention may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (13)

1. A method for path load balancing, comprising:
calculating the residual bandwidth of each preselected path;
screening out a target path from each pre-selected path according to the residual bandwidth of each pre-selected path;
and switching a path corresponding to the current data packet to be transmitted, of which the difference information meets the set conditions, from a historical path to the target path, wherein the difference information is used for representing the difference between the current data packet to be transmitted and the transmitted data packet, and the historical path is the path of the transmitted data packet.
2. The path load balancing method according to claim 1, wherein the screening of each of the preselected paths comprises:
sending a plurality of detection data packets to each path to be selected;
calculating the detection duration and/or the corresponding packet loss rate used by each path to be selected for forwarding the received detection data packets to the same target terminal;
and screening each preselected path from each path to be selected according to the detection time length and/or the packet loss rate corresponding to each path to be selected.
3. The path load balancing method according to claim 2, wherein said calculating the remaining bandwidth of each preselected path comprises:
counting the number of received data packets and the number of sent data packets of each preselected path in a measuring period;
calculating the remaining bandwidth of each of the preselected paths according to the number of the received data packets and the number of the transmitted data packets of each of the preselected paths and the measurement period.
4. A path load balancing method according to claim 3, wherein said calculating the remaining bandwidth for each of said preselected paths based on the number of said received packets and the number of said transmitted packets for each of said preselected paths and said measurement period comprises:
obtaining the number of received bytes of each preselected path according to the number of the received data packets and the bit value of each received data packet;
obtaining the number of sending bytes of each preselected path according to the number of the sent data packets and the bit value of each sent data packet;
dividing the sum of the number of received bytes and the number of sent bytes by the measuring period to obtain an intermediate result;
and subtracting the intermediate result from the original bandwidth of each preselected path to obtain the residual bandwidth of each preselected path.
5. The path load balancing method according to claim 3, wherein the calculation manner of the measurement period includes:
calculating each round-trip delay of the data packet on each path to be selected;
and obtaining the measurement period according to the round trip delay and the total number of paths formed by the paths to be selected.
6. The path load balancing method according to claim 1, wherein said screening out a target path from each of said preselected paths based on a remaining bandwidth of each of said preselected paths comprises:
and comparing the residual bandwidths of the preselected paths, and taking the preselected path with the maximum residual bandwidth as the target path.
7. The path load balancing method according to claim 1, wherein the switching a path corresponding to a current packet to be transmitted whose difference information satisfies a set condition from a historical path to the target path, where the difference information is used to characterize a difference between the current packet to be transmitted and a transmitted packet, and the historical path is a path of the transmitted packet, includes:
calculating the stream difference between the data stream of the current data packet to be transmitted and the data stream of the transmitted data packet in the difference information;
and when the stream difference meets two different data streams in the set condition, switching the path of the current data to be transmitted to the target path according to the historical path.
8. The path load balancing method according to claim 7, wherein the calculating the flow difference between the data flow in which the current data packet to be transmitted is located and the data flow in which the transmitted data packet is located in the difference information includes:
calculating the message identification of the current data packet to be transmitted and the message identification of the transmitted data packet, wherein the message identification is used for representing a data flow label;
and calculating the flow difference between the data flow of the current data packet to be transmitted and the data flow of the transmitted data packet according to the message identification of the current data packet to be transmitted and the message identification of the transmitted data packet.
9. The path load balancing method according to claim 1, wherein the switching a path corresponding to a current data packet to be transmitted whose difference information satisfies a set condition from a historical path to the target path, where the difference information is used to characterize a difference between the current data packet to be transmitted and a transmitted data packet, and the historical path is a path of the transmitted data packet, includes:
when the current data packet to be transmitted and the transmitted data packet belong to the same data stream, counting the time interval between the time when the current data packet to be transmitted reaches a packet processor and the time when the transmitted data packet reaches the packet processor;
and when the time interval is greater than the time threshold value in the set condition, switching the path of the current data packet to be transmitted from the historical path to the target path.
10. A path balancing load system, comprising:
the controller is used for calculating the residual bandwidth of each preselected path and screening out a target path from each preselected path according to the residual bandwidth of each preselected path;
and the packet processor is bidirectionally and electrically connected with the controller and is used for switching the path corresponding to the current data packet to be transmitted, the difference information of which meets the set condition, from the historical path to the target path.
11. The path balancing load system of claim 10, the controller comprising:
the topology monitoring module is used for monitoring the network topology of the internal network generating the data packet;
a link detection module, configured to send a plurality of detection data packets to each candidate path, where the candidate path includes the preselected path;
the link analysis module is bidirectionally and electrically connected with the link detection module and is used for analyzing the quality of each path to be selected according to the transmission condition of the detection data packet on each path to be selected;
and the path decision module is in bidirectional electrical connection with the link analysis module and is used for obtaining a preselected path according to the quality of each path to be selected and obtaining a target path according to the residual bandwidth of the preselected path.
12. A terminal device, characterized in that the terminal device comprises a memory, a processor and a path load balancing program stored in the memory and operable on the processor, and the processor implements the steps of the path load balancing method according to any one of claims 1 to 9 when executing the path load balancing program.
13. A computer-readable storage medium, having stored thereon a path load balancing program which, when executed by a processor, implements the steps of the path load balancing method according to any one of claims 1 to 9.
CN202211079482.5A 2022-09-05 2022-09-05 Path load balancing method and system Active CN115632986B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211079482.5A CN115632986B (en) 2022-09-05 2022-09-05 Path load balancing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211079482.5A CN115632986B (en) 2022-09-05 2022-09-05 Path load balancing method and system

Publications (2)

Publication Number Publication Date
CN115632986A true CN115632986A (en) 2023-01-20
CN115632986B CN115632986B (en) 2024-05-14

Family

ID=84903532

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211079482.5A Active CN115632986B (en) 2022-09-05 2022-09-05 Path load balancing method and system

Country Status (1)

Country Link
CN (1) CN115632986B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116708304A (en) * 2023-08-01 2023-09-05 腾讯科技(深圳)有限公司 Switching method and device of data transmission paths, storage medium and electronic equipment
CN118200770A (en) * 2024-03-18 2024-06-14 北京舍菲特信息服务有限公司 Method and system for installing multiple broadband by same light cat
CN118695144A (en) * 2024-08-26 2024-09-24 苏州爱雄斯通信技术有限公司 Multipath signal transmission method and system in optical communication network
CN118748654A (en) * 2024-06-07 2024-10-08 北京开源芯片研究院 Data packet sending method, device, electronic device and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103401802A (en) * 2013-08-26 2013-11-20 盛科网络(苏州)有限公司 Transmission protocol based message load balancing method and device
CN106656847A (en) * 2017-03-10 2017-05-10 重庆邮电大学 Software defined network (SDN) load balancing method with highest network utility
CN109787913A (en) * 2019-03-15 2019-05-21 北京工业大学 A dynamic load balancing method for data center network based on SDN
CN111245740A (en) * 2019-11-19 2020-06-05 华为技术有限公司 Service quality strategy method and device for configuration service and computing equipment
CN114024969A (en) * 2020-07-17 2022-02-08 华为技术有限公司 A load balancing method, device and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103401802A (en) * 2013-08-26 2013-11-20 盛科网络(苏州)有限公司 Transmission protocol based message load balancing method and device
CN106656847A (en) * 2017-03-10 2017-05-10 重庆邮电大学 Software defined network (SDN) load balancing method with highest network utility
CN109787913A (en) * 2019-03-15 2019-05-21 北京工业大学 A dynamic load balancing method for data center network based on SDN
CN111245740A (en) * 2019-11-19 2020-06-05 华为技术有限公司 Service quality strategy method and device for configuration service and computing equipment
CN114024969A (en) * 2020-07-17 2022-02-08 华为技术有限公司 A load balancing method, device and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116708304A (en) * 2023-08-01 2023-09-05 腾讯科技(深圳)有限公司 Switching method and device of data transmission paths, storage medium and electronic equipment
CN118200770A (en) * 2024-03-18 2024-06-14 北京舍菲特信息服务有限公司 Method and system for installing multiple broadband by same light cat
CN118748654A (en) * 2024-06-07 2024-10-08 北京开源芯片研究院 Data packet sending method, device, electronic device and readable storage medium
CN118695144A (en) * 2024-08-26 2024-09-24 苏州爱雄斯通信技术有限公司 Multipath signal transmission method and system in optical communication network
CN118695144B (en) * 2024-08-26 2024-11-01 苏州爱雄斯通信技术有限公司 Multipath signal transmission method and system in optical communication network

Also Published As

Publication number Publication date
CN115632986B (en) 2024-05-14

Similar Documents

Publication Publication Date Title
US10819654B2 (en) Method and apparatus for software programmable intelligent network
CN115632986B (en) Path load balancing method and system
US8811395B2 (en) System and method for determination of routing information in a network
EP1705845B1 (en) Load distributing method
JP3894232B2 (en) ATM switch performance monitoring
US8036121B2 (en) Method of estimating quality degradation on network in communication network system
US7525923B2 (en) Catprobe
US8229705B1 (en) Performance monitoring in computer networks
US20070097865A1 (en) Method for measuring end-to-end delay in asynchronous packet transfer network, and asynchronous packet transmitter and receiver
TW201524155A (en) A controller for delay measurement, a delay measurement system and a delay measurement method in SDN
JP2004112791A (en) Method of measuring network operation parameter
CN110417674B (en) Data traffic sharing method and device
US7898969B2 (en) Performance measurement in a packet transmission network
KR20160115050A (en) OpenFlow controller and method for managing QoS of packet forwarding path in OpenFlow network
CN112910795B (en) Edge load balancing method and system based on many sources
Ramadža et al. Network performance monitoring within MPLS traffic engineering enabled networks
US11784895B2 (en) Performance measurement in a packet-switched communication network
WO2021197617A1 (en) Network device, system and method for cycle-based load balancing
CN118075195B (en) Data center network fault rerouting method and device, electronic equipment and medium
CN110933002B (en) Method and device for realizing switching chip of MPLS in-band detection OAM
JP7514970B1 (en) Packet monitoring device, communication system, and program
CN115733755B (en) A data center transmission control system and method capable of filling network bandwidth
Xue et al. Providing reliable data transport for dynamic event sensing in wireless sensor networks
Joo et al. Performance monitoring for multimedia traffic using differentiated probe (DiffProbe)
JP2009171453A (en) Transmission node, method for specifying tight link, and program for specifying tight link

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