Congestion Control Method and Apparatus, Network Device, and Storage Medium

By obtaining the total cache depth in the network device and selecting a queue that meets the conditions for message discarding, the unnecessary discarding problem caused by unbalanced queue depth is solved, and the cache utilization rate and data stream processing efficiency are improved.

CN116418757BActive Publication Date: 2025-07-18SANECHIPS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310362969.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-12-12
Publication Date
2025-07-18
Estimated Expiration
2038-12-12

AI Technical Summary

Technical Problem

In the prior art, unnecessary packet discarding occurs in network devices, especially in the case of uneven queue depth, resulting in waste of cache space and impact of data stream processing functions.

Method used

By obtaining the total cache depth of multiple queues, when the total cache depth reaches the first drop threshold, the target queue that meets the drop conditions is selected for message discarding, and targeted message discarding is performed according to the queue depth, priority and type, and the undo threshold is set to stop unnecessary discarding.

Benefits of technology

Reduce unnecessary packet discarding, improve cache utilization, optimize data stream processing functions, and avoid mutual influence between queues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116418757B_ABST
    Figure CN116418757B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a congestion control method, apparatus, network device, and storage medium. The congestion control method includes: obtaining the total buffer depth of multiple queues; and if the total buffer depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Division Explanation

[0002] This application is a divisional application of a Chinese invention patent with the application number 201811519766.5 and the invention title "Congestion Control Method and Device, Network Device and Storage Medium". Technical Field

[0003] The present invention relates to the field of communication technologies, but is not limited to the field of communication technologies, and particularly relates to a congestion control method and device, a network device and a storage medium. Background Art

[0004] Congestion is a phenomenon that should be avoided as much as possible during the communication process. In the prior art, for example, a large number of packets are received by a Switching Access (SA) chip from a switching network. These packets are buffered in different queues in a certain manner, and the packets in different queues are scheduled and output according to a certain scheduling rule. When a flow control backpressure signal or data stream shaping occurs in the lower-level receiving module, that is, when the input rate of the queue is greater than the scheduling output rate of the queue, it will cause the accumulation of the queue depth and form buffer congestion. At this time, a congestion handling strategy is required to perform backpressure or discard processing on the packets entering the queue, so as to avoid excessive occupation of system resources and ultimately affect the relevant data stream processing functions. There are various solutions in the related art for relieving congestion by discarding packets. Sometimes, packets are discarded even when there is still sufficient buffer space for the entire device without the need to discard packets. Summary of the Invention

[0005] In view of this, embodiments of the present invention are expected to provide a congestion control method and device, a network device and a storage medium.

[0006] The technical solution of the present invention is implemented as follows:

[0007] A congestion handling method includes:

[0008] Obtaining the total buffer depth of multiple queues;

[0009] If the total buffer depth reaches a first discard threshold, select target queues whose queue depths meet the discard conditions from the multiple queues and discard packets.

[0010] Based on the above solution, the method includes:

[0011] If the queue depth after discarding packets from the target queue reaches a revocation threshold, stop discarding packets from the target queue.

[0012] Based on the above solution, the queue is a first-in-first-out queue;

[0013] If the total buffer depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets includes:

[0014] If the total buffer depth reaches a first discard threshold, select a target queue whose queue depth meets the discard condition from the multiple queues and discard the packets at the queue exit.

[0015] Based on the above solution, if the total buffer depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets includes:

[0016] If the total buffer depth reaches a first discard threshold, select the queue with the largest queue depth from the multiple queues as the target queue to discard packets.

[0017] Based on the above solution, if the total buffer depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets includes:

[0018] Determine the revocation threshold for each of the queues;

[0019] If the queue depth of the i-th queue is greater than the revocation threshold, then select the i-th queue to discard packets, where i is a positive integer less than I, and I is the total number of queues.

[0020] Based on the above solution, if the total buffer depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets includes:

[0021] Determine the depth range for selecting the target queue;

[0022] Select alternative queues whose depths are within the depth range from the multiple queues;

[0023] If there is one such alternative queue, select the alternative queue as the target queue to discard packets; and / or, if there are multiple such alternative queues, select the queue with the lowest queue priority as the target queue to discard packets according to the queue priorities of the alternative queues.

[0024] Based on the above solution, if the total buffer depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets further includes:

[0025] If the queue priorities of the multiple alternative queues are the same, then select the alternative queue with the largest queue depth as the target queue to discard packets.

[0026] Based on the above solution, the determination of the depth range for selecting the target queue includes:

[0027] Determine the selection parameter value of the depth range;

[0028] Determine the upper limit of the depth range according to the maximum queue depth in the multiple queues;

[0029] Determine the lower limit of the depth range according to the maximum queue depth and the selection parameter value.

[0030] Based on the above solution, when the total buffer depth reaches the first discard threshold, selecting a target queue with a queue depth that meets the discard condition from the multiple queues to discard packets includes:

[0031] When the total buffer depth reaches the first discard threshold, obtain the types of packets cached in the multiple queues;

[0032] According to the type of the packet, determine the total queue depth of the j-th type of packet in the queue where the j-th type of packet is located; j is a positive integer less than J; J is the total number of packet types;

[0033] When the total queue depth of the j-th type of packet reaches the second discard threshold of the j-th type of packet, and there is only one queue where the j-th type of packet is located, select the queue caching the j-th type of packet as the target queue to discard packets; and / or, when the total queue depth of the j-th type of packet reaches the second discard threshold of the j-th type of packet, and there are more than one queue where the j-th type of packet is located, select one or more queues as the target queue to discard packets according to the queue depth of the queue where the j-th type of packet is located.

[0034] Based on the above solution, when the total queue depth of the j-th type of packet reaches the second discard threshold of the j-th type of packet, and there are more than one queue where the j-th type of packet is located, selecting one or more queues as the target queue to discard packets according to the queue depth of the queue where the j-th type of packet is located includes at least one of the following:

[0035] When the total queue depth of the j-th type of packet reaches the second discard threshold of the j-th type of packet, select the queue with the maximum queue depth in the queue where the j-th type of packet is located as the target queue to discard packets;

[0036] When the total queue depth of the j-th type of packet reaches the second discard threshold of the j-th type of packet, select one or more queues with a queue depth greater than the revocation threshold and the lowest queue priority in the queue where the j-th type of packet is located as the target queue to discard packets.

[0037] A congestion handling device includes:

[0038] An obtaining module, configured to obtain the total cache depth of multiple queues;

[0039] A discarding module, configured to, if the total cache depth reaches a first discard threshold, select a target queue whose queue depth meets the discard condition from the multiple queues to discard packets.

[0040] A network device, comprising:

[0041] A network interface, configured to send and receive packets;

[0042] A memory, configured to store packets and computer-storable executable instructions;

[0043] A processor, respectively connected to the network interface and the memory, configured to control the sending and receiving of packets by the network interface and execute the congestion control method provided by any of the foregoing technical solutions by executing the computer-storable executable instructions.

[0044] A computer storage medium storing computer-executable instructions; after the computer-executable instructions are executed, the congestion control method provided by any of the foregoing technical solutions can be implemented.

[0045] In the technical solution provided by the embodiment of the present invention, when performing congestion control on packets, the total cache depth of multiple queues is overall considered. When the total cache depth reaches the first discard threshold, a queue that meets the discard condition is selected according to the queue depth of the queue to discard packets. In this way, compared with discarding packets based on the queue depth of each queue and the discard threshold of a single queue, the unnecessary packet discarding phenomenon is reduced when the network device as a whole still has a relatively large cache space but only the queue depth of a certain queue is relatively large; at the same time, when selecting the target queue for packet discarding, the target queue for discarding packets is selected according to whether the current queue depth of each queue meets the discard condition, so that the packets in the queue that need to be discarded can be discarded in a targeted manner, thereby further reducing the phenomenon of discarding packets that should not be discarded. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a schematic flowchart of the first congestion control method provided by the embodiment of the present invention;

[0047] Figure 2 It is a schematic flowchart of the second congestion control method provided by the embodiment of the present invention;

[0048] Figure 3 It is a schematic flowchart of the third congestion control method provided by the embodiment of the present invention;

[0049] Figure 4 It is a schematic structural diagram of a congestion control device provided by the embodiment of the present invention;

[0050] Figure 5 A schematic diagram of packet discard provided by an embodiment of the present invention;

[0051] Figure 6 A schematic flowchart of the fourth congestion control method provided by an embodiment of the present invention;

[0052] Figure 7 A schematic flowchart of the fifth congestion control method provided by an embodiment of the present invention;

[0053] Figure 8 A schematic diagram of the queue depth of a packet provided by this embodiment;

[0054] Figure 9 A corresponding schematic diagram of the queue and the queue discard revocation threshold table provided by this embodiment;

[0055] Figure 10 A schematic diagram of depth range screening provided by this embodiment;

[0056] Figure 11 A network device provided by an embodiment of the present invention. Detailed implementation manners

[0057] The technical solution of the present invention will be further elaborated in detail below in conjunction with the accompanying drawings of the specification and specific embodiments.

[0058] As Figure 1 shown, this embodiment provides a congestion handling method, including:

[0059] Step S110: Obtain the total buffer depth of multiple queues;

[0060] Step S120: If the total buffer depth reaches the first discard threshold, select a target queue whose queue depth meets the discard condition from the multiple queues to discard packets.

[0061] In this embodiment, the congestion handling method can be applied to various network devices with packet sending and receiving functions, for example, in the switching chip of a switch or the routing chip of a router.

[0062] In this embodiment, it is determined whether congestion occurs according to the total buffer depth of multiple queues. For example, M queues are configured in a network device, and the total buffer depth is the sum of the queue depths of the M queues. The queue depth depends on the number of packets cached in the queue; the larger the number of packets, the larger the queue depth.

[0063] Thus, if the total buffer depth of multiple queues in a network device is too large, for example, the total buffer depth is greater than the first discard threshold, it will cause congestion in the packet reception and transmission of the entire network device. Therefore, in this embodiment, only when the total buffer depth is greater than the first discard threshold, the queues that meet the discard conditions are selected as target queues according to the queue depth of each queue, and the packets of the target queues are discarded. In this way, compared with setting discard thresholds for each queue separately in the method provided in this embodiment, if the queue depth of a certain queue is very large while the queue depths of the remaining queues are very small, the network device has sufficient buffer space to continue to store the packets of the queue with a large queue depth, and the network device's continued storage of the packets of this queue with a large depth will not affect the packet reception and transmission of other queues. Therefore, if packet discarding is based on the discard threshold of a single queue, the queue with a large depth will naturally discard packets, but this kind of discard can actually be avoided, resulting in unnecessary packet discard. In this embodiment, considering the overall buffer depth of multiple queues in the network device (i.e., the total buffer depth), if the total buffer depth is greater than the first packet discard threshold, it is confirmed that the network device is congested as a whole and needs to discard packets, and then the appropriate queue will be further selected according to the queue depth of each queue, that is, the queue that meets the discard conditions) to discard packets targeted. In this way, on the one hand, unnecessary packet discard is reduced, and on the other hand, targeted packet discard is achieved.

[0064] In some embodiments, as Figure 2 shown, the method includes:

[0065] Step S130: If the queue depth after the target queue discards packets reaches the revocation threshold, stop the packet discard of the target queue.

[0066] In this embodiment, not only the first discard threshold is set, but also the revocation threshold is set, which is used to revoke packet discard. If one or more queues are selected as target queues for packet discard, when discarding packets, not all packets of this queue are discarded at once, but it is determined according to the revocation threshold. If the queue depth is lower than or less than the revocation threshold after the target queue discards one or more packets, it means that the congestion has been alleviated, and the target queue can stop discarding packets to reduce unnecessary packet discard.

[0067] In the embodiments of the present invention, the queues selected as the target queues for discarding packets are all queues with a packet queue greater than the revocation threshold at the current moment.

[0068] In this embodiment, the queue is a first-in-first-out queue; step S120 may include:

[0069] If the total buffer depth reaches a first discard threshold, select a target queue whose queue depth meets the discard condition from the multiple queues, and discard the packet at the queue exit.

[0070] In this embodiment, the queue is a first-in, first-out queue. Thus, the packet currently at the queue exit is the packet that first entered the queue, that is, the oldest packet. In this embodiment, in order to prioritize the discard of old packets, the target queue will preferentially select the packet at the queue exit for discard; thus, the phenomenon that large data volume packets or packets that are difficult to successfully send that have been piled up in the queue for a long time occupy the cache space for a long time and exacerbate congestion is reduced.

[0071] In still some other embodiments, the packets in a queue may have different packet priorities. When the target queue discards packets, it can select the packet with the lowest packet priority at the current moment for priority discard; and so on until the queue depth of the target queue reaches the revocation threshold.

[0072] In some embodiments, step S120 may include: If the total buffer depth reaches a first discard threshold, select the queue with the largest queue depth from the multiple queues as the target queue to discard the packet.

[0073] In this embodiment, the target queue that meets the discard condition is: the queue with the largest queue depth among the multiple queues, that is, the queue that currently contains the most packets.

[0074] In some embodiments, step S120 may include:

[0075] Determine the revocation threshold of each of the queues;

[0076] If the queue depth of the i-th queue is greater than the revocation threshold, then select the i-th queue to discard the packet, where i is a positive integer less than I, and I is the total number of queues.

[0077] In some embodiments, a first register is configured for each queue in the network device, and this first register is used to record the revocation threshold of each queue respectively. Thus, the revocation thresholds of different queues may be the same or different, but the revocation thresholds of different queues are not shared.

[0078] In still some other embodiments, multiple queues share a revocation threshold. For example, the multiple queues are queue A, queue B, and queue C respectively; the revocation thresholds of queue A, queue B, and queue C are shared, and there is only one revocation threshold. For example, the network device sets a second register for multiple queues, and this second register stores the revocation threshold shared by the multiple queues.

[0079] If the queue depth of the i-th queue is greater than the discard threshold, the i-th queue will be the target queue for packets to be discarded. Thus, if the queue depths of multiple queues in multiple columns are all greater than their respective discard thresholds, these queues will all be target queues and will discard packets; in this way, congestion within the network device can be quickly alleviated.

[0080] In some embodiments, as Figure 3 shown, step S120 may include:

[0081] Step S121: Determine the depth range for selecting the target queue;

[0082] Step S122: Select alternative queues from the multiple queues whose depths are within the depth range;

[0083] Step S123: If there is one such alternative queue, select the alternative queue as the target queue to discard packets;

[0084] And / or,

[0085] Step S124: If there are multiple such alternative queues, select the queue with the lowest queue priority as the target queue to discard packets according to the queue priorities of the alternative queues.

[0086] In this embodiment, when selecting the target queue that meets the discard condition, first a depth range for selecting the target queue will be determined. If the queue depth of a certain queue is within this depth range, then this queue will be used as an alternative queue; then the target queue is selected for packet discarding according to the number of alternative queues.

[0087] The selecting the target queue for packet discarding according to the number of alternative queues includes:

[0088] If there is only one alternative queue, it indicates that the queue depth of the current alternative queue is too large, and directly use this alternative queue as the target queue to discard packets.

[0089] If there are multiple alternative queues, the target queue can be selected from the alternative queues according to the queue priorities for packet discarding.

[0090] Specifically, in this embodiment, if there are multiple alternative queues, not all alternative queues will be used as the target queue, but the target queue will be selected according to the queue priorities of the alternative queues. If the queue priority of a queue is lower, it indicates that the urgency of packet reception and transmission in this queue is lower, or the importance of the packets is lower. Therefore, in this embodiment, if there are multiple alternative queues, the queue with the lowest queue priority is selected as the target queue to discard packets.

[0091] Further, step S120 may further include:

[0092] Step S125: If the queue priorities of multiple said alternative queues are the same, select the alternative queue with the largest queue depth as the target queue to discard packets.

[0093] If the queue priorities of multiple alternative queues are the same, it indicates that the importance or the urgency of receiving and sending of the packets in the alternative queues is the same. At this time, preferentially select the alternative queue with the largest queue depth as the target queue. In this way, it is equivalent to selecting the queue with the greatest impact on congestion to discard packets.

[0094] In some embodiments, step S121 may include:

[0095] Determine the selection parameter value of the depth range;

[0096] According to the maximum queue depth among the multiple queues, determine the upper limit of the depth range;

[0097] According to the maximum queue depth and the selection parameter value, determine the lower limit of the depth range.

[0098] In this embodiment, one or more third registers may be set in the network device, and the third register may be used to store the selection parameter value. The selection parameter may be a weighting parameter and / or a weighting factor.

[0099] Multiple queues all have queue depths, and these queue depths may be the same or different. However, through logical operations such as comparison, the maximum queue depth can be obtained. The maximum queue depth of the queue can be directly used as the upper limit of the depth range, or can be used as a known quantity for calculating the upper limit of the depth. For example, use A times the maximum queue depth as the depth upper limit, and A may be a positive integer greater than or equal to 1.

[0100] When determining the lower limit of the depth range, the difference between the maximum queue depth and the weighting parameter can be directly solved to obtain the lower limit. For example, the maximum queue depth is H, and the authentication parameter is h, then the lower limit may be H - h. In this way, the depth range may be: from H to H - h.

[0101] If the selection parameter value is a proportional value, the lower limit may be H * h, and the depth range may be: from H to H * h. At this time, the value range of h is a positive number between 0 and 1.

[0102] In some embodiments, step S120 may include:

[0103] If the total buffer depth reaches the first discard threshold, obtain the types of packets cached in multiple queues;

[0104] Determine the total queue depth of the j-th type of message in the queue where the j-th type of message is located according to the type of the message; j is a positive integer less than J; J is the total number of message types;

[0105] If the total queue depth of the j-th type of message reaches the second discard threshold of the j-th type of message, and there is only one queue where the j-th type of message is located, select the queue caching the j-th type of message as the target queue to discard the message; and / or, if the total queue depth of the j-th type of message reaches the second discard threshold of the j-th type of message, and there is more than one queue where the j-th type of message is located, select one or more queues as the target queues to discard the message according to the queue depth of the queues where the j-th type of message is located.

[0106] In this embodiment, the selection of the target queue and the message discard will be distinguished according to the message type.

[0107] The messages can be classified by type into: unicast messages, multicast messages, and / or broadcast messages.

[0108] In this embodiment, the j-th type of message can be any one of unicast messages, multicast messages, and broadcast messages.

[0109] If the total cache depth of all queues is greater than the first discard threshold, then look at the total queue depth of each type of message. If the total queue depth is greater than the second discard threshold, then automatically select one or more queues from the queues of this type of message as the target queues to discard the message. Among them, the second discard threshold is less than the first discard threshold.

[0110] For example, if unicast messages and multicast messages are cached in the current network device, if the total cache depth is greater than the first discard threshold, respectively check the total queue depth of the queues where the unicast messages and multicast messages are located. If the total queue depth of the queue where the unicast messages are located reaches the second discard threshold, but the total queue depth of the queue where the multicast messages are located does not reach the second discard threshold, then select one or more target queues from the queue caching the unicast messages to discard the messages.

[0111] In some embodiments, the second discard thresholds of different types of messages can be shared. In still some other embodiments, the second discard thresholds of different types of messages can be set separately.

[0112] Further, the step of, if the total queue depth of the j-th type of message reaches the second discard threshold of the j-th type of message, selecting one or more queues as the target queues to discard the message according to the queue depth of the queues where the j-th type of message is located includes at least one of the following:

[0113] If the total queue depth of the j-th type of message reaches the second discard threshold of the j-th type of message, select the queue with the largest queue depth from the queues where the j-th type of message is located as the target queue to discard the message;

[0114] If the total queue depth of the j-th type of message reaches the second discard threshold of the j-th type of message, one or more queues with a queue depth greater than the revocation threshold and the lowest queue priority are selected from the queue where the j-th type of message is located as the target queue to discard messages.

[0115] In this way, if there are more than one queue where the j-th type of message is located, one or more queues where the j-th type of message is located will be selected according to the queue priority and queue depth to discard messages.

[0116] As Figure 4 shown, this embodiment provides a congestion handling device, including:

[0117] An acquisition module 110, configured to acquire the total cache depth of multiple queues;

[0118] A discard module 120, configured to, if the total cache depth reaches the first discard threshold, select a target queue with a queue depth meeting the discard condition from the multiple queues to discard messages.

[0119] In some embodiments, the acquisition module 110 and the discard module 120 may be program modules. After being executed by a processor, the program modules can implement the determination of the total cache depth, the selection of the target queue, and the discarding of messages.

[0120] In still other embodiments, the acquisition module 110 and the discard module 120 may be a software-hardware combination module. The software-hardware combination module may be various programmable arrays; the programmable array may include: a complex programmable array and / or a field programmable array.

[0121] In other embodiments, the acquisition module 110 and the discard module 120 may be pure hardware modules, and the pure hardware module may be an application specific integrated circuit.

[0122] In some embodiments, the device includes:

[0123] A stop module, configured to stop discarding messages of the target queue if the queue depth after the target queue discards messages reaches the revocation threshold.

[0124] In some embodiments, the queue is a first-in-first-out queue;

[0125] The discard module 120 is specifically configured to, if the total cache depth reaches the first discard threshold, select a target queue with a queue depth meeting the discard condition from the multiple queues to discard messages at the queue exit.

[0126] In some embodiments, the discard module 120 is specifically configured to, if the total buffer depth reaches a first discard threshold, select the queue with the largest queue depth from the multiple queues as the target queue to discard packets.

[0127] In some embodiments, the discard module 120 is specifically configured to determine the revocation threshold of each queue; if the queue depth of the i-th queue is greater than the revocation threshold, select the i-th queue to discard packets, where i is a positive integer less than I, and I is the total number of queues.

[0128] In still some other embodiments, the discard module 120 is specifically configured to determine the depth range for selecting the target queue; select the candidate queues whose depths are within the depth range from the multiple queues; if there is one candidate queue, select the candidate queue as the target queue to discard packets; and / or, if there are multiple candidate queues, select the queue with the lowest queue priority as the target queue to discard packets according to the queue priorities of the candidate queues.

[0129] Further, the discard module 120 is specifically configured to, if the queue priorities of the multiple candidate queues are the same, select the candidate queue with the largest queue depth as the target queue to discard packets.

[0130] In some embodiments, the discard module 120 is specifically configured to determine the selection parameter value of the depth range; determine the upper limit of the depth range according to the maximum queue depth in the multiple queues; and determine the lower limit of the depth range according to the maximum queue depth and the selection parameter value.

[0131] In some embodiments, the discard module 120 is specifically configured to, if the total buffer depth reaches a first discard threshold, obtain the types of packets cached in the multiple queues; determine the total queue depth of the j-th type of packets in the queue where the j-th type of packets is located according to the types of the packets; j is a positive integer less than J; J is the total number of packet types; if the total queue depth of the j-th type of packets reaches the second discard threshold of the j-th type of packets, and there is only one queue where the j-th type of packets is located, select the queue caching the j-th type of packets as the target queue to discard packets; and / or, if the total queue depth of the j-th type of packets reaches the second discard threshold of the j-th type of packets, and there are more than one queue where the j-th type of packets is located, select one or more queues as the target queues to discard packets according to the queue depths of the queues where the j-th type of packets is located.

[0132] In some other embodiments, the discard module 120 is specifically configured to perform at least one of the following:

[0133] If the total queue depth of the j-th type of packet reaches the second discard threshold of the j-th type of packet, select the queue with the largest queue depth from the queue where the j-th type of packet is located as the target queue to discard packets;

[0134] If the total queue depth of the j-th type of packet reaches the second discard threshold of the j-th type of packet, select one or more queues with a queue depth greater than the revocation threshold and the lowest queue priority from the queue where the j-th type of packet is located as the target queue to discard packets.

[0135] Several specific examples are provided below in combination with any of the above embodiments:

[0136] Example 1:

[0137] This example provides an improved dynamic congestion control method and device, aiming to improve cache utilization, reduce the mutual influence between queues, and achieve the best congestion control effect as much as possible.

[0138] The congestion control method provided in this embodiment may include:

[0139] Taking the total cache depth as the judgment criterion for packet discard, when the discard condition is reached, select the queue with the largest queue depth or the queue with a large enough queue depth and a low priority to discard packets, that is, the queue with the most severe congestion condition, and perform head-of-queue discard.

[0140] Head-of-queue discard means discarding packets in the queue and reclaiming addresses at the exit of the queue.

[0141] Set the discard revocation threshold for the queue, that is, when the queue depth of the queue being head-of-queue discarded is lower than the revocation threshold, stop the discard operation for this queue. Re-enter the previous total cache depth judgment, and so on until the packet discard standard is no longer reached.

[0142] Such as Figure 5 shown is a packet discard in a backpressure manner, including:

[0143] Queues 0 to N respectively report their own queue depths to the comparator,

[0144] The comparator compares the received queue depth with the discard threshold found in the discard threshold table or the backpressure threshold found in the backpressure threshold table, and then marks the queue with a queue depth greater than the discard threshold as discarded, and marks the queue that reaches the backpressure threshold with a backpressure mark;

[0145] Discard the packets in the queue marked as discarded;

[0146] Perform packet backpressure on the queue marked with a backpressure mark. Here, the packet backpressure can be: stop or reduce the packet caching to the queue marked with a backpressure mark.

[0147] In this example, the structure shown in Figure 5 Figure 5 is used. After summarizing the packet depths of the N + 1 queues from queue 0 to queue N received, the total buffer depth is obtained. Based on the comparison between the total buffer depth and the first discard threshold, it is determined whether packets need to be discarded. If packets need to be discarded, a suitable target queue is selected for discarding.

[0148] In some other embodiments, if the buffer depth is greater than the total backpressure threshold, one or more target queues with increased queue depths are selected for packet backpressure.

[0149] As Figure 6 shown, the congestion control method provided in this example may include:

[0150] Start detecting the total buffer depth;

[0151] Judge whether it is greater than the discard threshold of the total buffer depth (i.e., the aforementioned first discard threshold). If not, return to the previous step; if so, proceed to the next step;

[0152] Find the queue with the maximum depth;

[0153] Judge whether it is the queue depth discard revocation threshold. If not, perform head discard (i.e., discard the packet at the queue exit). If so, stop discarding.

[0154] As Figure 7 shown, this example proposes a dynamic congestion avoidance device. The device structure includes: a queue management module, an output scheduling module, and a congestion monitoring module. Packets enter the storage system through the queue management module and are sent out via the output scheduling module. The congestion monitoring module receives the queue depth and total buffer depth information from the queue management module, makes a judgment on whether to perform head discard, and feeds back to the output scheduling module for corresponding operations. Figure 7 The queue depth information in

[0155] is used to indicate the queue depth; the head discard indication is used to indicate the corresponding queue to discard the packet at the exit; the queue information is used to indicate the corresponding queue.

[0156] Taking Figure 5 the schematic diagram of queue congestion management work as an example, assuming the number of queues in the system is N + 1, a RAM with a depth of N + 1 is required to count the number of packets entering each queue, and a RAM with a depth of N + 1 is also required to count the number of packets leaving each queue. The difference between the number of packets entering and the number of packets leaving is the depth of the queue.

[0157] Method 1:

[0158] Two registers are used to set the discard threshold and the revocation threshold for header discard, which are respectively defined as: the first header discard threshold (judged based on the total buffer depth), and the queue header discard revocation threshold (judged based on the single queue depth).

[0159] After the system initialization is completed, the depth of each queue is 0, and the total buffer depth is 0.

[0160] After the system starts to work, packets start to enter each queue. Assume that at this time, the nth queue has a large traffic burst and the queue depth increases.

[0161] When the total buffer is relatively idle, even if the queue reaches the first queue discard threshold, it will not affect the processing of data streams in other queues. If the total buffer utilization rate is high, that is, multiple queues have a large congestion depth or the first queue discard threshold of the nth queue is set too large, causing the total buffer depth to reach the set first header discard threshold, then the header discard operation is triggered: select the queue with the largest depth among all queues, such as the nth queue, and perform header discard until the depth of queue n is less than the set queue header discard revocation threshold, and stop the header discard operation. Then monitor again whether the buffer depth reaches the first header discard threshold to determine whether to perform a new round of header discard operations.

[0162] If the total buffer address depth is 0x3000, the current buffer depth threshold n_th for triggering header discard can be set to 0x2800, and the discard revocation threshold is 0x10. For example Figure 8 Currently, there are three data queues q0, q1, and q2. Due to congestion in the downlink path, the depths of the three queues continue to increase until q0 = 0x800, q1 = 0xc00, q2 = 0x1400, and q0 + q1 + q2 = n_th, reaching the first total buffer discard threshold, and the header discard operation starts. Select the queue with the highest depth, queue q2, for discard until the depth of q2 is as low as 0x10, stop the discard, and re-enter the monitoring status of the buffer depth.

[0163] Method 2:

[0164] Use the lookup table entry method to set the discard threshold for header discard and the single queue revocation threshold value. When the discard threshold is reached and the queue to be discarded is selected, look up the table according to the queue number to find the corresponding discard revocation threshold for the queue and use it. This method sets independent revocation thresholds for each queue according to the characteristics of different traffic corresponding to the actual queues used.

[0165] Use a RAM with a depth of N + 1 (the total number of available queues in the system) to set the discard cancellation threshold according to the actual application situation. Each address corresponds to a queue number, and the discard cancellation threshold actually used by each queue is saved. When head discarding is triggered, if the queue number to be discarded is selected as i, then at the i address of the cancellation threshold table RAM, the independent discard cancellation threshold corresponding to this queue is found. Determine whether the queue depth is lower than this cancellation threshold. Until the depth is lower than this threshold, stop the operation of discarding packets and enter the discard monitoring process again.

[0166] For example, if the total cache address depth is 0x3000, the first head discard threshold can be set to 0x2800. Such as Figure 9 , configure the table entries at addresses a0 to a2 (corresponding to queues q0 to q2) in the queue discard cancellation threshold table, where a0 = 0x30, a1 = 0x20, a3 = 0x10. Suppose there are three data streams entering queues q0 to q2 respectively. When the downstream path is congested, the depths of q0 to q2 keep increasing until q0 = 0x1800, q1 = 0x800, q2 = 0x800, and q0 + q1 + q2 = 0x2800, reaching the first head discard threshold, and the discard operation is started. Then select the queue q0 with the highest depth for discarding until the depth of q0 is as low as 0x30, that is, the table entry corresponding to address a0 in the cancellation threshold table, and stop discarding. Figure 9 The queue discard cancellation threshold table in

[0167] Method 3:

[0168] Combined with Method 1 or 2, the selection criterion for the discard queue can be set, that is: instead of simply selecting the queue with the highest depth for discarding, the queue with the lowest priority can be selected for discarding within a certain depth range [a, b].

[0169] For example: add a depth selection range register x to set the range for selecting the discard queue. When the queue with the highest depth is found and its queue depth is y, then within the range [y - x, y], that is, among the queues whose queue depths satisfy being greater than or equal to (y - x) and less than or equal to y, select the queue with the lowest priority to start discarding. If there are multiple queues with the same priority, then select the one with the highest queue depth among them for discarding.

[0170] Until the discard operation of this queue is cancelled, the system enters the discard judgment monitoring process again.

[0171] Suppose in the scenario of Method 1, the cache address depth is 0x3000 and the first discard threshold n_th = 0x2800. Such as Figure 10, there are four queues for data streams q0 to q3, and the discard cancellation threshold for a single queue is 0x10. Further set the priorities of the four queues as q0 > q1 = q2 = q3, and the depth range selector x = 0x800. When the downstream path is congested, the cache depths of the four queues continuously increase until q0 = 0x1000, q1 = 0xc00, q2 = 0x800, q3 = 0x400, and q0 + q1 + q2 + q3 = 0x2800, reaching the first discard threshold n_th of the head, and entering the discard queue selection. The queue q0 with the highest depth is 0x1000, select the queue depth range [0x1000, 0x1000 - 0x800], and the selected queues are q0 to q2. Among them, the low-priority queues are q1 and q2. Also, since q1 > q2, select to discard the packets in q1 until the depth of q1 is as low as 0x10, and cancel the discard.

[0172] Furthermore, the high-priority queues can be excluded, and only the low-priority queues can be selected and discarded. Figure 10 The priorities shown in are the queue priorities.

[0173] Method 4:

[0174] Combined with the above methods, it is also possible to divide according to the data types for which header discard monitoring is required. Unicast and multicast can be processed separately, that is, in addition to the first discard threshold of the total cache, an independent first discard threshold for unicast and a first discard threshold for multicast are set.

[0175] For example, combined with the cancellation method of Method 1: For the address depth of the total cache n = 0x3000, the first discard threshold of the total cache n_th = 0x2800, the first discard threshold for unicast u_th = 0x1800, the first discard threshold for multicast m_th = 0x1800, and the discard cancellation threshold is set to 0x10.

[0176] Suppose there are two data streams, unicast u0 and multicast m0, being mixed and sent currently. According to different outbound congestion situations, different thresholds come into play:

[0177] The unicast path is congested downstream. When the unicast path is congested, the cache address depth occupied by unicast continuously increases until it reaches the first discard threshold, and the address depth occupied by multicast is normal. For example, the depth of u0 is 0x1800 and the depth of m0 is 0x100, so the total cache depth u0 + m0 = 0x1900. In this case, the multicast data stream is normal, and only the unicast header discard is triggered. Start discarding the packets in the unicast queue until the address occupancy depth of the unicast queue is reduced to u0 = 0x10, cancel the discard operation, and re-enter the monitoring state of header discard.

[0178] Multicast path downstream congestion. The situation is similar to unicast. For example, if the depth of multicast m0 reaches 0x1800 and the depth of unicast u0 queue is 0x100, then the total buffer depth u0 + m0 = 0x1900. At this time, head dropping is performed on the multicast until the depth is reduced to m0 = 0x10, and the dropping operation is cancelled.

[0179] Overall path downstream congestion. When the traffic of unicast and multicast is close, due to the overall downstream path congestion, both unicast and multicast are piling up. Until the unicast u0 = 0x1300, m0 = 0x1500, u0 + m0 = 0x2800, then total buffer head dropping is triggered. The queue with the highest depth in the current buffer is selected, that is, the multicast queue m0 starts to be dropped until the depth of m0 is reduced to 0x10, and the dropping of multicast packets is cancelled.

[0180] Other methods:

[0181] Only a few usage examples are listed above. For the boundary setting and judgment of nodes such as threshold setting and queue selection, there are many feasible methods, which can be adjusted according to actual design needs and cannot be fully listed here.

[0182] The queue management module stores the input packets in queues, calculates the depth of each queue and passes it to the dropping monitoring module. At the same time, it passes the queue information related to scheduling to the scheduling output module and accepts its scheduling instructions to output or drop the packets of the corresponding queue.

[0183] The output scheduling module receives the queue information from the queue management module, selects queues in combination with the scheduling scheme configured by the system, and at the same time accepts the head dropping indication from the dropping monitoring module to determine the scheduling instruction for this queue - output or head dropping.

[0184] The monitoring module calculates the total buffer depth and selects the deepest queue based on the depth information of all queues sent by the queue management module, triggers head dropping monitoring, and issues an indication to the scheduling module whether to perform head dropping on a certain queue according to the process.

[0185] Furthermore, based on the above method, the device can be refined and adjusted. Combining multiple conditions, the queue to be dropped can be selected. For example, combining data types or queue priorities for queue selection and dropping, or even selecting a specific configured queue for dropping, etc. Based on this solution and device, according to specific needs, the range of queue selection methods for dropping can be expanded and used in more scenarios that require specific adjustment.

[0186] It should be understood that the description of the above specific embodiments is relatively detailed, and thus should not be construed as limiting the protection scope of the present invention patent. The protection scope of the present invention patent should be subject to the appended claims.

[0187] Such as Figure 11As shown in the figure, this embodiment provides a network device, including:

[0188] A network interface for receiving and transmitting packets;

[0189] A memory for storing packets and computer-storable executable instructions;

[0190] A processor, connected to the network interface and the memory respectively, for controlling the receiving and transmitting of packets by the network interface by executing the computer-storable executable instructions and being able to implement the congestion control method provided by any one of the foregoing technical solutions. For example, it can execute the congestion control method provided by one or more technical solutions as shown in Figures 1 to 3 and Figures 5 to 7 As shown.

[0191] This embodiment also provides a computer storage medium storing computer-executable instructions; after the computer-executable instructions are executed, the congestion control method provided by any one of the foregoing technical solutions can be implemented. For example, it can execute the congestion control method provided by one or more technical solutions as shown in Figures 1 to 3 and Figures 5 to 7 As shown.

[0192] The computer storage medium provided by this embodiment can be a non-transitory storage medium.

[0193] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed with each other can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical, or other forms.

[0194] The units described as separate components above may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0195] In addition, in each embodiment of the present invention, the functional units can all be integrated in a processing module, or each unit can be separately used as a unit, or two or more units can be integrated in one unit; the above-mentioned integrated units can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.

[0196] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including those of the above method embodiments; and the foregoing storage medium includes: various media that can store program codes, such as removable storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0197] As described above, the foregoing are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A congestion handling method, characterized in that, Including: Obtaining the total cache depth of multiple queues; If the total cache depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets; The step of, if the total cache depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets includes any one of the following steps: If the total cache depth reaches a first discard threshold, selecting the queue with the largest queue depth from the multiple queues as the target queue to discard packets; Determining the revocation threshold of each of the queues; If the queue depth of the i-th queue is greater than the revocation threshold, then select the i-th queue to discard packets, where i is a positive integer less than I, and I is the total number of queues; If the total cache depth reaches a first discard threshold, obtaining the types of packets cached in multiple queues; according to the types of the packets, determining the total queue depth of the j-th type of packets in the queue where the j-th type of packets is located; j is a positive integer less than J; J is the total number of packet types; if the total queue depth of the j-th type of packets reaches the second discard threshold of the j-th type of packets, and there is only one queue where the j-th type of packets is located, selecting the queue caching the j-th type of packets as the target queue to discard packets; and / or, if the total queue depth of the j-th type of packets reaches the second discard threshold of the j-th type of packets, and there are more than one queue where the j-th type of packets is located, selecting one or more queues as the target queues to discard packets according to the queue depth of the queues where the j-th type of packets is located.

2. The method according to claim 1, wherein The method includes: If the queue depth after the target queue discards packets reaches the revocation threshold, stop discarding packets of the target queue.

3. The method according to claim 1, wherein The queue is a first-in-first-out queue; The step of, if the total cache depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets includes: If the total cache depth reaches a first discard threshold, selecting a target queue whose queue depth meets the discard condition from the multiple queues to discard packets at the queue exit.

4. The method according to any one of claims 1 to 3, characterized in that The step of, if the total queue depth of the j-th type of packets reaches the second discard threshold of the j-th type of packets, and there are more than one queue where the j-th type of packets is located, selecting one or more queues as the target queues to discard packets according to the queue depth of the queues where the j-th type of packets is located includes at least one of the following: If the total queue depth of the j-th type of packets reaches the second discard threshold of the j-th type of packets, selecting the queue with the largest queue depth from the queues where the j-th type of packets is located as the target queue to discard packets; If the total queue depth of the j-th type of packets reaches the second discard threshold of the j-th type of packets, selecting one or more queues with queue depth greater than the revocation threshold and the lowest queue priority from the queues where the j-th type of packets is located as the target queues to discard packets.

5. A congestion handling device, characterized in that, Including: An obtaining module, configured to obtain the total cache depth of multiple queues; A discarding module, configured to, if the total cache depth reaches a first discard threshold, select a target queue whose queue depth meets the discard condition from the multiple queues to discard packets; If the total buffer depth reaches the first discard threshold, selecting a target queue with a queue depth that meets the discard condition from the multiple queues to discard packets includes any one of the following steps: If the total buffer depth reaches the first discard threshold, selecting the queue with the largest queue depth from the multiple queues as the target queue to discard packets; Determining the revocation threshold of each of the queues; If the queue depth of the i-th queue is greater than the revocation threshold, selecting the i-th queue to discard packets, where i is a positive integer less than I, and I is the total number of queues; If the total buffer depth reaches the first discard threshold, obtaining the types of packets cached in the multiple queues; according to the types of the packets, determining the total queue depth of the j-th type of packets in the queue where the j-th type of packets is located; j is a positive integer less than J; J is the total number of packet types; if the total queue depth of the j-th type of packets reaches the second discard threshold of the j-th type of packets, and there is only one queue where the j-th type of packets is located, selecting the queue caching the j-th type of packets as the target queue to discard packets; and / or, if the total queue depth of the j-th type of packets reaches the second discard threshold of the j-th type of packets, and there are more than one queue where the j-th type of packets is located, selecting one or more queues as the target queues to discard packets according to the queue depths of the queues where the j-th type of packets is located.

6. A network device, characterized in that, Including: A network interface for receiving and transmitting packets; A memory for storing packets and computer-storable executable instructions; A processor respectively connected to the network interface and the memory, for controlling the receiving and transmitting of packets by the network interface and executing the method provided in any one of claims 1 to 4 by executing the computer-storable executable instructions.

7. A computer storage medium storing computer-executable instructions; after the computer-executable instructions are executed, the method provided in any one of claims 1 to 4 can be implemented.

Citation Information

Patent Citations

  • Transmission control method for multimedia data in network equipment

    CN102223300A

  • Method and device for processing message

    CN102594691A