Active queue management method for network equipment and network equipment

By comparing the idle forwarding capacity on network devices with adjustment requests, a decision result is generated to decouple queue depth from the number of bottleneck link flows. This solves the problem that the RED/ECN algorithm cannot prevent congestion, and achieves flexible congestion control and reduced queuing delay.

CN115550263BActive Publication Date: 2025-09-05HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110721083.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-28
Publication Date
2025-09-05
Estimated Expiration
2041-06-28

AI Technical Summary

Technical Problem

Existing RED/ECN algorithms cannot control congestion before it occurs, resulting in the coupling of queue depth and the number of flows on the bottleneck link, increasing queuing delay, and can only provide single-bit signals, resulting in insufficient decision-making flexibility at the sender.

Method used

By comparing the idle forwarding capacity of the network device with the adjustment request, a decision result is generated to decouple the queue depth from the number of flows on the bottleneck link. A new AQM algorithm is used to determine whether to mark or adjust the sending window/rate based on the relationship between the idle forwarding capacity and the adjustment request, thus realizing a flexible decision-making mechanism.

Benefits of technology

It decouples queue depth from the number of bottleneck link flows, allows customized queue depth, reduces queuing delay, and implements flexible congestion control on high-speed network devices through simple comparison operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115550263B_ABST
    Figure CN115550263B_ABST
Patent Text Reader

Abstract

The present application discloses an active queue management method for a network device and a network device, which can be applied to the field of data transmission, including: the network device calculates the idle forwarding capacity (such as a letter of credit counter CC) of a target outgoing queue or a target outgoing port on the network device, and the idle forwarding capacity is used to characterize the difference between the upper limit of the forwarding data volume of the target outgoing queue or the target outgoing port and the current actual forwarding volume. After that, the network device obtains a first message carrying an adjustment request, and when the first message does not have a preset tag, obtains a decision result based on the idle forwarding capacity and the adjustment request, and carries the decision result in the first message to obtain a second message. In the embodiment of the present application, the sending end device adjusts the sending window / rate in different ways according to different decision results, and the new AQM algorithm proposed in the present application can realize the decoupling of the queue depth on the network device and the number of flows on the bottleneck link, so that the queue depth on the network device can be customized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data transmission, and in particular to an active queue management method for a network device and a network device. Background Art

[0002] Active queue management (AQM) algorithms implicitly or explicitly notify the source of congestion by dropping or marking packets in queues on network devices (such as routers and switches). The source responds by reducing the data transmission rate to prevent further congestion. Random early detection (RED) and explicit congestion notification (ECN) are widely used AQM methods in network devices, working in conjunction with transport layer congestion control protocols to improve throughput and reduce latency.

[0003] The basic principle of RED / ECN is that the switch calculates a probability p based on its current queue depth and marks the passing packets based on this probability p. The calculation method of probability p is shown in the following formula (1), where K min , K max 、P max They are the probability lower limit, probability upper limit and preset probability value respectively. It can be concluded from this formula that when the queue depth q is K min and K max When , the marking probability p increases linearly with the queue depth q.

[0004]

[0005] However, RED / ECN can only provide a single-bit signal, indicating "congestion" or "no congestion" (different levels of congestion can be provided in some application scenarios). The sender must design its window adjustment algorithm based on this signal. These algorithms, which make decisions at the sender end, have a common characteristic: as the number of flows (a flow is defined as the object controlled by an instance of a congestion control protocol, such as a five-tuple in the Transmission Control Protocol (TCP)) on the bottleneck port of a switch increases, the average queue depth on the bottleneck port also increases, leading to an increase in queuing delay. Furthermore, because RED / ECN marks packets based on queues, it must respond to congestion after it occurs, rather than controlling it before it occurs. Summary of the Invention

[0006] An embodiment of the present application provides an active queue management method for a network device and a network device, which is used to propose a new AQM algorithm to decouple the queue depth on the network device from the number of flows on the bottleneck link, so that the queue depth on the network device can be customized.

[0007] Based on this, the embodiments of the present application provide the following technical solutions:

[0008] In a first aspect, an embodiment of the present application first provides an active queue management method for a network device, which can be used in the field of data transmission. The method includes: first, the network device calculates the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device, wherein the idle forwarding capacity is used to characterize the difference between the upper limit of the forwarding data volume of the target outgoing queue (one or more) or target outgoing port (one or more) on the network device and the current actual forwarding volume. Specifically, it can be the difference between the upper limit of the forwarding data volume of the target outgoing queue (one or more) or target outgoing port (one or more) on the network device and the current actual forwarding volume. The preset time can be set by itself. The network device is any device on the path between the sending end device and the receiving end device (including the sending end device and the receiving end device). In addition to calculating the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device, the network device also obtains a message carrying an adjustment request, which can be called a first message. The adjustment request can be a window adjustment request or a rate adjustment request, wherein the window adjustment request is used to indicate the adjustment of the sending window of the sending end device, and the rate adjustment request is used to indicate the adjustment of the sending rate of the sending end device. After receiving the first message, the network device first determines whether the first message has a preset flag. If the network device determines that the first message does not have the preset flag, the network device determines a decision result based on the idle forwarding capability value and the adjustment request value, and carries the decision result in the first message, thereby obtaining a second message. Specifically, the network device determines the decision result by comparing the idle forwarding capability value with the adjustment request value. Therefore, during the comparison process, the units of the idle forwarding capability value and the adjustment request value must be consistent. If they are inconsistent, the network device must convert the units of the two to ensure that the units are consistent.

[0009] It should be noted that when the network device is a transmitting device, there are two processing methods: 1) The transmitting device performs the step of "obtaining a first message carrying an adjustment request." That is, the first message is generated by the transmitting device itself (in this case, the generated first message is an initial message and does not have a preset tag). The transmitting device carries the adjustment request in the first message. The transmitting device then obtains a decision result based on the value of the adjustment request and the obtained idle forwarding capability value. The decision result is then carried in the first message to obtain a second message, which is then sent to the next-hop device. 2) The transmitting device does not perform the step of "obtaining a first message carrying an adjustment request." That is, the transmitting device may not carry the adjustment request in the first message (in this case, the generated first message is an initial message and does not have a preset tag). Instead, after calculating the idle forwarding capability value, the transmitting device directly obtains a decision result based on the value of the adjustment request and the obtained idle forwarding capability value. The decision result is then carried in the first message to obtain a second message, which is then sent to the next-hop device.

[0010] The above-mentioned embodiment of the present application proposes a new AQM algorithm to decouple the queue depth on the network device from the number of flows on the bottleneck link, so that the queue depth on the network device can be customized.

[0011] In a possible implementation of the first aspect, when the first message does not have a preset tag, and the network device determines that the value of the idle forwarding capability is ≥ the value of the adjustment request II by comparing the value of the idle forwarding capability with the value of the adjustment request (the value of the adjustment request can be represented by II), in this case, the decision result obtained by the network device is "granted", that is, the grant information is used as the decision result, and the grant information is used to indicate that the sending end device is allowed to increase the sending window or sending rate. It should be noted that in other embodiments of the present application, when the first message does not have a preset tag, and the network device determines that the value of the idle forwarding capability is ≥ the value of the adjustment request II by comparing the value of the idle forwarding capability with the value of the adjustment request II, the network device can further subtract the value of the adjustment request II from the current value of the idle forwarding capability as the new value of the idle forwarding capability, taking the value of the idle forwarding capability as the value CC of the letter of credit counter as an example, that is, CC=CC-II.

[0012] In the above-mentioned embodiment of the present application, it is explained that when the first message does not have a preset tag and the value of the idle forwarding capability is ≥ the value II of the adjustment request, the decision result determined by the network device is the grant information, which is feasible. At the same time, compared with the existing solution that uses the method of making the speed increase / deceleration value of all messages in the previous cycle the same (the speed increase / deceleration value requires complex calculation on the network device and is difficult to implement on the network device), the decision results obtained by the method of the present application are all determined by the size relationship between the value of the idle forwarding capability and the value II of the adjustment request. Only a simple comparison operation is required to obtain the corresponding decision result, which is easy to implement on high-speed network devices.

[0013] In a possible implementation of the first aspect, when the first message does not have a preset mark, and the network device determines that 0≤the value of the idle forwarding capacity is less than the value of the adjustment request II by comparing the value of the idle forwarding capacity with the value of the adjustment request II, in this case, the network device marks the first message according to the preset probability. Specifically, the network device may mark the first message according to a preset probability by marking the first message according to a preset fixed probability p, or may calculate the dynamic probability p' of the current round after each determination that 0≤the value of the idle forwarding capacity is less than the value of the adjustment request II, and then mark the first message with the dynamic probability p'. This application does not limit this. It should be noted here that marking the first message according to the preset probability will have the following two results. Different results will result in different decision results obtained by the network device. When the first message is successfully marked with the preset mark by the network device with the preset probability, the network device will use the marking information of the first message marked with the preset mark as the decision result, that is, the decision result obtained by the network device is "marked", and the marking information is used to indicate that the sending end device is allowed to reduce the sending window or sending rate. It should also be noted that, in some other embodiments of the present application, when the first message does not have a preset tag, and the network device determines that 0≤the value of the idle forwarding capability<the value of the adjustment request II by comparing the value of the idle forwarding capability with the value of the adjustment request II, the network device may further increase the value of the deficit counter (DC) corresponding to the idle forwarding capability by a target preset value (which can be represented by β) as the new value of the deficit counter (the value of the deficit counter can be represented by DC), that is, DC=DC+β. It should be noted here that DC corresponds one-to-one to the value of the idle forwarding capability, and one idle forwarding capability value corresponds to one DC.

[0014] In the above-mentioned embodiment of the present application, it is explained that when the first message does not have a preset mark and 0≤the value of the idle forwarding capacity<the value II of the adjustment request, the network device needs to mark the first message according to the preset probability. If the first message is successfully marked with the preset message, the decision result determined by the network device is the marking information, which achieves different decision results when different conditions are met, and has flexibility. At the same time, compared with the existing solution that uses the method of making the speed increase / deceleration value of all messages in the previous cycle the same (the speed increase / deceleration value needs to be obtained by complex calculation on the network device, which is difficult to implement on the network device), the decision results obtained by the method of the present application are all determined by the value of the idle forwarding capacity, DC and the size relationship of II. Only a simple comparison operation is required to obtain the corresponding decision result, so it is easy to implement on high-speed network devices.

[0015] In one possible implementation of the first aspect, when the first message is not marked with the preset mark by the network device with a preset probability, the network device further compares the deficit counter value DC corresponding to the idle forwarding capability with the adjustment request value II (assuming the units of the two are consistent), and then obtains a specific decision result based on the comparison result. It should also be noted that different comparison results will result in different decision results obtained by the network device. When the deficit counter value DC corresponding to the idle forwarding capability is ≥ the adjustment request value II, the decision result obtained by the network device is "granted," i.e., grant information is used as the decision result. The grant information is used to indicate that the sending device is allowed to increase the sending window or sending rate. It should be noted that in other embodiments of the present application, if the first message is not marked with the preset mark by the network device with a preset probability, and the network device determines that the deficit counter value DC is ≥ the adjustment request value II by comparing the deficit counter value DC with the adjustment request value II, the network device may further subtract the adjustment request value II from the current deficit counter value DC to obtain the new deficit counter value DC, i.e., DC = DC - II.

[0016] In the above-mentioned embodiment of the present application, it is explained that when the first message does not have a preset mark and 0 < the value of the idle forwarding capacity < the value II of the adjustment request, the network device needs to mark the first message according to the preset probability. If the first message is not marked with the preset message, it is necessary to further compare the value DC of the deficit counter with the value II of the adjustment request. In the case where the value DC of the deficit counter ≥ the value II of the adjustment request, the decision result determined by the network device is the grant information, which achieves different decision results when different conditions are met and has flexibility. At the same time, compared with the existing solution that uses the method of making the speed increase / deceleration value of all messages in the previous cycle the same (the speed increase / deceleration value requires complex calculation on the network device and is difficult to implement on the network device), the decision results obtained by the method of the present application are all determined by the size relationship between the value of the idle forwarding capacity, DC, and II. Only a simple comparison operation is required to obtain the corresponding decision result, which is easy to implement on high-speed network devices.

[0017] In a possible implementation of the first aspect, when the network device determines that the first message is not marked with the preset mark, and the value DC of the deficit counter corresponding to the idle forwarding capability is less than the value II of the adjustment request, the decision result obtained by the network device is "rejection", that is, the rejection information is used as the decision result, and the rejection information is used to indicate that the sending device is not allowed to adjust the sending window or sending rate.

[0018] In the above-mentioned embodiment of the present application, it is described that when the first message is not marked with a preset probability marker, and the value of the deficit counter DC is less than the value of the adjustment request II, the decision result determined by the network device is a rejection message, thereby achieving different decision results when different conditions are met, and having flexibility. At the same time, compared with the existing solution that uses the method of making the speed increase / deceleration value of all messages in the previous cycle the same (this speed increase / deceleration value requires complex calculation on the network device and is difficult to implement on the network device), the decision results obtained by the method of the present application are all determined by the value of the idle forwarding capacity, DC, and the size relationship of II. Only a simple comparison operation is required to obtain the corresponding decision result, which is easy to implement on high-speed network devices.

[0019] In a possible implementation of the first aspect, when the first message does not have a preset mark, and the network device determines that the value of the idle forwarding capacity is less than 0 by comparing the value of the idle forwarding capacity with the value II of the adjustment request, in this case, the network device marks the first message with the preset mark, and uses the marking information that the first message is marked with the preset mark as the decision result, that is, the decision result obtained by the network device is "mark", and the marking information is used to indicate that the sending end device is allowed to reduce the sending window or sending rate.

[0020] In the above-mentioned embodiment of the present application, it is explained that when the first message does not have a preset tag and the value of the idle forwarding capability is less than 0, the network device marks the first message and determines that the decision result is the tag information, thereby achieving different decision results when different conditions are met, and having flexibility. At the same time, compared with the existing solution that uses the method of making the speed increase / deceleration value of all messages in the previous cycle the same (the speed increase / deceleration value needs to be obtained by complex calculation on the network device and is difficult to implement on the network device), the decision results obtained by the method of the present application are all determined by the value of the idle forwarding capability and the size relationship of II. Only a simple comparison operation is required to obtain the corresponding decision result, so it is easy to implement on high-speed network devices.

[0021] In one possible implementation of the first aspect, after receiving the first message, if the network device determines that the first message has the preset tag by determining whether the first message has the preset tag, the network device uses tag information indicating that the first message is marked with the preset tag as a decision result. That is, the decision result obtained by the network device is "tag," and the tag information is used to indicate that the sending device is allowed to reduce the sending window or sending rate. It should be noted that if the network device determines that the first message has the preset tag from the outset, the network device may further increase the idle forwarding capacity value by a target preset value β as the new idle forwarding capacity value. Taking the idle forwarding capacity value as CC as an example, CC = CC + β.

[0022] In the above-mentioned embodiment of the present application, it is explained that when the first message has a preset mark, the network device does not need to compare the value of the idle forwarding capability with the value of the adjustment request, but directly determines the mark information as the decision result, thereby achieving different decision results when different conditions are met, and having flexibility.

[0023] In a possible implementation of the first aspect, the process of the network device calculating the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device can specifically be: the network device calculates the value of a credit counter (CC) based on the upper limit of the forwarding data volume of the target outgoing queue or target outgoing port within a preset time length τ (which can be represented by B*τ, where B is the link bandwidth or link rate, which is not limited here) and the total amount of data passing through the target outgoing queue or the target outgoing port within the preset time length τ (which can be represented by TxSize), wherein the value of the credit counter (which can be represented by CC) is used to represent the size of the idle forwarding capacity.

[0024] In the above-mentioned embodiment of the present application, an implementation method for a network device to calculate the idle forwarding capacity of a target out-queue or target out-port on the network device is described, which is to calculate the idle forwarding capacity of the target out-queue or target out-port on the network device based on two parameters. The number of parameters involved is small and easy to implement.

[0025] In a possible implementation of the first aspect, the process of the network device calculating the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device can also be specifically as follows: the network device calculates the value of the letter of credit counter based on the upper limit B*τ of the forwarded data volume of the target outgoing queue or target outgoing port within a preset time length τ, the total amount of data TxSize passing through the target outgoing queue or the target outgoing port within the preset time length τ, and the current outgoing queue depth, wherein the current outgoing queue depth is the depth of the target outgoing queue or the depth of the outgoing queue corresponding to the target outgoing port, which can be represented by q. It should be noted that in the embodiment of the present application, q can refer to the sum of all current outgoing queue depths, or can refer to the maximum value of all current outgoing queue depths, or can refer to the current outgoing queue depth value (one or more) greater than a preset threshold. Specifically, this application does not limit the meaning of q. For ease of explanation, q in the following embodiments all represents the sum of the current outgoing queue depths, and will not be repeated later.

[0026] In the above embodiment of the present application, an implementation method for a network device to calculate the idle forwarding capacity of a target out-queue or target out-port on the network device is described, which is to calculate the idle forwarding capacity of the target out-queue or target out-port on the network device based on three parameters, thereby improving the accuracy of calculating the value of the letter of credit counter.

[0027] In a possible implementation of the first aspect, the process of the network device calculating the idle forwarding capacity of the target outgoing queue or the target outgoing port on the network device may specifically be: the network device calculates the idle forwarding capacity of the target outgoing queue or the target outgoing port based on the upper limit B*τ of the forwarding data volume of the target outgoing queue or the target outgoing port within the preset time length τ, the total amount of data TxSize passing through the target outgoing queue or the target outgoing port within the preset time length τ, the current outgoing queue depth q, and the preset queue depth (available Q t It should be noted that in the embodiment of the present application, the preset queue depth Q t A user-defined value, for example, Q t The specific value can be 0KB, 10KB, 20KB, etc. according to actual needs, and this application does not limit this. t If it is set to 0KB, it means that the queue depth of the target outbound queue or the depth of the outbound queue corresponding to the target outbound port needs to be maintained at 0, which can achieve extremely low queuing delay.

[0028] In the above embodiment of the present application, an implementation method for calculating the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device is described, which is based on four parameters to calculate the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device, wherein a preset queue depth Q is additionally introduced. t , thereby controlling the outbound queue depth on the network device to a specified depth value, reducing queuing delay.

[0029] In a possible implementation of the first aspect, the network device calculates the forwarding data volume upper limit B*τ of the target outgoing queue or target outgoing port within the preset time length τ, the total amount of data TxSize passing through the target outgoing queue or target outgoing port within the preset time length τ, the current outgoing queue depth q, and the preset queue depth Q. t The specific implementation method of calculating the value of the letter of credit counter CC can be: first, the network device subtracts the upper limit B*τ of the forwarded data volume of the target outgoing queue or target outgoing port within the preset time length τ from the total amount of data passing through the target outgoing queue or target outgoing port within the preset time length τ from TxSize to obtain a first subtraction result, and then subtracts the first subtraction result from the preset queue depth Q t Add to obtain an addition result, and subtract the addition result from the sum of the current queue depth q (in some embodiments, it can also be the maximum value of the current queue depth, which is not limited here) to obtain a second subtraction result, and finally multiply the second subtraction result by the preset coefficient to obtain the value of the letter of credit counter, where the value of the letter of credit counter is in bytes.

[0030] In the above embodiment of the present application, a specific implementation method for calculating the value of the letter of credit counter CC is described. The algorithm has low complexity and does not involve multiple multiplication and division operations, thereby reducing storage overhead.

[0031] In a possible implementation of the first aspect, the network device calculates the forwarding data volume upper limit B*τ of the target outgoing queue or target outgoing port within the preset time length τ, the total amount of data TxSize passing through the target outgoing queue or target outgoing port within the preset time length τ, the current outgoing queue depth q, and the preset queue depth Q. t The specific implementation method of calculating the value of the letter of credit counter CC can be: first, the network device subtracts the upper limit B*τ of the forwarded data volume of the target outgoing queue or target outgoing port within the preset time length τ from the total amount of data passing through the target outgoing queue or target outgoing port within the preset time length τ from TxSize to obtain a first subtraction result, and then subtracts the first subtraction result from the preset queue depth Q tAdd to obtain an addition result, and subtract the addition result from the sum of the current queue depth q (in some embodiments, it can also be the maximum value of the current queue depth, which is not limited here) to obtain a second subtraction result, and finally multiply the second subtraction result by the preset coefficient, and the multiplication result is divided by the preset time length τ to finally obtain the value of the letter of credit counter, where the unit of the value of the letter of credit counter is rate.

[0032] In the above-mentioned embodiment of the present application, another specific implementation method of calculating the value of the letter of credit counter CC is described, which is optional and flexible.

[0033] In a possible implementation of the first aspect, if the network device is not a receiving device, it means that the network device is not the last hop device on the transmission path. Therefore, the network device can further send the obtained second message (that is, the first message carrying the decision result) to the next hop device.

[0034] In a possible implementation of the first aspect, it is described that when the network device is not the last-hop device, the second message needs to be sent further to achieve message delivery, which is feasible.

[0035] In a possible implementation of the first aspect, if the next-hop device of the network device is the receiving device, then after the receiving device receives the second message sent by the network device, it will parse the second message and carry the decision result in a confirmation message to send to the sending device (there is no restriction on the path for the receiving device to return the confirmation message to the sending device to be the original path). The confirmation message is used to instruct the sending device to adjust the sending window (if the adjustment request is a window adjustment request) or the sending rate (if the adjustment request is a rate adjustment request) of the sending device according to the decision result carried therein.

[0036] In the above-mentioned embodiment of the present application, it is specifically explained that if the next-hop device is the receiving device, it means that the decision result obtained by the current network device is the final decision result (will not be rewritten). The final decision result must be carried in the confirmation message and returned to the sending device. The sending device can adjust the sending window or sending rate based on the final decision result, which is flexible.

[0037] In a possible implementation of the first aspect, if the network device is a receiving device, there are also two processing methods: 1) the receiving device executes the step of "carrying the decision result in the first message to obtain the second message", that is, when the receiving device determines that the first message does not have a preset mark, the receiving device obtains the decision result based on the idle forwarding capability and the adjustment request, and carries the decision result in the first message to obtain the second message. After that, the second message is parsed, and the decision result obtained by the analysis is carried in a confirmation message, and the confirmation message is sent to the sending device. The confirmation message is used to instruct the sending device to adjust the sending window (when the adjustment request is a window adjustment request) or the sending rate (when the adjustment request is a rate adjustment request) of the sending device according to the decision result carried therein. 2) The receiving device does not perform the step of "carrying the decision result in the first message to obtain the second message". Instead, when the receiving device determines that the first message does not have a preset mark, the receiving device obtains the decision result based on the idle forwarding capability and the adjustment request. The decision result is not carried in the first message, but is directly carried in the confirmation message, and the confirmation message is sent to the sending device. The confirmation message is used to instruct the sending device to adjust the sending window (when the adjustment request is a window adjustment request) or the sending rate (when the adjustment request is a rate adjustment request) of the sending device according to the decision result carried therein.

[0038] In the above-mentioned embodiment of the present application, the implementation method of how the receiving device processes the decision result if the current network device is the receiving device is specifically explained, which is selective and widely applicable.

[0039] In a possible implementation of the first aspect, if the decision result is marking information, then the confirmation message is specifically used to instruct the sending device to reduce the sending window or sending rate of the sending device according to the decision result, wherein the magnitude of the reduction is obtained according to the target preset value β. For example, the sending window or sending rate of the sending device can be reduced by β on the original basis, or the sending window or sending rate of the sending device can be reduced by k1*β on the original basis, wherein k1 is a custom parameter, and k1>0.

[0040] In the above-mentioned embodiment of the present application, it is explained that the decision results carried in the confirmation message are different, and the sending device adjusts the sending window and sending rate in different ways based on the confirmation message. The adjustment logic is simple, easy to implement, and optional.

[0041] In a possible implementation of the first aspect, if the decision result is grant information, then the confirmation message is specifically used to instruct the sending device to increase the sending window or sending rate of the sending device according to the decision result, wherein the magnitude of the increase is obtained according to the value II of the adjustment request, for example, the sending window or sending rate of the sending device can be increased by II on the original basis, or the sending window or sending rate of the sending device can be increased by k2*II on the original basis, wherein k2 is a custom parameter, and k2>0.

[0042] In the above-mentioned embodiment of the present application, it is explained that the decision results carried in the confirmation message are different, and the sending device adjusts the sending window and sending rate in different ways based on the confirmation message. The adjustment logic is simple, easy to implement, and optional.

[0043] In a possible implementation of the first aspect, if the decision result is rejection information, then the confirmation message is specifically used to instruct the sending device not to increase or decrease (i.e., not adjust) the sending window or sending rate of the sending device based on the decision result.

[0044] In the above-mentioned embodiment of the present application, it is explained that the decision results carried in the confirmation message are different, and the sending device adjusts the sending window and sending rate in different ways based on the confirmation message. The adjustment logic is simple, easy to implement, and optional.

[0045] A second aspect of the present application provides a network device that implements the method of the first aspect or any possible implementation of the first aspect. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions.

[0046] A third aspect of an embodiment of the present application provides a network device, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to call the programs stored in the memory to execute the method of the first aspect of the embodiment of the present application or any possible implementation method of the first aspect.

[0047] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, the computer can execute the method of the above-mentioned first aspect or any possible implementation of the first aspect.

[0048] A fifth aspect of the embodiments of the present application provides a computer program, which, when executed on a computer, enables the computer to execute the method of the first aspect or any possible implementation of the first aspect.

[0049] In a sixth aspect of an embodiment of the present application, a chip is provided, which includes at least one processor and at least one interface circuit, the interface circuit being coupled to the processor, the at least one interface circuit being used to perform transceiver functions and send instructions to the at least one processor, the at least one processor being used to run a computer program or instruction, which has the function of implementing the method of the first aspect or any possible implementation of the first aspect, the function can be implemented by hardware, software, or a combination of hardware and software, the hardware or software including one or more modules corresponding to the above functions. In addition, the interface circuit is used to communicate with other modules outside the chip. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of the relationship between an egress port and an egress queue on a network device provided in an embodiment of the present application;

[0051] Figure 2 A schematic diagram of the system architecture provided in an embodiment of the present application;

[0052] Figure 3 Another schematic diagram of the system architecture provided in an embodiment of the present application;

[0053] Figure 4 A flowchart of an active queue management method for a network device provided in an embodiment of the present application;

[0054] Figure 5 Another flowchart of the active queue management method for a network device provided in an embodiment of the present application;

[0055] Figure 6 A schematic diagram of a flow chart of a transmitting end device adjusting a sending window or a sending rate according to a decision result provided in an embodiment of the present application;

[0056] Figure 7 A schematic diagram of a framework for implementing a slow start algorithm using the active queue management method for a network device provided in an embodiment of the present application;

[0057] Figure 8 A schematic diagram of a framework for implementing an AIMD algorithm using the active queue management method for a network device provided in an embodiment of the present application;

[0058] Figure 9 A schematic diagram comparing the effects of the method of the present application and the existing method provided in the embodiment of the present application;

[0059] Figure 10 A schematic diagram of the structure of a network device provided in an embodiment of the present application;

[0060] Figure 11 Another structural diagram of the network device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] An embodiment of the present application provides an active queue management method for a network device and a network device, which is used to propose a new AQM algorithm to decouple the queue depth on the network device from the number of flows on the bottleneck link, so that the queue depth on the network device can be customized.

[0062] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0063] In order to better understand the solutions of the embodiments of the present application, the following first introduces the relevant terms and concepts that may be involved in the embodiments of the present application. It should be understood that the interpretation of the relevant concepts may be limited by the specific circumstances of the embodiments of the present application, but it does not mean that the present application is limited to the specific circumstances. The specific circumstances of different embodiments may also vary, which is not specifically limited here.

[0064] (1) Network equipment

[0065] Network devices and components are the physical entities connected to a network. The variety of network devices is vast and growing. Basic network equipment includes computers (whether personal computers or servers), hubs, switches, bridges, routers, gateways, network interface cards (NICs), wireless access points (WAPs), printers and modems, fiber optic transceivers, and fiber optic cables. Specifically, whether it's a local area network (LAN), a metropolitan area network (MAN), or a wide area network (WAN), it typically consists of network connection devices and transmission media, such as network cards, hubs, switches, routers, network cables, and RJ45 connectors. Network devices also include repeaters, bridges, routers, gateways, firewalls, and switches.

[0066] It should be noted that in the embodiments of the present application, in addition to the traditional devices described above, the network device can also be a terminal device such as a mobile phone, a smart bracelet, a smart watch, etc. On the data transmission path, the network device can specifically be any device on the path between the sending device and the receiving device (including the sending device and the receiving device).

[0067] (2) Out of queue

[0068] In the embodiments of the present application, when the queue type on the network device includes both an in-queue and an out-queue, the out-queue is the conventional out-queue; when the network device has only one queue type, then this queue type is the out-queue described in the present application (i.e., the network device must have an out-queue but may not have an in-queue). It should be noted that a network device can have one or more out-queues.

[0069] (3) Output port

[0070] In an embodiment of the present application, there may be one or more egress ports on a network device, one egress port may correspond to one or more egress queues, and the number of egress queues corresponding to each egress port may be the same or different, and this application does not impose any restrictions on this.

[0071] It should be noted that network devices (such as switches) have inbound and outbound ports. Inbound and outbound ports are relative to data flows, so there is no corresponding relationship between inbound and outbound ports. For some data flows, a port is an outbound port, but for data flows in the opposite direction, it is an inbound port. Figure 1 , Figure 1 A schematic diagram of the relationship between the outbound ports and outbound queues on a network device provided in an embodiment of the present application, wherein m is the number of outbound ports of the network device, m≥1, n1, n2, ... n m are the number of outbound queues corresponding to the m outbound ports, n1≥1, n2≥1, ..., n m ≥1. And, n1, n2, ... n m The values ​​of can be different, partially the same, or completely the same, and there is no limitation here.

[0072] (4) Idle forwarding capability

[0073] In the embodiment of the present application, the idle forwarding capacity is used to represent the difference between the upper limit of the forwarding data volume of the target outgoing queue (one or more) or the target outgoing port (one or more) on the network device and the current actual forwarding volume. Specifically, it can be the difference between the upper limit of the forwarding data volume of the target outgoing queue (one or more) or the target outgoing port (one or more) on the network device and the current actual forwarding volume within a preset time length (e.g., 200 microseconds (us)). The preset time length can be set arbitrarily. In different corresponding situations, the specific situations for calculating the idle forwarding capacity of the network device are as follows:

[0074] a. If the calculated idle forwarding capacity of the network device corresponds to one outgoing queue, then the idle forwarding capacity of the outgoing queue is calculated. In the embodiment of the present application, the purpose of calculating the idle forwarding capacity is to keep the outgoing queue depth at a low level even in congestion.

[0075] b. If the idle forwarding capacity of the network device is calculated for p outbound queues, then the total idle forwarding capacity of the p outbound queues is calculated. In this embodiment of the present application, the purpose of calculating the idle forwarding capacity is to ensure that the depth of the p outbound queues can be maintained at a low level as a whole even in congestion.

[0076] c. If the idle forwarding capacity of the network device is calculated for a single egress port, the total idle forwarding capacity of the egress queues (which may be a single egress queue or multiple egress queues) corresponding to that egress port is calculated. In this embodiment of the present application, the purpose of calculating the idle forwarding capacity is to maintain the depth of all egress queues associated with that egress port at a low level even in congestion.

[0077] d. If the idle forwarding capacity of the network device is calculated for q outbound ports, the total idle forwarding capacity of the outbound queues corresponding to each of the q outbound ports (each outbound port has at least one outbound queue) is calculated. In this embodiment of the present application, the purpose of calculating the idle forwarding capacity is to ensure that the depths of all outbound queues under the q outbound ports are maintained at a low level even in congestion.

[0078] To facilitate understanding, the following is an example of calculating the idle forwarding capacity of an egress port on a network device: assuming that this egress port on the network device is a 100Gbps port, the maximum amount of forwarded data within the preset duration of 100 microseconds (us) is: 100Gbps*10us=125KB, 125KB is the upper limit of the amount of forwarded data of the egress port within the preset duration of 100us (also known as the maximum forwarding capacity measured by data volume). If the actual forwarding volume of the egress port within the preset duration of 100us is 100KB, then the idle forwarding capacity of the egress port is 25KB.

[0079] It should be noted that in some embodiments of the present application, the idle forwarding capacity can also be reflected as idle bandwidth. If the idle forwarding capacity is represented by idle bandwidth, the unit needs to be converted. Taking the above example, the idle bandwidth can be expressed as 25KB / 10us=20Gbps.

[0080] It should also be noted that in the embodiments of the present application, the idle forwarding capacity can be measured by either the amount of data or the number of messages. The present application does not limit this. For the sake of ease of explanation, in the following embodiments of the present application, the size of the idle forwarding capacity is measured by the amount of data.

[0081] (5) Message passing

[0082] A general term for data communication methods between processes or software components in a computer system. It abstracts and encapsulates the data to be communicated as "messages." The two or more communicating parties use primitives such as message sending and receiving to transfer messages between processes or components, thus completing data communication.

[0083] (6) Data flow diagram

[0084] A data flow diagram is a graphical data structure that reflects the design principles and implementation processes of computing logic by expressing the flow direction and computing relationships of data in computing logic.

[0085] (7) Data flow graph parameters

[0086] In a data flow graph, a parameter refers to the data carried by the connecting edges of computing nodes on the graph, which is used for computing node processing or feedback by computing nodes.

[0087] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0088] First, the system architecture and overall process of the method of the embodiment of the present application are described. Figure 2 as well as Figure 3 , Figure 2 A schematic diagram of the system architecture provided in an embodiment of the present application. Figure 3 Another schematic diagram of the system architecture provided in an embodiment of the present application, wherein multiple servers are connected via one (or more, Figure 2 The following shows the situation of one machine. Figure 3 The diagram shows the situation of multiple devices) network devices are networked. In the embodiment of the present application, the server can be a cloud-side server, a data center network, a cluster and other traditional servers, or it can be a terminal device (such as virtual reality (VR) equipment, mobile phones, tablets, laptops, smart wearable devices, etc.), wheeled mobile devices (such as self-driving vehicles, assisted driving vehicles, etc.), and this application does not limit this. The network device described in this application can be any device on the path between the sending end device and the receiving end device (including the sending end device and the receiving end device). But in Figure 2 as well as Figure 3 In the figure, the network devices shown do not include either the sending end device or the receiving end device, that is, Figure 2 The network device in is the only device in the path between the sending device and the receiving device. Similarly, Figure 3 The network device in the example is any device in the path between the sending device and the receiving device. Figure 3 The schematic system structure illustrates the overall process of the active queue management method for a network device provided in an embodiment of the present application, which may specifically include the following steps:

[0089] Step 1: The network device periodically calculates the idle forwarding capacity of the target outbound queue (or target outbound port) on the network device. The target outbound queue may include one or more outbound queues, and the target outbound port may include one or more outbound ports. The network device is any device in the path between the sending device and the receiving device.

[0090] Step 2: The message sent by the transmitting device carries an adjustment request. The adjustment request may be a window adjustment request or a rate adjustment request, which is not limited in this application. The window adjustment request (or rate adjustment request) carries a specific value for how much the sending window (or sending rate) needs to be increased. The specific value can be represented by II. The window adjustment request is used to indicate adjustment of the sending window of the transmitting device, and the rate adjustment request is used to indicate adjustment of the sending rate of the transmitting device. The transmitting device here is any one of the n transmitting devices in the network structure, where n ≥ 1.

[0091] Step 3. After the message sent by the sending end device arrives at the network device, the network device will first determine whether the message is marked with a preset tag. If the message does not have a preset tag, the network device will make a decision based on the value of the idle forwarding capacity calculated in step 1 and the value of the window adjustment request (or rate adjustment request) in step 2. The decision result is carried by the message and is used to instruct the sending end device to adjust the sending window (or sending rate). The decision result includes the following three situations: ① Using the grant information as the decision result to indicate that the sending end device is granted to increase the sending window (or sending rate); ② Using the rejection information as the decision result to indicate that the sending end device is rejected from adjusting the sending window (or sending rate). ③ Marking the message with a preset tag and using the tag information as the decision result to indicate that the sending end device's sending window (or sending rate) is reduced. It should be noted that if the network device determines whether the message is marked with a preset tag and the result is that the message is marked with the preset tag, it is not necessary to make a decision based on the value of the idle forwarding capability and the value of the window adjustment request (or rate adjustment request). Instead, the tag information is directly used as the decision result to instruct the sending device to reduce the sending window (or sending rate). This situation can be classified as the third situation mentioned above, that is, the third situation mentioned above can be summarized as follows: ③ If the message is marked with a preset tag (whether it is marked by a previous network device or marked by itself), the tag information is used as the decision result to instruct the sending device to reduce the sending window (or sending rate).

[0092] Step 4: After the message carrying the decision result reaches the receiving device, the receiving device parses the decision result and returns the decision result to the sending device in an acknowledgement message (ACK).

[0093] Step 5. After receiving the confirmation message, the sending device parses the decision result carried in the confirmation message and adjusts the sending window (or sending rate) according to the decision result. The adjustment methods include: increasing the sending window (or sending rate), neither increasing nor decreasing the sending window (or sending rate), and decreasing the sending window (or sending rate).

[0094] Figure 3 The network devices included in the system structure shown are any devices in the path between the sending end device and the receiving end device, that is, Figure 3 In the figure, the network device shown does not include a sending device or a receiving device, and if there are multiple network devices, then the network device may be the first hop device after the sending device, or the last hop device before the receiving device, which is not limited here.

[0095] It should be noted that if the previous hop device of the network device is not the sending device but another network device, then the two decision results ① and ② determined by the previous hop device may be overwritten by the current network device. If the previous hop device determines the decision result ③, that is, any of the previous network devices marked the message with a preset mark, the subsequent network devices can only determine the decision result ③. Specific rewriting rules include but are not limited to the following:

[0096] a. If the decision result of the previous network device is situation ①, that is, the decision result is grant information, then the decision results that the current network device may reach are the above ①, ②, and ③, that is, the decision results may be: grant information, reject information, and mark information.

[0097] b. If the decision result of the previous network device is situation ②, that is, the decision result is to reject the information, then the decision results that the current network device may reach are the above ② and ③, that is, the decision results may be: reject the information or mark the information.

[0098] c. If the decision result of the previous network device is situation ③, that is, the decision result is tag information, then the decision result that the current network device may obtain is situation ③ above, that is, the decision result can only be: tag information.

[0099] The above is based on Figure 3 The schematic system structure illustrates the overall process of the active queue management method for the network device provided in the embodiment of the present application. Figure 2 The schematic system structure illustrates the overall process of the active queue management method for a network device provided in an embodiment of the present application, which may specifically include the following steps:

[0100] Step 1: The network device periodically calculates the idle forwarding capacity of a target egress queue (or target egress port) on the network device. The target egress queue may include one or more egress queues, and the target egress port may include one or more egress ports.

[0101] Step 2. The message sent by the sending device carries an adjustment request, which can be a window adjustment request or a rate adjustment request. This application does not limit this. The window adjustment request (or rate adjustment request) is used to indicate the adjustment of the sending window (or sending rate) of the sending device. The sending device here is any one of the n sending devices in the networking structure, n ≥ 1.

[0102] Step 3. After the message sent by the sending end device directly reaches the network device, since the message does not carry a preset tag when it is sent by the sending end, the network device does not need to determine whether the message has been marked. Instead, it directly makes a decision based on the value of the idle forwarding capacity calculated in step 1 and the value of the window adjustment request (or rate adjustment request) in step 2. The decision result is carried by the message and is used to instruct the sending end device to adjust the sending window (or sending rate). The decision result includes the following three situations: ① Using the grant information as the decision result to indicate that the sending end device is granted to increase the sending window (or sending rate); ② Using the rejection information as the decision result to indicate that the sending end device is rejected to adjust the sending window (or sending rate). ③ Marking the message with a preset tag and using the tag information as the decision result to indicate that the sending end device's sending window (or sending rate) is reduced.

[0103] Step 4: After the message carrying the decision result reaches the receiving device, the receiving device parses the decision result and returns the decision result to the sending device in a confirmation message.

[0104] Step 5. After receiving the confirmation message, the sending device parses the decision result carried in the confirmation message and adjusts the sending window (or sending rate) according to the decision result. The adjustment methods include: increasing the sending window (or sending rate), neither increasing nor decreasing the sending window (or sending rate), and decreasing the sending window (or sending rate).

[0105] It should be noted that, regardless of Figure 2 The corresponding steps of the overall process are Figure 3 For the steps of the corresponding overall process, there is no order in which step 1 and step 2 should be executed. Step 1 can be executed first, then step 2, or step 2 can be executed first, then step 1, or step 1 and step 2 can be executed at the same time. The specific steps are not limited here.

[0106] In summary, Figure 2 The corresponding steps of the overall process are Figure 3 The only difference between the steps of the corresponding overall process is: 1) Figure 3 Since there are multiple network devices in the path between the sending device and the receiving device, each network device needs to determine whether the message received from the previous hop device has a preset tag. Figure 2 There is only one network device in the path between the sending device and the receiving device, so the message received by the network device comes directly from the sending device. The message has no preset tag, so there is no need to determine whether it has a preset tag; 2) Figure 3 The current network device in the process may rewrite the decision result (if any) carried in the message sent by the previous hop device. Figure 2 There is only one current network device, and the decision results are all written by themselves, and there is no rewriting.

[0107] It should be noted that, in the embodiment of the present application, since the network device can also be a sending end device or a receiving end device, when the network device is used as a sending end device, the essence is the above Figure 2 or Figure 3 The steps executed by the corresponding network device and the steps executed by the sending end device are integrated into one device for execution. The specific execution steps can be found in the above Figure 2 or Figure 3 The corresponding network equipment and sending end equipment are not described here in detail; when the network equipment is used as a receiving end equipment, it is essentially the same as the above Figure 2 or Figure 3 The steps executed by the corresponding network device and the steps executed by the receiving device are integrated into one device for execution. The specific execution steps can be found in the above Figure 2 or Figure 3 The corresponding network equipment and receiving equipment are not described here in detail.

[0108] Combined with the above description of the system architecture and the overall process, the active queue management method of the network device provided by the embodiment of the present application is described below. Figure 4 , Figure 4 A flowchart of an active queue management method for a network device provided in an embodiment of the present application is provided. The method may specifically include the following steps:

[0109] 401. A network device calculates an idle forwarding capacity of a target outgoing queue or a target outgoing port on the network device. The idle forwarding capacity is used to represent a difference between an upper limit of a forwarded data volume of the target outgoing queue or the target outgoing port and a current actual forwarding volume. The network device is any device on a path between a transmitting device and a receiving device.

[0110] First, the network device calculates the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device, where the idle forwarding capacity is used to represent the difference between the upper limit of the forwarded data volume of the target outgoing queue (one or more) or target outgoing port (one or more) on the network device and the current actual forwarding volume. Specifically, it can be the difference between the upper limit of the forwarded data volume of the target outgoing queue (one or more) or target outgoing port (one or more) on the network device and the current actual forwarding volume within a preset time period (e.g., 200us), which can be set by the user. The network device is any device on the path between the sending end device and the receiving end device (including the sending end device and the receiving end device).

[0111] It should be noted that, in some embodiments of the present application, the network device calculates the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device by a periodic calculation, for example, once every time length τ (where τ is the period length); the calculation process can also be aperiodic calculation, for example, once for the first interval length τ1, once for the second interval length τ2, and so on. The present application does not specifically limit the calculation process. For ease of explanation, in the following embodiments, the network device periodically calculates the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device based on a preset time length τ.

[0112] It should also be noted that, in some embodiments of the present application, the process of a network device calculating the idle forwarding capacity of a target outgoing queue or a target outgoing port on the network device specifically includes but is not limited to:

[0113] a. The network device calculates the value of a credit counter (CC) based on the upper limit of the forwarding data volume of the target egress queue or target egress port within a preset time length τ (which can be represented by B*τ, where B is the link bandwidth) and the total amount of data passing through the target egress queue or target egress port within the preset time length τ (which can be represented by TxSize). The value of the credit counter (which can be represented by CC) is used to represent the size of the idle forwarding capacity.

[0114] b. The network device calculates the value of the letter of credit counter based on the upper limit B*τ of the forwarded data volume of the target outgoing queue or the target outgoing port within the preset time length τ, the total amount of data TxSize passing through the target outgoing queue or the target outgoing port within the preset time length τ, and the current outgoing queue depth, wherein the current outgoing queue depth is the depth of the target outgoing queue or the depth of the outgoing queue corresponding to the target outgoing port, which can be represented by q. It should be noted that in the embodiment of the present application, q can refer to the sum of all current outgoing queue depths, or it can refer to the largest of all current outgoing queue depth values, or it can refer to the current outgoing queue depth value (one or more) greater than a preset threshold value. Specifically, this application does not limit the meaning of q. For ease of explanation, q in the following embodiments all represents the sum of the current outgoing queue depths, and will not be repeated later.

[0115] c. The network device calculates the maximum amount of forwarded data B*τ of the target outbound queue or target outbound port within the preset time τ, the total amount of data TxSize passing through the target outbound queue or the target outbound port within the preset time τ, the current outbound queue depth q, and the preset queue depth (available Q t It should be noted that in the embodiment of the present application, the preset queue depth Q t A user-defined value, for example, Q tThe specific value can be 0KB, 10KB, 20KB, etc. according to actual needs, and this application does not limit this. t If it is set to 0KB, it means that the queue depth of the target outbound queue or the depth of the outbound queue corresponding to the target outbound port needs to be maintained at 0, which can achieve extremely low queuing delay.

[0116] In summary, the differences between the above three methods of calculating the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device are: Method a calculates the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device based on two parameters, involves fewer parameters, and is easy to implement; Method b calculates the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device based on three parameters, which improves the accuracy of calculating the value of the credit counter; Method c calculates the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device based on four parameters, in which a preset queue depth Q is additionally introduced. t , thereby controlling the outbound queue depth on the network device to a specified depth value, reducing queuing delay and decoupling the queue depth from the number of flows. For ease of explanation, the following embodiments use method c as an example to illustrate the process of calculating the idle forwarding capacity of the target outbound queue or target outbound port on the network device.

[0117] It should be noted here that the current outbound queue depth is the depth of the target outbound queue or the depth of the outbound queue corresponding to the target outbound port. The sum of the current outbound queue depths is the sum of the depths of the target outbound queues or the sum of the depths of the outbound queues corresponding to the target outbound ports. The sum of the current outbound queue depths can be the sum of the instantaneous current outbound queue depths or the sum of the average current outbound queue depths within a preset time period T. This application does not specifically limit this.

[0118] To help you understand the sum of the instantaneous current queue depths, the sum of the average current queue depths, the maximum current instantaneous queue depth, and the maximum current average queue depth, the following examples illustrate each:

[0119] (1) The sum of the instantaneous current queue depth

[0120] a. If the sum of the current outbound queue depths is the sum of the target outbound queue depths, assuming that the target outbound queues include outbound queue 1, outbound queue 2, and outbound queue 3, and at the current time t0, the queue depths of outbound queue 1, outbound queue 2, and outbound queue 3 are L1, L2, and L3 respectively, then the sum of the instantaneous current queue depths at the current time t0 is L all Just for L all =L1+L2+L3.

[0121] b. If the sum of the current outbound queue depths is the sum of the depths of the target outbound ports, assuming that the target outbound ports include outbound port 1 and outbound port 2, outbound port 1 corresponds to outbound queue 1 and outbound queue 2, outbound port 2 corresponds to outbound queue 3, outbound queue 4, and outbound queue 5, and at the current time t0, the queue depths of outbound queue 1, outbound queue 2, outbound queue 3, outbound queue 4, and outbound queue 5 are L1, L2, L3, L4, and L5 respectively, then the sum of the instantaneous current queue depths at the current time t0 is L all Just for L all =L1+L2+L3+L4+L5.

[0122] (2) The sum of the average current queue depth

[0123] a. If the sum of the current outbound queue depths is the sum of the target outbound queue depths, assuming that the target outbound queues include outbound queue 1, outbound queue 2, and outbound queue 3, and within the preset time T, the instantaneous queue depths of outbound queue 1, outbound queue 2, and outbound queue 3 are recorded at regular intervals. Suppose that within the preset time T, outbound queue 1, outbound queue 2, and outbound queue 3 are each recorded three times with an instantaneous queue depth of L, L, and L, respectively. 11 , L 12 , L 13 , L 21 , L 22 , L 23 , L 31 , L 32 , L 33 , then the sum of the average current queue depth L arv =(L 11 +L 12 +L 13 +L 21 +L 22 +L 23 +L 31 +L 32 +L 33 )÷3, where the denominator "3" is the number of times the instantaneous queue depth of each out-queue is recorded within the preset time length T.

[0124] b. If the sum of the current outbound queue depths is the sum of the depths of the target outbound ports, the calculation of the sum of the average current queue depths is similar and is not described in detail here.

[0125] (3) Maximum instantaneous current queue depth

[0126] a. If the current outbound queue depth is the target outbound queue depth, and the target outbound queues include outbound queue 1, outbound queue 2, and outbound queue 3, and at time t0, the queue depths of outbound queue 1, outbound queue 2, and outbound queue 3 are L1, L2, and L3, respectively, and L1 > L2 and L1 > L3, L1 is the largest of the current queue depths L1, L2, and L3. Therefore, the maximum instantaneous current queue depth at time t0 is L1.

[0127] b. If the current outbound queue depth is the depth of the target outbound port, and the target outbound ports include outbound port 1 and outbound port 2, outbound port 1 corresponds to outbound queue 1 and outbound queue 2, and outbound port 2 corresponds to outbound queue 3, outbound queue 4, and outbound queue 5, and at time t0, the queue depths of outbound queue 1, outbound queue 2, outbound queue 3, outbound queue 4, and outbound queue 5 are L1, L2, L3, L4, and L5, respectively, and L3 is the largest of the current queue depths L1, L2, L3, L4, and L5, then the maximum instantaneous current queue depth at time t0 is L3.

[0128] (4) Maximum average current queue depth

[0129] a. If the current out-queue depth is the target out-queue depth, assuming that the target out-queues include out-queue 1, out-queue 2, and out-queue 3, and within the preset time T, the instantaneous queue depths of out-queue 1, out-queue 2, and out-queue 3 are recorded at regular intervals. Assume that within the preset time T, out-queue 1, out-queue 2, and out-queue 3 are each recorded three times with instantaneous queue depths of L and L respectively. 11 , L 12 , L 13 , L 21 , L 22 , L 23 , L 31 , L 32 , L 33 , then the average current queue depth recorded each time is L avg1 =(L 11 +L 12 +L 13 )÷3,L avg2 =(L 21 +L 22 +L 23 )÷3,L avg3 =(L 31 +L 32 +L 33 )÷3, and L avg1 >L avg2 , L avg1 >L avg3 , indicating that L avg1 is the average current queue depth L avg1 , Lavg2 , L avg3 The largest one among them, then the maximum average current queue depth at the current time t0 is L avg1 , where the denominator "3" is the number of times the instantaneous queue depth of each outbound queue is recorded within the preset time length T.

[0130] b. If the current outbound queue depth is the depth of the target outbound port, the calculation of the maximum average current queue depth is similar and is not described in detail here.

[0131] It should also be noted that the network device calculates the sum of the current outgoing queue depth q, the upper limit B*τ of the forwarding data volume of the target outgoing queue or the target outgoing port within the preset time τ, the total amount of data TxSize passing through the target outgoing queue or the target outgoing port within the preset time τ, and the preset queue depth Q. t Specific implementation methods for calculating the CC value include but are not limited to the following:

[0132] A. When using bytes as the unit, CC can be calculated as shown in the following formula (2):

[0133] CC=λ*(B*τ-TxSize+Q t -q) (2)

[0134] In the embodiment of the present application, while updating CC, the following operations may also be performed:

[0135] TxSize=0

[0136] DC=0

[0137] CreditAllocated=0

[0138] Wherein, λ is a coefficient, and 0<λ≤1. It should be noted here that TxSize is specifically the total amount of data passing through the target egress queue or the target egress port within the previous preset time range τ.

[0139] B. When the rate is used as the unit, CC can be calculated as shown in the following formula (3):

[0140] CC=λ*(B*τ-TxSize+Q t -q) / τ (3)

[0141] In the embodiment of the present application, while updating CC, the following operations are also performed:

[0142] TxSize=0

[0143] DC=0

[0144] CreditAllocated=0

[0145] The difference between formula (3) and formula (2) is that formula (3) is based on formula (2) divided by the preset time length τ. In addition, in the above embodiment of the present application, the network device specifically explains the sum of the current outbound queue depth q, the upper limit B*τ of the forwarding data volume of the target outbound queue or target outbound port within the preset time length τ, the total amount of data TxSize passing through the target outbound queue or the target outbound port within the preset time length τ, and the preset queue depth Q. t Several implementation methods for calculating the value of CC are flexible, and the provided algorithms have low complexity and do not involve multiple multiplication and division operations, thereby reducing storage overhead.

[0146] It should also be noted that in some other embodiments of the present application, in addition to calculating the CC value based on the four parameters of the sum of the current outgoing queue depth q, the upper limit B*τ of the forwarded data volume of the target outgoing queue or target outgoing port within the preset time τ, the total amount of data TxSize passing through the target outgoing queue or target outgoing port within the preset time τ, and the preset queue depth Qt (the CC value may also be calculated based on the two parameters in the above method a or the three parameters in the above method b, which is not limited here), the network device may also incorporate more parameters on the basis of these four parameters to more accurately calculate the CC value. For example, the sum of the credit counters allocated to the messages within the preset time from the last CC update time to the current CC update time is counted, and the sum is subtracted during the current CC update, or the sum is subtracted and multiplied by λ. The method of subtracting the sum is not limited. In this case, the corresponding operation of the optimization is CreditAllocated = CreditAllocated + II (when CC ≥ II), where CreditAllocated represents the sum of the credit counters allocated within a cycle. If the first message is a marked message, then the optimization also brings about another operation, namely, CreditAllocated=CreditAllocated−β.

[0147] 402. The network device obtains a first message carrying an adjustment request, where the adjustment request is used to instruct adjustment of a sending window or a sending rate of a sending end device.

[0148] In addition to calculating the idle forwarding capacity of the target outbound queue or target outbound port on the network device, the network device will also obtain a message carrying an adjustment request, which can be called a first message. The adjustment request can be a window adjustment request or a rate adjustment request, wherein the window adjustment request is used to indicate the adjustment of the sending window of the sending device, and the rate adjustment request is used to indicate the adjustment of the sending rate of the sending device.

[0149] It should be noted that, in the embodiments of the present application, the manner in which the network device obtains the first message carrying the adjustment request includes but is not limited to: 1) when the network device is a sending end device, the first message is generated by the sending end device itself (the first message generated in this case is an initial message and does not have a preset tag), and the sending end device carries the adjustment request in the first message, and the sending end device then obtains a decision result based on the value II of the adjustment request and the obtained value of the idle forwarding capability, and then carries the decision result in the first message to obtain a second message, so that the second message can be subsequently sent to the next hop device. It should be noted here that, in some embodiments of the present application, when the network device is a sending end device, the sending end device may also not carry the adjustment request in the first message (the first message generated in this case is an initial message and does not have a preset tag), but instead, after calculating the value of the idle forwarding capability according to step 401, directly obtains a decision result based on the value II of the adjustment request and the obtained value of the idle forwarding capability, and then carries the decision result in the first message to obtain a second message, so that the second message can be subsequently sent to the next hop device. 2) When the network device is not a sending device, the network device receives a first message sent by a previous-hop device (which may be the sending device or another device located after the sending device).

[0150] It should be noted that in the embodiment of the present application, there is no order in which step 401 and step 402 are executed. Step 401 can be executed first and then step 402, or step 402 can be executed first and then step 401, or step 401 and step 402 can be executed at the same time. The specific order is not limited here.

[0151] 403. When the network device determines that the first message does not have a preset tag, the network device obtains a decision result according to the idle forwarding capability and the adjustment request, and carries the decision result in the first message to obtain a second message.

[0152] After receiving the first message, the network device will first determine whether the first message has a preset tag. If the network device determines that the first message does not have the preset tag, the network device will obtain a decision result based on the value of the idle forwarding capability and the value of the adjustment request (the value of the adjustment request is represented by II), and carry the decision result in the first message, thereby obtaining a second message. Specifically, the network device obtains the decision result by comparing the value of the idle forwarding capability with the value of the adjustment request, II. Therefore, during the comparison process, the unit of the value of the idle forwarding capability and the unit of the value of the adjustment request, II, must be consistent. If they are inconsistent, the network device must also convert the units of the two to make the units consistent.

[0153] The following describes a specific process of how the network device obtains a decision result by comparing the idle forwarding capability value with the adjustment request value II (assuming that the units of the two are consistent) when the first message does not have a preset flag:

[0154] (1) If the first message does not have a preset tag and the value of the idle forwarding capability is ≥ the value II of the adjustment request, the grant information is used as the decision result.

[0155] In the case where the first message does not have a preset tag, and the network device determines that the value of the idle forwarding capability is ≥ the value of the adjustment request II by comparing the value of the idle forwarding capability with the value II of the adjustment request, in this case, the decision result obtained by the network device is "grant", that is, the grant information is used as the decision result (that is, the situation ① of the decision result described above), and the grant information is used to indicate that the sending device is allowed to increase the sending window or sending rate.

[0156] It should be noted that, in some other embodiments of the present application, when the first message does not have a preset tag, and the network device determines that the value of the idle forwarding capacity is ≥ the value of the adjustment request II by comparing the value of the idle forwarding capacity with the value of the adjustment request II, the network device can further subtract the value of the adjustment request II from the current value of the idle forwarding capacity as the new value of the idle forwarding capacity, taking the value of the idle forwarding capacity as the value CC of the letter of credit counter as an example, that is, CC=CC-II.

[0157] In the above embodiment of the present application, it is explained that when the first message does not have a preset tag and the value of the idle forwarding capability is ≥ the value II of the adjustment request, the decision result determined by the network device is the grant information, which is feasible. At the same time, compared with the existing solution that uses the same speed-up / speed-down value for all messages in the previous cycle (the speed-up / speed-down value requires complex calculation on the network device and is difficult to implement on the network device), the decision result obtained by the method of the present application is determined by the value of the idle forwarding capability and the size relationship of II. Only a simple comparison operation is required to obtain the corresponding decision result, which is easy to implement on high-speed network devices.

[0158] (2) If the first message does not have a preset tag and 0≤the value of the idle forwarding capability<the value II of the adjustment request, the first message is marked according to a preset probability.

[0159] In the case that the first message does not have a preset mark, and the network device determines that 0≤the value of the idle forwarding capacity is less than the value of the adjustment request II by comparing the value of the idle forwarding capacity with the value of the adjustment request II, in this case, the network device marks the first message according to the preset probability. Specifically, the way in which the network device marks the first message according to the preset probability may be to mark the first message according to a pre-set fixed probability p, or it may be to calculate the dynamic probability p' of the current round after each determination that 0≤the value of the idle forwarding capacity is less than the value of the adjustment request II, and then mark the first message with the dynamic probability p'. This application does not limit this.

[0160] It should be noted that there are two possible outcomes for marking the first message according to the preset probability. Different outcomes lead to different decision results obtained by the network device, which are described below.

[0161] A. If the first message is successfully marked with a preset mark by the network device with a preset probability, the mark information is used as a decision result.

[0162] When the first message is successfully marked with the preset mark by the network device with a preset probability, the network device uses the marking information of the first message marked with the preset mark as the decision result, that is, the decision result obtained by the network device is "mark" (that is, situation ③ of the decision result described above), and the marking information is used to indicate that the sending end device is allowed to reduce the sending window or sending rate.

[0163] It should also be noted that, in some other embodiments of the present application, when the first message does not have a preset tag, and the network device determines that 0≤the value of the idle forwarding capability<the value of the adjustment request II by comparing the value of the idle forwarding capability with the value of the adjustment request II, the network device may further increase the value of the deficit counter (DC) corresponding to the idle forwarding capability by a target preset value (which can be represented by β) as the new value of the deficit counter (the value of the deficit counter can be represented by DC), that is, DC=DC+β. It should be noted here that DC corresponds one-to-one to the value of the idle forwarding capability, and one idle forwarding capability value corresponds to one DC.

[0164] In the above embodiment of the present application, it is explained that when the first message does not have a preset mark and 0≤the value of the idle forwarding capacity<the value II of the adjustment request, the network device needs to mark the first message according to the preset probability. If the first message is successfully marked with the preset message, the decision result determined by the network device is the marking information, which achieves different decision results when different conditions are met, and has flexibility. At the same time, compared with the existing solution that uses the method of making all message speed-up / speed-down values ​​in the previous cycle the same (the speed-up / speed-down value needs to be obtained by complex calculation on the network device, which is difficult to implement on the network device), the decision results obtained by the method of the present application are all determined by the value of the idle forwarding capacity, DC and the size relationship of II. Only a simple comparison operation is required to obtain the corresponding decision result, so it is easy to implement on high-speed network devices.

[0165] B. If the first message is not marked with a preset mark by the network device with a preset probability, the value DC of the deficit counter is compared with the value II of the adjustment request.

[0166] If the first message is not marked with the preset mark by the network device with a preset probability, the network device further compares the value DC of the deficit counter corresponding to the idle forwarding capability with the value II of the adjustment request (assuming that the units of the two are consistent), and then obtains a specific decision result based on the comparison result. It is also important to note that different comparison results will result in different decision results, which are explained below:

[0167] a. If the value of the deficit counter DC ≥ the value of the adjustment request II, the grant information is used as the decision result.

[0168] When the value DC of the deficit counter corresponding to the idle forwarding capability is ≥ the value II of the adjustment request, the decision result obtained by the network device is "grant", that is, the grant information is used as the decision result (that is, the situation ① of the decision result described above). The grant information is used to indicate that the sending device is allowed to increase the sending window or sending rate.

[0169] It should be noted that, in some other embodiments of the present application, when the first message is not marked with a preset mark by the network device with a preset probability, and the network device determines that the value of the deficit counter DC ≥ the value of the adjustment request II by comparing the value DC of the deficit counter with the value II of the adjustment request, the network device can further subtract the value II of the adjustment request from the current value DC of the deficit counter as the new value DC of the deficit counter, that is, DC = DC-II.

[0170] In the above-mentioned embodiment of the present application, it is explained that when the first message does not have a preset mark and 0 < the value of the idle forwarding capacity < the value II of the adjustment request, the network device needs to mark the first message according to the preset probability. If the first message is not marked with the preset message, it is necessary to further compare the value DC of the deficit counter with the value II of the adjustment request. In the case that the value DC of the deficit counter ≥ the value II of the adjustment request, the decision result determined by the network device is the grant information, which achieves different decision results when different conditions are met and has flexibility. At the same time, compared with the existing solution that uses the method of making the speed increase / deceleration value of all messages in the previous cycle the same (the speed increase / deceleration value requires complex calculation on the network device and is difficult to implement on the network device), the decision results obtained by the method of the present application are all determined by the size relationship between the value of the idle forwarding capacity, DC, and II. Only a simple comparison operation is required to obtain the corresponding decision result, which is easy to implement on high-speed network devices.

[0171] b. If the value of the deficit counter DC is less than the value of the adjustment request II, the rejection information is taken as the decision result.

[0172] When the value DC of the deficit counter corresponding to the idle forwarding capability is less than the value II of the adjustment request, the decision result obtained by the network device is "rejection", that is, the rejection information is used as the decision result (that is, the situation ② of the decision result described above). The rejection information is used to indicate that the sending device is not allowed to adjust the sending window or sending rate.

[0173] (3) When the first message does not have a preset tag, the value of the idle forwarding capability is less than 0.

[0174] In the case where the first message does not have a preset mark, and the network device determines that the value of the idle forwarding capacity is less than 0 by comparing the value of the idle forwarding capacity with the value II of the adjustment request, in this case, the network device marks the first message with the preset mark, and uses the marking information of the first message marked with the preset mark as the decision result, that is, the decision result obtained by the network device is "mark" (that is, situation ③ of the decision result described above), and the marking information is used to indicate that the sending end device is allowed to reduce the sending window or sending rate.

[0175] In the above-mentioned embodiment of the present application, it is explained that when the first message does not have a preset tag and the value of the idle forwarding capability is less than 0, the network device marks the first message and determines that the decision result is the tag information, thereby achieving different decision results when different conditions are met, and having flexibility. At the same time, compared with the existing solution that uses the method of making the speed increase / deceleration value of all messages in the previous cycle the same (the speed increase / deceleration value needs to be obtained by complex calculation on the network device and is difficult to implement on the network device), the decision results obtained by the method of the present application are all determined by the value of the idle forwarding capability and the size relationship of II. Only a simple comparison operation is required to obtain the corresponding decision result, so it is easy to implement on high-speed network devices.

[0176] Points (1), (2), and (3) above describe how the network device obtains a decision result based on the idle forwarding capability and the adjustment request when the first message does not have a preset tag. In other embodiments of the present application, after the network device obtains the first message, if it is determined that the first message has a preset tag by determining whether the first message has a preset tag, then the network device marks the first message with the tag information of the preset tag as the decision result, that is, the decision result obtained by the network device is "marked" (that is, the situation ③ of the decision result described above), and the tag information is used to indicate that the sending end device is allowed to reduce the sending window or sending rate.

[0177] It should be noted that when the first message is determined by the network device to have a preset mark at the beginning, the network device can further increase the value of the idle forwarding capacity by a target preset value β as the new idle forwarding capacity value. Taking the idle forwarding capacity value as CC as an example, CC=CC+β.

[0178] In the above-mentioned embodiment of the present application, it is explained that when the first message has a preset mark, the network device does not need to compare the value of the idle forwarding capability with the value II of the adjustment request, but directly determines the mark information as the decision result, thereby achieving different decision results when different conditions are met, and having flexibility.

[0179] It should also be noted that, in the embodiments of the present application, the network device can be any device on the path between the sending end device and the receiving end device. That is, in addition to being a traditional network device (such as a switch, router, etc.), the network device can also be a sending end device or a receiving end device. The following describes each of these separately:

[0180] (1) A network device is any device between the sending device and the receiving device (excluding the sending device and the receiving device).

[0181] When the network device is any device between the sending device and the receiving device (excluding the sending device and the receiving device), that is, the network device is neither a sending device nor a receiving device, then the way the network device obtains the first message carrying the adjustment request in step 402 is that the network device receives the first message sent by the previous hop device (which may be the sending device or another device located after the sending device). Since the network device is not the receiving device, it means that the network device is not the last hop device. Therefore, in some embodiments of the present application, after step 403, the network device may further send the obtained second message (i.e., the first message carrying the decision result) to the next hop device.

[0182] It should be noted here that if the next-hop device of the network device is the receiving device, then after the receiving device receives the second message sent by the network device, it will parse the second message and carry the decision result in the confirmation message and send it to the sending device (there is no restriction on the path for the receiving device to return the confirmation message to the sending device to be the original path). The confirmation message is used to instruct the sending device to adjust the sending window (when the adjustment request is a window adjustment request) or the sending rate (when the adjustment request is a rate adjustment request) of the sending device according to the decision result carried therein.

[0183] (2) The network device is the sending device.

[0184] When the network device is a transmitting device, there are two processing methods: 1) The transmitting device executes the execution steps of the network device in step 402, that is, the first message is generated by the transmitting device itself (the first message generated in this case is an initial message and does not have a preset tag), and the transmitting device carries the adjustment request in the first message. The transmitting device then obtains a decision result based on the value II of the adjustment request and the obtained value of the idle forwarding capability, and then carries the decision result in the first message to obtain a second message, so that the second message can be subsequently sent to the next-hop device. 2) The transmitting device does not execute the execution steps of the network device in step 402, that is, the transmitting device may also not carry the adjustment request in the first message (the first message generated in this case is an initial message and does not have a preset tag), but instead, after calculating the value of the idle forwarding capability according to step 401, directly obtains a decision result based on the value II of the adjustment request and the obtained value of the idle forwarding capability, and then carries the decision result in the first message to obtain a second message, so that the second message can be subsequently sent to the next-hop device.

[0185] Similarly, since the sending device is not the last-hop device, in some embodiments of the present application, after step 403, the sending device may further send the obtained second message (i.e., the first message carrying the decision result) to the next-hop device.

[0186] It should also be noted that if the next-hop device of the sending device is the receiving device, then after the receiving device receives the second message sent by the sending device, it will parse the second message and carry the decision result in the confirmation message and send it to the sending device (there is no restriction on the path for the receiving device to return the confirmation message to the sending device to be the original path). The confirmation message is used to instruct the sending device to adjust the sending window (when the adjustment request is a window adjustment request) or the sending rate (when the adjustment request is a rate adjustment request) of the sending device according to the decision result carried therein.

[0187] (3) The network device is the receiving device.

[0188] When the network device is a receiving device, there are also two processing methods: 1) the receiving device executes the execution steps of the network device in step 403, that is, when the receiving device determines that the first message does not have a preset mark, the receiving device obtains a decision result based on the idle forwarding capability and the adjustment request, and carries the decision result in the first message to obtain a second message. Thereafter, the second message is parsed, and the decision result obtained by the analysis is carried in a confirmation message, and the confirmation message is sent to the sending device. The confirmation message is used to instruct the sending device to adjust the sending window (when the adjustment request is a window adjustment request) or the sending rate (when the adjustment request is a rate adjustment request) of the sending device according to the decision result carried therein. 2) The receiving device does not execute the execution steps of the network device in step 403. Instead, when the receiving device determines that the first message does not have a preset mark, the receiving device obtains a decision result based on the idle forwarding capability and the adjustment request. The decision result is not carried in the first message, but is directly carried in the confirmation message, and the confirmation message is sent to the sending device. The confirmation message is used to instruct the sending device to adjust the sending window (when the adjustment request is a window adjustment request) or the sending rate (when the adjustment request is a rate adjustment request) of the sending device according to the decision result carried therein.

[0189] It should be noted that in the above-mentioned embodiment of the present application, there are three situations in which the decision results are as follows: ① The grant information is used as the decision result to indicate that the sending end device is granted to increase the sending window (or sending rate); ② The rejection information is used as the decision result to indicate that the sending end device is rejected to increase the sending window (or sending rate). ③ If the message is marked with a preset mark (whether it is marked by the previous network device or marked by itself), the mark information is used as the decision result, and the mark information is used as the decision result to indicate that the sending window (or sending rate) of the sending end device is reduced. Therefore, after the sending end device receives the confirmation message sent by the receiving end device, according to the different decision results carried therein, the way it adjusts the sending window (or sending rate) of the sending end device is also different, including but not limited to:

[0190] a. If the decision result is marking information, then the confirmation message is specifically used to instruct the sending device to reduce the sending window or sending rate of the sending device according to the decision result, wherein the magnitude of the reduction is obtained according to the target preset value β. For example, the sending window or sending rate of the sending device can be reduced by β on the original basis, or the sending window or sending rate of the sending device can be reduced by k1*β on the original basis, wherein k1 is a custom parameter and k1>0.

[0191] b. If the decision result is grant information, then the confirmation message is specifically used to instruct the sending device to increase the sending window or sending rate of the sending device according to the decision result, wherein the magnitude of the increase is obtained according to the value II of the adjustment request. For example, the sending window or sending rate of the sending device can be increased by II on the original basis, or the sending window or sending rate of the sending device can be increased by k2*II on the original basis, wherein k2 is a custom parameter, and k2>0.

[0192] c. If the decision result is a rejection message, the confirmation message is specifically used to instruct the sending end device not to increase or decrease the sending window or sending rate of the sending end device according to the decision result.

[0193] In the above-mentioned embodiment of the present application, it is explained that the decision results carried in the confirmation message are different, and the sending device adjusts the sending window and sending rate in different ways based on the confirmation message. The adjustment logic is simple, easy to implement, and optional.

[0194] In the embodiment of the present application, in order to further understand the logic of the above step 403, the following takes the idle forwarding capability as CC as an example to illustrate the process of obtaining different decision results based on different comparison results. Figure 5 , Figure 5Another flowchart of the active queue management method for a network device provided in an embodiment of the present application is provided. When the network device obtains the first message, the network device performs the following operations:

[0195] Step 1: The network device determines whether the first message is marked with a preset tag. If so, the marking information indicating that the first message has the preset tag is the decision result. The network device also increases the CC by β (β is a custom parameter, i.e., the target preset value described above. The empirical value is generally 0.5 * Maximum Transmission Unit (MTU)) as the new CC, i.e., CC = CC + β. If the network device is not the receiving device, it further sends the first message to the next hop device on the path between the sending device and the receiving device. If the network device is the receiving device, it includes the marking information as the decision result in the generated confirmation message. If the first message is not marked with the preset tag, the process proceeds to Step 2.

[0196] Step 2: The network device determines the relationship between the value CC of the letter of credit counter and the value II of the adjustment request carried in the first message. If CC≥II, the grant information is carried in the first message as the decision result of the network device, and CC minus II is used as the new CC (i.e. CC=CC-II). If the network device is not a receiving device, the network device will further send the first message carrying the decision result (i.e. Figure 4 The second message described in the corresponding embodiment) is sent to the next-hop device on the path between the sending device and the receiving device. If the network device is the receiving device, the decision result will be carried in the generated confirmation message; if 0≤CC<II, enter Step 3, if CC<0, enter Step 6.

[0197] Step 3. The network device marks the first message according to the preset probability (the preset probability is a custom parameter. If the preset probability is a fixed probability p, the empirical value is generally 0.1-0.2. If the preset probability is a dynamic probability p', the network device calculates it automatically each time). If the first message is successfully marked with the preset mark, then the marking information of the first message with the preset mark is the decision result. The network device will also increase the DC corresponding to CC by β to obtain a new DC, that is, DC = DC + β. If the network device is not a receiving device, the network device will further send the first message with the preset mark to the next hop device on the path between the sending device and the receiving device. If the network device is a receiving device, it will use the marking information as the decision result and carry it in the generated confirmation message. If the first message is not marked with the preset mark by the preset probability, then go to Step 4.

[0198] Step 4. The network device compares DC with II. If DC≥II, the network device will take the grant information as the decision result of the network device and carry it in the first message, and subtract II from DC as the new DC (i.e. DC=DC-II). If the network device is not a receiving device, the network device will further send the first message carrying the decision result (i.e. Figure 4 The second message described in the corresponding embodiment) is sent to the next hop device on the path between the sending device and the receiving device. If the network device is the receiving device, the decision result will be carried in the generated confirmation message; if DC < II, enter Step 5.

[0199] Step 5, the network device carries the rejection information as the decision result of the network in the first message. If the network device is not a receiving device, the network device will further carry the first message carrying the decision result (i.e. the above Figure 4 The second message described in the corresponding embodiment) is sent to the next hop device on the path between the sending end device and the receiving end device. If the network device is the receiving end device, the decision result will be carried in the generated confirmation message.

[0200] Step 6: The network device marks the first message. The predetermined marking information on the first message is the decision result. If the network device is not the receiving device, it further sends the first message to the next hop device on the path between the sending device and the receiving device. If the network device is the receiving device, it includes the marking information as the decision result in the generated confirmation message.

[0201] It should be noted that in Figure 5 In the corresponding embodiment, it is explained that the current network device obtains its own decision result for the first message obtained, and the decision result does not take into account the previous decision result on the first message carried by the previous hop device of the network device (if any). In actual application, assuming that the current network device is not a sending end device, and the previous hop device of the network device is not a sending end device, then if the decision result determined by the previous hop device is grant information or reject information (i.e., ① and ② described above), these two decision results may be rewritten by the current network device. If the previous hop device determines that the first message has a preset mark (i.e., ③ described above), that is, any of the previous network devices marks the first message with a preset mark, the subsequent network devices can only obtain the decision result of ③. The specific rewriting rules are as described above and will not be repeated here.

[0202] It should also be noted that when the sending device receives the confirmation message returned by the receiving device, it will adjust the sending window or sending rate according to the different decision results in the confirmation message. For details, please refer to Figure 6 , Figure 6 A flow chart of a sending end device adjusting a sending window or sending rate according to a decision result provided in an embodiment of the present application, comprising Figure 6 It can be seen that if the decision result is marking information, then the confirmation message is specifically used to instruct the sending device to reduce the sending window or sending rate of the sending device according to the decision result; if the decision result is granting information, then the confirmation message is specifically used to instruct the sending device to increase the sending window or sending rate of the sending device according to the decision result; if the decision result is rejection information, then the confirmation message is specifically used to instruct the sending device not to adjust (i.e., neither increase nor decrease) the sending window or sending rate of the sending device according to the decision result.

[0203] It should also be noted that the active queue management method for network devices provided in the embodiments of the present application can be used in conjunction with a congestion control protocol to control the queue depth at a specified depth. The following describes how the slow start algorithm and the additive increase multiplicative decrease (AIMD) algorithm are implemented using the active queue management method for network devices provided in the embodiments of the present application:

[0204] (1) The slow start algorithm is implemented using the active queue management method of the network device provided in the embodiment of the present application.

[0205] Please refer to the following for details: Figure 7 , Figure 7 A schematic diagram of a framework for implementing a slow start algorithm using the active queue management method of a network device provided by an embodiment of the present application. The characteristic of the slow start algorithm is that the size of the sending window doubles after each round trip time (RTT). Under the control of the algorithm, the window increases rapidly to quickly fill up the idle bandwidth. In order to implement the algorithm, in each message sent by the sending device, the value II of the adjustment request carried in the message is set to MTU, such as Figure 7 As shown in step S1 in FIG, after the message passes through the network device (here it is assumed that the network device does not include the sending end device and the receiving end device), the network device will make a judgment, such as Figure 7In step S2 of the above, there are three possible decision results: 1) II keeps the MTU unchanged (i.e., the decision result is grant information); 2) II is changed to 0 (i.e., the decision result is reject information); 3) the message is marked (i.e., the decision result is mark information), as shown in step S3 above. The receiving device carries the decision result in the message in the confirmation message ACK and returns it to the sending device, as shown in step S3 above. Figure 7 As shown in step S4 and step S5 in the above example, it should be noted that Figure 7 The return path of the ACK message shown in the figure is the same as the sending path. In actual applications, there is no restriction on the return path being consistent with the sending path. After the ACK message reaches the sending device, the sending device updates the window according to the decision result carried in the ACK message, such as Figure 7 In step S6, if the decision result carried in the confirmation message ACK is not the marking information, the adjustment request value II is added to the sending window; if the decision result carried in the confirmation message ACK is the marking information, the sending end device reduces the sending window by β.

[0206] It should be noted here that the present application utilizes the active queue management method of the network device provided in the embodiment of the present application to implement the slow start algorithm to adjust the sending window of the sending device. In other implementations of the present application, it can also be used to adjust the sending rate of the sending device. The adjustment method is similar to the method of adjusting the sending window, which will not be repeated here.

[0207] (2) Implement the AIMD algorithm using the active queue management method for network devices provided in the embodiments of the present application.

[0208] On the basis of the above (1), when the network device determines that 0<CC<II, the network device can determine that the bandwidth is fully occupied. However, at this time, the multiple flows are not necessarily fair, that is, they have the same bandwidth, so the AIMD algorithm can continue to be implemented based on the active queue management method of the network device provided in the embodiment of the present application to achieve fairness of the flow. When the sending device is in the slow start algorithm, if II=0 in the confirmation message ACK received by the sending device (that is, the decision result is a rejection message) or the decision result in the confirmation message ACK is a marking message, the sending device can also determine that the bottleneck link bandwidth is full (or even congested), and then exit from the slow start algorithm and enter the AIMD algorithm. In order to implement the AIMD algorithm, the II carried in the message sent by the sending device is α / cwnd, and other behaviors remain unchanged, such as Figure 8 As shown. Since the bandwidth of the network device has been fully occupied, 0<CC<II, so the above Figure 5 This corresponds to Step 3 in the embodiment. When the II carried in the message is set to α / cwnd, this branch implements the AIMD algorithm, which can achieve equal throughput for multiple flows after multiple iterations.

[0209] In summary, the active queue management method for a network device provided in the embodiments of the present application has the following beneficial effects:

[0210] 1) The queue depth on the network device can be stably maintained at the preset queue depth Q t For example, Q t It can be set to 0KB, that is, the queue depth is maintained at 0, which can achieve extremely low queuing delay.

[0211] 2) It can be used to implement fast speed-up algorithms such as slow start. This method can enable the sending device to quickly fill up the bandwidth when the link bandwidth is not full, while maintaining simple logic.

[0212] 3) When the bandwidth is full, it can be used to implement the AIMD algorithm, achieving fairness for multiple flows without losing bandwidth, while keeping the implementation logic simple.

[0213] 4) This method has low complexity and is easy to implement on high-speed network equipment.

[0214] In order to have a more intuitive understanding of the beneficial effects brought by the embodiments of the present application, the following further compares the technical effects brought by the embodiments of the present application. The present application uses the active queue management method of the network device to implement the slow start algorithm for comparison. The present application constructs a dumbbell-shaped topology on the simulation platform and constructs traffic passing through the bottleneck link. The number of upstream flows on the bottleneck link is continuously increased, and the queue depth on the bottleneck link is observed. The present application uses the Q t Set to 0KB, the results are compared with those of the existing technology. Figure 9 As shown, C-AQM is the method of the present application, HPCC and XCP are the results of the existing technology. Figure 9 From the comparison chart of the effects, we can see that: the result of the prior art XCP is that as the number of flows increases, the average queue depth shows a significant upward trend overall, but decreases at some intermediate flow numbers; the result of the prior art HPCC is that the average queue depth increases significantly with the number of flows; the result of the embodiment of the present invention C-AQM is that the average queue depth increases slightly with the number of flows. The reason why the queue depth is not strictly 0KB is that the real-time queue depth actually fluctuates around 0KB, and when the queue underflows, it is actually calculated as 0, so the actual average queue depth is higher than 0KB. The reason why the average queue depth increases slightly with the number of flows is that when the number of flows increases, the jitter of the queue also increases, resulting in an increase in the instantaneous queue, which in turn causes a slight increase in the average queue depth.

[0215] On the basis of the above embodiments, in order to better implement the above solutions of the embodiments of the present application, the following also provides related devices for implementing the above solutions. Figure 10 , Figure 10A schematic diagram of a network device provided in an embodiment of the present application, wherein the network device 1000 may specifically include: a calculation module 1001, an acquisition module 1002, and a decision module 1003, wherein the calculation module 1001 is used to calculate the idle forwarding capacity of a target outgoing queue or a target outgoing port on the network device 1000, where the idle forwarding capacity is used to characterize the difference between the upper limit of the forwarded data volume of the target outgoing queue or the target outgoing port and the current actual forwarding volume, the target outgoing queue includes one or more outgoing queues, the target outgoing port includes one or more outgoing ports, and the network device 1000 is any device on the path between the sending end device and the receiving end device; the acquisition module 1002 is used to obtain a first message carrying an adjustment request, the adjustment request including a window adjustment request or a rate adjustment request, the adjustment request being used to instruct adjustment of the sending window or sending rate of the sending end device; the decision module 1003 is used to obtain a decision result based on the idle forwarding capacity and the adjustment request when the network device 1000 determines that the first message does not have a preset mark, and carry the decision result in the first message to obtain a second message.

[0216] It should be noted here that when the network device is a sending device, there are two processing methods: 1) the acquisition module 1002 executes the step of "obtaining a first message carrying an adjustment request", that is, the first message is generated by the acquisition module 1002 itself (the first message generated at this time is an initial message and does not have a preset mark), and the acquisition module 1002 carries the adjustment request in the first message, and the decision module 1003 then obtains a decision result based on the value of the adjustment request and the obtained idle forwarding capacity value, and then carries the decision result in the first message to obtain a second message, so that the second message can be subsequently sent to the next-hop device. 2) The acquisition module 1002 does not perform the step of "obtaining the first message carrying the adjustment request", that is, the acquisition module 1002 may also not carry the adjustment request in the first message (the first message generated at this time is an initial message and does not have a preset tag). The acquisition module 1002 only generates the first message, and after the decision module 1003 calculates the value of the idle forwarding capacity, it directly obtains the decision result based on the value of the adjustment request and the obtained idle forwarding capacity value, and then the decision module 1003 carries the decision result in the first message to obtain the second message, so that the second message can be subsequently sent to the next-hop device.

[0217] In one possible design, the decision module 1003 is specifically used to: when the network device 1000 determines that the value of the idle forwarding capability is greater than or equal to the value of the adjustment request, use the grant information as the decision result, and the grant information is used to indicate that the sending device is allowed to increase the sending window or sending rate of the sending device.

[0218] In one possible design, the decision module 1003 is specifically used to: when the network device 1000 determines that the value of the idle forwarding capacity is greater than zero and less than the value of the adjustment request, mark the first message according to a preset probability; when the network device 1000 determines that the first message is marked with the preset mark, use the marking information of the first message with the preset mark as the decision result, and the marking information is used to indicate that the sending device is allowed to reduce the sending window or sending rate of the sending device.

[0219] In one possible design, the decision module 1003 is also used to: when the network device 1000 determines that the first message is not marked with the preset mark, and the value of the deficit counter corresponding to the idle forwarding capability is greater than or equal to the value of the adjustment request, use the grant information as the decision result, and the grant information is used to indicate that the sending device is allowed to increase the sending window or sending rate of the sending device.

[0220] In one possible design, the decision module 1003 is also used to: when the network device 1000 determines that the first message is not marked with the preset mark, and the value of the deficit counter corresponding to the idle forwarding capability is less than the value of the adjustment request, use the rejection information as the decision result, and the rejection information is used to indicate that the sending device is not allowed to adjust the sending window or sending rate of the sending device.

[0221] In one possible design, the decision module 1003 is further specifically used to: when the network device 1000 determines that the value of the idle forwarding capability is less than zero, mark the first message with the preset mark, and use the mark information of the first message with the preset mark as the decision result, and the mark information is used to indicate that the sending device is allowed to reduce the sending window or sending rate of the sending device.

[0222] In one possible design, the decision module 1003 is also used to: when the network device 1000 determines that the first message has the preset mark, use the mark information that the first message has the preset mark as the decision result, and carry the decision result to the first message to obtain a second message, and the mark information is used to indicate that the sending end device is allowed to reduce the sending window or sending rate of the sending end device.

[0223] In one possible design, the calculation module 1001 is specifically used to calculate the value of the letter of credit counter based on the upper limit of the forwarding data volume of the target out-queue or the target out-port within a preset time length and the total amount of data passing through the target out-queue or the target out-port within the preset time length, and the value of the letter of credit counter is used to represent the size of the idle forwarding capacity.

[0224] In one possible design, the calculation module 1001 is specifically used to calculate the value of the letter of credit counter based on the upper limit of the forwarding data volume of the target out-queue or the target out-port within a preset time length, the total amount of data passing through the target out-queue or the target out-port within the preset time length, and the current out-queue depth. The value of the letter of credit counter is used to characterize the size of the idle forwarding capacity, and the current out-queue depth is the depth of the target out-queue or the depth of the out-queue corresponding to the target out-port.

[0225] In one possible design, the calculation module 1001 is specifically used to calculate the value of the letter of credit counter based on the upper limit of the forwarding data volume of the target out-queue or the target out-port within a preset time length, the total amount of data passing through the target out-queue or the target out-port within the preset time length, the current out-queue depth and the preset queue depth. The value of the letter of credit counter is used to characterize the size of the idle forwarding capacity, and the current out-queue depth is the depth of the target out-queue or the depth of the out-queue corresponding to the target out-port.

[0226] In one possible design, the calculation module 1001 is further specifically used to: subtract the upper limit of the forwarding data volume of the target outgoing queue or the target outgoing port within a preset time length from the total amount of data passing through the target outgoing queue or the target outgoing port within the preset time length to obtain a first subtraction result; add the first subtraction result to the preset queue depth to obtain an addition result; subtract the addition result from the sum of the current outgoing queue depths to obtain a second subtraction result; multiply the second subtraction result by a preset coefficient to obtain the value of the letter of credit counter, wherein the unit of the value of the letter of credit counter is bytes.

[0227] In one possible design, the calculation module 1001 is further specifically used to: subtract the upper limit of the forwarding data volume of the target outgoing queue or the target outgoing port within a preset time length from the total amount of data passing through the target outgoing queue or the target outgoing port within the preset time length to obtain a first subtraction result; add the first subtraction result to the preset queue depth to obtain an addition result; subtract the addition result from the sum of the current outgoing queue depths to obtain a second subtraction result; multiply the second subtraction result by a preset coefficient to obtain a multiplication result; divide the multiplication result by the preset time length to obtain the value of the letter of credit counter, wherein the unit of the value of the letter of credit counter is rate.

[0228] In one possible design, the network device 1000 is not the receiving device, and the network device 1000 also includes: a sending module 1004, and the sending module 1004 is used to send the second message to the next-hop device.

[0229] In one possible design, when the next-hop device is the receiving device, the sending module 1004 is specifically used to: send the second message to the receiving device, so that the receiving device sends a confirmation message carrying the decision result to the sending device, and the confirmation message is used to instruct the sending device to adjust the sending window or sending rate of the sending device according to the decision result.

[0230] In one possible design, the network device 1000 is the receiving device, and the network device 1000 also includes a sending module 1004, which is used to send a confirmation message carrying the decision result to the sending device, and the confirmation message is used to instruct the sending device to adjust the sending window or sending rate of the sending device according to the decision result.

[0231] It should be noted here that when the network device is a sending device, there are also two processing methods: 1) the decision module 1003 executes the step of "carrying the decision result in the first message to obtain the second message", that is, when the decision module 1003 determines that the first message does not have a preset mark, the decision result is obtained according to the idle forwarding capability and the adjustment request, and the decision result is carried in the first message to obtain the second message. After that, the sending module 1004 parses the second message, and the decision result obtained by the analysis is carried in the confirmation message, and the confirmation message is sent to the sending device. The confirmation message is used to instruct the sending device to adjust the sending window of the sending device (when the adjustment request is a window adjustment request) or the sending rate (when the adjustment request is a rate adjustment request) according to the decision result carried therein. 2) The decision module 1003 does not perform the step of "carrying the decision result in the first message to obtain the second message". Instead, when the decision module 1003 determines that the first message does not have a preset mark, the decision result is obtained based on the idle forwarding capability and the adjustment request. The decision result is not carried in the first message, but is directly carried in the confirmation message, and the sending module 1004 sends the confirmation message to the sending device. The confirmation message is used to instruct the sending device to adjust the sending window (when the adjustment request is a window adjustment request) or the sending rate (when the adjustment request is a rate adjustment request) of the sending device according to the decision result carried therein.

[0232] In one possible design, when the decision module 1003 takes the marking information of the first message having the preset mark as the decision result, the confirmation message is specifically used to instruct the sending device to reduce the sending window or sending rate of the sending device according to the decision result, wherein the magnitude of the reduction is obtained according to the target preset value.

[0233] In one possible design, when the decision module 1003 uses the grant information as the decision result, the confirmation message is used to instruct the sending device to increase the sending window or sending rate of the sending device according to the decision result, wherein the increase is obtained according to the value of the adjustment request.

[0234] In one possible design, when the decision module 1003 takes rejection information as the decision result, the confirmation message is used to instruct the sending device not to adjust (i.e., neither increase nor decrease) the sending window or sending rate of the sending device according to the decision result.

[0235] It should be noted that the information interaction, execution process, etc. between the modules / units in the network device 1000 are the same as those in the present application. Figure 4 or Figure 5 The corresponding method embodiments are based on the same concept. For specific contents, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.

[0236] Next, another network device provided by the embodiment of the present application is introduced. Figure 11 , Figure 11 A schematic diagram of a network device provided in an embodiment of the present application is provided. The network device 1100 may be deployed with Figure 10 The network device 1000 described in the corresponding embodiment is used to implement Figure 10 Regarding the functions of the network device 1000 in the corresponding embodiment, specifically, the network device 1100 is implemented by one or more servers. The network device 1100 may vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 1122 and memories 1132, and one or more storage media 1130 (e.g., one or more mass storage devices) storing application programs 1142 or data 1144. The memories 1132 and storage media 1130 may be either transient or persistent storage. The program stored in the storage medium 1130 may include one or more modules (not shown), each of which may include a series of instruction operations on the network device 1100. Furthermore, the CPU 1122 may be configured to communicate with the storage medium 1130 to execute the series of instruction operations in the storage medium 1130 on the network device 1100.

[0237] The network device 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0238] In the embodiment of the present application, the central processing unit 1122 is used to execute Figure 4 or Figure 5 The steps performed by the network device in the corresponding embodiment. For example, the central processor 1122 can be used to: first, calculate the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device, wherein the idle forwarding capacity is used to represent the difference between the upper limit of the forwarding data volume of the target outgoing queue (one or more) or target outgoing port (one or more) on the network device and the current actual forwarding volume, and specifically can be the difference between the upper limit of the forwarding data volume of the target outgoing queue (one or more) or target outgoing port (one or more) on the network device and the current actual forwarding volume within a preset time length (e.g., 200us), and the preset time length can be set arbitrarily. The network device is any device on the path between the sending end device and the receiving end device (including the sending end device and the receiving end device). In addition, in addition to calculating the idle forwarding capacity of the target outgoing queue or target outgoing port on the network device, the central processor 1122 also obtains a message carrying an adjustment request, which can be referred to as a first message. The adjustment request can be a window adjustment request or a rate adjustment request, wherein the window adjustment request is used to instruct the adjustment of the sending window of the sending end device, and the rate adjustment request is used to instruct the adjustment of the sending rate of the sending end device. After receiving the first message, the network device first determines whether the first message has a preset flag. If the network device determines that the first message does not have the preset flag, the network device determines a decision result based on the idle forwarding capability value and the adjustment request value II, and carries the decision result in the first message, thereby obtaining a second message. Specifically, the network device determines the decision result by comparing the idle forwarding capability value with the adjustment request value II. Therefore, during the comparison process, the units of the idle forwarding capability value and the adjustment request value II must be consistent. If they are inconsistent, the network device must convert the units of the two to ensure that the units are consistent.

[0239] It should be noted that the specific manner in which the CPU 1122 performs the above steps is different from the specific manner in which the CPU 1122 performs the above steps. Figure 4 or Figure 5The corresponding method embodiments are based on the same concept, and the technical effects they bring are also the same as the above-mentioned embodiments of this application. For specific contents, please refer to the description in the method embodiments shown above in this application, and will not be repeated here.

[0240] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.

[0241] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general-purpose hardware, and of course can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. In general, all functions performed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits, or dedicated circuits. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.

[0242] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0243] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can 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 can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, computer, training device or data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

Claims

1. A method for active queue management of a network device, characterized in that: include: The network device calculates an idle forwarding capacity of a target outgoing queue or a target outgoing port on the network device, where the idle forwarding capacity represents a difference between an upper limit of a forwarded data volume of the target outgoing queue or the target outgoing port and a current actual forwarding volume. The target outgoing queue includes one or more outgoing queues, and the target outgoing port includes one or more outgoing ports. The network device is any device on a path between a sending end device and a receiving end device. The network device obtains a first message carrying an adjustment request, where the adjustment request is used to instruct adjustment of a sending window or a sending rate of the sending end device, and the adjustment request carries a value of an increased sending window or a sending rate; When the network device determines that the first message does not have a preset tag, the network device obtains a decision result based on the idle forwarding capability and the value carried in the adjustment request, and the decision result is used to indicate adjustment of the sending window or sending rate.

2. The method according to claim 1, characterized in that The network device obtains a decision result according to the idle forwarding capability and the value carried in the adjustment request, including: When the network device determines that the value of the idle forwarding capability is greater than or equal to the value carried in the adjustment request, the network device uses the grant information as the decision result, and the grant information is used to indicate that the sending device is allowed to increase the sending window or sending rate of the sending device.

3. The method according to claim 1, characterized in that The network device obtains a decision result according to the idle forwarding capability and the value carried in the adjustment request, including: When the network device determines that the value of the idle forwarding capability is greater than zero and less than the value carried in the adjustment request, the network device marks the first message with the preset mark according to a preset probability; In the case where the first message is marked with the preset mark by the network device, the network device uses the preset mark as the decision result, and the preset mark is used to indicate that the sending end device is allowed to reduce the sending window or sending rate of the sending end device.

4. The method according to claim 3, characterized in that The method further comprises: When the first message is not marked with the preset mark by the network device, and the value of the deficit counter corresponding to the idle forwarding capability is greater than or equal to the value carried in the adjustment request, the network device will use the grant information as the decision result, and the grant information is used to indicate that the sending device is allowed to increase the sending window or sending rate of the sending device.

5. The method according to claim 4, characterized in that The method further comprises: When the first message is not marked with the preset mark by the network device and the value of the deficit counter corresponding to the idle forwarding capability is less than the value carried in the adjustment request, the network device will use rejection information as the decision result, and the rejection information is used to indicate that the sending device is not allowed to adjust the sending window or sending rate of the sending device.

6. The method according to claim 1, characterized in that The network device obtains a decision result according to the idle forwarding capability and the value carried in the adjustment request, including: When the network device determines that the value of the idle forwarding capability is less than zero, the network device marks the first message with the preset mark; The network device uses the preset mark as the decision result, where the preset mark is used to indicate that the sending end device is allowed to reduce the sending window or the sending rate of the sending end device.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When the network device determines that the first message has the preset tag, the network device uses the preset tag as a decision result, where the preset tag is used to indicate that the sending end device is allowed to reduce the sending window or sending rate of the sending end device.

8. The method according to any one of claims 1 to 6, characterized in that The network device calculating the idle forwarding capacity of a target outgoing queue or a target outgoing port on the network device includes: The network device calculates the value of the credit counter based on the upper limit of the forwarding data volume of the target out-queue or the target out-port within a preset time period and the total amount of data passing through the target out-queue or the target out-port within the preset time period. The value of the credit counter is used to characterize the size of the idle forwarding capacity.

9. The method according to claim 8, characterized in that The network device calculates the value of the credit counter according to the upper limit of the forwarded data volume of the target outgoing queue or the target outgoing port within a preset time period and the total amount of data passing through the target outgoing queue or the target outgoing port within the preset time period, including: The network device calculates the value of the letter of credit counter based on the upper limit of the forwarding data volume of the target out-queue or the target out-port within a preset time period, the total amount of data passing through the target out-queue or the target out-port within the preset time period, and the current out-queue depth, where the current out-queue depth is the depth of the target out-queue or the depth of the out-queue corresponding to the target out-port.

10. The method according to claim 9, characterized in that The network device calculates a value of a credit counter according to an upper limit of the amount of forwarded data of the target outgoing queue or the target outgoing port within a preset time period, a total amount of data passing through the target outgoing queue or the target outgoing port within the preset time period, and a current outgoing queue depth, including: The network device calculates the value of the letter of credit counter based on the upper limit of the forwarded data volume of the target outgoing queue or the target outgoing port within a preset time period, the total amount of data passing through the target outgoing queue or the target outgoing port within the preset time period, the current outgoing queue depth and the preset queue depth.

11. The method according to claim 10, characterized in that The network device calculates a value of a credit counter according to an upper limit of the amount of forwarded data of the target outgoing queue or the target outgoing port within a preset time period, a total amount of data passing through the target outgoing queue or the target outgoing port within the preset time period, a current outgoing queue depth, and a preset queue depth, including: The network device subtracts the upper limit of the forwarding data volume of the target outgoing queue or the target outgoing port within a preset time period from the total amount of data passing through the target outgoing queue or the target outgoing port within the preset time period to obtain a first subtraction result; The network device adds the first subtraction result and the preset queue depth to obtain an addition result; The network device subtracts the addition result from the current outbound queue depth to obtain a second subtraction result; The network device multiplies the second subtraction result by a preset coefficient to obtain a value of the letter of credit counter, wherein the unit of the value of the letter of credit counter is byte.

12. The method according to any one of claims 1 to 6, characterized in that The network device is not the receiving device, and the method further includes: The network device obtains a second message including the decision result; The network device sends the second message to the next-hop device.

13. The method according to claim 12, characterized in that The next-hop device is the receiving end device, and the network device sending the second message to the next-hop device includes: The network device sends the second message to the receiving device, so that the receiving device sends a confirmation message carrying the decision result to the sending device, and the confirmation message is used to instruct the sending device to adjust the sending window or sending rate of the sending device according to the decision result.

14. The method according to any one of claims 1 to 6, characterized in that The network device is the receiving end device, and the method further includes: The network device sends a confirmation message carrying the decision result to the sending end device, where the confirmation message is used to instruct the sending end device to adjust the sending window or sending rate of the sending end device according to the decision result.

15. The method according to claim 14, characterized in that When the network device uses the preset mark as the decision result, the confirmation message is specifically used to instruct the sending device to reduce the sending window or sending rate of the sending device according to the decision result, wherein the reduction amplitude is obtained according to the target preset value.

16. The method according to claim 15, characterized in that When the network device uses the grant information as the decision result, the confirmation message is used to instruct the sending device to increase the sending window or sending rate of the sending device according to the decision result, wherein the increase is obtained according to the value carried in the adjustment request.

17. The method according to claim 16, characterized in that When the network device uses rejection information as the decision result, the confirmation message is used to instruct the sending end device not to adjust the sending window or sending rate of the sending end device according to the decision result.

18. A network device, characterized in that: include: a calculation module, configured to calculate an idle forwarding capacity of a target outgoing queue or a target outgoing port on the network device, the idle forwarding capacity being used to represent a difference between an upper limit of a forwarded data volume of the target outgoing queue or the target outgoing port and a current actual forwarding volume, the target outgoing queue including one or more outgoing queues, the target outgoing port including one or more outgoing ports, and the network device being any device on a path between a transmitting end device and a receiving end device; an acquisition module, configured to acquire a first message carrying an adjustment request, wherein the adjustment request is used to instruct adjustment of a sending window or a sending rate of the sending end device, and the adjustment request carries a value of an increased sending window or a sending rate; A decision module is used to obtain a decision result based on the idle forwarding capability and the value carried in the adjustment request when the network device determines that the first message does not have a preset mark, and the decision result is used to indicate the adjustment of the sending window or the sending rate.

19. The device according to claim 18, characterized in that The decision module is specifically used to: When the network device determines that the value of the idle forwarding capability is greater than or equal to the value carried in the adjustment request, the grant information is used as the decision result, and the grant information is used to indicate that the sending device is allowed to increase the sending window or sending rate of the sending device.

20. The apparatus according to claim 18, wherein The decision module is specifically used to: When the network device determines that the value of the idle forwarding capability is greater than zero and less than the value carried in the adjustment request, marking the first message with the preset mark according to a preset probability; In a case where the first message is marked with the preset mark by the network device, the preset mark is used as the decision result, and the preset mark is used to indicate that the sending end device is allowed to reduce the sending window or sending rate of the sending end device.

21. The device according to claim 20, characterized in that The decision module is further configured to: When the first message is not marked with the preset mark by the network device, and the value of the deficit counter corresponding to the idle forwarding capability is greater than or equal to the value carried in the adjustment request, the grant information is used as the decision result, and the grant information is used to indicate that the sending device is allowed to increase the sending window or sending rate of the sending device.

22. The device according to any one of claims 21, characterized in that The decision module is further configured to: When the first message is not marked with the preset mark by the network device and the value of the deficit counter corresponding to the idle forwarding capability is less than the value carried in the adjustment request, the rejection information is used as the decision result, and the rejection information is used to indicate that the sending device is not allowed to adjust the sending window or sending rate of the sending device.

23. The apparatus according to claim 18, wherein The decision module is further configured to: When the network device determines that the value of the idle forwarding capability is less than zero, marking the first message with the preset mark; The preset mark is used as the decision result, and the preset mark is used to indicate that the sending end device is allowed to reduce the sending window or the sending rate of the sending end device.

24. The apparatus according to any one of claims 18 to 23, characterized in that The decision module is further configured to: When the network device determines that the first message has the preset tag, the preset tag is used as a decision result, and the preset tag is used to indicate that the sending end device is allowed to reduce the sending window or sending rate of the sending end device.

25. The apparatus according to any one of claims 18 to 23, characterized in that The computing module is specifically configured to: The value of the credit counter is calculated based on the upper limit of the forwarding data volume of the target outbound queue or the target outbound port within the preset time period and the total amount of data passing through the target outbound queue or the target outbound port within the preset time period. The value of the credit counter is used to represent the size of the idle forwarding capacity.

26. The apparatus according to any one of claims 18 to 23, characterized in that The computing module is further configured to: The value of the credit counter is calculated based on the upper limit of the forwarding data volume of the target outbound queue or the target outbound port within a preset time period, the total amount of data passing through the target outbound queue or the target outbound port within the preset time period, and the current outbound queue depth. The value of the credit counter is used to represent the size of the idle forwarding capacity. The current outbound queue depth is the depth of the target outbound queue or the depth of the outbound queue corresponding to the target outbound port.

27. The apparatus according to any one of claims 18 to 23, characterized in that The computing module is further configured to: The value of the credit counter is calculated based on the upper limit of the forwarding data volume of the target outbound queue or the target outbound port within a preset time period, the total amount of data passing through the target outbound queue or the target outbound port within the preset time period, the current outbound queue depth and the preset queue depth. The value of the credit counter is used to represent the size of the idle forwarding capacity. The current outbound queue depth is the depth of the target outbound queue or the depth of the outbound queue corresponding to the target outbound port.

28. The device according to claim 27, characterized in that The computing module is further configured to: subtracting an upper limit of the amount of forwarded data of the target outgoing queue or the target outgoing port within a preset time period from the total amount of data passing through the target outgoing queue or the target outgoing port within the preset time period to obtain a first subtraction result; Adding the first subtraction result and the preset queue depth to obtain an addition result; Subtracting the addition result from the current queue depth to obtain a second subtraction result; The second subtraction result is multiplied by a preset coefficient to obtain the value of the letter of credit counter, wherein the unit of the value of the letter of credit counter is byte.

29. The apparatus according to any one of claims 18 to 23, characterized in that The network device is not the receiving end device, and the device further includes: The sending module is used to obtain a second message containing the decision result; and send the second message to the next-hop device.

30. The apparatus according to claim 29, wherein The next-hop device is the receiving device, and the sending module is specifically configured to: The second message is sent to the receiving device so that the receiving device sends a confirmation message carrying the decision result to the sending device, and the confirmation message is used to instruct the sending device to adjust the sending window or sending rate of the sending device according to the decision result.

31. The apparatus according to any one of claims 18 to 23, characterized in that The network device is the receiving end device, and the device further includes: The sending module is used to send a confirmation message carrying the decision result to the sending end device, and the confirmation message is used to instruct the sending end device to adjust the sending window or sending rate of the sending end device according to the decision result.

32. A network device comprising a processor and a memory, wherein the processor is coupled to the memory, wherein: The memory is used to store programs; The processor is configured to execute the program in the memory, so that the network device executes the method according to any one of claims 1 to 17.

33. A computer-readable storage medium comprising a program, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 17.

34. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method according to any one of claims 1 to 17.

35. A chip comprising a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface and executes the method according to any one of claims 1 to 17.