CN113098790B - Flow forwarding method and device - Google Patents

Flow forwarding method and device Download PDF

Info

Publication number
CN113098790B
CN113098790B CN202110327849.XA CN202110327849A CN113098790B CN 113098790 B CN113098790 B CN 113098790B CN 202110327849 A CN202110327849 A CN 202110327849A CN 113098790 B CN113098790 B CN 113098790B
Authority
CN
China
Prior art keywords
member port
aggregation
aggregation member
port
user terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110327849.XA
Other languages
Chinese (zh)
Other versions
CN113098790A (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.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN202110327849.XA priority Critical patent/CN113098790B/en
Publication of CN113098790A publication Critical patent/CN113098790A/en
Application granted granted Critical
Publication of CN113098790B publication Critical patent/CN113098790B/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/24Multipath
    • H04L45/245Link aggregation, e.g. trunking

Abstract

The embodiment of the invention provides a flow forwarding method and a device, which relate to the technical field of data processing, and the method comprises the following steps: determining an aggregation port for forwarding network traffic of a user terminal; calculating a target indicated value of an aggregation member port according to the identifier of the user terminal and the total residual bandwidth, wherein the total residual bandwidth is as follows: the sum of the residual bandwidths of all aggregation member ports contained in the aggregation port; determining an indication value for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth; selecting a target aggregation member port whose indication value comprises the target indication value; and forwarding the network traffic through the target aggregation member port. When the scheme provided by the embodiment of the invention is applied to flow forwarding, the load of each aggregation member port tends to be balanced, and the condition of link congestion can be reduced.

Description

Flow forwarding method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a traffic forwarding method and apparatus.
Background
Gateway equipment such as BRAS (Broadband Remote Access Server) can provide network Access service for a user terminal, wherein BRAS is novel Access gateway equipment facing Broadband network application. Generally, the gateway device includes a plurality of physical interfaces, and in order to facilitate operations, the physical interfaces may be aggregated into an aggregation port, and the physical interfaces included in the aggregation port are referred to as aggregation member ports.
After receiving the network traffic of the user terminal, the gateway device may select an aggregation member port for forwarding the network traffic from among aggregation member ports included in the aggregation port, and forward the network traffic through the selected aggregation member port.
Due to the factors such as the strategy adopted when the gateway device selects the aggregation member port, a large amount of network traffic of the user terminal is often concentrated in one aggregation member port, so that the load of each aggregation member port is unbalanced when the network traffic is forwarded, and link congestion is likely to occur.
Disclosure of Invention
The embodiment of the invention aims to provide a traffic forwarding method and a traffic forwarding device, so that loads of all aggregation member ports are balanced when network traffic is forwarded, and the condition of link congestion is reduced. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a traffic forwarding method, where the method includes:
determining an aggregation port for forwarding network traffic of a user terminal;
calculating a target indicated value of an aggregation member port according to the identifier of the user terminal and the total residual bandwidth, wherein the total residual bandwidth is as follows: the sum of the residual bandwidths of all aggregation member ports contained in the aggregation port;
determining an indication value for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth;
selecting a target aggregation member port whose indicated value comprises the target indicated value;
and forwarding the network traffic through the target aggregation member port.
In an embodiment of the present invention, the calculating a target indication value of an aggregation member port according to the identifier of the user terminal and the total remaining bandwidth includes:
calculating a quantization value of the total residual bandwidth according to a preset bandwidth quantization step;
calculating the remainder of the identification of the user terminal and the quantization value as a target indicated value of the aggregation member port;
the determining an indication value for indicating each aggregation member port according to a ratio of the remaining bandwidth of each aggregation member port to the total remaining bandwidth includes:
determining the number of indicated values for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth;
and selecting a corresponding number of numerical values of the aggregation member port from [0, the quantization value-1 ] as an indication value for indicating the aggregation member port for each aggregation member port.
In an embodiment of the present invention, the bandwidth quantization step size is 1.
In an embodiment of the present invention, the determining an aggregation port for forwarding network traffic of the user terminal includes:
and determining an aggregation port for forwarding network traffic of the user terminal according to a polling interval, wherein the polling interval is determined according to the number of the online user terminals.
In an embodiment of the present invention, the method further includes:
judging whether the target aggregation member port is consistent with a cached member port, wherein the cached member port is as follows: the aggregation member port corresponding to the user terminal is stored in a user member port list, and the user member port list is used for storing the corresponding relation between the user terminal and the aggregation member port;
if not, updating the cached member port as the target aggregation member port, and updating the aggregation member port corresponding to the user side recorded in the forwarding table entry as the target aggregation member port;
the forwarding the network traffic through the target aggregation member port includes:
and forwarding the network flow through the aggregation member port corresponding to the user terminal stored in the forwarding table entry.
In a second aspect, an embodiment of the present invention provides a traffic forwarding apparatus, where the apparatus includes:
the aggregation port determining module is used for determining an aggregation port for forwarding the network traffic of the user terminal;
an indicated value calculation module, configured to calculate a target indicated value of an aggregation member port according to the identifier of the user terminal and a total remaining bandwidth, where the total remaining bandwidth is: the sum of the residual bandwidths of all aggregation member ports contained in the aggregation port;
an indicated value determining module, configured to determine an indicated value for indicating each aggregation member port according to a ratio of a remaining bandwidth of each aggregation member port to the total remaining bandwidth;
an aggregation member port selection module for selecting a target aggregation member port whose indicated value includes the target indicated value;
and the network flow forwarding module is used for forwarding the network flow through the target aggregation member port.
In an embodiment of the present invention, the indicating value calculating module includes:
the quantized value operator module is used for calculating the quantized value of the total residual bandwidth according to the preset bandwidth quantization step length;
an indicated value calculation submodule, configured to calculate a remainder of the identifier of the user terminal and the quantized value, where the remainder is used as a target indicated value of the aggregation member port;
the indicated value determination module includes:
the quantity determination submodule is used for determining the quantity of the indicated values for indicating the aggregation member ports according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth;
and an indication value determining submodule, configured to select, for each aggregation member port, a corresponding number of numerical values of the aggregation member port from [0, the quantization value-1 ], as an indication value for indicating the aggregation member port.
In an embodiment of the present invention, the bandwidth quantization step size is 1.
In an embodiment of the present invention, the aggregation interface determining module is specifically configured to determine an aggregation interface for forwarding network traffic of the user terminal according to a polling interval, where the polling interval is determined according to the number of online user terminals.
In an embodiment of the present invention, the apparatus further includes an aggregation member port determining module,
the aggregation member port determining module is specifically configured to determine whether the target aggregation member port is consistent with a cached member port, where the cached member port is: the aggregation member port corresponding to the user terminal is stored in a user member port list, and the user member port list is used for storing the corresponding relation between the user terminal and the aggregation member port; if not, updating the cached member port as the target aggregation member port, and updating the aggregation member port corresponding to the user side recorded in the forwarding table entry as the target aggregation member port;
the network traffic forwarding module is specifically configured to forward the network traffic through the aggregation member port corresponding to the user terminal stored in the forwarding table entry.
In a third aspect, an embodiment of the present invention provides a gateway device, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the method steps of the first aspect are carried out.
In a fourth aspect, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: the method steps according to the second aspect above are implemented.
As can be seen from the above, when the scheme provided in the embodiment of the present invention is applied to perform traffic forwarding, the indication value for indicating each aggregation member port is determined according to the proportion of the remaining bandwidth of each aggregation member port in the total remaining bandwidth, because the remaining bandwidth of each aggregation member port reflects the capability of each aggregation member port that can currently forward network traffic, and the proportion of the remaining bandwidth of each aggregation member port in the total remaining bandwidth reflects the relative relationship between the capabilities of each aggregation member port that can currently forward network traffic, the number of the indication values of each aggregation member is adapted to the capability of each aggregation member port that can currently forward network traffic. And the target indicated value of the target aggregation member port for forwarding the network traffic of the user terminal is calculated based on the identifier of the user terminal and the total residual bandwidth, so that the indicated values calculated based on the identifiers of different user terminals can be distributed in the indicated values of each aggregation member port in the overall view. Therefore, different user terminals can hit different aggregation member ports by combining the total residual bandwidth, so that the load tends to be balanced when each aggregation member port forwards the network traffic, and the condition of link congestion is further reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention 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 invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a traffic forwarding system according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a traffic forwarding method according to an embodiment of the present invention;
fig. 3a is a schematic flowchart of a traffic forwarding method in a first application scenario according to an embodiment of the present invention;
fig. 3b is a schematic flowchart of a flow forwarding method in a second application scenario according to an embodiment of the present invention
Fig. 4 is a schematic structural diagram of a traffic forwarding device in an application scenario according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a gateway device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
First, an execution body of the embodiment of the present invention will be explained.
The execution main body of the embodiment of the invention can be gateway equipment, such as BRAS, wireless access gateway and the like.
Next, an application scenario of the embodiment of the present invention is specifically described with reference to fig. 1.
Fig. 1 is a schematic structural diagram of a traffic forwarding system according to an embodiment of the present invention. Fig. 1 includes a User terminal User and a gateway device.
The User terminal User comprises a User terminal User1, a User terminal User2 and a User terminal User 3.
The gateway device comprises a plurality of physical interfaces, and for the convenience of operation, each physical interface can be aggregated into an aggregation port, and the physical interfaces contained in the aggregation port are called aggregation member ports. The gateway device may forward the network traffic of the user terminal to the network through the aggregation member port.
In a first application scenario, the gateway device periodically polls and determines an aggregation member port for forwarding network traffic of each User terminal User. For example, after receiving the network traffic of the User terminal User1, an aggregation member port for forwarding the network traffic of the User terminal User1 is determined from aggregation member ports for forwarding the network traffic of each User terminal User, and the network traffic is forwarded through the determined aggregation member port.
Specifically, the gateway device may store the determined aggregation member port for forwarding the network traffic of each User terminal User in the forwarding table entry, and after receiving the network traffic of the User terminal, forward the network traffic through the aggregation member port corresponding to the User terminal in the forwarding table.
In the second application scenario, when the gateway device receives the network traffic of the user terminal, an aggregation member port for forwarding the network traffic is determined, and the network traffic is forwarded through the aggregation member port.
The following describes in detail a traffic forwarding method, an apparatus, a gateway device, and a storage medium provided in the embodiments of the present invention, respectively, with specific embodiments.
Referring to fig. 2, fig. 2 is a schematic flow chart of a traffic forwarding method according to an embodiment of the present invention, where the method includes the following steps S201 to S205.
Step S201: an aggregation port for forwarding network traffic of the user terminal is determined.
The aggregation port is an aggregation port in the gateway device, and the aggregation port includes a plurality of physical interfaces, which are also called aggregation member ports.
Specifically, when determining the aggregation port, in an embodiment, a corresponding relationship between the user terminal and the aggregation port for forwarding the user terminal may be preset, and the aggregation port for forwarding the network traffic of the user terminal may be determined based on the corresponding relationship.
In another embodiment, the aggregation port for forwarding the network traffic of the user terminal may be further determined based on an interface through which the gateway device receives the network traffic.
Specifically, a corresponding relationship between an interface through which the gateway device receives the network traffic and an aggregation port through which the network traffic is forwarded may be preset, and the aggregation port for forwarding the network traffic of the user terminal may be determined based on the interface through which the gateway device receives the network traffic and the corresponding relationship.
Step S202: and calculating a target indicated value of the aggregation member port according to the identification of the user terminal and the total residual bandwidth.
The total residual bandwidth is: the aggregate port comprises the sum of the remaining bandwidths of the aggregate member ports.
The residual bandwidth of the aggregation member port is: aggregating the difference between the total bandwidth and the occupied bandwidth of the member ports; the residual bandwidth of the aggregation member port reflects the current network traffic forwarding capability of the aggregation member port, the higher the residual bandwidth is, the better the current network traffic forwarding capability of the aggregation member port is, and the lower the residual bandwidth is, the poorer the current network traffic forwarding capability of the aggregation member port is.
For example: assuming that there are three aggregation member ports in an aggregation port, the total bandwidth of an aggregation member port 1 is 10G, the occupied bandwidth is 5G, and the remaining bandwidth of the aggregation member port 1 is (10-5) ═ 5G; the total actual bandwidth of the aggregation member port 2 is 10G, the occupied bandwidth is 3G, and the remaining bandwidth of the aggregation member port 2 is (10-3) ═ 7G; the total bandwidth of the aggregation member port 3 is 2G, the occupied bandwidth is 1G, and the remaining bandwidth of the aggregation member port 3 is (2-1) ═ 1G; the total remaining bandwidth is: (5+7+1) ═ 13G.
The target indication value is calculated according to the identifier of the user terminal and the total remaining bandwidth, and then the aggregation member port indicated by the target indication value is: and the aggregation member port is used for forwarding the network traffic of the user terminal. And the indicator values calculated based on the identities of different user terminals are different.
When calculating the target indicated value of the aggregation member port, the quantized value of the total residual bandwidth can be calculated according to a preset bandwidth quantization step length; and calculating the remainder of the identification of the user terminal and the quantized value as a target indication value of the aggregation member port.
The bandwidth quantization step may be set by a worker according to experience in advance, and the bandwidth quantization step may be: 1. 10, etc.
The bandwidth quantization step size may also be determined by a worker in advance based on the accuracy of the indication value of each aggregation member port, for example: the more accurate indication value needs to be calculated, the lower bandwidth quantization step size value can be selected, and the higher bandwidth quantization step size value can be selected when the more rough indication value needs to be calculated.
When calculating the quantization value of the total residual bandwidth, a ratio between the total residual bandwidth and the bandwidth quantization step may be calculated as the quantization value of the total residual bandwidth, for example: when the bandwidth quantization step is 1 and the total residual bandwidth is 13G, the quantization value of the total residual bandwidth is: 13 ÷ 1 ÷ 13.
The identifier of the user terminal may be an ID, a number, a serial number, and the like of the user terminal. Taking the ID of the ue as an example, assuming that the ID of the ue is 3 and the quantization value of the total residual bandwidth is 13, calculating the remainder of the ID of the ue and the total residual bandwidth as: (3 ÷ 13 ═ 0 … … 3) ═ 3, that is, the target indicator value for the aggregation member port is 3.
In this way, the remainder of the user terminal identifier and the quantization value is calculated as the target indication value of the aggregation member port, and the target indication values calculated based on the user terminal identifiers are different and are uniformly distributed in [0, quantization value-1 ].
Step S203: and determining an indication value for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth.
Because the residual bandwidth of the aggregation member port reflects the current capability of the aggregation member port for forwarding the network traffic, and the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth reflects the relative relationship between the current capabilities of each aggregation member port for forwarding the network traffic, the determined relative relationship between each indication value and the current capability of each aggregation member port for forwarding the network traffic is adapted.
Specifically, in the step S202, when the remainder of the identifier and the quantization value of the user equipment is used as the target indication value of the aggregation member port, and when the indication value for indicating each aggregation member port is determined, the number of the indication values for indicating each aggregation member port may be determined according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth; and selecting a corresponding number of numerical values of the aggregation member port from [0, quantization value-1 ] as an indication value having a corresponding relation with the aggregation member port for each aggregation member port.
Specifically, when determining the number of the indication values for indicating the respective aggregation member ports, the number of the indication values for indicating the respective aggregation member ports may be determined based on a ratio of the remaining bandwidth of the respective aggregation member ports to the total remaining bandwidth and the total number of the indication values.
When the remainder of the user terminal identifier and the quantization value is used as the target indication value of the aggregation member port, the target indication value of the aggregation member port is calculated to be between [0, quantization value-1 ], and [0, quantization value-1 ] can be determined as the indication value range of the indication value for indicating each aggregation member port. The total number of the above indicated values is a quantized value.
For example: assuming that the quantization value is 13, that is, the total number of the indication values is 13, the ratio of the remaining bandwidth of each aggregation member port in the total remaining bandwidth is: 5/13, 7/13 and 1/13, based on the above proportional relationship and the total number of indication values, the number of indication values for indicating each aggregation member port can be determined as: 5. 7 and 1.
When determining the indication value for indicating the aggregation member port, the corresponding number of values of the aggregation member port may be sequentially selected in the order of [0, quantization value-1 ], for example: assuming that the quantization value is 13 and the corresponding number of each aggregation member port is 5, 7,1, respectively, the indication value for indicating each aggregation member port can be determined as: [0,4], [5,11] and [12 ].
The numerical values of the corresponding number of the aggregation member ports can be selected in turn from the order of [0, quantization value-1 ] according to the sequence of the corresponding number of the aggregation member ports from large to small. For example: assuming that the quantization value is 13 and the corresponding number of each aggregation member port is 7, 5, and 1 in descending order, the indication value for indicating each aggregation member port can be determined as follows according to [0,12 ]: [0,6], [7,11] and [12 ].
The number of the determined indicated values is determined according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth, namely, the number of the determined indicated values is adaptive to the current capability of forwarding network traffic of each aggregation member port, and the indicated values obtained by calculation based on the identifications of different user terminals are uniformly distributed in [0, a quantized value-1 ], namely, the target indicated values obtained by calculation based on the identifications of different user terminals are distributed in the indicated values of each aggregation member port.
Step S204: a target aggregate member port is selected whose indicator value comprises a target indicator value.
Assume that the determined indication values for indicating the respective aggregation member ports are: [0,4], [5,11], [12], the target indication value is 3, the indication value [0,4] includes the target indication value 3, and the aggregation member port corresponding to the indication value [0,4] can be determined as the target aggregation member port.
Step S205: and forwarding the network traffic through the target aggregation member port.
As can be seen from the above, when the scheme provided in this embodiment is applied to perform traffic forwarding, the indication value for indicating each aggregation member port is determined according to the proportion of the remaining bandwidth of each aggregation member port in the total remaining bandwidth, because the remaining bandwidth of each aggregation member port reflects the capability of each aggregation member port that can currently forward network traffic, and the proportion of the remaining bandwidth of each aggregation member port in the total remaining bandwidth reflects the relative relationship between the capabilities of each aggregation member port that can currently forward network traffic, the number of the indication values of each aggregation member is adapted to the capability of each aggregation member port that can currently forward network traffic. And because the target indicated value of the target aggregation member port for forwarding the network traffic of the user terminal is calculated based on the identifier of the user terminal and the total residual bandwidth, the indicated values calculated based on the identifiers of different user terminals can be distributed in the indicated values of each aggregation member port in an overall view. Therefore, different user terminals can hit different aggregation member ports by combining the total residual bandwidth, so that the load tends to be balanced when each aggregation member port forwards the network traffic, and the condition of link congestion is further reduced.
In a first application scenario, the gateway device may determine an aggregation port for forwarding network traffic of the user terminal according to the polling interval. The polling interval may be determined based on the number of on-line user terminals.
The online user terminals refer to the number of online user terminals when traversing according to the polling interval.
Specifically, the correspondence between the number of online user terminals and each polling interval may be preset, and the polling interval may be determined based on the determined correspondence and the number of online user terminals; it is also possible to preset a linear relationship between the number of online user terminals and the polling interval, and to calculate the polling interval based on the determined linear relationship and the number of online user terminals.
The polling intervals are determined according to the number of the online user terminals, so that the determined polling intervals are adaptive to the number of the online user terminals, the problem that all the online user terminals are difficult to traverse in one polling period is avoided, and the user terminals can be traversed in time.
The gateway device may store a forwarding table entry, where the forwarding table entry records the user terminal and an aggregation member port for forwarding network traffic of the user terminal. The forwarding table entry may store a corresponding relationship between the user terminal and the aggregation member port in a key-value (key-extended) structure, where an identifier of the user terminal is a key and the aggregation member port is an extended. After receiving the network traffic of the user terminal, the gateway device may determine the corresponding aggregation member port through the identifier of the user terminal, and forward the network traffic based on the aggregation member port.
When the network traffic is forwarded, the network traffic can be forwarded through the aggregation member port corresponding to the user terminal stored in the forwarding table entry. Because the network flow is forwarded through the information recorded by the forwarding table entry, the efficiency of forwarding the network flow of the user terminal is improved.
On this basis, the gateway device of the embodiment of the present invention may further store a user member port list, where the user member port list is used to store a corresponding relationship between the user terminal and the aggregation member port, and update the user member port list and the forwarding table entry based on the determined target aggregation member port.
Specifically, it may be determined whether the target aggregation member port is consistent with the cached member port, and if not, the cached member port is updated to the target aggregation member port, and the aggregation member port corresponding to the user side recorded in the forwarding table entry is updated to the target aggregation member port.
The cached member ports are: and the aggregation member port corresponding to the user terminal is stored in the user member port list.
And under the condition that the target aggregation member port is judged to be inconsistent with the cached member port, updating the cached member port to the target aggregation member port, and updating the aggregation member port corresponding to the user side recorded in the forwarding table entry to the target aggregation member port, so that the information stored in the user member port list and the forwarding table entry is more accurate.
In one embodiment, the gateway device may refuse to update the cached member port and refuse to update the aggregation member port corresponding to the user side recorded in the forwarding entry, when it is determined that the target aggregation member port is consistent with the cached member port.
In another embodiment, the gateway device may not update the cached member port and the aggregation member port corresponding to the user side recorded in the forwarding table entry.
Therefore, under the condition that the target aggregation member port is consistent with the cached member port, the cached member port and the aggregation member port corresponding to the user side recorded in the forwarding table entry are kept unchanged, and processing resources for updating the table entry are saved.
It can be seen from the above embodiments that, since the information stored in the forwarding table entry is updated when the target aggregation member port is inconsistent with the cached member port, and the information stored in the forwarding table entry is maintained when the target aggregation member port is consistent with the cached member port, the aggregation member port corresponding to the user terminal recorded in the forwarding table entry is more accurate, so that the network traffic can be forwarded based on the accurate aggregation member port.
The following describes the traffic forwarding method provided by the present invention in detail with reference to the application scenario and fig. 3a and 3 b.
Fig. 3a is a schematic flowchart of a traffic forwarding method in a first application scenario according to an embodiment of the present invention.
S3011: traversing the online user terminal in a polling period according to a preset polling interval to obtain an aggregation port for forwarding the network traffic of the user terminal.
For each user terminal, the following steps S3021 to S3051 are adopted to determine an aggregation member port for forwarding the network traffic of the user terminal, and update a user member port list and a forwarding table entry.
S3021: and calculating the remainder of the user ID of the user terminal and the total residual bandwidth of each aggregation member port contained in the aggregation port as a target indication value.
S3031: and determining an indication value for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth, and selecting a target aggregation member port of which the indication value comprises a target indication value.
S3041: and judging whether the target aggregation member port is consistent with the aggregation member port corresponding to the user terminal stored in the user member port list, if not, executing S3051.
If the target aggregation member port is consistent with the aggregation member port corresponding to the user terminal stored in the user member port list, in an embodiment, the gateway device may refuse to update the aggregation member port corresponding to the user terminal stored in the user member port list, and refuse to update the aggregation member port corresponding to the user terminal recorded in the forwarding table entry.
In another embodiment, the gateway device may not update the aggregation member port corresponding to the user terminal stored in the user member port list and the aggregation member port corresponding to the user terminal recorded in the forwarding table entry.
S3051: and updating the aggregation member port corresponding to the user terminal stored in the user member port list as a target aggregation member port, and updating the aggregation member port corresponding to the user terminal recorded in the forwarding table entry as the target aggregation member port.
S3061: and after receiving the network flow of the user terminal, forwarding the network flow through an aggregation member port which is recorded by the forwarding table entry and used for forwarding the network flow of the user terminal.
Fig. 3b is a schematic flowchart of a traffic forwarding method in a second application scenario according to an embodiment of the present invention.
S3012: and after receiving the network traffic of the user terminal, acquiring an aggregation port for forwarding the network traffic of the user terminal.
S3022: and calculating the remainder of the user ID of the user terminal and the total residual bandwidth of each aggregation member port contained in the aggregation port as a target indication value.
S3032: and determining an indicating value for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth, and selecting a target aggregation member port of which the indicating value comprises a target indicating value.
S3042: forwarding network traffic based on the determined target aggregation member port.
S3052: and judging whether the target aggregation member port is consistent with the aggregation member port corresponding to the user terminal stored in the user member port list, if not, executing S3062.
If the target aggregation member port is consistent with the aggregation member port corresponding to the user terminal stored in the user member port list, in one embodiment, the gateway device may refuse to reject updating the aggregation member port corresponding to the user terminal stored in the user member port list, and refuse to update the aggregation member port corresponding to the user terminal recorded in the forwarding table entry.
In another embodiment, the gateway device may not update the aggregation member port corresponding to the user terminal stored in the user member port list and the aggregation member port corresponding to the user terminal recorded in the forwarding table entry.
S3062: and updating the aggregation member port corresponding to the user terminal stored in the user member port list as a target aggregation member port, and updating the aggregation member port corresponding to the user terminal recorded in the forwarding table entry as the target aggregation member port.
Corresponding to the traffic forwarding method, the embodiment of the invention also provides a traffic forwarding device.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a traffic forwarding device according to an embodiment of the present invention, where the traffic forwarding device includes the following modules 401 and 405.
An aggregation port determining module 401, configured to determine an aggregation port for forwarding network traffic of a user terminal;
an indicated value calculating module 402, configured to calculate a target indicated value of an aggregation member port according to the identifier of the user equipment and a total remaining bandwidth, where the total remaining bandwidth is: the sum of the residual bandwidths of all aggregation member ports contained in the aggregation port;
an indication value determining module 403, configured to determine an indication value for indicating each aggregation member port according to a ratio of the remaining bandwidth of each aggregation member port in the total remaining bandwidth;
an aggregation member port selection module 404, configured to select a target aggregation member port whose indication value includes the target indication value;
a network traffic forwarding module 405, configured to forward the network traffic through the target aggregation member port.
As can be seen from the above, when the scheme provided in the embodiment of the present invention is applied to perform traffic forwarding, the indication value for indicating each aggregation member port is determined according to the proportion of the remaining bandwidth of each aggregation member port in the total remaining bandwidth, because the remaining bandwidth of each aggregation member port reflects the capability of each aggregation member port that can currently forward network traffic, and the proportion of the remaining bandwidth of each aggregation member port in the total remaining bandwidth reflects the relative relationship between the capabilities of each aggregation member port that can currently forward network traffic, the number of the indication values of each aggregation member is adapted to the capability of each aggregation member port that can currently forward network traffic. And the target indicated value of the target aggregation member port for forwarding the network traffic of the user terminal is calculated based on the identifier of the user terminal and the total residual bandwidth, so that the indicated values calculated based on the identifiers of different user terminals can be distributed in the indicated values of each aggregation member port in the overall view. Therefore, different user terminals can hit different aggregation member ports by combining the total residual bandwidth, so that the load tends to be balanced when each aggregation member port forwards the network traffic, and the condition of link congestion is further reduced.
In an embodiment of the present invention, the indicating value calculating module 402 includes:
the quantized value operator module is used for calculating the quantized value of the total residual bandwidth according to the preset bandwidth quantization step length;
an indicated value calculation submodule, configured to calculate a remainder of the identifier of the user terminal and the quantized value, where the remainder is used as a target indicated value of the aggregation member port;
the indication value determining module 403 includes:
the quantity determination submodule is used for determining the quantity of the indicated value for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth;
and an indication value determining submodule, configured to select, for each aggregation member port, a corresponding number of numerical values of the aggregation member port from [0, the quantization value-1 ], as an indication value for indicating the aggregation member port.
In this way, the remainder of the user terminal identifier and the quantization value is calculated as the target indication value of the aggregation member port, and the target indication values calculated based on the user terminal identifiers are different and are uniformly distributed in [0, quantization value-1 ].
And the quantity of the determined indicated value is determined according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth, namely the quantity of the determined indicated value is adapted to the current capability of forwarding network flow of each aggregation member port, and the indicated values obtained by calculation based on the identifications of different user terminals are uniformly distributed in [0, quantized value-1 ], namely the target indicated values obtained by calculation based on the identifications of different user terminals are distributed in the indicated values of each aggregation member port.
In an embodiment of the present invention, the bandwidth quantization step size is 1.
In an embodiment of the present invention, the aggregation interface determining module 401 is specifically configured to determine an aggregation interface for forwarding network traffic of the user terminal according to a polling interval, where the polling interval is determined according to the number of online user terminals.
The polling intervals are determined according to the number of the online user terminals, so that the determined polling intervals are adaptive to the number of the online user terminals, the problem that all the online user terminals are difficult to traverse in one polling period is avoided, and the user terminals can be traversed in time.
In an embodiment of the present invention, the apparatus further includes an aggregation member port determining module,
the aggregation member port determining module is specifically configured to determine whether the target aggregation member port is consistent with a cached member port, where the cached member port is: the aggregation member port corresponding to the user terminal is stored in a user member port list, and the user member port list is used for storing the corresponding relation between the user terminal and the aggregation member port; if not, updating the cached member port as the target aggregation member port, and updating the aggregation member port corresponding to the user side recorded in the forwarding table entry as the target aggregation member port;
the network traffic forwarding module 405 is specifically configured to forward the network traffic through the aggregation member port corresponding to the user terminal stored in the forwarding table entry.
Under the condition that the target aggregation member port is judged to be inconsistent with the aggregation member port corresponding to the user terminal stored in the user member port list, the aggregation member port corresponding to the user terminal stored in the user member port list is updated to be the target aggregation member port, and the aggregation member port corresponding to the user side recorded in the forwarding table entry is updated to be the target aggregation member port, so that the information stored in the user member port list and the forwarding table entry is more accurate.
In addition, it can be seen from the above embodiment that, since the information stored in the forwarding table entry is updated when the target aggregation member port is inconsistent with the cached member port, the aggregation member port corresponding to the user terminal recorded in the forwarding table entry is more accurate, so that the network traffic can be forwarded based on the accurate aggregation member port.
Corresponding to the traffic forwarding method, the embodiment of the invention also provides gateway equipment.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a gateway device according to an embodiment of the present invention, and includes a processor 501 and a machine-readable storage medium 502, where the machine-readable storage medium 502 stores machine-executable instructions that can be executed by the processor 501, and the processor 501 is caused by the machine-executable instructions to implement a traffic forwarding method according to an embodiment of the present invention.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, which stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the traffic forwarding method provided by the embodiment of the present invention.
In another embodiment provided by the present invention, a computer program product containing instructions is also provided, which when executed on a computer causes the computer to implement the traffic forwarding method provided by the embodiment of the present invention.
As can be seen from the above, when the scheme provided in the embodiment of the present invention is used to forward traffic, the indication value for indicating each aggregation member port is determined according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth, and since the residual bandwidth of each aggregation member port reflects the current capability of each aggregation member port for forwarding network traffic and the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth reflects the relative relationship between the current capabilities of each aggregation member port for forwarding network traffic, the number of the indication values of each aggregation member is adapted to the current capability of each aggregation member port for forwarding network traffic. And the target indicated value of the target aggregation member port for forwarding the network traffic of the user terminal is calculated based on the identifier of the user terminal and the total residual bandwidth, so that the indicated values calculated based on the identifiers of different user terminals can be distributed in the indicated values of each aggregation member port in the overall view. Therefore, different user terminals can hit different aggregation member ports by combining the total residual bandwidth, so that the load tends to be balanced when each aggregation member port forwards the network traffic, and the condition of link congestion is further reduced.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
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.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the embodiments of the apparatus, the gateway device, and the computer-readable storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and in relation to the above, reference may be made to the partial description of the embodiments of the method.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for forwarding traffic, the method comprising:
determining an aggregation port for forwarding network traffic of a user terminal;
calculating a target indicated value of an aggregation member port according to the identifier of the user terminal and the total residual bandwidth, wherein the total residual bandwidth is as follows: the sum of the residual bandwidths of all aggregation member ports contained in the aggregation port;
determining an indication value for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth;
selecting a target aggregation member port whose indication value comprises the target indication value;
forwarding the network traffic through the target aggregation member port;
the calculating a target indicated value of the aggregation member port according to the identifier of the user terminal and the total residual bandwidth includes:
calculating a quantization value of the total residual bandwidth according to a preset bandwidth quantization step;
calculating the remainder of the identification of the user terminal and the quantization value as a target indicated value of the aggregation member port;
the determining an indication value for indicating each aggregation member port according to a ratio of the remaining bandwidth of each aggregation member port to the total remaining bandwidth includes:
determining the number of indicated values for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth;
and selecting a corresponding number of numerical values of the aggregation member port from [0, the quantization value-1 ] as an indication value for indicating the aggregation member port for each aggregation member port.
2. The method of claim 1, wherein the bandwidth quantization step size is 1.
3. The method of claim 1, wherein determining an aggregation port for forwarding network traffic of the user terminal comprises:
and determining an aggregation port for forwarding network traffic of the user terminal according to a polling interval, wherein the polling interval is determined according to the number of the online user terminals.
4. The method according to any one of claims 1-3, further comprising:
judging whether the target aggregation member port is consistent with a cached member port, wherein the cached member port is as follows: the aggregation member port corresponding to the user terminal is stored in a user member port list, and the user member port list is used for storing the corresponding relation between the user terminal and the aggregation member port;
if not, updating the cached member port as the target aggregation member port, and updating the aggregation member port corresponding to the user side recorded in the forwarding table entry as the target aggregation member port;
the forwarding the network traffic through the target aggregation member port includes:
and forwarding the network flow through the aggregation member port corresponding to the user terminal stored in the forwarding table entry.
5. A traffic forwarding apparatus, the apparatus comprising:
the aggregation port determining module is used for determining an aggregation port for forwarding the network traffic of the user terminal;
an indicated value calculation module, configured to calculate a target indicated value of an aggregation member port according to the identifier of the user terminal and a total remaining bandwidth, where the total remaining bandwidth is: the sum of the residual bandwidths of all aggregation member ports contained in the aggregation port;
an indicated value determining module, configured to determine an indicated value for indicating each aggregation member port according to a ratio of a remaining bandwidth of each aggregation member port to the total remaining bandwidth;
an aggregation member port selection module for selecting a target aggregation member port whose indicated value includes the target indicated value;
a network traffic forwarding module, configured to forward the network traffic through the target aggregation member port;
the indicated value calculation module includes:
the quantized value operator module is used for calculating the quantized value of the total residual bandwidth according to the preset bandwidth quantization step length;
an indicated value calculation submodule, configured to calculate a remainder of the identifier of the user terminal and the quantized value, where the remainder is used as a target indicated value of the aggregation member port;
the indicated value determination module includes:
the quantity determination submodule is used for determining the quantity of the indicated value for indicating each aggregation member port according to the proportion of the residual bandwidth of each aggregation member port in the total residual bandwidth;
and an indication value determining submodule, configured to select, for each aggregation member port, a corresponding number of numerical values of the aggregation member port from [0, the quantization value-1 ], as an indication value for indicating the aggregation member port.
6. The apparatus of claim 5, wherein the bandwidth quantization step size is 1.
7. The apparatus of claim 5,
the aggregation port determining module is specifically configured to determine an aggregation port for forwarding network traffic of the user terminal according to a polling interval, where the polling interval is determined according to the number of online user terminals.
8. The apparatus according to any one of claims 5-7, further comprising an aggregate membership port determination module,
the aggregation member port determining module is specifically configured to determine whether the target aggregation member port is consistent with a cached member port, where the cached member port is: the aggregation member port corresponding to the user terminal is stored in a user member port list, and the user member port list is used for storing the corresponding relation between the user terminal and the aggregation member port; if not, updating the cached member port as the target aggregation member port, and updating the aggregation member port corresponding to the user side recorded in the forwarding table entry as the target aggregation member port;
the network traffic forwarding module is specifically configured to forward the network traffic through the aggregation member port corresponding to the user terminal stored in the forwarding table entry.
9. A gateway device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: carrying out the method steps of any one of claims 1 to 4.
10. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: carrying out the method steps of any one of claims 1 to 4.
CN202110327849.XA 2021-03-26 2021-03-26 Flow forwarding method and device Active CN113098790B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110327849.XA CN113098790B (en) 2021-03-26 2021-03-26 Flow forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110327849.XA CN113098790B (en) 2021-03-26 2021-03-26 Flow forwarding method and device

Publications (2)

Publication Number Publication Date
CN113098790A CN113098790A (en) 2021-07-09
CN113098790B true CN113098790B (en) 2022-06-21

Family

ID=76670327

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110327849.XA Active CN113098790B (en) 2021-03-26 2021-03-26 Flow forwarding method and device

Country Status (1)

Country Link
CN (1) CN113098790B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113890847B (en) * 2021-09-26 2023-04-25 新华三信息安全技术有限公司 Traffic forwarding method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227402A (en) * 2008-02-20 2008-07-23 杭州华三通信技术有限公司 Method and apparatus for sharing polymerization link circuit flow
CN109547341A (en) * 2019-01-04 2019-03-29 烽火通信科技股份有限公司 A kind of load sharing method and system of link aggregation
CN110945844A (en) * 2017-10-31 2020-03-31 华为技术有限公司 Method and device for distributing message
CN111010348A (en) * 2019-12-30 2020-04-14 苏州浪潮智能科技有限公司 Link resource load balancing method, device, equipment and storage medium
CN111010343A (en) * 2019-12-18 2020-04-14 锐捷网络股份有限公司 Method, device, network equipment and storage medium for forwarding multicast message
CN111356181A (en) * 2020-02-25 2020-06-30 杭州迪普信息技术有限公司 Flow forwarding method and device, network equipment and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11627096B2 (en) * 2019-06-04 2023-04-11 Cisco Technology, Inc. Bandwidth awareness in a link aggregation group

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227402A (en) * 2008-02-20 2008-07-23 杭州华三通信技术有限公司 Method and apparatus for sharing polymerization link circuit flow
CN110945844A (en) * 2017-10-31 2020-03-31 华为技术有限公司 Method and device for distributing message
CN109547341A (en) * 2019-01-04 2019-03-29 烽火通信科技股份有限公司 A kind of load sharing method and system of link aggregation
CN111010343A (en) * 2019-12-18 2020-04-14 锐捷网络股份有限公司 Method, device, network equipment and storage medium for forwarding multicast message
CN111010348A (en) * 2019-12-30 2020-04-14 苏州浪潮智能科技有限公司 Link resource load balancing method, device, equipment and storage medium
CN111356181A (en) * 2020-02-25 2020-06-30 杭州迪普信息技术有限公司 Flow forwarding method and device, network equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于多出口链路网络负载平衡模型研究;王宇坤等;《茂名学院学报》;20070615(第03期);全文 *

Also Published As

Publication number Publication date
CN113098790A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
CN109005085B (en) Service availability monitoring system, method, device and equipment
US9356827B2 (en) Data center node management
RU2612583C2 (en) Marketplace for timely event data distribution
EP1966712B1 (en) Load balancing mechanism using resource availability profiles
CN107872402B (en) Global flow scheduling method and device and electronic equipment
US9137325B2 (en) Efficiently isolating malicious data requests
US8601499B2 (en) Systems, methods and computer readable media for routing requests from an application
US8595322B2 (en) Target subscription for a notification distribution system
CN111200657B (en) Method for managing resource state information and resource downloading system
JP2022549055A (en) NODE RATE LIMITING METHOD, APPARATUS, ELECTRONIC DEVICE AND STORAGE MEDIUM
US20120143616A1 (en) System for and method of transaction management
CN108989368B (en) Link quality control method and monitoring equipment
CN112231187B (en) Micro-service abnormity analysis method and device
US9736226B2 (en) Rule distribution server, event processing system and method, and program
CN109921925B (en) Dial testing method and device
CN108809848A (en) Load-balancing method, device, electronic equipment and storage medium
CN110460879B (en) Video request scheduling method, device, server and storage medium
CN113098790B (en) Flow forwarding method and device
CN110880991B (en) Bandwidth limiting method, device and system
CN116760655B (en) POP point method for providing CPE optimal access in SD-WAN application
CN113641713A (en) Data processing method and device
CN115086299B (en) File downloading method, device, equipment, medium and program product
CN115190062B (en) Service processing method and device, electronic equipment and computer readable storage medium
CN108810130B (en) Method and device for planning distribution request
CN113835905B (en) Message queue load balancing method and device, electronic equipment and medium

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