Network congestion processing method and device and readable medium
By configuring subqueries for network queues and establishing mapping relationships, accurate positioning of network congestion and accurate triggering of ECN are achieved, which solves the problem that traditional technology cannot recognize elephant flow, improves network service quality and reduces costs.
Patent Information
- Application Number
- CN202311190448.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2025-03-14
AI Technical Summary
Traditional ECN-based network congestion control cannot achieve accurate positioning of congestion, resulting in the inability to accurately identify the impact of elephant flow on rat flow.
In the case of congestion in the queue, at least two subqueries are configured for the parent queue, and a mapping relationship between the subquery and the parent queue is established, and the pending messages are allocated to the subquery, and the congested target subquery is determined to ECN mark its messages, and the target messages and uncongested subquery are fairly scheduled to the parent queue.
By accurately triggering ECN, accurately identifying elephant flows, avoiding the impact of elephant flow on mouse flow, thereby improving the service quality of the network and reducing the cost and complexity of the switch.
Smart Images

Figure CN119629123A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a network congestion processing method, device and readable medium. Background Art
[0002] ECN (Explicit Congestion Notification) means that after the traffic receiver senses congestion on the network, it notifies the traffic sender through a protocol message, so that the traffic sender reduces the message sending rate, thereby avoiding packet loss caused by congestion at an early stage and achieving maximum utilization of network performance. It has the following advantages: 1. All traffic senders can sense congestion in the intermediate path at an early stage and actively slow down the sending rate to prevent congestion. 2. In the queue forwarded on the intermediate switch, the packets that exceed the average queue length are marked with ECN and continue to be forwarded without discarding the packets, thus avoiding packet discard and packet retransmission. 3. Due to the reduction of packet loss, the sender does not need to retransmit the packet after a retransmission timer of several seconds or tens of seconds, which improves the user experience of delay-sensitive applications. 4. Compared with networks without ECN functions, the network utilization rate is better and no longer oscillates back and forth between overload and light load.
[0003] ECN is based on queues. There are a lot of flows in the queues, and each flow will be affected. But in reality, the congestion may be caused by a certain elephant flow, and traditional ECN-based network congestion control cannot accurately locate the congestion. Summary of the invention
[0004] The present disclosure provides a network congestion processing method, device and readable medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a network congestion processing method, comprising: in the case of congestion in a queue, configuring at least two sub-queues for a mother queue where congestion occurs, and establishing a mapping relationship between each of the sub-queues and the mother queue; the queue is a queue of an egress port of a network congestion processing device, and the mother queue is at least one of the queues;
[0006] Allocating the to-be-processed messages that should enter the parent queue to each of the child queues;
[0007] Determine a target sub-queue where congestion occurs, and perform an explicit congestion notification (ECN) mark on a target message in the target sub-queue;
[0008] The target message and messages in each of the sub-queues without congestion are fairly scheduled to the main queue.
[0009] On the other hand, an embodiment of the present disclosure also provides a network congestion processing device, comprising: one or more processors; a storage device, on which one or more programs are stored; when the one or more programs are executed by the one or more processors, the one or more processors implement the network congestion processing method as described above; one or more I / O interfaces, connected between the processor and the storage device, configured to implement information interaction between the processor and the storage device.
[0010] On the other hand, an embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed, implements the network congestion processing method as described above.
[0011] The network congestion processing method provided by the embodiment of the present disclosure includes: in the case of queue congestion, configuring at least two sub-queues for the mother queue where congestion occurs, and establishing a mapping relationship between each sub-queue and the mother queue; allocating the pending messages that should enter the mother queue to each sub-queue; determining the target sub-queue where congestion occurs, performing an explicit congestion notification ECN mark on the target message in the target sub-queue, and scheduling the target message and the messages in each sub-queue where congestion does not occur to the mother queue; the embodiment of the present disclosure establishes a mapping relationship between the congested mother queue and each sub-queue, allocates the pending messages that should enter the mother queue to each sub-queue, and uses the congested sub-queue to mark the message with ECN, so as to accurately trigger ECN, accurately identify the elephant flow, and avoid the influence of the elephant flow on the mouse flow in the same queue, thereby improving the service quality of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a schematic diagram of switch QoS egress queue scheduling in the related technology;
[0013] Figure 2 Schematic diagram of the network congestion processing process provided by the embodiment of the present disclosure Figure 1 ;
[0014] Figure 3 Schematic diagram of the network congestion processing process provided by the embodiment of the present disclosure Figure 2 ;
[0015] Figure 4 Schematic diagram of the network congestion processing process provided by the embodiment of the present disclosure Figure 3 ;
[0016] Figure 5 A schematic diagram of network congestion processing provided for a specific example of the present disclosure;
[0017] Figure 6 A schematic diagram of the structure of a network congestion processing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.
[0019] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0020] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.
[0021] The embodiments described herein may be described with reference to plan views and / or cross-sectional views by means of idealized schematic diagrams of the present disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances. Therefore, the embodiments are not limited to the embodiments shown in the accompanying drawings, but include modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the accompanying drawings have schematic properties, and the shapes of the regions shown in the figures illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.
[0022] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0023] Figure 1 FIG. 1 is a schematic diagram of switch QoS egress queue scheduling in the related technology. Figure 1 As shown, data center switches generally support common QoS (Quality of Service), with 8 queues per outlet, namely queues 0-7. Each queue sends packets to a target port (TP) and is sent out of the switch after shaping.
[0024] When the lossless queue of the data center switch is congested and the used buffer of the queue exceeds the ECN threshold, the data center switch will mark the forwarded message with an ECN mark, that is, set the ECN field to 11. The ECN mark indicates message congestion. After receiving the message carrying the ECN mark, the destination server sends a CNP (Congestion Notification Packets) message to the source server. After receiving the CNP message, the source server reduces the packet sending rate. In this way, the mouse flow in the same queue is inevitably affected by the elephant flow. The elephant flow refers to a large amount of continuous data transmission through the network link; the mouse flow is a small amount of short-term data transmission through the network link. Traffic in scenarios such as sending emails, browsing web pages, and chatting on WeChat belongs to mouse flow, while traffic in scenarios such as virtual machine migration, data migration, and MapReduce belongs to elephant flow.
[0025] In the related technology, the messages in the queue are mirrored to the CPU and then sent to the controller for elephant flow identification, or the ACL (Access Control Lists) rules are controlled and sent to the switch device for elephant flow control. The switch CPU and controller need to consume a lot of computing resources, and the switch chip needs to consume a lot of ACL resources. The solution is complex to implement and has high deployment requirements, which inevitably increases the cost of the switch.
[0026] In order to solve the above technical problems, an embodiment of the present disclosure provides a network congestion processing method, which is applied to a network congestion processing device. In the embodiment of the present disclosure, the network congestion processing device can be a message forwarding device such as a switch.
[0027] Figure 2 Schematic diagram of the network congestion processing process provided by the embodiment of the present disclosure Figure 1 ,like Figure 2 As shown, the network congestion processing method includes the following steps:
[0028] Step S11: when a queue is congested, at least two sub-queues are configured for the congested parent queue, and a mapping relationship between each sub-queue and the parent queue is established.
[0029] The queue is a queue of an egress port of a network congestion processing device, and the parent queue is at least one of the queues.
[0030] The CPU of the network congestion processing device periodically polls each queue of the network congestion processing device egress port. When it is detected that one or more queues are congested, for each queue where congestion occurs, the congested queue is called a parent queue, multiple child queues are configured for the parent queue, and a mapping relationship between each child queue and the parent queue is established.
[0031] Step S12: Allocate the to-be-processed messages that should enter the parent queue to each child queue.
[0032] Since the mapping relationship between each sub-queue and the main queue has been established, the to-be-processed messages that should enter the main queue are evenly distributed to each sub-queue.
[0033] Step S13, determining a target sub-queue where congestion occurs, and performing ECN marking on target packets in the target sub-queue.
[0034] The network congestion processing device determines the cache depth of each subqueue, determines the subqueue whose cache depth is greater than a preset threshold, and the subqueue is the target subqueue where congestion occurs, and marks the target message in the target subqueue with an ECN mark.
[0035] Step S14: Fairly dispatch the target message and messages in each sub-queue where no congestion occurs to the main queue.
[0036] The network congestion processing device fairly dispatches the messages of each sub-queue to the main queue. Due to the fair dispatch of each sub-queue, when the main queue is congested, it will backpressure a sub-queue to cause network congestion, thereby triggering the ECN of the sub-queue, while other sub-queues will not be affected. Accordingly, the traffic in the sub-queue with network congestion is the elephant flow, and the traffic in other sub-queues without network congestion is the mouse flow.
[0037] The network congestion processing method provided by the embodiment of the present disclosure includes: in the case of congestion in the queue, configuring at least two sub-queues for the mother queue where congestion occurs, and establishing a mapping relationship between each sub-queue and the mother queue; allocating the pending messages that should enter the mother queue to each sub-queue; determining the target sub-queue where congestion occurs, marking the target message in the target sub-queue with an explicit congestion notification ECN, and scheduling the target message and the messages in each sub-queue where congestion does not occur to the mother queue; the embodiment of the present disclosure establishes a mapping relationship between the congested mother queue and each sub-queue, allocates the pending messages that should enter the mother queue to each sub-queue, and uses the congested sub-queue to mark the message with ECN, which can accurately trigger ECN, accurately identify elephant flows, and avoid the influence of elephant flows on mouse flows in the same queue, thereby improving the service quality of the network. Compared with the related technology that uses the switch CPU or controller to identify elephant flows, the embodiment of the present disclosure has the advantages of low cost and easy deployment and implementation.
[0038] In some embodiments, Figure 3As shown, after the target message in the target sub-queue is ECN marked (i.e., step S13), before the target message and the messages in each sub-queue where congestion does not occur are scheduled to the parent queue (i.e., step S14), the network congestion processing method may further include the following steps:
[0039] Step S13', setting a first discarding priority for the target message, and setting a second discarding priority for the messages in each sub-queue where no congestion occurs, wherein the first discarding priority is lower than the second discarding priority.
[0040] The discard priority is represented by color, which is used to determine the order in which packets are discarded when a queue is congested. It has no effect on the mapping relationship between local priorities and queues. There are three colors, and the priorities defined by IEEE are Green, Yellow, and Red from low to high. In the disclosed embodiment, the first discard priority can be yellow or red, and the second discard priority can be green.
[0041] The ECN function is enabled by default on lossless Ethernet switch devices. The 8 queues of each egress port have the ECN function enabled. For green, yellow, and red packets, the ECN marking thresholds are different. The green threshold is the highest, the yellow threshold is the second, and the red threshold is the lowest. In this way, red packets are most likely to be marked by ECN.
[0042] Accordingly, after the target message and the messages in each sub-queue where congestion does not occur are fairly scheduled to the parent queue (i.e., step S14), the network congestion processing method may further include the following steps:
[0043] Step S15: the parent queue performs ECN marking on the messages scheduled to the parent queue according to the discarding priorities from low to high.
[0044] Since the discard priority of the target message coming out of the target sub-queue with congestion (i.e., the first discard priority) is lower than the discard priority of the message coming out of other sub-queues without congestion (i.e., the second discard priority), the parent queue gives priority to ECN marking for the target message coming out of the target sub-queue with congestion. In this way, the parent queue can give priority to ECN marking for the elephant flow, alleviating network congestion, that is, alleviating the impact of the elephant flow without ECN marking on the mouse flow.
[0045] In some embodiments, the network congestion processing device has an egress port configured with a counter corresponding to each queue, and the congestion of a queue is determined in the following manner: it is determined that the queue corresponding to the counter with an increased value is congested. That is, a counter is configured for each queue at the egress port of the network congestion processing device, and the network congestion processing device periodically polls the counter corresponding to each queue. If the value of the counter increases, the pre-mapping function of the corresponding queue is enabled, that is, multiple sub-queues are configured for the queue, and a mapping relationship between each sub-queue and the queue is established.
[0046] In some embodiments, configuring at least two sub-queues for the congested parent queue (i.e., step S11) includes the following steps: configuring at least two consecutive idle sub-queues for the congested target queue, wherein the number of sub-queues may be 2 n , n is a natural number.
[0047] In some embodiments, the fair scheduling of the target message and the messages in each sub-queue that is not congested to the parent queue (i.e., step S14) may include the following steps: using a round-robin algorithm to fairly schedule the target message and the messages in each sub-queue that is not congested to the parent queue.
[0048] The chip business process of the switch determines the forwarding queues 0-7 of the message. If the queue pre-mapping function is not enabled, the message directly enters queues 0-7; if the queue pre-mapping function is enabled, the message is mapped to 128 sub-queues according to the five-tuple information. The 128 sub-queues use RR fair scheduling. If the parent queue has network congestion, it will trigger congestion in a sub-queue (usually the elephant flow queue), so that the sub-queue can accurately trigger ECN, and the message of this sub-queue is marked as yellow and enters the parent queue.
[0049] In some embodiments, the allocation of the pending messages that should enter the mother queue to each sub-queue (i.e., step 12) includes the following steps: according to the five-tuple information of the pending messages that should enter the mother queue, the pending messages are allocated to each sub-queue through a hash algorithm, that is, the pending messages are allocated to continuous idle sub-queues to achieve discrete and uniform allocation of messages. The five-tuple information may include: source MAC address, destination MAC address, source IP address, destination IP address, and IP protocol number.
[0050] In some embodiments, Figure 4 As shown, after the target message and the messages in each sub-queue where congestion does not occur are fairly scheduled to the main queue (i.e., step S14), the network congestion processing method may further include the following steps:
[0051] Step S15': when the messages in the parent queue have no ECN mark, delete each sub-queue and release the resources occupied by each sub-queue.
[0052] If the elephant flow disappears, the CPU of the network congestion processing device will delete the sub-queues and release the resources of each sub-queue, and the related messages will be directly forwarded and processed by the main queue.
[0053] To clearly illustrate the solution of the embodiment of the present disclosure, the following Figure 5 The process of handling network congestion is explained through a specific example.
[0054] like Figure 5 As shown in the figure, assuming that queue 7 of switch egress port 10 is congested due to elephant flow, queue 7 will trigger the ECN mark. The local CPU of the switch polls the ECN counters of the 8 queues of each egress port of the switch with a period of 1 second. It is found that the counter value of queue 7 of port 10 has increased. Then the queue pre-mapping function of queue 7 of port 10 is enabled, that is, 128 idle sub-queues are allocated to queue 7 (i.e., the parent queue), such as 1000-1127. Queue 7 is mapped to these 128 sub-queues through the 5-tuple information hash of the message, thereby establishing a mapping relationship between queue 7 and the 128 sub-queues. The 128 sub-queues are scheduled through the RR algorithm and all point to queue 7.
[0055] If the elephant flow is mapped to subqueue 1001, and other flows are mapped to other subqueues. Then, due to the congestion in queue 7, subqueue congestion will be triggered. If RR fair scheduling is used, the elephant flow in subqueue 1001 will be congested, and other mouse flows will be forwarded normally. Therefore, the ECN mark will be triggered in subqueue 1001, and the ECN field value of the message will be set to 11. In this way, the downstream device will notify the upstream switch to reduce the traffic transmission for the elephant flow in subqueue 1001. In addition, the message in subqueue 1001 (i.e., the elephant flow) is marked as yellow and enters queue 7, and the messages in other subqueues (i.e., the mouse flow) are marked as green and enter queue 7. Queue 7 will give priority to ECN marking for the yellow elephant flow, and the green mouse flow will not be affected.
[0056] By enabling the queue pre-mapping function, the packets in the queue with network congestion are hashed into 128 sub-queues. The elephant flows are accurately identified through the sub-queues. The impact of the elephant flows on the mouse flows can be reduced from 100% to less than 1%.
[0057] The disclosed embodiment proposes an improved ECN implementation scheme. When the local CPU of the switch monitors that a queue at the output port of the switching chip has network congestion, the queue pre-mapping function of this queue (parent queue) is enabled, and continuous idle queues are allocated as sub-queues to which this parent queue is mapped, and the traffic is hashed and mapped to each sub-queue through the message five-tuple (source and destination MAC address, source and destination IP address, IP protocol number). Since the network congestion of the parent queue will back pressure a sub-queue to have network congestion, thereby triggering the ECN of a specific sub-queue, and other sub-queues will not be affected in any way. The CPU of the subsequent switch monitors the network congestion of each sub-queue, and the congested sub-queue will be marked with ECN, and the color of the message will be changed to yellow to enter the parent queue. Since the priority of the yellow message is lower than that of the green message, the ECN of the parent queue will also take effect before the yellow message. Through the above scheme, ECN can be controlled more accurately, and the mouse flow on the parent queue will not be affected by the elephant flow.
[0058] The present disclosure also provides a network congestion processing device, such as Figure 6 As shown, the network congestion processing device includes: one or more processors 601, a storage device 602 and one or more I / O interfaces 603; wherein, one or more programs are stored on the storage device 602, and when the one or more programs are executed by the one or more processors, the one or more processors 601 implement the network congestion processing method provided in the aforementioned embodiments; the I / O interface 603 is connected between the processor 601 and the storage device 602, and is configured to implement information interaction between the processor 601 and the storage device 602.
[0059] Among them, the processor 601 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the storage device 602 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 603 is connected between the processor 601 and the storage device 602, and can realize information interaction between the processor 601 and the storage device 702, including but not limited to a data bus (Bus), etc.
[0060] The embodiments of the present disclosure further provide a computer-readable medium on which a computer program is stored, wherein when the computer program is executed, the network congestion processing method provided in the aforementioned embodiments is implemented.
[0061] It will be appreciated by those skilled in the art that all or some of the steps in the method disclosed above, the functional modules / units in the device may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0062] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. A method for handling network congestion, characterized in that: The method comprises: In the case of congestion in a queue, at least two sub-queues are configured for the congested mother queue, and a mapping relationship between each of the sub-queues and the mother queue is established; the queue is a queue of an egress port of a network congestion processing device, and the mother queue is at least one of the queues; Allocating the to-be-processed messages that should enter the parent queue to each of the child queues; Determine a target sub-queue where congestion occurs, and perform an explicit congestion notification (ECN) mark on a target message in the target sub-queue; The target message and messages in each of the sub-queues without congestion are fairly scheduled to the main queue.
2. The method according to claim 1, characterized in that After the target message in the target sub-queue is marked with an explicit congestion notification (ECN), the target message and messages in each of the sub-queues where congestion does not occur are scheduled before the parent queue, and the method further includes: Setting a first discard priority for the target message, and setting a second discard priority for the messages in each of the sub-queues where no congestion occurs, wherein the first discard priority is lower than the second discard priority; After scheduling the target message and the messages in each of the sub-queues where congestion does not occur to the parent queue, the method further includes: The mother queue performs ECN marking on the messages scheduled to the mother queue according to the discarding priorities from low to high.
3. The method according to claim 2, characterized in that The discarding priority is represented by color, the first discarding priority is yellow or red, and the second discarding priority is green.
4. The method according to claim 1, characterized in that The network congestion processing device output port is configured with a counter corresponding to each of the queues one by one, and the queue congestion is determined in the following manner: it is determined that the queue corresponding to the counter with an increased value is congested.
5. The method according to claim 1, characterized in that The configuring at least two sub-queues for the congested parent queue includes: Configure at least two consecutive idle sub-queues for the target queue where congestion occurs.
6. The method according to claim 1, characterized in that The fair scheduling of the target message and messages in each of the sub-queues without congestion to the parent queue includes: A polling scheduling algorithm is adopted to fairly schedule the target message and the messages in each of the sub-queues that are not congested to the main queue.
7. The method according to claim 1, characterized in that The allocating the to-be-processed messages that should enter the parent queue to each of the child queues includes: According to the five-tuple information of the to-be-processed messages that should enter the parent queue, the to-be-processed messages are distributed to each of the sub-queues through a hash algorithm.
8. The method according to any one of claims 1 to 7, characterized in that: After the target message and the messages in each of the sub-queues where congestion does not occur are fairly scheduled to the parent queue, the method further includes: When the messages in the parent queue have no ECN mark, each of the sub-queues is deleted, and the resources occupied by each of the sub-queues are released.
9. A network congestion processing device, comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the network congestion processing method according to any one of claims 1 to 8; One or more I / O interfaces are connected between the processor and the storage device and are configured to implement information interaction between the processor and the storage device.
10. A computer readable medium having a computer program stored thereon, wherein: When the program is executed, the network congestion processing method according to any one of claims 1 to 8 is implemented.