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

Path load balancing method and system
Technical Field
The invention relates to the technical field of data flow, in particular to a path load balancing method and a path load balancing system.
Background
Under the condition of multi-path transmission, the case of network asymmetry is very common (a path, i.e. a link, is used for transmitting a data stream, and the network asymmetry, i.e. the data streams generated by the network generating the data streams at different time periods are different), for example: heterogeneous networks, failure of intermediate network devices or link failures, etc. In addition, due to the diversity of the traffic on the network, different flows have different traffic characteristics, such as arrival time of application traffic, traffic distribution, traffic size and duration, and the like, and the flows with different characteristics have different requirements on the network. How to adapt to a complex network environment with a variety of different feature traffic mixtures for paths allocated to data flows is an extremely important challenge, and an improper load balancing (i.e., load balancing means that the size of data flows loaded by each path is balanced) strategy can cause part of links to be idle and remaining links to be congested or even lost, or cause messages of a single flow to be out of order at an aggregation point to increase processing delay, and in addition, the capability of sensing whether a link fails or not needs to be provided so as to schedule traffic originally scheduled to a failed link to an available link in time.
In summary, the conventional path load balancing is prone to cause path congestion.
Thus, there is a need for improvements and enhancements in the art.
Disclosure of Invention
In order to solve the technical problems, the invention provides a method and a system for path load balancing, which solve the problem that the existing path load balancing is easy to cause path congestion.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, the present invention provides a path load balancing method, including:
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.
In one implementation, the filtering manner of each preselected path includes:
sending a plurality of detection data packets to each path to be selected;
calculating the detection time length and/or the corresponding packet loss rate used by each path to be selected for transmitting 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.
In one implementation, the calculating the remaining bandwidth of each preselected path includes:
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 preselected path according to the number of the received data packets and the number of the sent data packets of each preselected path and the measuring period.
In one implementation, said calculating the remaining bandwidth of each of said preselected paths according to the number of received packets and the number of sent packets of 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 measurement 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.
In one implementation, the measurement period is calculated by:
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.
In one implementation, the filtering out a target path from each of the preselected paths according to the remaining bandwidth of each of the preselected paths includes:
and comparing the residual bandwidths of the preselected paths, and taking the preselected path with the maximum residual bandwidth as the target path.
In one implementation manner, the switching a path corresponding to a current data packet to be transmitted, where difference information of which meets a set condition, from a historical path to the target path, where the difference information is used to represent a difference between the current data packet to be transmitted and a transmitted data packet, where the historical path is a path of the transmitted data 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.
In one implementation, the calculating a stream difference between a data stream in which the current data packet to be transmitted is located and a data stream 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.
In one implementation manner, the switching a path corresponding to a current data packet to be transmitted, where difference information of which meets a set condition, from a historical path to the target path, where the difference information is used to represent 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.
In a second aspect, an embodiment of the present invention further provides a path balancing load system, where the system includes the following components:
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.
In one implementation, the controller includes:
the topology monitoring module is used for monitoring the network topology of the internal network generating the data packet;
the link detection module is used for sending a plurality of detection data packets to each path to be selected, and the path to be selected comprises 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.
In a third aspect, an embodiment of the present invention further provides a terminal device, where the terminal device includes a memory, a processor, and a path load balancing program that is stored in the memory and is executable on the processor, and when the processor executes the path load balancing program, the steps of the path load balancing method 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 steps of the path load balancing method are implemented.
Has the beneficial effects that: 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. Through the analysis, the invention can select 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 when the same data packet is placed on different paths for transmission.
Drawings
FIG. 1 is an overall flow chart of the present invention;
FIG. 2 is a schematic diagram of a network deployment in an embodiment of the present invention;
FIG. 3 is a block diagram of a load balancing system in an embodiment of the present invention;
FIG. 4 is a flowchart of implementing load balancing in an embodiment of the present invention;
fig. 5 is a schematic block diagram of an internal structure of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical scheme of the invention is clearly and completely described below by combining the embodiment and the attached drawings of the specification. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It has been found that under the condition of multipath transmission, the network is not symmetric (the paths, i.e. links, are used for transmitting data streams, and the network is not symmetric, i.e. the data streams generated by the network generating the data streams are different at different time periods), for example: heterogeneous networks, failure of intermediate network devices or link failures, etc. In addition, due to the diversity of the traffic on the network, different flows have different traffic characteristics, such as arrival time of application traffic, traffic distribution, traffic size and duration, and the like, and the flows with different characteristics have different requirements on the network. How to adapt to a complex network environment with a variety of different characteristic traffic mixtures for paths allocated to data flows is an extremely important challenge, and an improper load balancing (i.e., balancing the size of the data flow loaded by each path) strategy can cause part of links to be idle and remaining links to be congested or even to lose packets, or cause messages of a single flow to be out of order at an aggregation point to increase processing delay.
In order to solve the technical problems, the invention provides a path load balancing method and a path load balancing system, which solve the problem that the existing path load balancing is easy to cause path congestion. During specific implementation, the residual bandwidth of each preselected path is calculated, then the target path is screened out according to the residual bandwidth, and finally the current data packet to be transmitted, which is different from the transmitted data packet, is transmitted on the target path, so that the problem of path congestion is solved.
For example, as shown in fig. 2, a data stream (video stream or audio stream) of the internal network needs to be transmitted to the external network in the form of data packets through a pre-selected path. When one data packet (the current data packet to be transmitted, which is denoted as data packet a) of the data stream reaches a P4 switch (packet processor), the P4 switch is used to determine whether the data packet a and the data packet B have a difference (the difference is whether the two data packets belong to the same data stream, if the two data packets belong to the same data stream, the two data packets do not belong to the same packet set, and the time interval of the data packet in the packet set reaching the P4 switch is smaller than a set time threshold), and if the difference exists, the data packet a is no longer transmitted by using the path of the data packet B which is transmitted before. At this time, the data packet a needs to be transmitted by using the path with the largest remaining bandwidth as the target path according to the remaining bandwidth of each path. On the contrary, if the data packet a is transmitted on a path with a small residual bandwidth, the congestion of the path is increased, so the present embodiment balances the load of each path to reduce the congestion. In addition, the present embodiment does not change the transmission path of other packets that are the same as the packet B, but keeps the same path as the packet B, so that the external network can receive the packet and put it together with the packet B.
Exemplary System
The present embodiment provides a path balancing load system, as shown in fig. 3, the system includes the following components:
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 (P4 switch) is in bidirectional electrical connection 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.
In one embodiment, the controller includes:
the topology monitoring module is used for monitoring the network topology of the internal network generating the data packet;
the link detection module is used for sending a plurality of detection data packets to each path to be selected, and the path to be selected comprises 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.
In one embodiment, the P4 switch and the controller implement load balancing of each path in fig. 2 under the SDN architecture, and the controller is responsible for collecting network topology information in fig. 2 and performing link probing (probing whether each path is suitable for transmitting data packets) and calculating delay of each link. And the P4 switch is responsible for implementing the forwarding logic specified by the controller for the packet on each path.
The controller and the P4 switch cooperate to implement the load balancing of each path as follows:
the topology monitoring module is responsible for starting and stopping a switch port or disconnecting a link, updating the topology of the whole network (internal network) in real time, maintaining multi-path information between node pairs in the network topology and transmitting the multi-path condition to the link detection module and the link analysis module.
The link detection module is responsible for sending a group of detection data packets at a fixed period (measurement period) to detect the quality of all paths, realizes the sending and receiving of the detection data packets through a packet-in (data packet sending unit) and a packet-out (data packet receiving unit), records a sending time stamp and a time stamp of the detection data packets received by a switch at an external network side, counts the number of the data packets actually received by the switch at the sending and external network sides, and transmits the result to the link analysis module.
The link analysis module calculates RTT (round trip time of the detection data packet on the path) through the timestamps sent and received by the link detection module, calculates packet loss rate through the number of the sent and actually received packets, and analyzes link quality according to the RTT and the packet loss rate so as to find a failed link in time and reschedule traffic. In the path decision module, the residual bandwidth of each path is calculated by obtaining counter data (the number of bytes sent and received by each path) of the P4 switch in a measurement period, and flow scheduling is performed in combination with the result of the link analysis module (a path with large residual bandwidth is selected for a data packet arriving at the P4 switch).
The present embodiment implements flow (packet aggregation) based forwarding logic in the data plane using P4 switches. The flow detection module firstly carries out hash operation according to the packet head of each data packet, carries out hash on the ipv4 message on the network layer according to a quintuple (an IP source address, an IP destination address, a TCP source port, a TCP destination port and a protocol type), and carries out hash on the ipv6 message on the network layer by adopting a flow label. And then, detecting the time interval between data packets in the same network flow according to a flow overtime threshold, when the time interval is detected to be larger than the overtime threshold (time threshold), indicating that a new flow appears, and scheduling the next flow according to the principle that the residual bandwidth of each port of the switch is the most prior.
Exemplary method
The path load balancing method of the embodiment may be applied to a terminal device, and the terminal device may 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:
and S100, calculating the residual bandwidth of each preselected path.
Step S100 includes two parts, a first part: screening paths with good quality from the paths to be selected in the figure 2 as pre-selected paths; a second part: the remaining bandwidth of each preselected path is calculated.
The first part comprises the following steps S101, S102 and S103:
s101, sending a plurality of detection data packets to each path to be selected.
And S102, 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 S103, 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.
A link detection module of the controller sends a plurality of detection packets, for example, ten detection packets, to each candidate path in fig. 2 through the P4 switch. In the P4 switch, a counter is added to each table entry through a P4 program, the counter records the time (sending time) of a detection data packet arriving at the P4 switch, when the detection data packet arrives at a switch on an external network side through a path to be selected, an outer side switch sends a feedback instruction, the counter records the time (receiving time) of the P4 switch receiving the feedback instruction, and the detection time length of the detection data packet on the path to be selected can be calculated according to the sending time and the receiving time. The counter of the P4 switch records that it has received ten packets, and the counter of the switch on the external network side also records how many packets it has received, and if the outer switch has received only eight packets, the packet loss rate is twenty percent. If the detection time of a candidate path is long and the packet loss rate is also large, the candidate path is a path with poor quality, and the data packet transmission cannot be carried out by using the candidate path. 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 (preselected path) with good quality.
The second part includes the following steps S104 to S108:
and S104, counting the number of the received data packets and the number of the sent data packets of each preselected path in the measuring period T.
In one embodiment, the measurement period T is calculated as follows:
calculating each round-trip delay of the data packet on each path to be selected; and obtaining the measurement period T according to the round trip delay and the total number of paths formed by the paths to be selected.
Figure BDA0003833126740000091
RTT i The round trip delay of the data packet on the ith candidate path, N is the total number of paths,
Figure BDA0003833126740000092
to round the bottom after the evolution of N, the unit of T is seconds.
S105, obtaining the receiving byte number RX _ Bytes of each preselected path according to the number of the received data packets and the bit value of each received data packet.
The number of received packets multiplied by the bit size of each packet is RX _ Bytes.
S106, 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.
The number of transmitted packets multiplied by the bit size of each packet is the TX Bytes.
S107, 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 S108, subtracting the intermediate result from the original bandwidth of each preselected path to obtain the residual bandwidth of each preselected path.
Residual bandwidth = BW- (RX _ Bytes + TX _ Bytes)/T, where (RX _ Bytes + TX _ Bytes)/T is an intermediate result.
In one embodiment, if the deviation between the residual bandwidth calculated in the measurement period and the residual bandwidth calculated in the last measurement period reaches 20%, it is determined that the status change link exists, and the path _ rem _ bw register array is updated.
S200, screening out target paths from each preselected path according to the residual bandwidth of each preselected path.
In this embodiment, the preselected path with the largest remaining bandwidth is used as a target path, and then the current data packet to be transmitted is transmitted from the internal network to the external network through the target path. The path where the maximum residual bandwidth is located is selected to transmit the data packet, so that the bandwidth of the path can be fully utilized, and the balance between the bandwidth of the path and the bandwidth of other paths is realized.
S300, switching a path corresponding to a current data package to be transmitted, of which difference information meets set conditions, from a historical path to the target path, wherein the difference information is used for representing the difference between the current data package to be transmitted and a transmitted data package, and the historical path is the path of the transmitted data package.
Step S300 includes two parts: the first part judges whether the current data packet to be transmitted needs to be transmitted by adopting a target path, the second part transmits the data packet on a historical path if the data packet does not need to be transmitted on the target path, and otherwise, the data packet is transmitted on the target path.
The first part of step S300 includes the steps of:
s301, 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.
In this embodiment, when the P4 switch receives a current data packet to be transmitted, hash operation is performed on packet header identification information of the data packet to obtain a packet identifier (including a network IP address of a source of the data packet, a network IP address to which the data packet needs to be sent, a source port, a destination port, and a protocol type).
S302, according to the message identifier of the current data packet to be transmitted and the message identifier of the transmitted data packet, calculating a stream difference between a data stream where the current data packet to be transmitted is located and a data stream where the transmitted data packet is located.
When the message identifiers of the two data packets are different, it is indicated that the two data packets do not belong to the same data stream, that is, the data streams where the two data packets are located are different, and therefore, a path needs to be reselected for transmission for the current data packet to be transmitted, so that the load of each path is balanced.
In another embodiment, whether the two data packets are different is not only whether the two data packets belong to the same data flow but also whether the two data packets arrive at the P4 switch at a time interval, and if the time interval is large, it is indicated that the two data packets do not belong to the same data packet set flow, or even if the two data packets belong to the same data flow, the time interval between the two data packets before and after arriving at the P4 switch is too large, and the target path needs to be reselected for the current data packet to be transmitted. This embodiment comprises the steps of:
s303, when the current data packet to be transmitted and the transmitted data packet belong to the same data stream, counting a 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.
S304, when the time interval is larger 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.
After determining whether the current data packet to be transmitted needs to be re-routed for transmission through the above steps S301 to S304, a second part of step S300 is executed: if the current data packet to be transmitted is not different from the transmitted data packet, the current data packet to be transmitted is continuously transmitted by using the path where the previous data packet is located without reselecting the path for transmission, and if the current data packet to be transmitted is different from the transmitted data packet, the current data packet to be transmitted is transmitted by using the target path screened in the step S200.
The following takes fig. 4 as an example to illustrate the overall path load balancing process of the present invention:
the invention sets four registers on the data plane (P4 switch): flow _ last records the time of the last data packet arriving at the switch, flow _ id is used to identify the flow, path _ rem _ bw records the residual bandwidth corresponding to the link, and next _ hop records the port of the optimal path, i.e. the residual bandwidth is the maximum. The detailed steps are as follows:
and (I) starting the controller and the P4 exchanger to complete initialization work and keep normal long connection between the controller and the P4 exchanger.
And (II) carrying out Hash operation on the header identification information of the received data packet to obtain the identification of the packet, wherein the identification information of the IPv4 packet is a quintuple, namely a source IP address, a destination IP address, a source port, a destination port and a protocol type carried in the packet header, and the identification information of the IPv6 packet is a flow label.
And (III) the controller assembles the detection message containing the sequence number and sends a timestamp. The detection messages are sent to the opposite terminal in batches at regular time through packet-in, then the opposite terminal returns to receive through packet-out, the receiving time stamp and the number of the received messages are recorded, and the detection messages are ping messages assembled by the opposite terminal.
If the returned detection packet is not received or a large amount of packet is lost or the calculated RTT obviously rises to the state that the link cannot be normally used in the step (III), indicating that the corresponding link fails, if the link is used, immediately deleting the flow table and selecting the path with the largest residual bandwidth as a flow outlet in the available path to re-issue the flow table; and if the link is subsequently recovered to be normal, the effective link is re-counted.
And (V) recording the number and the bit size of the data packets flowing through each port by using the counter of the P4 switch. In a measurement period T, the number of bytes of the data packet passing through the port is obtained as the sum of the number of bytes sent and the number of bytes received: TX _ Bytes + RX _ Bytes. The remaining bandwidth can then be found to be: BW- (TX _ Bytes + RX _ Bytes)/T; 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.
And (VI) in the step (five), if the deviation between the residual bandwidth calculated in the measurement period and the residual bandwidth calculated in the last measurement period reaches 20%, the state change link is considered to exist, and the path _ rem _ bw register array is updated.
And (seventhly), judging whether a matching item exists in the flow _ id register array after the header identification information of the received data packet is subjected to hash operation.
(eighth), if there is a matching entry in the flow _ id register array, the difference between the current timestamp and the timestamp recorded in the flow _ last register array is obtained through the standard _ metadata of the P4 switch, and the time interval is calculated.
And (nine) judging whether the time interval in the step (six) is larger than the set flow threshold value.
And (ten) if the time interval in the step (six) is not larger than the set threshold value of the flow, judging that the message belongs to the same flow, and recording the time stamp of receiving the message into the corresponding flow _ last register array item.
And (eleven) forwarding the message according to the last message forwarding path of the flow.
And (twelve) if no matching item exists in the step (seven), indicating that a new stream appears.
(thirteen) for the data packet interval of the same flow in the step (nine) is larger than the flow threshold value, increasing the value of the corresponding item in the flow _ id register array by 1, and updating the item of the flow _ last register array as the time stamp for receiving the message; and (5) performing hash operation on the packet header identification information of the data packet in the step (ten), and then adding a flow _ id register array and a flow _ lasttime register array which belong to the flow.
And (fourteen) reading the path _ rem _ bw register array, and selecting the link with the largest residual bandwidth as a flow outlet.
In summary, the present invention first calculates the remaining bandwidth of each preselected path, and then selects the target path from each preselected 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 transmitted on a new target path instead of transmitting the current data packet to be transmitted by using a historical path. According to the analysis, one of the paths is selected to transmit the new current data packet to be transmitted according to the residual bandwidth of each path, so that the load balance of each path is realized. 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.
In addition, the invention can schedule the flow to the most reasonable path in time according to the link state by the SDN architecture and the programmable data plane technology, fully utilize link resources, reduce link congestion and greatly reduce the processing delay caused by packet disorder at the convergence end.
Based on the above embodiments, the present invention further provides a terminal device, and a schematic block diagram thereof may be as shown in fig. 5. The terminal equipment comprises a processor, a memory, a network interface, a display screen and a temperature sensor which are connected through a system bus. Wherein the processor of the terminal device is configured to provide computing and control capabilities. The memory of the terminal equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the terminal device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a path load balancing method. The display screen of the terminal equipment can be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the terminal equipment is arranged in the terminal equipment in advance and used for detecting the operating temperature of the internal equipment.
It will be understood by those skilled in the art that the block diagram of fig. 5 is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation to the terminal device to which the solution of the present invention is applied, and a specific terminal device may include more or less components than those shown in the figure, or may combine some components, or have different arrangements of components.
In one embodiment, a terminal device is provided, where the terminal device includes a memory, a processor, and a path load balancing program stored in the memory and executable on the processor, and when the processor executes the dual path load balancing program, the following operation instructions are implemented:
calculating the residual bandwidth of each preselected path;
screening out a target path from each preselected path according to the residual bandwidth of each preselected path;
and switching a path corresponding to the current data packet to be transmitted, of which difference information meets a set condition, 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.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile 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 a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the 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 (1)

* 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

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 kind of data center network dynamic load balancing method 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 华为技术有限公司 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 kind of data center network dynamic load balancing method 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 华为技术有限公司 Load balancing method, device and system

Cited By (1)

* 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

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
CN101729303B (en) Method and device for measuring network performance parameter
US8811395B2 (en) System and method for determination of routing information in a network
US8036121B2 (en) Method of estimating quality degradation on network in communication network system
US7898969B2 (en) Performance measurement in a packet transmission network
US20030012200A1 (en) Methods and system for resequencing out of order data packets
JP7322288B2 (en) Network OAM method and apparatus
CN110417674B (en) Data traffic sharing method and device
KR101467137B1 (en) In-service throughput testing in distributed router/switch architectures
CN115632986B (en) Path load balancing method and system
US20230017561A1 (en) Network Device, System and Method For Cycle-Based Load Balancing
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
CN110933002B (en) Method and device for realizing switching chip of MPLS in-band detection OAM
Sossalla et al. Enhanced one-way delay monitoring with openflow
EP4243368A1 (en) Data obtaining method and apparatus, device, and storage medium
JP7512415B2 (en) Network Device, System, and Method for Cycle-Based Load Balancing - Patent application
CN118075195A (en) Data center network fault rerouting method and device, electronic equipment and medium
Maksic et al. On the performance of the load balanced shortest path routing
JP5117534B2 (en) Network monitoring apparatus, network monitoring method, and network monitoring program
JP2002077160A (en) Network quality evaluating device
CN115733755A (en) Data center transmission control system and method capable of filling network bandwidth
Joo et al. Performance monitoring for multimedia traffic using differentiated probe (DiffProbe)
Barabas et al. Routing Management Based on Statistical Cross-Layer QoS Information Regarding Link Status
KR20060131098A (en) Apparatus of monitoring atm cell for cdma mobile communication system and the method of the same

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