Active queue management method and device
By actively managing the data packets based on the current queue information, parameter adjustment information and traffic query information when entering and dequeuing the queue, the network congestion problem caused by the sharp increase in Internet traffic is solved, and the effect of quickly alleviating congestion and improving network performance is achieved.
Patent Information
- Application Number
- CN202411345784.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-09-26
AI Technical Summary
The sharp increase in Internet traffic can easily cause network congestion, leading to problems such as increased latency, packet loss, and decreased throughput, and may even lead to network unavailability.
An active queue management method is proposed, which manages based on the current queue information, parameter adjustment information and traffic query information when the data packet is in and out of queue. When a network congestion trend occurs, determine whether the data packet belongs to the elephant stream and discard the data packets if necessary to alleviate network congestion.
Effectively alleviate network congestion, improve network performance, maintain network availability and stability, thereby providing better network service quality.
Smart Images

Figure CN118869608B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an active queue management method and device. Background Art
[0002] As the scale of the Internet continues to expand, the complexity and diversity of network transmission scenarios and protocols have also increased dramatically. Network users have put forward higher requirements for the network. At the same time, the emergence of emerging network applications such as online live broadcast, short video, VR / AR has caused an explosive growth in Internet traffic. The sharp increase in Internet traffic can easily cause network congestion, increase latency, packet loss, and decrease throughput, and may even cause network unavailability. Therefore, in order to maintain the availability and stability of the network, it is necessary to control network congestion.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide an active queue management method and device, aiming to solve the technical problem that a sharp increase in Internet traffic easily causes network congestion.
[0005] To achieve the above objectives, the present application proposes an active queue management method, the active queue management method comprising:
[0006] When a first data packet enters a queue, the first data packet is managed according to the current queue information, the parameter adjustment information and the flow query information of the first data packet;
[0007] When the second data packet is dequeued, dequeuing management is performed on the second data packet according to the current queue information, parameter adjustment information, the residence time of the second data packet and the flow query information of the second data packet.
[0008] In one embodiment, when the first data packet is queued, the step of managing the first data packet according to the current queue information, the parameter adjustment information and the traffic query information of the first data packet includes:
[0009] When the first data packet enters the queue, determining the network congestion state according to the current queue information and the parameter adjustment information;
[0010] When the network congestion state is that the network has a congestion trend, determining whether the first data packet belongs to an elephant flow according to the flow query information of the first data packet;
[0011] When it is determined that the first data packet belongs to an elephant flow, discarding the first data packet and updating the parameter adjustment information;
[0012] When it is determined that the first data packet does not belong to the elephant flow, a timestamp is added to the first data packet after the first data packet is controlled to enter the queue.
[0013] In one embodiment, the current queue information includes queue length and queue delay, and the parameter adjustment information includes expected delay; wherein, when the first data packet is queued, the step of determining the network congestion state according to the current queue information and the parameter adjustment information includes:
[0014] When the first data packet enters the queue, determining whether the queue length is equal to a preset queue length;
[0015] When it is determined that the queue length is equal to the preset queue length, discarding the first data packet;
[0016] When it is determined that the queue length is not equal to the preset queue length, a target queue length threshold and a target expected delay are determined, and when the queue length is greater than the target queue length threshold and the current queue delay is greater than the target expected delay, it is determined that the network congestion state is that the network has a congestion trend, wherein the target queue length threshold is determined according to a maximum average queue length threshold, and the target expected delay is determined according to the expected delay.
[0017] In one embodiment, the step of determining whether the first data packet belongs to an elephant flow according to the flow query information of the first data packet includes:
[0018] Based on the identification information of the first data packet, calling the Sketch interface to query the estimated size of the flow corresponding to the first data packet;
[0019] Whether the first data packet belongs to an elephant flow is determined according to the estimated flow size, a preset score threshold, and the sizes of all flows within a time period.
[0020] In one embodiment, when determining that the first data packet belongs to an elephant flow, the step of discarding the first data packet and updating the parameter adjustment information includes:
[0021] When it is determined that the first data packet belongs to an elephant flow, discarding the first data packet;
[0022] Determine the total number of packets sent and the elapsed time from the previous measurement time to the current time;
[0023] Determine the current dequeue rate according to the total number of data packets sent and the elapsed time;
[0024] Determine an average dequeue rate based on the current dequeue rate, the previous average dequeue rate and a weighted constant;
[0025] The parameter adjustment information is updated based on the average dequeue rate, the egress link bandwidth, and the previously measured queue delay.
[0026] In one embodiment, the parameter adjustment information includes an expected delay and a target exceeded delay; wherein, when the second data packet is dequeued, the step of dequeuing the second data packet according to the current queue information, the parameter adjustment information, the residence time of the second data packet and the traffic query information of the second data packet comprises:
[0027] When the second data packet is dequeued, determining whether the sojourn time is less than the expected delay;
[0028] When the stay time is less than the expected delay, setting the target exceeding time value to a preset value, and controlling the second data packet to be dequeued;
[0029] When the stay time is not less than the expected delay, a target exceeding time value is determined, and based on the target exceeding time value, the current queue information, the parameter adjustment information and the traffic query information of the second data packet, the second data packet is dequeued and managed.
[0030] In one embodiment, when the stay time is not less than the expected delay, determining a target exceeding time value, and performing dequeue management on the second data packet based on the target exceeding time value, the current queue information, the parameter adjustment information, and the traffic query information of the second data packet includes:
[0031] When the stay time is not less than the expected delay, determining that the target exceeds the time value;
[0032] When the target exceeding time value is the preset value, updating the target exceeding time value to the sum of the current time and the target exceeding delay, and controlling the second data packet to be dequeued;
[0033] When the target exceeding time value is greater than the preset value and less than or equal to the current time, discarding the second data packet;
[0034] When the target exceeding time is greater than the current time, dequeue management is performed on the second data packet according to the current queue information, the parameter adjustment information and the flow query information of the second data packet.
[0035] In one embodiment, the current queue information includes a queue length and a queue delay; wherein, when the target exceeding time is greater than the current time, the step of performing dequeue management on the second data packet according to the current queue information, the parameter adjustment information and the traffic query information of the second data packet includes:
[0036] When the target exceeding time value is greater than the current time, determining a network congestion state according to the current queue information and the parameter adjustment information;
[0037] When the network congestion state is that the network has a congestion trend, determining whether the second data packet belongs to an elephant flow according to the flow query information of the second data packet;
[0038] When it is determined that the second data packet belongs to an elephant flow, discarding the second data packet;
[0039] When it is determined that the second data packet does not belong to the elephant flow, the second data packet is controlled to enter the queue.
[0040] In one embodiment, when the second data packet is dequeued, the step of dequeuing the second data packet according to the current queue information, the parameter adjustment information, the residence time of the second data packet and the traffic query information of the second data packet includes:
[0041] Determine the packet loss interval according to the number of packet losses in the current iteration and the number of packet losses in the previous iteration;
[0042] Determine the next discard state time according to the packet loss interval and the time of leaving the discard state;
[0043] When the current time is the next discard state time, determining whether the second data packet is dequeued;
[0044] When the second data packet is dequeued, dequeuing management is performed on the second data packet according to current queue information, parameter adjustment information, residence time of the second data packet, and traffic query information of the second data packet.
[0045] In addition, to achieve the above purpose, the present application also proposes an active queue management device, the active queue management device comprising:
[0046] An enqueue management module, configured to manage the first data packet when the first data packet is enqueued according to current queue information, parameter adjustment information, and flow query information of the first data packet;
[0047] The dequeue management module is used to manage the dequeue of the second data packet according to the current queue information, parameter adjustment information, the residence time of the second data packet and the flow query information of the second data packet when the second data packet is dequeued.
[0048] In addition, to achieve the above-mentioned purpose, the present application also proposes an active queue management device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the active queue management method as described above.
[0049] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the active queue management method described above are implemented.
[0050] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the active queue management method described above are implemented.
[0051] One or more technical solutions proposed in this application have at least the following technical effects:
[0052] The active queue management method and device proposed in the present application, when the first data packet enters the queue, the first data packet is managed to enter the queue according to the current queue information, parameter adjustment information and the traffic query information of the first data packet; when the second data packet leaves the queue, the second data packet is managed to leave the queue according to the current queue information, parameter adjustment information, the residence time of the second data packet and the traffic query information of the second data packet, thereby solving the technical problem that the sharp increase in Internet traffic is likely to cause network congestion. Compared with the prior art, the present application can manage the entry and exit of data packets according to the current queue information, parameter adjustment information and traffic query information, and can discard data packets in time when the network has a congestion trend, which can quickly alleviate network congestion and greatly improve network performance, maintain the availability and stability of the network, and provide users with better network service quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0055] Figure 1 A flowchart of the first embodiment of the active queue management method of the present application is provided;
[0056] Figure 2 A schematic diagram of the entry and exit queues provided in Example 1 of the active queue management method of this application;
[0057] Figure 3 A flow chart of the second embodiment of the active queue management method of the present application;
[0058] Figure 4 A schematic diagram of the queue entry process provided in Example 2 of the active queue management method of this application;
[0059] Figure 5 A pseudo-code diagram of the enqueuing process logic provided in Example 2 of the active queue management method of this application;
[0060] Figure 6 A flowchart of the third embodiment of the active queue management method of the present application is provided;
[0061] Figure 7 A schematic diagram of the dequeue process provided in Example 3 of the active queue management method of this application;
[0062] Figure 8 A logical diagram of packet loss judgment for dequeuing provided in Example 3 of the active queue management method of this application;
[0063] Fig. 9 A pseudo code diagram of the dequeue operation logic provided in Example 3 of the active queue management method of this application;
[0064] Fig.10 This is a schematic diagram of the module structure of the active queue management device according to an embodiment of the present application;
[0065] Fig.11 Schematic diagram of the device structure of the hardware operating environment involved in the active queue management method in the embodiment of the present application.
[0066] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0067] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0068] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0069] The main solution of the embodiment of the present application is: when the first data packet enters the queue, the first data packet is managed to enter the queue according to the current queue information, parameter adjustment information and the traffic query information of the first data packet; when the second data packet leaves the queue, the second data packet is managed to leave the queue according to the current queue information, parameter adjustment information, the residence time of the second data packet and the traffic query information of the second data packet.
[0070] In this embodiment, for the convenience of description, the following description is made by taking the identification of the active queue management device as the execution subject.
[0071] The sharp increase in Internet traffic can easily cause network congestion.
[0072] The active queue management method and device proposed in the present application, when the first data packet enters the queue, the first data packet is managed to enter the queue according to the current queue information, parameter adjustment information and the traffic query information of the first data packet; when the second data packet leaves the queue, the second data packet is managed to leave the queue according to the current queue information, parameter adjustment information, the residence time of the second data packet and the traffic query information of the second data packet, thereby solving the technical problem that the sharp increase in Internet traffic is likely to cause network congestion. Compared with the prior art, the present application can manage the entry and exit of data packets according to the current queue information, parameter adjustment information and traffic query information, and discard data packets in time when the network has a congestion trend, which can quickly alleviate network congestion and greatly improve network performance, maintain the availability and stability of the network, and provide users with better network service quality.
[0073] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an active queue management device, etc. The following takes the active queue management device as an example to illustrate this embodiment and the following embodiments.
[0074] Based on this, the present application embodiment provides an active queue management method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the active queue management method of the present application.
[0075] In this embodiment, the active queue management method includes steps S10 to S20:
[0076] Step S10, when the first data packet enters the queue, the first data packet is managed according to the current queue information, the parameter adjustment information and the flow query information of the first data packet;
[0077] It should be noted that the first data packet refers to the data packet that is about to enter the queue; the first data packet entering the queue means that the first data packet is about to enter the queue; the current queue information may include the queue length and queue delay at the current moment; the parameter adjustment information may include the expected delay and the longest delay that the queuing delay exceeds the expected delay (that is, the target exceeds the delay); the traffic query information may be the estimated size of the flow corresponding to the data packet; and the queue management includes discarding the first data packet and allowing the first data packet to enter the queue.
[0078] It should be noted that the network congestion situation can be determined according to the current queue information, parameter adjustment information and traffic query information, and then the first data packet can be managed for enqueuing according to the congestion situation.
[0079] In a specific implementation, the parameter adjustment information can be dynamically adjusted according to the current queue status within the timing cycle; The query interface is used to obtain the flow query information of the first data packet. For example, the flow query information can be determined by counting and estimating the data packets.
[0080] Step S20, when the second data packet is dequeued, dequeuing management is performed on the second data packet according to the current queue information, parameter adjustment information, the residence time of the second data packet and the flow query information of the second data packet.
[0081] It should be noted that the second data packet refers to the data packet that is about to come out of the queue, and the second data packet dequeueing refers to the second data packet that is about to be dequeued; the residence time refers to the stay time of the second data packet in the queue; and the dequeue management includes discarding the second data packet and allowing the second data packet to be dequeued.
[0082] In a specific implementation, the parameter adjustment information can be dynamically adjusted according to the current queue status within the timing cycle; The query interface is used to obtain the flow query information of the second data packet. For example, the flow query information can be determined by counting and estimating the data packets.
[0083] In the specific implementation, Figure 2 As shown, the parameter adjustment information can be obtained through the parameter adjustment module, and The query interface is used to obtain the flow query information of the first data packet or the second data packet, and finally the data packet is managed in and out of the queue according to the parameter adjustment information and the flow query information.
[0084] This embodiment manages the entry of the first data packet into the queue according to the current queue information, parameter adjustment information and traffic query information of the first data packet when the first data packet enters the queue; and manages the exit of the second data packet from the queue according to the current queue information, parameter adjustment information, the residence time of the second data packet and the traffic query information of the second data packet when the second data packet leaves the queue, thereby solving the technical problem that a sharp increase in Internet traffic easily causes network congestion. Compared with the prior art, the present application can manage the entry and exit of data packets according to the current queue information, parameter adjustment information and traffic query information, and discard data packets in time when the network has a congestion trend, which can quickly alleviate network congestion, greatly improve network performance, maintain network availability and stability, and provide users with better network service quality.
[0085] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S10 includes steps S101 to S104:
[0086] Step S101, when the first data packet enters the queue, determining the network congestion state according to the current queue information and parameter adjustment information;
[0087] In a specific implementation, when the first data packet is about to enter the queue, it is first necessary to determine whether the queue is full. If the queue is full, the first data packet can be directly discarded. If the queue is not full, it is necessary to determine the network congestion status through the current queue information and parameter adjustment information. Specifically, the current network congestion status can be preliminarily judged through the queue length, queue delay and expected delay of the parameter adjustment information in the current queue information.
[0088] In a feasible implementation manner, the current queue information includes queue length and queue delay, and the parameter adjustment information includes expected delay; wherein, when the first data packet enters the queue, the step of determining the network congestion state according to the current queue information and the parameter adjustment information includes: when the first data packet enters the queue, judging whether the queue length is equal to the preset queue length; when it is judged that the queue length is equal to the preset queue length, discarding the first data packet; when it is judged that the queue length is not equal to the preset queue length, determining a target queue length threshold and a target expected delay, and when the queue length is greater than the target queue length threshold and the current queue delay is greater than the target expected delay, determining that the network congestion state is that the network has a congestion trend, wherein the target queue length threshold is determined according to the maximum average queue length threshold, and the target expected delay is determined according to the expected delay.
[0089] It should be noted that when the queue length is equal to the preset queue length, it means that the queue is full. At this time, the first data packet can be directly discarded. When the queue length is not equal to the preset queue length, it means that the queue is not full. At this time, it is necessary to further judge the network congestion status.
[0090] It can be understood that when the queue length is greater than the target queue length threshold and the current queue delay is greater than the target expected delay, the network congestion state is determined to be that the network has a congestion trend (that is, it satisfies both and It can be preliminarily determined that the network has a congestion trend, among which, represents the expected delay, Indicates the queue length, Indicates the maximum average queue length threshold. Indicates the target queue length threshold. represents the target expected delay).
[0091] Step S102, when the network congestion state is that the network has a congestion trend, judging whether the first data packet belongs to an elephant flow according to the flow query information of the first data packet;
[0092] In a feasible implementation, the step of determining whether the first data packet belongs to an elephant flow based on the traffic query information of the first data packet includes: based on the identification information of the first data packet, calling the Sketch interface to query the estimated flow size corresponding to the first data packet; determining whether the first data packet belongs to an elephant flow based on the estimated flow size, a preset score threshold, and the sizes of all flows within a time period.
[0093] It should be noted that when the data packet is an IPv4 message, the flow Uniquely identified by a five-tuple, when the data packet is an IPv6 message, the flow Identified by the flow label, the Sketch interface can be called according to the identification information of the first data packet to query the estimated flow size corresponding to the first data packet, and then the estimated flow size is compared with the preset score threshold and all flow sizes within the time period. Finally, it is determined whether the first data packet belongs to the elephant flow based on the comparison result.
[0094] In a specific implementation, when the estimated flow size corresponding to the first data packet is greater than or equal to the product of a preset score threshold and the size of all flows within a time period, it is determined that the first data packet belongs to an elephant flow; when the estimated flow size corresponding to the first data packet is less than the preset score threshold and the product of the size of all flows within a time period, it is determined that the first data packet does not belong to an elephant flow.
[0095] Step S103, when it is determined that the first data packet belongs to an elephant flow, the first data packet is discarded and the parameter adjustment information is updated;
[0096] In the specific implementation, you can call The query interface is used to query the flow corresponding to the first data packet. Estimated size , that is, the estimated size of the flow, if , then the first data packet is considered to belong to the elephant flow. At this time, it can be considered that the network is in a relatively congested state and the first data packet needs to be discarded. In the formula, is the preset score threshold, is the size of all flows in the time period; if , then it is considered that the first data packet does not belong to the elephant flow.
[0097] Step S104: when it is determined that the first data packet does not belong to the elephant flow, a timestamp is added to the first data packet after the first data packet is queued.
[0098] It should be noted that when the first data packet does not belong to the elephant flow, it means that the network is not congested at this time. At this time, the sketch interface can be called to update the elements in the hash bucket, and the first data packet is queued and timestamped.
[0099] In the specific implementation, Figure 4 As shown, when a data packet arrives, it is necessary to first determine whether the current queue is full. If the current queue is full, the data packet can be directly discarded. If the current queue is not full, it is necessary to further determine whether the current queue has a congestion trend to determine the data packets that can be queued and the data packets that need to be discarded.
[0100] In a feasible implementation manner, the step of discarding the first data packet and updating the parameter adjustment information when it is determined that the first data packet belongs to an elephant flow includes: discarding the first data packet when it is determined that the first data packet belongs to an elephant flow; determining the total number of data packets sent and the elapsed time from the previous measurement moment to the current moment; determining the current dequeue rate based on the total number of data packets sent and the elapsed time; determining the average dequeue rate based on the current dequeue rate, the previous average dequeue rate and a weighted constant; and updating the parameter adjustment information based on the average dequeue rate, the export link bandwidth and the previously measured queue delay.
[0101] It should be noted that the parameter adjustment information may include the expected delay and the longest delay by which the queuing delay exceeds the expected delay (i.e., the target exceeding delay);
[0102] It should be noted that the current dequeue rate is calculated as follows:
[0103]
[0104] In the formula, Indicates the total number of packets sent since the last measurement (i.e., the total number of packets sent from the previous measurement time to the current time), Represents the elapsed time since the last measurement (i.e., the elapsed time from the previous measurement moment to the current moment).
[0105] It should be noted that in order to smooth the impact of burst traffic, the average dequeue rate can be calculated using an exponentially weighted average method:
[0106]
[0107] In the formula, represents the average dequeue rate, is a weighting constant greater than 0 and less than 1, Indicates the current dequeue rate.
[0108] It should be noted that the expected delay in the parameter adjustment information is updated as follows:
[0109]
[0110] In the formula, is the egress link bandwidth, is a weighting constant greater than 0 and less than 1, Indicates the average dequeue rate.
[0111] It should be noted that the target exceeding delay in the parameter adjustment information is updated as follows:
[0112]
[0113] In the formula, is the egress link bandwidth, The last measured queue delay (previously measured queue delay).
[0114] In this embodiment, the expected delay and the target delay are updated and corrected by the queue state perceived in real time during the queue entry process to adapt to a more complex network environment, thereby maintaining the stability and fault tolerance of the network.
[0115] In the specific implementation, the pseudo code of the queue entry process logic is as follows Figure 5 shown.
[0116] This embodiment determines the network congestion state according to the current queue information and parameter adjustment information when the first data packet enters the queue; when the network congestion state is that the network has a congestion trend, it determines whether the first data packet belongs to the elephant flow according to the flow query information of the first data packet; when it is determined that the first data packet belongs to the elephant flow, the first data packet is discarded and the parameter adjustment information is updated; when it is determined that the first data packet does not belong to the elephant flow, the first data packet is timestamped after the first data packet is controlled to enter the queue. It can preliminarily determine whether the network has a congestion trend according to the current queue information and parameter adjustment information, and then determine whether the first data packet belongs to the elephant flow according to the flow query information to further determine the network congestion situation, and can make fine-grained distinctions for different data packets, identify the flow that actually causes congestion, and discard these data packets in time, which can not only avoid entering the congestion control state too early, but also avoid frequent discarding of data packets, thereby effectively improving network efficiency.
[0117] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 6 , step S20 includes steps S201 to S203:
[0118] Step S201, when the second data packet is dequeued, determining whether the residence time is less than the expected delay;
[0119] Step S202, when the stay time is less than the expected delay, setting the target exceeding time value to a preset value, and controlling the second data packet to be dequeued;
[0120] In the specific implementation, the default value is set to 0. If the stay time Less than expected delay , then the target exceeds the time value Set to 0 and let the second data packet be directly dequeued.
[0121] Step S203, when the stay time is not less than the expected delay, determine the target exceeding time value, and perform dequeue management on the second data packet based on the target exceeding time value, the current queue information, the parameter adjustment information and the traffic query information of the second data packet.
[0122] It should be noted that when the stay time is not less than the expected delay, it is necessary to perform queue management according to different situations based on the current target exceeding time value.
[0123] In the specific implementation, Figure 7The packet dequeue flow chart shown needs to calculate the residence time of the packet in the queue, and preliminarily determine the packets that can be dequeued based on the comparison result of the residence time and the expected delay, and then further judge whether the current queue has a congestion trend to determine the packets that can be dequeued and the packets that need to be discarded.
[0124] In a feasible implementation manner, when the stay time is not less than the expected delay, the target exceed time value is determined, and based on the target exceed time value, the current queue information, the parameter adjustment information and the traffic query information of the second data packet, the step of dequeueing the second data packet includes: when the stay time is not less than the expected delay, the target exceed time value is determined; when the target exceed time value is the preset value, the target exceed time value is updated to the sum of the current time and the target exceed delay, and the second data packet is controlled to be dequeued; when the target exceed time value is greater than the preset value and less than or equal to the current time, the second data packet is discarded; when the target exceed time is greater than the current time, the second data packet is dequeued according to the current queue information, the parameter adjustment information and the traffic query information of the second data packet.
[0125] It should be noted that if the stay time Greater than or equal to expected delay , it needs to be handled according to different situations. The specific handling methods are as follows:
[0126] (1) If , it means that this is the first time that the queue has stayed longer than the expected delay The data packet will Set to , and as a start of the inspection, where Represents the current time, Indicates that the target exceeds the delay.
[0127] (2) If , it means that it is already in the inspection phase, and the delay of the data packets in the queue has exceeded the expected delay for more than , and packet loss begins.
[0128] (3) When in between the above two states, the queue length and queue delay Perform a preliminary congestion judgment in the same way as the packet enqueue stage; if it is judged that there is a trend of congestion, call the same as the enqueue stage The query interface queries the corresponding flow of the second data packet Estimated size ,like The second data packet is considered to belong to the elephant flow and is discarded.
[0129] In a feasible implementation manner, the current queue information includes queue length and queue delay; wherein, when the target exceeding time is greater than the current time, the step of dequeueing the second data packet according to the current queue information, the parameter adjustment information and the traffic query information of the second data packet includes: when the target exceeding time value is greater than the current time, determining the network congestion status according to the current queue information and the parameter adjustment information; when the network congestion status is that the network has a congestion trend, judging whether the second data packet belongs to the elephant flow according to the traffic query information of the second data packet; when it is determined that the second data packet belongs to the elephant flow, discarding the second data packet; when it is determined that the second data packet does not belong to the elephant flow, controlling the second data packet to enter the queue.
[0130] In a specific implementation, the network congestion state can be determined according to the current queue information and the parameter adjustment information. Specifically, when the queue length is greater than the target queue length threshold and the current queue delay is greater than the target expected delay, the network congestion state is determined as the network has a congestion trend (that is, it satisfies both and It can be preliminarily determined that the network has a congestion trend, among which, represents the expected delay, Indicates the queue length, Indicates the maximum average queue length threshold. Indicates the target queue length threshold. represents the target expected delay).
[0131] In a specific implementation, the traffic query information of the first data packet is the estimated flow size corresponding to the second data packet. Based on the identification information of the second data packet, the Sketch interface can be called to query the estimated flow size corresponding to the second data packet; then, based on the estimated flow size corresponding to the second data packet, the preset score threshold and the sizes of all flows within the time period, it is determined whether the first data packet belongs to an elephant flow.
[0132] It should be noted that when the data packet is an IPv4 message, the flow Uniquely identified by a five-tuple, when the data packet is an IPv6 message, the flow Identified by the flow label, the Sketch interface can be called according to the identification information of the second data packet to query the estimated flow size corresponding to the second data packet, and then the estimated flow size is compared with the preset score threshold and all flow sizes within the time period. Finally, it is determined whether the first data packet belongs to the elephant flow based on the comparison result.
[0133] In a specific implementation, when the estimated flow size corresponding to the second data packet is greater than or equal to the product of the preset score threshold and the size of all flows within a time period, the second data packet is determined to belong to the elephant flow; when the estimated flow size corresponding to the second data packet is less than the preset score threshold and the product of the size of all flows within the time period, the second data packet is determined not to belong to the elephant flow.
[0134] In the specific implementation, the logic for judging packet loss when leaving the queue is as follows: Figure 8 shown.
[0135] In a feasible implementation manner, when the second data packet is dequeued, the step of dequeuing the second data packet according to the current queue information, parameter adjustment information, the residence time of the second data packet and the traffic query information of the second data packet includes: determining the packet loss interval according to the number of packet losses in the current iteration and the number of packet losses in the previous iteration; determining the next discard state time according to the packet loss interval and the time of leaving the discard state; when the current time is the next discard state time, judging whether the second data packet is dequeued; when the second data packet is dequeued, dequeuing the second data packet according to the current queue information, parameter adjustment information, the residence time of the second data packet and the traffic query information of the second data packet.
[0136] It should be noted that during the packet dequeue operation, if the queue is in the discard state , you need to check whether it is time to leave the discard state or schedule the next discard. If the queue is not in the discard state, determine whether it should enter the discard state and perform the initial discard.
[0137] It can be understood that the next discard state time refers to the time of entering the next discard state.
[0138] It is understandable that there are discard operations in both the enqueue process and the dequeue process, and the elephant flow can be identified in a fine-grained manner to avoid congestion. The time interval for the next round of packet loss can be appropriately increased to:
[0139]
[0140] In the formula, The number of packets discarded in this iteration (i.e. the number of packets lost in the current iteration), is the number of packet losses in the previous iteration (i.e. the number of packet losses in the previous iteration), It is the maximum delay that the queuing delay exceeds the expected delay (i.e., the target excess delay).
[0141] In the specific implementation, the pseudo code of the dequeue operation logic is as follows Fig. 9 shown.
[0142] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the active queue management method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0143] This application also provides an active queue management device, please refer to Fig.10 , the active queue management device comprises:
[0144] The queue management module 10 is used to manage the first data packet when the first data packet is queued according to the current queue information, the parameter adjustment information and the flow query information of the first data packet;
[0145] The dequeue management module 20 is used to manage the dequeue of the second data packet according to the current queue information, parameter adjustment information, the residence time of the second data packet and the flow query information of the second data packet when the second data packet is dequeued.
[0146] The active queue management device provided by the present application adopts the active queue management method in the above embodiment, which can solve the technical problem that the sharp increase of Internet traffic easily causes network congestion. Compared with the prior art, the beneficial effects of the active queue management device provided by the present application are the same as the beneficial effects of the active queue management method provided by the above embodiment, and other technical features in the active queue management device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0147] The present application provides an active queue management device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the active queue management method in the above-mentioned embodiment 1.
[0148] Reference below Fig.11 , which shows a schematic diagram of the structure of an active queue management device suitable for implementing an embodiment of the present application. The active queue management device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11The active queue management device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0149] like Fig.11 As shown, the active queue management device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the active queue management device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the active queue management device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an active queue management device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0150] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0151] The active queue management device provided by the present application adopts the active queue management method in the above embodiment, which can solve the technical problem that the sharp increase in Internet traffic easily causes network congestion. Compared with the prior art, the beneficial effects of the active queue management device provided by the present application are the same as the beneficial effects of the active queue management method provided by the above embodiment, and other technical features in the active queue management device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0152] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0153] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0154] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the active queue management method in the above-mentioned embodiment.
[0155] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0156] The computer-readable storage medium may be included in the active queue management device; or may exist independently without being assembled into the active queue management device.
[0157] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the active queue management device, the active queue management device: when a first data packet enters the queue, the first data packet is managed to enter the queue according to the current queue information, parameter adjustment information and the traffic query information of the first data packet; when a second data packet is dequeued, the second data packet is managed to leave the queue according to the current queue information, parameter adjustment information, the residence time of the second data packet and the traffic query information of the second data packet.
[0158] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0159] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0160] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0161] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned active queue management method, and can solve the technical problem that the sharp increase in Internet traffic easily causes network congestion. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the active queue management method provided by the above-mentioned embodiment, and will not be repeated here.
[0162] The present application also provides a computer program product, including a computer program, which implements the steps of the active queue management method as described above when executed by a processor.
[0163] The computer program product provided by the present application can solve the technical problem that the sharp increase in Internet traffic easily causes network congestion. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the active queue management method provided by the above embodiment, which will not be repeated here.
[0164] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An active queue management method, characterized in that: The method comprises: When a first data packet enters a queue, the first data packet is managed according to the current queue information, the parameter adjustment information and the flow query information of the first data packet; When the second data packet is dequeued, dequeuing management is performed on the second data packet according to the current queue information, the parameter adjustment information, the residence time of the second data packet and the flow query information of the second data packet; When the first data packet enters the queue, the step of managing the first data packet entering the queue according to the current queue information, the parameter adjustment information and the flow query information of the first data packet includes: When the first data packet enters the queue, determining the network congestion state according to the current queue information and the parameter adjustment information; When the network congestion state is that the network has a congestion trend, determining whether the first data packet belongs to an elephant flow according to the flow query information of the first data packet; When it is determined that the first data packet belongs to an elephant flow, discarding the first data packet and updating the parameter adjustment information; When it is determined that the first data packet does not belong to the elephant flow, controlling the first data packet to be timestamped after entering the queue; When determining that the first data packet belongs to an elephant flow, the step of discarding the first data packet and updating the parameter adjustment information comprises: When it is determined that the first data packet belongs to an elephant flow, discarding the first data packet; Determine the total number of packets sent and the elapsed time from the previous measurement time to the current time; Determine the current dequeue rate according to the total number of data packets sent and the elapsed time; Determine an average dequeue rate based on the current dequeue rate, the previous average dequeue rate and a weighted constant; Based on the average dequeue rate, the egress link bandwidth, and the previously measured queue delay, the parameter adjustment information is updated, wherein the parameter adjustment information includes an expected delay and a target exceeded delay, and the expected delay is updated in the following manner: , is the egress link bandwidth, Represents the average dequeue rate. The update method of the target exceeding the delay is: , The queue delay is measured previously; When the second data packet is dequeued, the step of dequeuing the second data packet according to the current queue information, the parameter adjustment information, the residence time of the second data packet and the flow query information of the second data packet comprises: The packet loss interval is determined according to the number of packet losses in the current iteration and the number of packet losses in the previous iteration, where the packet loss interval is: In the formula, is the number of packet losses in the current iteration, is the number of packet losses in the previous iteration, For the target to exceed the delay; Determine the next discard state time according to the packet loss interval and the time of leaving the discard state; When the current time is the next discard state time, determining whether the second data packet is dequeued; When the second data packet is dequeued, dequeuing management is performed on the second data packet according to current queue information, parameter adjustment information, residence time of the second data packet, and traffic query information of the second data packet.
2. The method according to claim 1, characterized in that The current queue information includes queue length and queue delay; wherein, when the first data packet enters the queue, the step of determining the network congestion state according to the current queue information and parameter adjustment information includes: When the first data packet enters the queue, determining whether the queue length is equal to a preset queue length; When it is determined that the queue length is equal to the preset queue length, discarding the first data packet; When it is determined that the queue length is not equal to the preset queue length, a target queue length threshold and a target expected delay are determined, and when the queue length is greater than the target queue length threshold and the current queue delay is greater than the target expected delay, it is determined that the network congestion state is that the network has a congestion trend, wherein the target queue length threshold is determined according to a maximum average queue length threshold, and the target expected delay is determined according to the expected delay.
3. The method according to claim 1, characterized in that The step of determining whether the first data packet belongs to an elephant flow according to the flow query information of the first data packet comprises: Based on the identification information of the first data packet, calling the Sketch interface to query the estimated size of the flow corresponding to the first data packet; Whether the first data packet belongs to an elephant flow is determined according to the estimated flow size, a preset score threshold, and the sizes of all flows within a time period.
4. The method according to claim 1, characterized in that When the second data packet is dequeued, the step of dequeuing the second data packet according to the current queue information, the parameter adjustment information, the residence time of the second data packet and the flow query information of the second data packet comprises: When the second data packet is dequeued, determining whether the sojourn time is less than the expected delay; When the stay time is less than the expected delay, setting the target exceeding time value to a preset value, and controlling the second data packet to be dequeued; When the stay time is not less than the expected delay, a target exceeding time value is determined, and based on the target exceeding time value, the current queue information, the parameter adjustment information and the traffic query information of the second data packet, the second data packet is dequeued and managed.
5. The method according to claim 4, characterized in that The step of determining a target exceeding time value when the stay time is not less than the expected delay, and performing dequeue management on the second data packet based on the target exceeding time value, the current queue information, the parameter adjustment information, and the traffic query information of the second data packet comprises: When the stay time is not less than the expected delay, determining that the target exceeds the time value; When the target exceeding time value is the preset value, updating the target exceeding time value to the sum of the current time and the target exceeding delay, and controlling the second data packet to be dequeued; When the target exceeding time value is greater than the preset value and less than or equal to the current time, discarding the second data packet; When the target exceeding time is greater than the current time, dequeue management is performed on the second data packet according to the current queue information, the parameter adjustment information and the flow query information of the second data packet.
6. The method according to claim 5, characterized in that The current queue information includes a queue length and a queue delay; wherein, when the target exceeding time is greater than the current time, the step of performing dequeue management on the second data packet according to the current queue information, the parameter adjustment information and the flow query information of the second data packet includes: When the target exceeding time value is greater than the current time, determining a network congestion state according to the current queue information and the parameter adjustment information; When the network congestion state is that the network has a congestion trend, determining whether the second data packet belongs to an elephant flow according to the flow query information of the second data packet; When it is determined that the second data packet belongs to an elephant flow, discarding the second data packet; When it is determined that the second data packet does not belong to the elephant flow, the second data packet is controlled to be dequeued.
7. An active queue management device, characterized in that: The device comprises: An enqueue management module, configured to manage the first data packet when the first data packet is enqueued according to current queue information, parameter adjustment information, and flow query information of the first data packet; a dequeue management module, configured to manage the dequeue of the second data packet according to the current queue information, the parameter adjustment information, the residence time of the second data packet and the flow query information of the second data packet when the second data packet is dequeued; The active queue management device is used for: When the first data packet enters the queue, determining the network congestion state according to the current queue information and the parameter adjustment information; When the network congestion state is that the network has a congestion trend, determining whether the first data packet belongs to an elephant flow according to the flow query information of the first data packet; When it is determined that the first data packet belongs to an elephant flow, discarding the first data packet and updating the parameter adjustment information; When it is determined that the first data packet does not belong to the elephant flow, controlling the first data packet to be timestamped after entering the queue; The active queue management device is further used for: When it is determined that the first data packet belongs to an elephant flow, discarding the first data packet; Determine the total number of packets sent and the elapsed time from the previous measurement time to the current time; Determine the current dequeue rate according to the total number of data packets sent and the elapsed time; Determine an average dequeue rate based on the current dequeue rate, the previous average dequeue rate and a weighted constant; Based on the average dequeue rate, the egress link bandwidth, and the previously measured queue delay, the parameter adjustment information is updated, wherein the parameter adjustment information includes an expected delay and a target exceeded delay, and the expected delay is updated in the following manner: , is the egress link bandwidth, Represents the average dequeue rate. The update method of the target exceeding the delay is: , The queue delay is measured previously; The active queue management device is further used for: The packet loss interval is determined according to the number of packet losses in the current iteration and the number of packet losses in the previous iteration, where the packet loss interval is: In the formula, is the number of packet losses in the current iteration, is the number of packet losses in the previous iteration, For the target to exceed the delay; Determine the next discard state time according to the packet loss interval and the time of leaving the discard state; When the current time is the next discard state time, determining whether the second data packet is dequeued; When the second data packet is dequeued, dequeuing management is performed on the second data packet according to current queue information, parameter adjustment information, residence time of the second data packet, and traffic query information of the second data packet.
Citation Information
Patent Citations
Active queue management method based on summary data
CN113064738A
High-speed network active queue scheduling method based on controllable time delay
CN113572705A