Dynamic fair queuing method for shared memory switch

By dynamically adjusting the admission threshold and priority of the queue in a shared memory switch, and combining the queue splitting and merging strategy, the problem of low cache resource utilization in the existing technology is solved, efficient network traffic scheduling and bandwidth management are achieved, and the performance and throughput of the data center network are improved.

CN120499131APending Publication Date: 2025-08-15ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510826992.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing approximate fair queue mechanism has excessive packet loss problem in shared memory switches, making it difficult to effectively utilize cache resources, resulting in low link utilization and throughput, affecting the performance and efficiency of the data center network.

Method used

By monitoring the status of packets and cache queues in real time, dynamically adjusting the admission threshold and priority of the queue, and combining queue splitting and merging strategies, the incoming and dequeuing process of data packets is optimized to achieve fairness and cache utilization.

Benefits of technology

While approaching the ideal fair queue, it reduces unnecessary packet loss, improves network utilization, optimizes bandwidth resource management and traffic control, and adapts to high load and high traffic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120499131A_ABST
    Figure CN120499131A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic fair queuing method for a shared memory switch. According to the method, the admission threshold value and the queue management strategy of each queue are dynamically adjusted by monitoring the arriving data packet and the buffer queue state in real time. Specifically, the method comprises the following steps: firstly, calculating a dynamic admission threshold according to an accumulated bit number reaching a data packet and a residual cache space of a queue; and performing enqueue decision based on the threshold value, so that the data packet enters a corresponding queue according to a first-in first-out rule. In addition, the invention provides a queue splitting and merging mechanism in combination with a shared memory architecture: when the cache of the queue with the highest priority has free space, the queue with the highest priority is redistributed as the queue with the lowest priority at present, and a subsequently arrived data packet enters the queue according to admission control, so that the overall fairness is improved. The method is suitable for fair bandwidth allocation in a data center network, improves the utilization rate of network resources while improving fairness, and is suitable for network environments of a data center, cloud computing, high-performance computing and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer networks, and in particular to a dynamic fair queuing method for a programmable shared memory switch, which is suitable for bandwidth resource management and flow control in a data center network. Background Art

[0002] With the rapid growth of network traffic, data center networks are facing diverse traffic demands. Different applications have varying performance requirements (such as latency, bandwidth, and reliability). Fair bandwidth allocation is crucial to prevent resource monopoly and reduce interference between different traffic patterns. Fair queue scheduling in switches has become a mainstream mechanism. Modern switches typically use on-chip shared caches, rather than allocating private caches to each port, to improve cache utilization.

[0003] Bit-by-Bit Round Robin (BR) is a simple and efficient fair bandwidth allocation algorithm. Its core concept is to have each flow send one bit per round. However, because bit-level scheduling is not feasible, BR approximates ideal fairness by calculating the number of packets leaving a round. However, strictly scheduling packets based on their departure times is computationally expensive and difficult to implement at line speed. Consequently, various approximate fair queuing mechanisms have emerged in recent years.

[0004] Typical approximate fair queuing mechanisms include Approximate Fair Queueing (AFQ), Elastic Fair Queueing (EFQ) and Adaptive Approximate Fair Queueing (A 2 AFQ uses multiple priority queues and manages the enqueueing of packets based on a fixed round threshold. However, when a large number of packets arrive at the same time, packets exceeding the threshold will be dropped, even if there is still space available in the cache. EFQ optimizes cache utilization based on AFQ and avoids packet loss by dividing the remaining cache equally among all active flows. However, EFQ assumes that all packets are of the same size. In real scenarios, there are packets of various sizes. Large packets are more likely to exceed the allocated space, resulting in an increased packet loss rate. 2 FQ dynamically adjusts the number of queues to adapt to traffic changes. However, when the number of queues is small, insufficient buffer utilization still leads to a high packet loss rate.

[0005] Therefore, existing near-fair queuing mechanisms in shared memory programmable switches suffer from excessive packet loss, making it difficult to effectively utilize cache resources, resulting in low link utilization and throughput. These issues severely impact the performance and efficiency of data center networks. Summary of the Invention

[0006] The present invention aims to provide a dynamic fair queuing method for shared memory switches to address existing issues. This method can be implemented at line speed on the data plane of a programmable switch, achieving near-ideal fair queuing while improving network utilization, reducing unnecessary packet loss, and optimizing bandwidth resource management and flow control in data center networks.

[0007] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0008] In a first aspect, the present invention provides a dynamic fair queuing method for a shared memory switch, comprising:

[0009] Traverse each data packet in each flow arriving at the switch ingress port in turn, and calculate the end round of the current data packet based on the end round of the previous data packet and the size of the current data packet;

[0010] Enqueue operations are processed according to a preset time period. During each time period, a dynamic admission threshold is calculated for each queue based on the cumulative bit distribution corresponding to the departure round of arriving packets monitored in real time and the remaining buffer space in the switch egress queue. Enqueue decisions are then made for each packet in the flow based on the dynamic admission threshold, thereby ensuring fairness while reducing excessive packet loss.

[0011] In the switch, data packets are dequeued in descending order of queue priority, and a queue priority dynamic adjustment strategy and a queue splitting and merging strategy are implemented during the enqueuing and dequeuing process;

[0012] The dynamic queue priority adjustment strategy is as follows: when the highest priority queue is emptied of data packets, its priority is lowered to the lowest, and the priorities of other queues are raised in turn to ensure overall fairness;

[0013] The queue splitting and merging strategy is as follows: when a newly arrived data packet needs to be queued, if the current highest-priority queue still has remaining cache space, a queue splitting operation is performed, and the remaining cache space is redefined as a new queue with the current lowest priority. After the current highest-priority queue is emptied, it is merged with the new queue again to improve cache utilization and reduce data packet discards.

[0014] As a preferred embodiment of the first aspect, for each data packet in each flow arriving at the ingress port of the switch, the end round thereof is the sum of the size of the current data packet itself and the end round of the data packet before the current data packet.

[0015] As a preferred embodiment of the first aspect, the dynamic admission thresholds of all queues at the egress of the switch in each time period are calculated as follows:

[0016] First, according to the end rounds of all newly arrived data packets in the current time period, the cumulative bit distribution Ω is obtained by statistics. r , the cumulative bit distribution Ω r Taking round r as the variable, the distribution value corresponding to round r represents the sum of the sizes of all newly arrived data packets whose ending rounds are less than or equal to r;

[0017] Then, the current queue length and total buffer size of each queue on the switch's outbound port are read to calculate the remaining buffer space of each queue;

[0018] Finally, the dynamic admission threshold is calculated for each queue in descending order of priority, where:

[0019] The dynamic admission threshold of the first queue is the cumulative bit distribution Ω r The round r corresponding to the maximum distribution value of the remaining cache space that does not exceed the first queue;

[0020] The dynamic admission threshold of any other queue i≥2 is the cumulative bit distribution Ω r The round r corresponding to the maximum distribution value that does not exceed the middle value, where the middle value is the dynamic admission threshold of the previous queue in the cumulative bit distribution Ω r The sum of the corresponding distribution value in and the remaining buffer space of the current queue.

[0021] As a preferred embodiment of the first aspect, the specific method for executing the enqueue decision for each data packet in the flow according to the dynamic admission threshold is:

[0022] Traverse each data packet in the flow in turn, and search in descending order of queue priority to see if there is a queue where the current data packet can be enqueued. If the end round of the current data packet is less than or equal to the dynamic admission threshold of a queue, the current data packet is enqueued into the corresponding queue to complete the enqueuing operation. If the end round of the current data packet is greater than the dynamic admission threshold of all queues at the switch egress end, the current data packet is discarded.

[0023] As a preferred embodiment of the first aspect above, in the queue priority dynamic adjustment strategy, an initial priority is assigned to each queue at the switch egress end, and then while processing the enqueuing operation according to a preset time period, data packets are dequeued in descending order of queue priority. When the queue is emptied of data packets, a priority rotation operation is performed, and the priority of the highest priority queue is reduced to the lowest, and the priorities of other queues are increased by 1 level in turn.

[0024] As a preferred embodiment of the first aspect, in the queue splitting and merging strategy, the specific execution process is as follows:

[0025] When the current highest priority queue has remaining buffer space and a new packet arrives, the queue split operation is triggered. The remaining buffer space of the current highest priority queue is released to the shared memory pool and redefined as a new queue as an auxiliary queue. The priority of the new queue is set to the lowest and it can make enqueue decisions for packets based on its own dynamic admission threshold.

[0026] When the split highest priority queue is emptied of data packets, its remaining buffer space is merged into the auxiliary queue, so that the auxiliary queue becomes a complete formal queue, and the priority of the merged formal queue still follows the priority of the auxiliary queue.

[0027] As a preferred embodiment of the first aspect, when calculating the end round for all data packets in each flow, the initial round value of the first data packet is set to 0.

[0028] In a second aspect, the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, can implement the dynamic fair queuing method for a shared memory switch as described in any one of the solutions of the first aspect above.

[0029] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the dynamic fair queuing method for a shared memory switch as described in any one of the solutions of the first aspect above can be implemented.

[0030] In a fourth aspect, the present invention provides a computer electronic device comprising a memory and a processor;

[0031] The memory is used to store computer programs;

[0032] The processor is configured to implement the dynamic fair queuing method for a shared memory switch as described in any one of the solutions of the first aspect when executing the computer program.

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] The dynamic fair queuing method proposed in the present invention is a complete network traffic scheduling solution that can be directly applied to the actual deployment of shared memory switches. Through real-time dynamic admission control and queue splitting and merging operations, this method not only optimizes the fairness of traffic scheduling, but also improves the overall system performance, and can simultaneously ensure low network latency and high throughput. Based on this, the scheduling method of the present invention can adapt to high-load, high-traffic actual application environments while ensuring network traffic fairness, optimizing bandwidth utilization, and reducing packet loss rates. It provides strong support for efficient management of network resources and traffic scheduling, and is suitable for modern data center network environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a schematic diagram of the system architecture overview of the present invention;

[0036] Figure 2 This is a schematic diagram of dynamic admission threshold calculation and data packet enqueueing;

[0037] Figure 3 This is a diagram of the queue splitting and merging mechanism. DETAILED DESCRIPTION

[0038] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in the various embodiments of the present invention can be combined accordingly without conflicting with each other.

[0039] The present invention provides a dynamic fair queuing method for a shared memory switch, which dynamically adjusts the admission threshold and queue management strategy of each queue by real-time monitoring of the arriving data packets and the cache queue status. Specifically, the dynamic admission threshold is first calculated based on the cumulative number of bits of the arriving data packets and the remaining cache space of the queue; then, the enqueuing decision is made based on the threshold, so that the data packets enter the corresponding queue according to the first-in-first-out (FIFO) rule. In addition, the present invention combines the shared memory architecture and proposes a queue splitting and merging mechanism: when there is free space in the cache of the highest priority queue, it is reallocated to the current lowest priority queue, and the subsequently arriving data packets enter the queue according to the admission control, thereby further improving the overall fairness. The present invention is suitable for fair bandwidth allocation in data center networks, improving network resource utilization while improving fairness, and is suitable for network environments such as data centers, cloud computing and high-performance computing.

[0040] This method can be implemented at line speed on the data plane of a programmable switch, aiming to improve network utilization while approaching ideal fair queuing. The basic process of this method is as follows:

[0041] (1) Packet departure round calculation: traverse each packet in each flow arriving at the switch ingress port in turn, and calculate the end round of the current packet based on the end round of the previous packet and the size of the current packet;

[0042] (2) Dynamic admission control: Enqueue operations are processed according to a preset time period. In each time period, a dynamic admission threshold is calculated for each queue based on the cumulative bit distribution corresponding to the departure round of the arriving data packets monitored in real time and the remaining buffer space of the switch egress queue. Enqueue decisions are then made for each data packet in the flow based on the dynamic admission threshold to ensure fairness while reducing excessive packet loss.

[0043] In the above switch, data packets are dequeued in descending order of queue priority, and a queue priority dynamic adjustment strategy and a queue splitting and merging strategy are executed during the enqueuing and dequeuing process.

[0044] The above switch implements the following dynamic queue priority adjustment strategy: when the highest priority queue is emptied of packets, its priority is lowered to the lowest, and the priorities of other queues are raised in turn to ensure overall fairness;

[0045] The queue splitting and merging strategy implemented by the above switch is as follows: when a newly arrived data packet needs to be queued, if the current highest-priority queue still has remaining cache space, a queue split operation is performed, and the remaining cache space is redefined as a new queue with the current lowest priority. After the current highest-priority queue is emptied, it is merged with the new queue to improve cache utilization and reduce packet discards.

[0046] The above method can be applied to data center networks and can be implemented at line speed on the data plane of programmable switches in data centers. While approaching ideal fair queuing, it improves network utilization and reduces unnecessary packet loss, thereby optimizing bandwidth resource management and flow control in data center networks.

[0047] In a preferred embodiment of the present invention, Figure 1 As shown, the above dynamic fair queuing method can be implemented by three modules: the enqueue module, the dequeue module, and the queue management module. These modules can be implemented by writing computer programs in the data plane of the programmable switch. The overall system architecture based on these three modules can be implemented through the following five links, as follows:

[0048] (1) Calculation of the number of times a data packet leaves the round.

[0049] The function of this link is to calculate the exit round of each data packet. The data flow arriving at the switch inlet port is composed of data packets. For each flow arriving at the switch inlet port, an initial round can be set before calculating the end round to calculate the end round of the first data packet. Because the first data packet does not have the end round of the previous data packet, in an embodiment of the present invention, the initial round value of the first data packet in the flow can be set to 0, and this initial round can be equivalent to the end round of the previous data packet. Therefore, for all data packets in the flow, each data packet can be traversed in turn (for the sake of convenience of description, the traversed data packet is called the current data packet), and the end round (previous_pkt_round) corresponding to the previous data packet of the current data packet in the flow is obtained, and the size of the current data packet (pkt_size) is obtained at the same time, so as to calculate the end round of the current data packet. For the current data packet, its end round is the sum of the size of the current data packet itself and the end round of the previous data packet of the current data packet, which is expressed by the formula:

[0050] pkt_round=previous_pkt_round+pkt_size

[0051] Except that the previous_pkt_round of the first data packet in the flow adopts the initial round value 0, for the remaining data packets in the traversal process, the calculated end round pkt_round can be used as the new previous_pkt_round of the flow for the calculation of the next data packet.

[0052] (2) Calculation of dynamic admission threshold.

[0053] This step is responsible for calculating the dynamic admission threshold for each queue. For a switch, packets continuously arrive at its ingress ports, but enqueue operations must be performed periodically. The specific time period T is a preset parameter that can be controlled based on actual needs. Since the operations required in each time period T are the same, for ease of description, this document will refer to the currently executing time period as the current time period.

[0054] The dynamic admission thresholds for all queues at the switch egress in each current time period are calculated as follows:

[0055] First, at the initial moment, create an empty cumulative bit-based round distribution table Ω r , the cumulative bit distribution Ω rThe independent variable is round r, and the dependent variable is the distribution of accumulated bits. When the time period T has passed since the last enqueue operation, the dynamic admission threshold calculation for the current time period begins to facilitate subsequent enqueue operations. The specific steps are:

[0056] First, count the end rounds of all newly arrived data packets in the current time period (the aforementioned pkt_round), and then update the initially empty cumulative bit distribution Ω r , updated cumulative bit distribution Ω r Taking round r as a variable, the distribution value corresponding to round r represents the sum of the sizes of all data packets whose ending round is less than or equal to r among all newly arrived data packets. The sum is the accumulated bits.

[0057] Then, read the current queue length and total buffer size of each queue at the switch output port, and subtract the current queue length from the total buffer size to calculate the remaining buffer space of each queue. Assume that the real-time length of the i-th queue at time t is defined as c i (t), the total buffer capacity of the queue is C i (t), then the remaining buffer of each queue can be calculated as S according to the following formula: i (t), that is:

[0058] S i (t) = C i (t)-c i (t)

[0059] Finally, the dynamic admission threshold is calculated for each queue in descending order of priority, with i∈[1,n] as the queue index and n as the total number of queues on the egress port. The specific dynamic admission threshold calculation method is as follows:

[0060] The dynamic admission threshold of the first queue is the cumulative bit distribution Ω r The round r corresponding to the maximum distribution value that does not exceed the remaining cache space S1(t) of the first queue.

[0061] The dynamic admission threshold of any other queue i≥2 is the cumulative bit distribution Ω r The round r corresponding to the maximum distribution value that does not exceed the median value, the median value U i (t) is the dynamic admission threshold of the previous queue in the cumulative bit distribution Ω r The corresponding distribution value in The remaining buffer space S of the current queue i (t) and.

[0062] The dynamic admission threshold of the queue can be calculated by the cumulative bit distribution Ω rTo achieve this, we use the inverse function. Specifically:

[0063] For the first queue, the calculation method is to convert S i (t) in Ω r The inverse function is taken to get the round value r that meets the conditions, that is:

[0064] th1=max{r:Ω r ≤S1(t)}

[0065] For subsequent queues (i ≥ 2), the threshold calculation requires adding the bits corresponding to the dynamic admission threshold of the previous queue (i-1). That is, first calculate:

[0066]

[0067] Then to U i (t) in Ω r The inverse function is taken to obtain the round value r that meets the conditions. This round value r is the dynamic admission threshold of the i-th queue ≥ 2, and the calculation formula is:

[0068] th i =max{r:Ω r ≤U i (t)}

[0069] (3) Packet enqueuing decision.

[0070] In this phase, after the dynamic admission threshold is calculated, the packets in the flow are queued one by one in descending order of queue priority. The specific packet queueing decision-making process is as follows:

[0071] Traverse each data packet in the flow in turn, and search for a queue in descending order of queue priority to see if there is one in which the current data packet can be queued. If the end round of the current data packet (the aforementioned pkt_round) is less than or equal to the dynamic admission threshold of a queue (the aforementioned th i ), the current data packet is queued into the corresponding queue to complete the enqueue operation. If the end round of the current data packet is greater than the dynamic admission threshold of all queues at the switch egress end, the current data packet is discarded.

[0072] Note that each packet can only be queued to the first queue that meets the threshold conditions. If the threshold conditions for all queues are not met, the packet is directly discarded. This maximizes the use of space in each queue while ensuring the global order of packets, which is close to ideal fairness while improving cache utilization.

[0073] Figure 2An example of a packet being dynamically queued based on queue thresholds is shown. In this example, the dynamic admission thresholds for queues Q1, Q2, and Q3 are 3, 4, and 5, respectively. i , C and U correspond to the aforementioned c i (t), C i (t) and U i The results show that the dynamic fair queuing method proposed in this invention can be very close to the effect of ideal fairness, because in the ideal fair queue, the order of dequeuing data packets is C, B, D, A.

[0074] (4) Data packet dequeueing and queue priority adjustment.

[0075] This step adjusts queue priorities through a priority rotation mechanism. Initially, each queue is assigned an initial priority, typically in queue index order. Packets are then dequeued in descending order of queue priority. The highest-priority queue must be dequeued before the next-highest-priority queue can be dequeued. Whenever a queue is dequeued, a priority rotation operation is performed, lowering the priority of the highest-priority queue to the lowest and increasing the priorities of the remaining queues by one level, ensuring that the queue served is always the highest-priority one.

[0076] (5) Queue splitting and merging.

[0077] When a new packet arrives and needs to be enqueued, if the current highest-priority queue has remaining buffer space, a queue split operation is triggered. Because the queue is not yet empty, priority rotation cannot be performed. If there is free buffer in the queue, some packets can enter the queue. However, packets in subsequent queues have completed their rounds earlier. If the queue is enqueued directly, the overall order of the packets will be disrupted. To effectively utilize this buffer space while maintaining the global order of the packets, the present invention requires implementing a queue splitting and merging strategy in the switch. The specific implementation process is as follows:

[0078] When the current highest priority queue has remaining buffer space and a new packet arrives, the queue split operation is triggered. The remaining buffer space of the current highest priority queue is released to the shared memory pool and redefined as a new queue as an auxiliary queue. The priority of the new queue is set to the lowest and it can make enqueue decisions for packets based on its own dynamic admission threshold.

[0079] When the split highest priority queue is emptied of data packets, its remaining buffer space is merged into the auxiliary queue, so that the auxiliary queue becomes a complete formal queue, and the priority of the merged formal queue still follows the priority of the auxiliary queue.

[0080] Figure 3 The following diagram shows the specific process of queue splitting and merging strategies in this section:

[0081] When a new data packet arrives, check whether there is any remaining buffer space in the current highest priority queue. If there is, split it and release the remaining buffer space in the current highest priority queue back to the shared buffer pool. Then, create a new queue with this released buffer space, name this new queue the auxiliary queue and assign it the current lowest priority. For example, Figure 3 In the original queues Q1, Q2, and Q3, when a new data packet arrives after the period T=0, the highest priority queue Q1 needs to be split to form a new auxiliary queue Q4. Then, the data packets are enqueued according to the methods and processes in the above steps (1), (2), and (3). At this time, some data packets may enter the auxiliary queue.

[0082] When the data packets in the split original queue (i.e., the highest priority queue after the auxiliary queue is released) are emptied, its cache space is merged into the auxiliary queue to form a complete queue, the cache continuity is restored, the original queue is deleted, and the merged complete queue is set as the official queue and uses the priority of the auxiliary queue. Subsequent data packets can be enqueued according to the methods and processes in the above (1), (2) and (3). The newly enqueued data packets are placed at the end of the queue. For example, Figure 3 In the Q4 queue, three packets were already queued in period T = 1. The new packet arriving in period T = 2 needs to be queued after these three packets. Therefore, this queue splitting and merging strategy can effectively utilize cache space while further ensuring the global order of packets.

[0083] It should be noted that the steps of the above-mentioned dynamic fair queuing method for a shared memory switch can essentially be implemented in the form of a computer program or a software function module.

[0084] Therefore, based on the same inventive concept, the present invention also provides a computer electronic device corresponding to the dynamic fair queuing method for a shared memory switch provided in the above embodiment, which includes a memory and a processor;

[0085] The memory is used to store computer programs;

[0086] The processor is configured to implement the aforementioned dynamic fair queuing method for a shared memory switch when executing the computer program.

[0087] Furthermore, the logic instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for causing a computer device (which can be a network device suitable for controlling a switch, or the switch itself) to execute all or part of the steps of the methods described in various embodiments of the present invention.

[0088] Therefore, based on the same inventive concept, the present invention provides a computer-readable storage medium corresponding to a dynamic fair queuing method for a shared memory switch, wherein the storage medium stores a computer program. When the computer program is executed by a processor, the dynamic fair queuing method for a shared memory switch as described above can be implemented.

[0089] Therefore, based on the same inventive concept, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can implement the dynamic fair queuing method for a shared memory switch as described above.

[0090] Specifically, in the computer-readable storage medium of the above three embodiments, the stored computer program is executed by a processor to perform the steps of the above-mentioned dynamic fair queuing method for a shared memory switch.

[0091] It is understood that the storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Furthermore, the storage medium may be any medium capable of storing program code, such as a USB flash drive, a mobile hard drive, a magnetic disk, or an optical disk.

[0092] It is understandable that the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0093] It should also be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the various embodiments provided in this application, the division of steps or modules in the system and method is only a logical function division. In actual implementation, there may be other division methods, for example, multiple modules or steps can be combined or integrated together, and a module or step can also be split.

[0094] In summary, the present invention achieves approximately fair queuing through two key new mechanisms: dynamic admission thresholds and queue splitting and merging. This effectively overcomes the performance drawback of low network utilization and can operate at line speed in switches. The above-described specific embodiments are intended to illustrate the present invention, not to limit it. Any modifications and variations to the present invention that fall within the spirit and scope of the claims are intended to be included within the scope of protection of the present invention.

Claims

1. A dynamic fair queuing method for a shared memory switch, characterized in that: include: Traverse each data packet in each flow arriving at the switch ingress port in turn, and calculate the end round of the current data packet based on the end round of the previous data packet and the size of the current data packet; Enqueue operations are processed according to a preset time period. During each time period, a dynamic admission threshold is calculated for each queue based on the cumulative bit distribution corresponding to the departure round of arriving packets monitored in real time and the remaining buffer space in the switch egress queue. Enqueue decisions are then made for each packet in the flow based on the dynamic admission threshold, thereby ensuring fairness while reducing excessive packet loss. In the switch, data packets are dequeued in descending order of queue priority, and a queue priority dynamic adjustment strategy and a queue splitting and merging strategy are implemented during the enqueuing and dequeuing process; The dynamic queue priority adjustment strategy is as follows: when the highest priority queue is emptied of data packets, its priority is lowered to the lowest, and the priorities of other queues are raised in turn to ensure overall fairness; The queue splitting and merging strategy is as follows: when a newly arrived data packet needs to be queued, if the current highest-priority queue still has remaining cache space, a queue splitting operation is performed, and the remaining cache space is redefined as a new queue with the current lowest priority. After the current highest-priority queue is emptied, it is merged with the new queue again to improve cache utilization and reduce data packet discards.

2. The dynamic fair queuing method for a shared memory switch according to claim 1, wherein: For each data packet in each flow arriving at the ingress port of the switch, its end round is the sum of the size of the current data packet itself and the end round of the previous data packet of the current data packet.

3. The dynamic fair queuing method for a shared memory switch according to claim 1, wherein: The dynamic admission thresholds for all queues at the switch egress in each time period are calculated as follows: First, according to the end rounds of all newly arrived data packets in the current time period, the cumulative bit distribution Ω is obtained by statistics. r , the cumulative bit distribution Ω r Taking round r as the variable, the distribution value corresponding to round r represents the sum of the sizes of all newly arrived data packets whose ending rounds are less than or equal to r; Then, the current queue length and total buffer size of each queue on the switch's outbound port are read to calculate the remaining buffer space of each queue; Finally, the dynamic admission threshold is calculated for each queue in descending order of priority, where: The dynamic admission threshold of the first queue is the cumulative bit distribution Ω r The round r corresponding to the maximum distribution value of the remaining cache space that does not exceed the first queue; The dynamic admission threshold of any other queue i≥2 is the cumulative bit distribution Ω r The round r corresponding to the maximum distribution value that does not exceed the middle value, where the middle value is the dynamic admission threshold of the previous queue in the cumulative bit distribution Ω r The sum of the corresponding distribution value in and the remaining buffer space of the current queue.

4. The dynamic fair queuing method for a shared memory switch according to claim 1, wherein: The specific method of executing the enqueue decision for each data packet in the flow according to the dynamic admission threshold is: Traverse each data packet in the flow in turn, and search in descending order of queue priority to see if there is a queue where the current data packet can be enqueued. If the end round of the current data packet is less than or equal to the dynamic admission threshold of a queue, the current data packet is enqueued into the corresponding queue to complete the enqueuing operation. If the end round of the current data packet is greater than the dynamic admission threshold of all queues at the switch egress end, the current data packet is discarded.

5. The dynamic fair queuing method for a shared memory switch according to claim 1, wherein: In the described queue priority dynamic adjustment strategy, each queue at the switch egress is assigned an initial priority. While enqueuing operations are processed according to a preset time period, packets are dequeued in descending order of queue priority. When a queue is emptied of packets, a priority rotation operation is performed, reducing the priority of the highest-priority queue to the lowest and increasing the priorities of the remaining queues by one level.

6. The dynamic fair queuing method for a shared memory switch according to claim 1, wherein: In the queue splitting and merging strategy, the specific execution process is as follows: When the current highest priority queue has remaining buffer space and a new packet arrives, the queue split operation is triggered. The remaining buffer space of the current highest priority queue is released to the shared memory pool and redefined as a new queue as an auxiliary queue. The priority of the new queue is set to the lowest and it can make enqueue decisions for packets based on its own dynamic admission threshold. When the split highest priority queue is emptied of data packets, its remaining buffer space is merged into the auxiliary queue, so that the auxiliary queue becomes a complete formal queue, and the priority of the merged formal queue still follows the priority of the auxiliary queue.

7. The dynamic fair queuing method for a shared memory switch according to claim 1, wherein: When calculating the end round for all packets in each flow, the initial round value of the first packet is set to 0.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, it can implement the dynamic fair queuing method for a shared memory switch according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the dynamic fair queuing method for a shared memory switch according to any one of claims 1 to 7 is implemented.

10. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is configured to implement the dynamic fair queuing method for a shared memory switch according to any one of claims 1 to 7 when executing the computer program.