CN109450807B - Interface selection method and communication equipment - Google Patents
Interface selection method and communication equipment Download PDFInfo
- Publication number
- CN109450807B CN109450807B CN201811435692.7A CN201811435692A CN109450807B CN 109450807 B CN109450807 B CN 109450807B CN 201811435692 A CN201811435692 A CN 201811435692A CN 109450807 B CN109450807 B CN 109450807B
- Authority
- CN
- China
- Prior art keywords
- interface
- bandwidth
- weight value
- basic weight
- current weight
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000004891 communication Methods 0.000 title claims abstract description 29
- 238000010187 selection method Methods 0.000 title claims abstract description 12
- 238000000034 method Methods 0.000 claims abstract description 39
- 238000004364 calculation method Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000004590 computer program Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000009825 accumulation Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 229920006395 saturated elastomer Polymers 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2854—Wide area networks, e.g. public data networks
- H04L12/2856—Access arrangements, e.g. Internet access
- H04L12/2858—Access network architectures
- H04L12/2859—Point-to-point connection between the data network and the subscribers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the application provides an interface selection method and communication equipment, and the method comprises the following steps: acquiring a bandwidth basic weight value of each interface in a plurality of interfaces, wherein the bandwidth basic weight value represents the message sending capacity of the interface; for each interface, adding the bandwidth current weight value corresponding to each interface with the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface; and selecting the interface with the largest bandwidth current weight value as the interface for sending the message. For each interface, adding the original bandwidth current weight value of the interface and the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface; then, an interface with the largest bandwidth current weight value can be selected from the plurality of interfaces to send the message, wherein the largest bandwidth current weight value means that the message sending capability of the interface is stronger, and the possibility of sending congestion of the interface is the smallest, so that the message sending probability is improved.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to an interface selection method and a communication device.
Background
Now, the requirement for bandwidth is higher and higher, the bandwidth of the previous physical link cannot meet the internet access requirement of people, but in consideration of cost saving, it is generally desirable that the previous network planning and layout are not changed, so that a method for binding a plurality of physical links with smaller bandwidth is proposed. In a wide area network link, a multi-link Point-to-Point Protocol (MPPP) binds a plurality of Point-to-Point Protocol (PPP) links for use, thereby increasing bandwidth.
However, the bandwidth difference between different PPP links is large, and if the packets are not reasonably distributed to the links with different bandwidths, the traffic of the physical interface with a smaller bandwidth may be large, which causes physical congestion, while the physical interface with a larger bandwidth is far from being saturated.
Content of application
In view of this, embodiments of the present application provide an interface selection method and a communication device, so as to solve the problem that a physical interface cannot be matched with its corresponding bandwidth.
In a first aspect, an embodiment of the present application provides an interface selection method, which is applied to a communication device that sends a packet based on a multilink point-to-point protocol, where the method includes: acquiring a bandwidth basic weight value of each interface in a plurality of interfaces, wherein the bandwidth basic weight value represents the message sending capacity of the interface; adding the bandwidth current weight value corresponding to each interface with the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface; and selecting the interface with the largest bandwidth current weight value as the interface for sending the message.
For each interface, adding the original bandwidth current weight value of the interface and the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface; then, an interface with the largest bandwidth current weight value can be selected from the plurality of interfaces to send the message, wherein the largest bandwidth current weight value means that the message sending capability of the interface is stronger, and the possibility of sending congestion of the interface is the smallest, so that the message sending probability is improved.
In a possible design, after the selecting the interface with the largest current weight value of bandwidth as the interface for sending the packet, the method further includes: and subtracting the sum of the bandwidth current weight value and the bandwidth basic weight value of the interface sent by the current message, and taking the difference obtained by subtraction as a new bandwidth current weight value of the interface, wherein the sum of the bandwidth basic weight values is the sum of the bandwidth basic weight values of each interface.
Since the interface with the largest bandwidth current weight value has just sent the packet, in order to reduce the probability that the interface continues to be the interface with the largest bandwidth current weight value, the bandwidth current weight value and the sum of the bandwidth basic weight values may be subtracted, the obtained difference is used as a new bandwidth current weight value of the interface, and the sum of the bandwidth basic weight values is the sum of the bandwidth basic weight values of each interface. If the bandwidth difference of the two interfaces is small, and one interface just sends a message, the updated current weighted value of the bandwidth of the interface just sending the message is less than that of the other interface when the current weighted value of the bandwidth of the interface just sending the message is subtracted from the sum of the basic weighted values of the bandwidth; when the message is sent again next time, the bandwidth current weight values of the two interfaces are respectively added with the respective bandwidth basic weight values, the bandwidth current weight value of the interface which does not send the message is more likely to be larger than the bandwidth current weight value of the interface which has just sent the message, so that the interface which does not send the message can be selected when the message is sent again, and therefore load balance is achieved.
In one possible design, before obtaining the bandwidth base weight value of each of the plurality of interfaces, the method further includes: acquiring a bandwidth value reflecting the bandwidth size of each interface of a plurality of interfaces; calculating a greatest common divisor of the plurality of bandwidth values; dividing the bandwidth value of each interface by the greatest common divisor to obtain a quotient which is the bandwidth basic weight value of the interface, and initializing the bandwidth current weight value of each interface.
The bandwidth value of each interface can be obtained first, then the greatest common divisor of all the bandwidth values is calculated, for each interface, the bandwidth value of the interface is divided by the greatest common divisor, the obtained quotient is used as the bandwidth basic weight value of the interface, the bandwidth basic weight value is calculated in the mode, the difference and the multiple relation among the bandwidth basic weight values of each interface really reflect the difference and the multiple relation among the bandwidths of each interface, the flow carrying capacity of each interface can be reflected more intuitively, the bandwidth current weight value of each interface is initialized to be 0 generally, and then the bandwidth current weight value of each interface is subjected to addition and subtraction operation.
In one possible design, after the quotient obtained by dividing the bandwidth value of each interface by the greatest common divisor is the bandwidth basic weight value of the interface, the method further includes: constructing a preset array; and storing the bandwidth basic weight value of each interface into a preset array.
The preset array can be constructed in the communication equipment to store the bandwidth basic weight value of each interface, under the normal condition, the bandwidth of each interface cannot be changed, which means that the bandwidth basic weight value of each interface cannot be changed generally, so that the bandwidth basic weight value of each interface can be stored, and when the current weight value of the bandwidth of each interface needs to be accumulated, the bandwidth basic weight value of the corresponding interface is obtained from the preset array.
In one possible design, the obtaining a bandwidth base weight value of each of the plurality of interfaces includes: traversing the preset array; and acquiring a bandwidth basic weight value of each interface stored in the preset array.
When the bandwidth basic weight value is obtained, the bandwidth basic weight value of each interface can be obtained in a mode of traversing the preset array, and the mode of obtaining the bandwidth basic weight value is quicker and more accurate; the bandwidth basic weight value may also be obtained by calculating the bandwidth value of the interface divided by the greatest common divisor each time the bandwidth basic weight value is obtained, and the manner of obtaining the bandwidth basic weight value of each interface should not be construed as a limitation to the present application.
In a second aspect, an embodiment of the present application provides a communication device, where the communication device includes: a basic weight value obtaining module, configured to obtain a bandwidth basic weight value of each interface in the multiple interfaces, where the bandwidth basic weight value represents a size of a message sending capability of the interface; the current weight value calculation module is used for adding the bandwidth current weight value corresponding to each interface with the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface; and the interface selection module is used for selecting the interface with the largest current weight value of the bandwidth as the interface for sending the message.
For each interface, adding the original bandwidth current weight value of the interface and the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface; then, an interface with the largest bandwidth current weight value can be selected from the plurality of interfaces to send the message, wherein the largest bandwidth current weight value means that the message sending capability of the interface is stronger, and the possibility of sending congestion of the interface is the smallest, so that the message sending probability is improved.
In one possible design, the communication device further includes: and the current weight value calculating module is used for subtracting the sum of the bandwidth current weight value and the bandwidth basic weight value of the interface which is sent by the current message, and taking the difference obtained by subtraction as a new bandwidth current weight value of the interface, wherein the sum of the bandwidth basic weight values is the sum of the bandwidth basic weight values of each interface.
Since the interface with the largest bandwidth current weight value has just sent the packet, in order to reduce the probability that the interface continues to be the interface with the largest bandwidth current weight value, the bandwidth current weight value and the sum of the bandwidth basic weight values may be subtracted, the obtained difference is used as a new bandwidth current weight value of the interface, and the sum of the bandwidth basic weight values is the sum of the bandwidth basic weight values of each interface. If the bandwidth difference of the two interfaces is small, and one interface just sends a message, the updated current weighted value of the bandwidth of the interface just sending the message is less than that of the other interface when the current weighted value of the bandwidth of the interface just sending the message is subtracted from the sum of the basic weighted values of the bandwidth; when the message is sent again next time, the bandwidth current weight values of the two interfaces are respectively added with the respective bandwidth basic weight values, the bandwidth current weight value of the interface which does not send the message is more likely to be larger than the bandwidth current weight value of the interface which has just sent the message, so that the interface which does not send the message can be selected when the message is sent again, and therefore load balance is achieved.
In one possible design, the basic weight value obtaining module is specifically configured to obtain a bandwidth value that reflects a bandwidth size of each of the plurality of interfaces; the common divisor calculation module is used for calculating the maximum common divisor of the plurality of bandwidth values; and the weight value calculation module is used for dividing the bandwidth value of each interface by the maximum common divisor to obtain a quotient which is the bandwidth basic weight value of the interface, and initializing the bandwidth current weight value of each interface.
The bandwidth value of each interface can be obtained first, then the greatest common divisor of all the bandwidth values is calculated, for each interface, the bandwidth value of the interface is divided by the greatest common divisor, the obtained quotient is used as the bandwidth basic weight value of the interface, the bandwidth basic weight value is calculated in the mode, the difference and the multiple relation among the bandwidth basic weight values of each interface really reflect the difference and the multiple relation among the bandwidths of each interface, the flow carrying capacity of each interface can be reflected more intuitively, the bandwidth current weight value of each interface is initialized to be 0 generally, and then the bandwidth current weight value of each interface is subjected to addition and subtraction operation.
In one possible design, the base weight value obtaining module is further configured to: the method is used for constructing a preset array; and the method is used for storing the bandwidth basic weight value of each interface into a preset array.
The preset array can be constructed in the communication equipment to store the bandwidth basic weight value of each interface, under the normal condition, the bandwidth of each interface cannot be changed, which means that the bandwidth basic weight value of each interface cannot be changed generally, so that the bandwidth basic weight value of each interface can be stored, and when the current weight value of the bandwidth of each interface needs to be accumulated, the bandwidth basic weight value of the corresponding interface is obtained from the preset array.
In one possible design, the weight value obtaining module is specifically configured to traverse the preset array; and acquiring a bandwidth basic weight value of each interface stored in the preset array.
When the bandwidth basic weight value is obtained, the bandwidth basic weight value of each interface can be obtained in a mode of traversing the preset array, and the mode of obtaining the bandwidth basic weight value is quicker and more accurate; the bandwidth basic weight value may also be obtained by calculating the bandwidth value of the interface divided by the greatest common divisor each time the bandwidth basic weight value is obtained, and the manner of obtaining the bandwidth basic weight value of each interface should not be construed as a limitation to the present application.
In a third aspect, the present application provides an electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the communication device is operating, the machine-readable instructions when executed by the processor performing the method of the first aspect or any of the alternative implementations of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect or any of the alternative implementations of the first aspect.
In a fifth aspect, the present application provides a computer program product which, when run on a computer, causes the computer to perform the method of the first aspect or any possible implementation manner of the first aspect.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
For a clearer explanation of the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of an interface selection method according to a first embodiment of the present application;
fig. 2 is a flowchart of steps before step S110;
fig. 3 is a flowchart illustrating specific steps of step S110;
fig. 4 is a block diagram of a communication device according to a second embodiment of the present application.
Detailed Description
In the prior art, at most, N physical member interfaces of MPPP can be configured, and the bandwidth difference between the interfaces is large, for example, the bandwidth of CE1 interface is 64K, the bandwidth of E1 interface is 2M, and the interfaces with bandwidths such as 155M, 622M, 1.25G, 2.5G, 10G, etc. In the face of such a huge difference in bandwidth, some existing algorithms for implementing load balancing according to interface bandwidth cannot be normally used, and congestion occurs in an interface with a smaller bandwidth, and an interface with a larger bandwidth sends unsaturated information.
The above-mentioned drawbacks of the prior art are considered by the applicant to be the result of the practical and careful study, and therefore, the discovery process of the above-mentioned problems and the solution proposed by the following embodiments of the present invention to the above-mentioned problems should be the contribution of the inventor to the present invention in the course of the present invention.
In order to solve the above technical problem, embodiments of the present application provide the following interface selection method and communication device, which will be described in detail below with reference to the accompanying drawings.
First embodiment
Referring to fig. 1, fig. 1 shows a schematic flow chart of an interface selection method provided in a first embodiment of the present application, which specifically includes the following steps:
step S110, obtaining a bandwidth basic weight value of each interface of the plurality of interfaces, where the bandwidth basic weight value represents a size of a message sending capability of the interface.
The bandwidth basic weight value represents the message sending capacity of the interface, reflects the size of the interface bandwidth, and is large, which means that the message sending capacity of the interface is strong and the bandwidth of the interface is large; the low basic weight of the bandwidth means that the message sending capability of the interface is weak, and the bandwidth of the interface is low. The bandwidth of an interface does not typically change, so the individual bandwidth base weight value for each interface is also typically a fixed value. The plurality of interfaces acquired in this step are all activated interfaces.
The bandwidth basic weight values can be stored in a preset array, and if the bandwidth basic weight value of each interface in the plurality of interfaces is to be acquired, the preset array can be traversed to acquire the bandwidth basic weight values stored in the array. The bandwidth basic weight value may be stored in a preset array, or may also be stored in a preset data storage space, and the storage manner of storing the bandwidth basic weight value should not be construed as a limitation to the present application.
Step S120, adding the bandwidth current weight value corresponding to each interface to the bandwidth basic weight value of the interface, and using the sum as a new bandwidth current weight value of the interface.
The current weight value of the bandwidth of each interface is changed when the interface is selected every time, the basic weight value of the bandwidth of each interface is added on the basis of the current weight value of the bandwidth of each interface every time the interface is selected, and the obtained added values are used as the new current weight value of the bandwidth of each interface.
For convenience of description, the following description does not take three interfaces as an example: for interface a, interface B and interface C, the bandwidth basic weight values of interface a, interface B and interface C are a, B and C, respectively, and before accumulation, the bandwidth current weight values of interface a, interface B and interface C are X ═ a1, Y ═ B1 and Z ═ C1, respectively, where X, Y, Z represents the bandwidth current weight values of three interfaces (initialized to 0, or any other determined value, as long as all interfaces are unified), and a1, B1 and C1 are specific numerical values of the three bandwidth current weight values, respectively. For each interface, the corresponding bandwidth current weight value is added to the bandwidth basic weight value of the interface, as a new bandwidth current weight value, that is, the bandwidth current weight value of the interface a becomes: x is a1+ a is a 2; the bandwidth current weight value for interface B becomes: y-b 1+ b-b 2; the bandwidth current weight value of interface C becomes: z-c 1+ c-c 2.
Step S130, selecting the interface with the largest bandwidth current weight value as the interface for sending the current message.
And after the new bandwidth current weight value of each interface is obtained, taking the interface with the maximum bandwidth current weight value in each interface as the interface for sending the message. For each interface, adding the original bandwidth current weight value of the interface and the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface; then, an interface with the largest bandwidth current weight value can be selected from the plurality of interfaces to send the message, wherein the largest bandwidth current weight value means that the message sending capability of the interface is stronger, and the possibility of sending congestion of the interface is the smallest, so that the message sending probability is improved.
After step S130, the following steps are also included: and subtracting the sum of the bandwidth current weight value and the bandwidth basic weight value of the interface sent by the current message, and taking the difference obtained by subtraction as a new bandwidth current weight value of the interface, wherein the sum of the bandwidth basic weight values is the sum of the bandwidth basic weight values of each interface.
Since the interface with the largest bandwidth current weight value has just sent the packet, in order to reduce the probability that the interface continues to be the interface with the largest bandwidth current weight value, the bandwidth current weight value and the sum of the bandwidth basic weight values may be subtracted, the obtained difference is used as a new bandwidth current weight value of the interface, and the sum of the bandwidth basic weight values is the sum of the bandwidth basic weight values of each interface.
For interface a, interface B and interface C, if it is not set that the current weight value of the bandwidth of interface a is the largest, interface a is selected to send a message, and after interface a sends the message, the current weight value X of the bandwidth of interface a is a2- (a + B + C) is a 3. If the bandwidth difference between the interface a, the interface B and the interface C is not large, the bandwidth current weight values of the interface a, the interface B and the interface C should have a small difference although the bandwidth current weight values of the interface a, the interface B and the interface C have a small difference before the bandwidth current weight value is subtracted from the bandwidth basic weight value sum, and after the bandwidth current weight value is subtracted from the bandwidth basic weight value sum, the bandwidth current weight value of the interface a should be obviously smaller than the bandwidth current weight value of the interface B or the interface C. When the message is sent again next time, adding respective bandwidth basic weight values to the bandwidth current weight values of the three interfaces, namely the bandwidth current weight value of the interface A becomes: x ═ a2- (a + b + c) + a ═ a 4; the bandwidth current weight value for interface B becomes: y-b 2+ b-b 3; the bandwidth current weight value of interface C becomes: if Z is C2+ C is C3, the current weight of bandwidth of interface a is still larger than the smallest possible weight of interface B or interface C.
The following example is given by the fact that the bandwidth basic weight values of the three interfaces have small differences:
the bandwidth basic weight values of the interfaces a, B and C are respectively 5, 4 and 3, before accumulation, the bandwidth current weight values of the interfaces a, B and C are respectively initialized to X ═ 0, Y ═ 0 and Z ═ 0, for each interface, the corresponding bandwidth current weight value is added to the bandwidth basic weight value of the interface, and as a new bandwidth current weight value, that is, the bandwidth current weight value of the interface a becomes: x is 0+5 is 5; the bandwidth current weight value for interface B becomes: y is 0+4 is 4; the bandwidth current weight value of interface C becomes: z is 0+3 is 3. And selecting the interface with the largest bandwidth current weight value to send the message, namely selecting the interface A to send the message.
After the selected interface a performs packet transmission, the bandwidth current weight value of the interface a needs to be subtracted from the sum of the bandwidth basic weight values (5+4+3 equals 12), so as to obtain the updated bandwidth current weight value X of the interface a, where X equals 5-12 equals-7.
When the message needs to be sent again, the current weight value of the bandwidth of each interface is added to the basic weight value of the bandwidth of the interface to serve as a new current weight value of the bandwidth, that is, the current weight value of the bandwidth of the interface a becomes: x-7 + 5-2; the bandwidth current weight value for interface B becomes: y4 + 4-8; the bandwidth current weight value of interface C becomes: and Z is 3+3 and 6. The interface with the largest current weight value of the bandwidth among the three interfaces is the interface B, namely the interface B is selected to send the message.
After the selected interface B performs packet transmission, the current weight value of the bandwidth of the interface B needs to be subtracted from the sum of the basic weight values of the bandwidth (5+4+3 equals 12), so as to obtain the updated current weight value Y of the bandwidth of the interface B, which equals 8-12 equals-4.
When the message needs to be sent again, the current weight value of the bandwidth of each interface is added to the basic weight value of the bandwidth of the interface to serve as a new current weight value of the bandwidth, that is, the current weight value of the bandwidth of the interface a becomes: x-2 + 5-3; the bandwidth current weight value for interface B becomes: y-4 + 4-0; the bandwidth current weight value of interface C becomes: and Z is 6+3 and 9. The interface with the largest current weight value of the bandwidth among the three interfaces is the interface C, namely the interface C is selected to send the message.
After the selected interface C performs packet transmission, the bandwidth current weight value of the interface C needs to be subtracted from the sum of the bandwidth basic weight values (5+4+3 equals 12), so as to obtain the updated bandwidth current weight value Z of the interface C, where Z equals 9-12 equals-3.
……
By the above mode, every 12 times of message sending, the number of times of message sending by the interface A is 5, the number of times of message sending by the interface B is 4, and the number of times of message sending by the interface C is 3, so that the load balance of the interface is better realized.
The following example is given by taking the bandwidth basic weight values of three interfaces as big differences:
the bandwidth basic weight values of the interfaces a, B and C are respectively 7, 2 and 1, before accumulation, the bandwidth current weight values of the interfaces a, B and C are respectively initialized to X ═ 0, Y ═ 0 and Z ═ 0, for each interface, the corresponding bandwidth current weight value is added to the bandwidth basic weight value of the interface, and as a new bandwidth current weight value, that is, the bandwidth current weight value of the interface a becomes: x is 0+7 is 7; the bandwidth current weight value for interface B becomes: y is 0+2 is 2; the bandwidth current weight value of interface C becomes: z is 0+1 is 1. And selecting the interface with the largest bandwidth current weight value to send the message, namely selecting the interface A to send the message.
After the selected interface a performs packet transmission, the bandwidth current weight value of the interface a needs to be subtracted from the sum of the bandwidth basic weight values (7+2+1 ═ 10), and the updated bandwidth current weight value X of the interface a is obtained, where X is 7-10 ═ 3.
When the message needs to be sent again, the current weight value of the bandwidth of each interface is added to the basic weight value of the bandwidth of the interface to serve as a new current weight value of the bandwidth, that is, the current weight value of the bandwidth of the interface a becomes: x-3 + 7-4; the bandwidth current weight value for interface B becomes: y2 + 2-4; the bandwidth current weight value of interface C becomes: z is 1+1 is 2. Among the three interfaces, the interface with the largest current weight value of the bandwidth is the interface a and the interface B, and when the current weight values of the bandwidths of two or more interfaces are the same and are the largest, the interfaces can be selected according to the sequence of the serial numbers of the interfaces, for example, the serial number of the interface a is not set to be smaller than the serial number of the interface B, that is, the interface a is still selected to send the message.
After the selected interface a performs packet transmission, the bandwidth current weight value of the interface a needs to be subtracted from the sum of the bandwidth basic weight values (5+4+3 ═ 12), and the updated bandwidth current weight value X of the interface a is obtained, where X is 4-10 ═ 6.
When the message needs to be sent again, the current weight value of the bandwidth of each interface is added to the basic weight value of the bandwidth of the interface to serve as a new current weight value of the bandwidth, that is, the current weight value of the bandwidth of the interface a becomes: x-6 + 7-1; the bandwidth current weight value for interface B becomes: y is 4+2 is 6; the bandwidth current weight value of interface C becomes: and Z is 2+ 1-3. The interface with the largest current weight value of the bandwidth among the three interfaces is the interface B, namely the interface B is selected to send the message.
After the selected interface B performs packet transmission, the current weight value of the bandwidth of the interface B needs to be subtracted from the sum of the basic weight values of the bandwidth (5+4+3 equals 12), so as to obtain the updated current weight value X of the bandwidth of the interface B, which equals 6-10 equals-4.
……
From the above example, it can be known that, if the bandwidth basic weight values of different interfaces are different greatly, an interface with a large bandwidth basic weight value may be selected many times in a small number of message transmissions, and the requirement of many messages transmitted by an interface with a large bandwidth basic weight value is met. When the message is continuously sent for 10 times, the frequency of sending the message by the interface A is 7 times, the frequency of sending the message by the interface B is 2 times, and the frequency of sending the message by the interface C is 1 time, so that the load balance of the interfaces is better realized.
Referring to fig. 2, fig. 2 shows a schematic step diagram before step S110, which specifically includes the following steps:
step S101, a bandwidth value reflecting the bandwidth size of each of the plurality of interfaces is obtained.
And step S102, calculating the greatest common divisor of the plurality of bandwidth values.
Step S103, dividing the bandwidth value of the interface by the greatest common divisor, obtaining a quotient as a bandwidth basic weight value of the interface, and initializing the bandwidth current weight value of each interface.
The bandwidth value of each interface can be obtained first, then the greatest common divisor of all the bandwidth values is calculated, for each interface, the bandwidth value of the interface is divided by the greatest common divisor, the obtained quotient is used as the bandwidth basic weight value of the interface, the bandwidth basic weight value is calculated in the mode, the difference and the multiple relation between the bandwidth basic weight values of the interfaces really reflect the difference and the multiple relation between the bandwidths of the interfaces, the flow carrying capacity of the interfaces can be reflected more intuitively, the bandwidth current weight value of each interface is initialized, the bandwidth current weight value of each interface is generally initialized to 0 (any other determined value can be used as long as all the interfaces are unified), and then the bandwidth current weight value of each interface is subjected to addition and subtraction operation.
The following is a specific example to illustrate how to calculate the bandwidth basic weight value of each interface:
for example, if the bandwidths of the three interfaces are BW _ a, BW _ b, BW _ c: calculating the greatest common divisor of the three interfaces: maxGcd ═ gcd (BW _ a, BW _ b, BW _ c).
Calculating the bandwidth basic weight values of the three activated interfaces according to the greatest common divisor, wherein the bandwidth basic weight values can be calculated in units of Kbps:
a=BW_a/maxGcd
b=BW_b/maxGcd
c=BW_c/maxGcd
assuming that the bandwidth values of the interface a, the interface B and the interface C are respectively 15M, 20M and 25M, obtaining a greatest common divisor 5 of the three interfaces, and then obtaining a bandwidth basic weight value of the interface a: 15/5 ═ 3, bandwidth base weight value for interface B: 20/5 — 4, bandwidth base weight value of interface C: 25/5 ═ 5.
And step S104, constructing a preset array.
Step S105, storing the bandwidth basic weight value of each interface to a preset array.
And constructing a preset Array to store the bandwidth basic weight value of each interface, wherein the Array [ … ] ═ a, b and c.
The preset array can be constructed in the communication equipment to store the bandwidth basic weight value of each interface, under the normal condition, the bandwidth of each interface cannot be changed, which means that the bandwidth basic weight value of each interface cannot be changed generally, so that the bandwidth basic weight value of each interface can be stored, and when the current weight value of the bandwidth of each interface needs to be accumulated, the bandwidth basic weight value of the corresponding interface is obtained from the preset array.
Referring to fig. 3, in an embodiment of the present application, the obtaining a bandwidth basic weight value of each interface of a plurality of interfaces specifically includes the following steps:
and step S111, traversing the preset array.
Step S112, obtaining a bandwidth basic weight value of each interface stored in the preset array.
When the bandwidth basic weight value is obtained, the bandwidth basic weight value of each interface can be obtained in a mode of traversing the preset array, and the mode of obtaining the bandwidth basic weight value is quicker and more accurate; the bandwidth basic weight value may also be obtained by calculating the bandwidth value of the interface divided by the greatest common divisor each time the bandwidth basic weight value is obtained, and the manner of obtaining the bandwidth basic weight value of each interface should not be construed as a limitation to the present application.
The interface selection method provided by the first embodiment of the present application selects an interface by adding or subtracting the bandwidth basic weight value and according to the updated bandwidth basic weight value, which not only can satisfy the weighted average of load balancing, but also can ensure the random selection of the interface.
Second embodiment
Referring to fig. 4, fig. 4 shows a communication device provided in a second embodiment of the present application, where the communication device 300 includes:
the basic weight value obtaining module 310 is configured to obtain a bandwidth basic weight value of each interface of the multiple interfaces, where the bandwidth basic weight value represents a size of a message sending capability of the interface.
And a current weight value calculating module 320, configured to add the bandwidth current weight value corresponding to each interface to the bandwidth basic weight value of the interface, and use the added sum as a new bandwidth current weight value of the interface.
The interface selection module 330 is configured to select an interface with the largest bandwidth current weight value as an interface for sending the current packet.
The communication device further includes: the current weight value calculating module 320 is further configured to subtract the bandwidth current weight value of the interface sent by the current packet from the sum of the bandwidth basic weight values of the plurality of interfaces, and use the difference obtained by subtraction as a new bandwidth current weight value of the interface.
The basic weight value obtaining module 310 is specifically configured to obtain a bandwidth value that reflects a bandwidth size of each of the plurality of interfaces; calculating a greatest common divisor of a plurality of the bandwidth values; dividing the bandwidth value of the interface by the greatest common divisor to obtain a quotient which is a bandwidth basic weight value of the interface, and initializing the bandwidth current weight value of each interface. The basic weight value obtaining module 310 is further configured to: constructing a preset array; and storing the bandwidth basic weight value of each interface into a preset array. The basic weight value obtaining module 310 is specifically configured to traverse the preset array; and acquiring a bandwidth basic weight value of each interface stored in the preset array.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the communication device described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
The present application further provides an electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the communication device is operating, the machine-readable instructions when executed by the processor performing the method of the first embodiment.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first embodiment.
The present application also provides a computer program product which, when run on a computer, causes the computer to perform the method of the first embodiment.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
According to the embodiment of the application, in an application scene that a large number of physical interfaces are bound by the MPPP and the bandwidth difference between the physical interfaces is large, the problem that the sending performance is reduced due to poor load balancing effect is solved, the sending performance of the MPPP is improved, and the use experience of a user is improved.
The embodiment of the application provides an interface selection method and communication equipment, which are applied to the communication equipment for sending messages based on a multilink point-to-point protocol, and comprise the following steps: acquiring a bandwidth basic weight value of each interface in a plurality of interfaces, wherein the bandwidth basic weight value represents the message sending capacity of the interface; adding the bandwidth current weight value corresponding to each interface with the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface; and selecting the interface with the largest bandwidth current weight value as the interface for sending the message. For each interface, adding the original bandwidth current weight value of the interface and the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface; then, an interface with the largest bandwidth current weight value can be selected from the plurality of interfaces to send the message, wherein the largest bandwidth current weight value means that the message sending capability of the interface is stronger, and the possibility of sending congestion of the interface is the smallest, so that the message sending probability is improved.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (8)
1. An interface selection method applied to a communication device that sends a packet based on a multilink point-to-point protocol, the method comprising:
acquiring a bandwidth basic weight value of each interface in a plurality of interfaces, wherein the bandwidth basic weight value represents the message sending capacity of the interface;
adding the bandwidth current weight value corresponding to each interface with the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface;
selecting an interface with the largest bandwidth current weight value as an interface for sending the message;
after the interface with the largest current weight value of the bandwidth is selected as the interface for sending the current message, the method further includes:
and subtracting the sum of the bandwidth current weight value of the interface sent by the current message and the bandwidth basic weight values of the plurality of interfaces, and taking the difference obtained by subtraction as a new bandwidth current weight value of the interface.
2. The method of claim 1, wherein before obtaining the bandwidth base weight value for each of the plurality of interfaces, the method further comprises:
acquiring a bandwidth value reflecting the bandwidth size of each interface of a plurality of interfaces;
calculating a greatest common divisor of a plurality of the bandwidth values;
dividing the bandwidth value of each interface by the greatest common divisor to obtain a quotient which is the bandwidth basic weight value of the interface, and initializing the bandwidth current weight value of each interface.
3. The method of claim 2, wherein after the quotient obtained by dividing the bandwidth value of each interface by the greatest common divisor is a bandwidth base weight value of the interface, the method further comprises:
constructing a preset array;
and storing the bandwidth basic weight value of each interface into a preset array.
4. The method of claim 3, wherein obtaining the bandwidth base weight value for each of the plurality of interfaces comprises:
traversing the preset array;
and acquiring a bandwidth basic weight value of each interface stored in the preset array.
5. A communication device, characterized in that the communication device comprises:
a basic weight value obtaining module, configured to obtain a bandwidth basic weight value of each interface in the multiple interfaces, where the bandwidth basic weight value represents a size of a message sending capability of the interface;
the current weight value calculation module is used for adding the bandwidth current weight value corresponding to each interface with the bandwidth basic weight value of the interface, and taking the added sum as a new bandwidth current weight value of the interface;
the interface selection module is used for selecting the interface with the largest current weight value of the bandwidth as the interface for sending the message;
the current weight value calculating module is further configured to subtract the bandwidth current weight value of the interface sent by the current packet from the sum of the bandwidth basic weight values of the plurality of interfaces, and use the difference obtained by subtraction as a new bandwidth current weight value of the interface.
6. The communication device according to claim 5, wherein the basic weight value obtaining module is specifically configured to,
acquiring a bandwidth value reflecting the bandwidth size of each interface of a plurality of interfaces;
calculating a greatest common divisor of a plurality of the bandwidth values;
dividing the bandwidth value of each interface by the greatest common divisor to obtain a quotient which is the bandwidth basic weight value of the interface, and initializing the bandwidth current weight value of each interface.
7. The communications device of claim 6, wherein the basic weight value obtaining module is further configured to:
constructing a preset array;
and storing the bandwidth basic weight value of each interface into a preset array.
8. The communications device according to claim 7, wherein the basic weight value obtaining module is specifically configured to traverse the preset array;
and acquiring a bandwidth basic weight value of each interface stored in the preset array.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811435692.7A CN109450807B (en) | 2018-11-28 | 2018-11-28 | Interface selection method and communication equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811435692.7A CN109450807B (en) | 2018-11-28 | 2018-11-28 | Interface selection method and communication equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109450807A CN109450807A (en) | 2019-03-08 |
CN109450807B true CN109450807B (en) | 2022-02-22 |
Family
ID=65555682
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811435692.7A Active CN109450807B (en) | 2018-11-28 | 2018-11-28 | Interface selection method and communication equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109450807B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113050978B (en) * | 2019-12-26 | 2024-03-19 | 中国移动通信集团北京有限公司 | Gray release control method, device and equipment for application and computer storage medium |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6430155B1 (en) * | 1998-11-30 | 2002-08-06 | Cisco Technology, Inc. | Congestion avoidance on communications networks |
CN101110763A (en) * | 2007-06-22 | 2008-01-23 | 中兴通讯股份有限公司 | Method for fast weighing and selecting port |
CN101110775A (en) * | 2007-07-06 | 2008-01-23 | 中兴通讯股份有限公司 | Method and system for dynamically regulating load distribution |
CN101184049A (en) * | 2007-12-12 | 2008-05-21 | 中兴通讯股份有限公司 | Dynamic load sharing method and system |
CN103117946A (en) * | 2012-12-11 | 2013-05-22 | 广东电网公司电力调度控制中心 | Flow sharing method based on combined application of isolating device and isolation gateway |
CN104219111A (en) * | 2013-05-31 | 2014-12-17 | 中国电信股份有限公司 | Link binding method based on MLPPP (Multilink-Point-to-Point Protocol) and communication system |
CN104301305A (en) * | 2014-09-17 | 2015-01-21 | 北京大学深圳研究生院 | Method and forwarding terminal for interest packet forwarding under information center network |
CN104954275A (en) * | 2014-03-30 | 2015-09-30 | 瞻博网络公司 | Systems and methods for multipath load balancing |
CN105578528A (en) * | 2016-01-08 | 2016-05-11 | 努比亚技术有限公司 | Data interface distribution method and apparatus and terminal device |
CN105682146A (en) * | 2016-01-08 | 2016-06-15 | 努比亚技术有限公司 | Data transmission method and device and user equipment |
CN106941455A (en) * | 2016-01-04 | 2017-07-11 | 中兴通讯股份有限公司 | The method and device that balanced load is shared |
CN108055203A (en) * | 2017-12-26 | 2018-05-18 | 杭州迪普科技股份有限公司 | A kind of equivalent route load sharing method and device |
EP3355498A1 (en) * | 2017-01-30 | 2018-08-01 | Xieon Networks S.à r.l. | Method and tool for service provisioning with improved spectral efficiency in grid-less optical networks |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8451860B2 (en) * | 2007-02-08 | 2013-05-28 | The Boeing Company | Low-weight hybrid deterministic highspeed data bus |
-
2018
- 2018-11-28 CN CN201811435692.7A patent/CN109450807B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6430155B1 (en) * | 1998-11-30 | 2002-08-06 | Cisco Technology, Inc. | Congestion avoidance on communications networks |
CN101110763A (en) * | 2007-06-22 | 2008-01-23 | 中兴通讯股份有限公司 | Method for fast weighing and selecting port |
CN101110775A (en) * | 2007-07-06 | 2008-01-23 | 中兴通讯股份有限公司 | Method and system for dynamically regulating load distribution |
CN101184049A (en) * | 2007-12-12 | 2008-05-21 | 中兴通讯股份有限公司 | Dynamic load sharing method and system |
CN103117946A (en) * | 2012-12-11 | 2013-05-22 | 广东电网公司电力调度控制中心 | Flow sharing method based on combined application of isolating device and isolation gateway |
CN104219111A (en) * | 2013-05-31 | 2014-12-17 | 中国电信股份有限公司 | Link binding method based on MLPPP (Multilink-Point-to-Point Protocol) and communication system |
CN104954275A (en) * | 2014-03-30 | 2015-09-30 | 瞻博网络公司 | Systems and methods for multipath load balancing |
CN104301305A (en) * | 2014-09-17 | 2015-01-21 | 北京大学深圳研究生院 | Method and forwarding terminal for interest packet forwarding under information center network |
CN106941455A (en) * | 2016-01-04 | 2017-07-11 | 中兴通讯股份有限公司 | The method and device that balanced load is shared |
CN105578528A (en) * | 2016-01-08 | 2016-05-11 | 努比亚技术有限公司 | Data interface distribution method and apparatus and terminal device |
CN105682146A (en) * | 2016-01-08 | 2016-06-15 | 努比亚技术有限公司 | Data transmission method and device and user equipment |
EP3355498A1 (en) * | 2017-01-30 | 2018-08-01 | Xieon Networks S.à r.l. | Method and tool for service provisioning with improved spectral efficiency in grid-less optical networks |
CN108055203A (en) * | 2017-12-26 | 2018-05-18 | 杭州迪普科技股份有限公司 | A kind of equivalent route load sharing method and device |
Non-Patent Citations (1)
Title |
---|
基于权重的反馈优先IP流量控制算法;季春兰,叶德谦,柳旭日,王天娥;《计算机技术与发展》;20090630;142-144 * |
Also Published As
Publication number | Publication date |
---|---|
CN109450807A (en) | 2019-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112131006B (en) | Service request allocation method, device, computer equipment and storage medium | |
CN105721350B (en) | A kind of method and device of smart allocation bandwidth | |
US8208403B2 (en) | Defining an end-to-end path for a network service | |
JP2013168934A (en) | Load-balancing device and load-balancing method | |
CN110365748A (en) | Treating method and apparatus, storage medium and the electronic device of business datum | |
JP2013168139A (en) | Load balancing device, load balancing method and hierarchized data center system | |
CN109450816B (en) | Queue scheduling method, device, network equipment and storage medium | |
CN110708242B (en) | Traffic scheduling method and device, electronic equipment and storage medium | |
CN107317764B (en) | Traffic load balancing method, system, device and computer readable storage medium | |
CN115664501B (en) | Adaptive weighted scheduling method and system based on space-based distributed satellite cluster | |
CN114598654B (en) | Flow equalization processing method and device based on content delivery network CDN | |
Moscholios et al. | QoS guarantee in a batched poisson multirate loss model supporting elastic and adaptive traffic | |
CN110233866A (en) | A kind of load-balancing method and load balancer | |
CN110113263A (en) | A kind of communication path determines method and device | |
CN109450807B (en) | Interface selection method and communication equipment | |
CN110198267B (en) | Traffic scheduling method, system and server | |
CN107113323A (en) | A kind of date storage method, device and system | |
CN110851275B (en) | Load transfer method and device of routing node | |
CN110995802A (en) | Task processing method and device, storage medium and electronic device | |
CN114090187A (en) | Resource scheduling method, system and cloud | |
CN107210962B (en) | Path selection method, device and system | |
Roy et al. | Fairness in message delivery in delay tolerant networks | |
CN113590319A (en) | Computing resource load balancing method and device for message queue | |
Panagoulias et al. | Performance metrics in OFDM wireless networks supporting quasi-random traffic | |
Kontogiannis et al. | ALBL: an adaptive load balancing algorithm for distributed web systems |
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 |