Congestion control method, device, switching device, medium and readable storage medium

By calculating the congestion value of the data stream in the switching equipment and performing queue switching, combined with source control by the detection server, the problem of not being able to accurately locate the congested data stream in the switching equipment is solved, thus achieving rapid congestion relief and ensuring network transmission performance.

CN121217657BActive Publication Date: 2026-02-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511773127.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-02-17
Estimated Expiration
2045-11-28

AI Technical Summary

Technical Problem

In existing technologies, in network transmission based on the RoCEv2 protocol, switching devices cannot accurately locate the data streams that cause congestion, leading to PFC deadlock and a decline in network transmission performance.

Method used

By determining the first congestion value and priority of data packets in the switching equipment, calculating the second congestion value of the data stream, and switching the congested data stream to a lower priority port queue, while using the detection server for further source control, the congested data stream can be accurately located and processed.

Benefits of technology

It enables rapid relief of switching device queue congestion, reduces the probability of PFC deadlock, ensures lossless network transmission performance, and precisely handles congested data streams through source control to avoid affecting other data streams.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121217657B_ABST
    Figure CN121217657B_ABST
Patent Text Reader

Abstract

This application provides a congestion control method, apparatus, switching device, medium, and readable storage medium, applicable to the field of communications. The method includes: in response to receiving a backpressure signal from a downstream device, determining a first congestion value for each of at least one data packet based on attribute information of data packets in a first port queue; determining a second congestion value for each of at least one data stream corresponding to the at least one data packet based on the first congestion value and priority; if a target data stream exists in at least one data stream whose second congestion value satisfies the congestion condition, switching the port queue used for forwarding data packets corresponding to the target data stream from the first port queue to the second port queue; and sending a warning event to a detection server, so that the detection server, when forwarding data packets corresponding to the target data stream through the second port queue, controls the rate at which the upstream device sends data packets corresponding to the target data stream based on the congestion detection result for the target data stream.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of communication, and more particularly to a congestion control method and device, a switching device, a medium and a readable storage medium. BACKGROUND

[0002] Current distributed storage, high-performance computing, artificial intelligence and other scenarios use cluster network communication protocols (RDMA over Converged Ethernet version 2, RoCEv2) for remote memory direct access (Remote Direct Memory Access, RDMA) on Ethernet to reduce transmission latency and central processing unit (Central Processing Unit, CPU) burden. When network transmission is performed based on the RoCEv2 protocol, the switching device can use priority-based flow control (Priority-based Flow Control, PFC) to ensure transmission performance and avoid data loss.

[0003] When transmission flow control is performed based on PFC, the switching device can appear transmission flow congestion, at which time the switching device can perform packet loss and forwarding processing on all data streams or all data packets in the queue that causes congestion. However, the above congestion control method affects the flow of the entire queue, and it is difficult to accurately locate the data stream that causes congestion and accurately process it. SUMMARY

[0004] In view of the above problems, the present application provides a congestion control method and device, a switching device, a medium and a readable storage medium.

[0005] One aspect of the present application provides a congestion control method applied to a switching device, the switching device comprising a plurality of port queues, each port queue being configured to forward data packets received from an upstream device to a downstream device in a received order, and each port queue being configured to forward data packets of at least one priority, the method comprising: in response to receiving a backpressure signal sent by the downstream device, determining first congestion values of at least one data packet in a first port queue according to attribute information of the at least one data packet, the first port queue being a port queue indicated by the backpressure signal to generate congestion; determining second congestion values of at least one data flow corresponding to the at least one data packet according to the first congestion values of the at least one data packet and the priority; in a case where there is a target data flow of which the second congestion value satisfies a congestion condition in the at least one data flow, switching a port queue used to forward data packets of the target data flow from the first port queue to a second port queue, wherein the priority of the second port queue is lower than that of the first port queue; and sending a warning event indicating that the second congestion value satisfies the congestion condition to a detection server, so that the detection server controls a rate at which the upstream device sends data packets of the target data flow according to a congestion detection result for the target data flow in a case where the data packets of the target data flow are forwarded through the second port queue.

[0006] According to an embodiment of the present application, the determining of the second congestion values of the at least one data flow corresponding to the at least one data packet according to the first congestion values of the at least one data packet and the priority comprises: determining a highest priority of the data packets that can be forwarded by the first port queue according to a target mapping relationship stored in the switching device, wherein the target mapping relationship is a mapping relationship between the priority of the first port queue and the priority of the data packets that can be forwarded; determining congestion weights of the at least one data packet according to the priority of the at least one data packet and the highest priority; and determining the second congestion values of the at least one data flow according to the first congestion values of the at least one data packet and the congestion weights.

[0007] According to an embodiment of the present application, the determining of the congestion weights of the at least one data packet according to the priority of the at least one data packet and the highest priority comprises: determining queue states of the at least one data flow according to a queue state field in data flow attribute information stored in the switching device, wherein the queue state comprises at least one of the following: a normal state, a switching cooling state and a switching state; for the data packets corresponding to the data flow in the normal state and / or the switching cooling state, determining the congestion weights of the data packets according to the priority of the data packets and the highest priority; and for the data packets corresponding to the data flow in the switching state, determining a preset weight as the congestion weight of the data packets.

[0008] According to an embodiment of the present application, the preset weight is greater than the congestion weight determined according to the priority of the data packet and the highest priority, so that the change speed of the second congestion value of the data flow in the switching state is greater than the change speed of the second congestion value of the data flow in the normal state and / or the switching cooling state.

[0009] According to an embodiment of the present application, the congestion weight of the data packet is determined according to the priority of the data packet and the highest priority, comprising: using the highest priority to standardize the relative difference between the priority of the data packet and the highest priority to obtain the congestion weight of the data packet.

[0010] According to an embodiment of the present application, the second congestion value of each of the at least one data flow is determined according to the first congestion value and the congestion weight of each of the at least one data packet, comprising: determining the historical second congestion value of each of the at least one data flow according to the congestion value field in the data flow attribute information stored by the switching device; determining the current congestion value of each of the at least one data flow according to the first congestion value and the congestion weight of each of the at least one data packet corresponding to the same data flow; and summing the historical second congestion value and the current congestion value of each of the at least one data flow to obtain the second congestion value of each of the at least one data flow.

[0011] According to an embodiment of the present application, the method further comprises: performing timeliness detection on the congestion value field to obtain a timeliness detection result; and resetting the field value of the congestion value field to zero in a case where the timeliness detection result indicates that the congestion value field has not changed within a first predetermined time length.

[0012] According to an embodiment of the present application, the method further comprises: for the data flow in which the second congestion value does not satisfy the congestion condition, updating the congestion value field using the second congestion value until the updated congestion value of the data packet updated by the first port queue satisfies the congestion condition, and / or until the updated congestion value field is reset to zero through timeliness detection on the updated congestion value field.

[0013] According to an embodiment of the present application, the attribute information comprises the data packet length parsed from the data packet, and the first congestion value of each of the at least one data packet is determined according to the attribute information of the at least one data packet in the first port queue, comprising: determining the first congestion value of each of the at least one data packet according to the ratio of the data packet length of each of the at least one data packet to the queue length of the first port queue.

[0014] According to an embodiment of the present application, the switching device updates the second congestion value of the target data flow when forwarding the data packet corresponding to the target data flow through the second port queue; and sends the early warning event to the detection server again when the updated second congestion value of the target data flow again satisfies the congestion condition; and the congestion detection result of the target data flow is determined by the following method: the detection server determines the congestion detection result of the target data flow according to the number of times of receiving the early warning event within the second predetermined time length.

[0015] According to an embodiment of the present application, the method further comprises: the detection server is configured to send control information to the upstream device of the target data flow when the congestion detection result indicates that the target data flow is a congested data flow, wherein the control information is used to reduce the rate of sending the data packet corresponding to the target data flow by the upstream device of the target data flow.

[0016] According to an embodiment of the present application, the method further comprises: switching the port queue used for forwarding the data packet corresponding to the target data flow back to the first port queue when the waiting time length after switching the first port queue to the second port queue satisfies the time condition.

[0017] According to an embodiment of the present application, switching the port queue used for forwarding the data packet corresponding to the target data flow back to the first port queue when the waiting time length satisfies the time condition comprises: updating the queue state from the queue switching state to the queue cooling state when the waiting time length reaches a first time threshold; switching the port queue used for forwarding the data packet corresponding to the target data flow back to the first port queue when the waiting time length reaches a second time threshold, wherein the second time threshold is greater than the first time threshold; and updating the queue state from the queue cooling state to the normal state.

[0018] According to an embodiment of the present application, switching the port queue used for forwarding the data packet corresponding to the target data flow from the first port queue to the second port queue when there is a target data flow in the at least one data flow whose second congestion value satisfies the congestion condition comprises: obtaining the queue state of the target data flow when there is a target data flow in the at least one data flow whose second congestion value satisfies the congestion condition; and switching the port queue used for forwarding the data packet corresponding to the target data flow from the first port queue to the second port queue when the queue state is the normal state.

[0019] According to an embodiment of the present application, the method further comprises: updating the queue state of the target data flow to the queue switching state after switching the first port queue to the second port queue; and clearing the field value of the congestion value field of the target data flow to reset the historical second congestion value, so that the second congestion value of the target data flow is updated according to the reset historical second congestion value and the newly determined current congestion value when congestion occurs in the second port queue.

[0020] According to an embodiment of the present application, the correspondence between the at least one data packet and the at least one data flow is determined by: parsing the data packet to obtain data packet forwarding information, wherein the data packet forwarding information comprises at least one of a source address, a destination address, a source port, a destination port, and a transmission protocol; and determining at least one data packet having the same data packet forwarding information as the data packet as a data packet corresponding to the same data flow.

[0021] The second aspect of the present application provides a congestion control device applied to a switching device, the switching device comprising a plurality of port queues, each port queue being configured to forward data packets received from an upstream device to a downstream device in a received order, and each port queue being configured to forward data packets having at least one priority, the device comprising: a first determining module configured to, in response to receiving a backpressure signal sent by the downstream device, determine a first congestion value of each of the at least one data packet according to attribute information of the at least one data packet in a first port queue, the first port queue being a port queue indicated by the backpressure signal to generate congestion; a second determining module configured to determine a second congestion value of each of at least one data flow corresponding to the at least one data packet according to the first congestion value of each of the at least one data packet and the priority; a switching module configured to, in a case where there is a target data flow in the at least one data flow whose second congestion value satisfies a congestion condition, switch a port queue used to forward data packets corresponding to the target data flow from the first port queue to a second port queue, wherein the priority of the second port queue is lower than that of the first port queue; and a sending module configured to send a warning event indicating that the second congestion value satisfies the congestion condition to a detection server, so that the detection server, in a case where the data packets corresponding to the target data flow are forwarded through the second port queue, controls a rate at which the upstream device sends the data packets corresponding to the target data flow according to a congestion detection result for the target data flow.

[0022] The third aspect of the present application provides a switching device, comprising: one or more processors; and a memory configured to store one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method.

[0023] The fourth aspect of the present application further provides a computer-readable storage medium having stored thereon a computer program or instructions, wherein the computer program or instructions, when executed by a processor, implement the steps of the method.

[0024] The fifth aspect of the present application further provides a computer program product comprising a computer program or instructions, wherein the computer program or instructions, when executed by a processor, implement the steps of the method.

[0025] In the embodiments of the present application, in the case that the exchange device receives the back pressure signal sent by the downstream device, the exchange device does not directly forward the back pressure signal to the upstream device for flow control, but determines the congestion value in the data packet granularity and the data flow granularity in sequence, and determines whether to perform data flow switching according to the second congestion value of the data flow granularity, so that the data flow causing congestion can be preliminarily and quickly located, and simple data flow queue switching can be performed at the exchange device. By accurately locating the data flow and performing queue switching, the congestion of the first port queue can be preliminarily relieved in a short time, the probability of PFC deadlock occurrence is reduced, and the transmission performance of the lossless network is ensured without affecting the upstream device to continue transmitting data packets to the downstream device. Further, the target data flow after switching is further detected by the detection server, so that the source control of the transmission rate of the target data flow by the upstream device is realized, and the accurate positioning and processing of the data flow are realized, which neither affects other data flows in the first port queue and the second port queue nor relieves the congestion caused by the target data flow. BRIEF DESCRIPTION OF DRAWINGS

[0026] The above content and other purposes, features and advantages of the present application will be more apparent from the following description of the embodiments of the present application with reference to the accompanying drawings.

[0027] Figure 1 A flow chart of a congestion control method according to an embodiment of the present application is shown.

[0028] Figure 2 A scene schematic diagram of a congestion control method according to an embodiment of the present application is shown.

[0029] Figure 3 A flow chart of determining the second congestion value and performing congestion condition judgment according to an embodiment of the present application is shown.

[0030] Figure 4 A flow chart of performing queue switching and queue switching back according to an embodiment of the present application is shown.

[0031] Figure 5 A structure block diagram of a congestion control device according to an embodiment of the present application is shown.

[0032] Figure 6 A block diagram of an exchange device suitable for implementing a congestion control method according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0033] Embodiments of the present application will be described herein below with reference to drawings. It should be understood, however, that the description is merely exemplary and is not intended to limit the scope of the present application. In the following detailed description of embodiments of the application, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to one skilled in the art that one or more embodiments of the present application can be practiced without these specific details. In other instances, well-known structures and functions have not been described in detail in order to avoid obscuring the concepts of the present application.

[0034] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used herein, the term "includes" and tautological expressions thereof, such as "including," "includes," "include," "contains," "containing," and so forth, shall not be taken to exclude

[0035] All terms used herein including technical and scientific terms have the meanings commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein are defined as having a meaning that is consistent with the context of the specification in which the terms are utilized and the terms should not be interpreted in an idealized or overly formal sense.

[0036] In situations where similar terminology is used, such as "at least one of A, B, and C is used," it is generally intended that the inclusion of at least one of A, B, or C, and an appreciation for a number of values falling within the set of values, should be taken into account when interpreting this term. For example, "a system having at least one of A, B, or C" should be interpreted to potentially include a system having A alone, a system having B alone, a system having C alone, a system having both A and B, a system having both A and C, a system having both B and C, and / or a system having A, B, and C, etc.

[0037] RoCEv2 is a User Datagram Protocol (UDP) based connectionless protocol, which has higher transmission rate and less CPU resource occupation than Transmission Control Protocol (TCP), but it does not have the mechanism such as sliding window and acknowledgement response as TCP protocol to realize reliable transmission. Therefore, in order to bring out the real performance of RDMA and break through the network performance bottleneck of large-scale distributed system in data center, it is necessary to build a lossless network environment for RDMA. PFC is one of the necessary means to build a lossless Ethernet, which can provide hop-by-hop priority-based flow control. PFC allows creating 8 virtual channels on an Ethernet link, and assigning an 802.1p priority level to each virtual channel. When the traffic of a specific priority is congested, the receiving device can send a backpressure signal such as PFC pause frame (PAUSE frame) to the opposite device (sending device) to require the opposite device to stop sending traffic of the specific priority, so as to prevent buffer overflow and data loss.

[0038] However, PFC has a deadlock problem in some special scenarios. For example, due to a loop or other reasons, congestion occurs simultaneously on multiple switching devices, the interface buffer usage of each switching device exceeds the threshold, the switching devices wait for each other to release resources, and the data flow on all switching devices is thus permanently blocked. The current PFC deadlock resolution method is mainly to drop or force forward all data packets in the queue where the deadlock occurs (without distinguishing data flows). Such processing method is too rough, affects the entire queue traffic, and also cannot find the specific data flow that causes the PFC deadlock, so that the link may be trapped in periodic deadlock, thereby affecting the transmission performance of the RoCEv2 network.

[0039] In related technologies, PFC and Explicit Congestion Notification (ECN) can be used together to achieve lossless transmission and relieve congestion. ECN marks the congestion state by setting the ECN flag in the data packet header (rather than directly dropping the data packet). When the switching device detects that the exit queue is congested, it will mark the data packet, and the receiving device will feed back to the sending device after receiving the mark, triggering the sending device to reduce the transmission rate and relieve congestion from the source. Although the PFC+ECN technology can achieve lossless transmission of the RoCEv2 network, it still has some defects, such as PFC only supports coarse-grained classification based on port+priority, does not support per-flow control, and congestion may spread upstream through pause frames. Although ECN can reduce the transmission rate and relieve congestion from the source, there is a time difference between the switching device detecting congestion, marking the data packet, and the sending device receiving the feedback and adjusting the rate, which may cause congestion to be triggered to reduce the speed when the congestion has been aggravated, and cannot avoid the risk of packet loss caused by short-term traffic burst in time. Most importantly, the flow control of PFC and the congestion marking of ECN are both based on queue management, which cannot identify the specific data flow that causes congestion, and cannot control the specific data flow that causes congestion, ultimately affecting the transmission of the entire queue traffic due to part of the traffic.

[0040] Therefore, an embodiment of the present application provides a congestion control method applied to a switching device to achieve accurate positioning of the data flow causing congestion and processing.

[0041] Figure 1 A flowchart of the congestion control method according to an embodiment of the present application is shown.

[0042] As shown in Figure 1 The congestion control method 100 of the embodiment includes operations S110-S140.

[0043] In operation S110, in response to receiving the back pressure signal sent by the downstream device, a first congestion value of each of the at least one data packet is determined according to attribute information of the at least one data packet in the first port queue, and the first port queue is a port queue indicated by the back pressure signal to generate congestion.

[0044] In operation S120, a second congestion value of each of at least one data flow corresponding to the at least one data packet is determined according to the first congestion value of each of the at least one data packet and a priority.

[0045] In operation S130, in a case where the second congestion value of a target data flow of the at least one data flow satisfies a congestion condition, a port queue used for forwarding data packets corresponding to the target data flow is switched from the first port queue to a second port queue, and a priority of the second port queue is smaller than that of the first port queue.

[0046] In operation S140, a warning event indicating that the second congestion value satisfies the congestion condition is sent to a detection server, so that the detection server controls a rate of sending data packets corresponding to the target data flow by the upstream device according to a congestion detection result of the target data flow in a case where the data packets corresponding to the target data flow are forwarded through the second port queue.

[0047] According to an embodiment of the present application, a switching device is arranged between at least one upstream device and at least one downstream device, and is used to forward data packets received from the upstream device to the downstream device. For one data packet, the upstream device is a sending device, and the downstream device is a receiving device. Each data packet uniquely corresponds to one upstream device and one downstream device.

[0048] The switching device can include a plurality of ports used to forward data packets to downstream devices connected to each port. Each port can be provided with at least one port queue used to sequentially forward data packets to the downstream device through the port according to a receiving order. In one embodiment, each port can be provided with a plurality of port queues having different priorities, and each port queue can forward data packets of at least one priority.

[0049] The embodiment of the present application can implement data packet forwarding based on PFC. Each priority port queue can uniquely correspond to data packets of one priority, or one priority port queue can correspond to data packets of a plurality of priorities.

[0050] For example, the data packet header includes a priority field, which is used to indicate the priority of the data packet, such as the Class of Service (CoS) field in the Ethernet frame header, the Differentiated Services Code Point (DSCP) field in the Internet Protocol (IP) based packet. The CoS priority has 8 levels from 0 to 7, and the DSCP priority has 64 levels from 0 to 63. In a specific implementation, the mapping relationship between the priority of the data packet and the port queue can be that the CoS priority is one-to-one corresponding to the port queue (because the number of port output direction queues is generally 8); and the DSCP priority corresponds to one port queue every 8 priorities, such as 0-7 corresponding to queue 0, 8-15 corresponding to queue 1, and so on.

[0051] In the process of forwarding the data packet received from the upstream device to the downstream device, the downstream device can be congested, causing the port queue forwarding the data packet to the downstream device to be congested. At this time, the downstream device sends a back pressure signal to the switching device. For example, when the data packet forwarding of at least one priority is implemented based on PFC, the back pressure signal sent by the downstream device is the PAUSE frame of PFC. In response to receiving the PAUSE frame of PFC sent by the downstream device, the switching device can determine the first port queue causing congestion according to the PAUSE frame of PFC.

[0052] The first congestion value can indicate the flow proportion of the data packet in the first port queue. The attribute information of the data packet can include: data packet length, priority, identification, transmission address, transmission protocol, transmission port, and the like. In response to receiving the PAUSE frame of PFC, the switching device can parse the data packet of the first port queue to obtain the attribute information of the data packet. Then, the first congestion value of each data packet can be determined according to one or more attribute information.

[0053] One or more data packets in the first port queue can correspond to one or more data flows. In the embodiments of the present application, the second congestion value of each data flow can be accumulated according to the first congestion value of each data packet and the priority thereof, and the second congestion value can indicate the flow proportion of the data flow in the current first port queue.

[0054] For example, the first port queue can forward data packets of multiple priorities, and the data packets of multiple priorities can correspond to the same data flow. Therefore, the second congestion value of each data flow can be accumulated according to the first congestion value and the priority of the data packet.

[0055] The congestion condition can be a condition for queue switching. For example, the second congestion value satisfying the congestion condition can be that the second congestion value is greater than a congestion threshold, such as greater than 80%. Since each data flow can obtain a second congestion value, the second congestion value of one or more data flows in the at least one data flow can satisfy the congestion condition, that is, one or more target data flows can exist. For the one or more target data flows that need to be switched, the target data flow can be switched to a second port queue with a lower priority to alleviate the congestion of the first port queue.

[0056] The switching device can also communicate with a detection server. The detection server is configured to receive the events reported by the switching device and perform corresponding processing. For example, in the case that the second congestion value satisfies the congestion condition, the switching device generates and reports a warning event.

[0057] For example, in the case that the second congestion value of the target data flow satisfies the congestion condition, the switching device can perform queue switching and report a warning event to the detection server, so that the detection server can determine the congestion detection result of the target data flow after the queue switching to control the rate at which the upstream device sends data packets corresponding to the target data flow.

[0058] The congestion detection result is used to represent whether the target data flow after the queue switching is a congested data flow. The detection server can control the rate at which the upstream device sends data packets corresponding to the target data flow. If the target data flow is a congested data flow, the detection server can control the upstream device to reduce the rate at which the target data flow sends data packets to control the target data flow at the source; otherwise, the detection server can not control the source.

[0059] In the embodiments of the present application, in the case that the switching device receives the back pressure signal sent by the downstream device, the switching device does not directly forward the back pressure signal to the upstream device for flow control, but determines the congestion value in the data packet granularity and the data flow granularity in sequence, and determines whether to switch the data flow according to the second congestion value in the data flow granularity. In this way, the data flow causing the congestion can be preliminarily and quickly located, and simple data flow queue switching can be performed at the switching device. By accurately locating the data flow and performing queue switching, the congestion of the first port queue can be preliminarily alleviated in a short time, the probability of PFC deadlock can be reduced, and the transmission performance of the lossless network can be ensured without affecting the upstream device to continue transmitting data packets to the downstream device. Further, the detection server further detects the target data flow after the switching to control the sending rate of the target data flow at the source through the upstream device, so as to accurately locate and process the data flow, which does not affect other data flows in the first port queue and the second port queue and can alleviate the congestion caused by the target data flow.

[0060] According to an embodiment of the present application, the correspondence between the at least one data packet and the at least one data flow is determined by: parsing the data packet to obtain data packet forwarding information, wherein the data packet forwarding information comprises at least one of a source address, a target address, a source port, a target port, and a transmission protocol; and determining at least one data packet having the same data packet forwarding information as the data packet as a data packet corresponding to the same data flow.

[0061] The data packet forwarding information can also be referred to as a five-tuple of the data packet, the source address and the source port being an IP address and a port of the upstream device sending the data packet to the switching device, and similarly, the target address and the target port being an IP address and a port of the downstream device to receive the data packet, and the transmission protocol being a transmission protocol supported by the data packet.

[0062] The switching device, in response to receiving the back pressure signal sent by the downstream device, can parse each data packet in the first port queue to obtain attribute information of the data packet, wherein the attribute information of the data packet comprises the data packet forwarding information. A single five-tuple indicates a data flow, and a plurality of data packets having the same source address, target address, source port, target port, and transmission protocol can be determined as data packets corresponding to the same data flow indicated by the five-tuple.

[0063] Figure 2 A scenario diagram of the congestion control method according to an embodiment of the present application is shown. As shown in Figure 2 The switching device can implement congestion control through a plurality of functional modules. The switching device comprises a plurality of port queues for forwarding data packets received from an upstream device to a downstream device. A flow record module in the switching device is configured to record information of a congested data flow, such as determining a first congestion value, a second congestion value, and determining whether the second congestion value satisfies a congestion condition in response to receiving a back pressure signal sent by the downstream device indicating that the port queue is congested. In the case that there is a target data flow in which the second congestion value satisfies the congestion condition in the at least one data flow, the queue switching module is notified to switch the first port queue used for forwarding data packets corresponding to the target data flow to a second port queue, and at the same time, an information processing module of a detection server is notified of a pre-warning event, so that the detection server controls the rate at which the upstream device sends data packets corresponding to the target data flow according to a congestion detection result for the target data flow in the case that the target data flow is forwarded through the second port queue.

[0064] According to an embodiment of the present application, for operation S120, determining the second congestion value of each data flow corresponding to the at least one data packet according to the first congestion value and the priority of each data packet comprises: determining the highest priority of the data packets that can be forwarded by the first port queue according to the target mapping relationship stored in the switching device, wherein the target mapping relationship is a mapping relationship between the priority of the first port queue and the priority of the data packets that can be forwarded; determining the congestion weight of each data packet according to the priority of each data packet and the highest priority; and determining the second congestion value of each data flow according to the first congestion value and the congestion weight of each data packet.

[0065] The priority of each port queue of the switching device and the priority of the data packet have a mapping relationship, and the mapping relationship of the first port queue is referred to as the target mapping relationship. In an embodiment of the present application, the switching device can be preconfigured with the mapping relationship between the priority of the data packet and the port queue and store the same, so that after receiving the data packet from the upstream device, the data packet can be stored in the corresponding port queue according to the priority of the data packet for forwarding to the downstream device in order.

[0066] For example, the priority of the data packet can be the CoS priority or the DSCP priority. If there are less than 8 port queues in each port, the data packets with DSCP priorities 0-10 can be allocated to queue 0, that is, each 11 priorities correspond to one port queue. For the CoS priority, the CoS priority can be first converted into the DSCP priority, and then the mapping relationship between the DSCP priority and the port queue is reused. For example, CoS priority 0 corresponds to DSCP priority 0, CoS priority 1 corresponds to DSCP priority 8, and CoS priority 7 corresponds to DSCP priority 56, and at this time, the data packets with CoS priorities 0 and 1 are forwarded through queue 0. In the above example, if the first port queue is queue 0, there are 11 priorities of data packets that can be forwarded, and the highest priority is 10.

[0067] For each data packet in the first port queue, the congestion weight can be determined according to the difference between the data packet and the highest priority. Based on operation S110, the first congestion value of each data packet can be determined, and the congestion values of multiple data packets under the same data flow can be accumulated in a weighted summation manner, and then the second congestion value of each data flow is obtained.

[0068] In the embodiments of the present application, the first congestion value of each data packet is determined at the data packet granularity, and then the congestion weight in the current first port queue dimension is determined based on the highest priority between the priority of the data packet and the data packet that can be forwarded by the current first port queue, and the second congestion value of each data flow is accumulated. Through the above-mentioned manner, the hierarchical congestion value calculation of data packet first and then data flow can be realized, the second congestion value of each data flow is determined, which facilitates subsequent positioning of the data flow causing congestion at the data flow granularity and processing in the data flow dimension. Therefore, the embodiments of the present application not only can alleviate the congestion of the queue and reduce the probability of PFC deadlock, but also can not affect other data flows in the queue and avoid affecting the entire traffic of the first port queue.

[0069] According to the embodiments of the present application, the congestion weight of each data packet is determined according to the respective priority of the at least one data packet and the highest priority, comprising: determining the queue state of the at least one data flow according to the queue state field in the data flow attribute information stored by the switching device, wherein the queue state comprises at least one of the following: normal state, switching cooling state and switching state; for the data packet corresponding to the data flow in the normal state and / or switching cooling state, the congestion weight of the data packet is determined according to the priority and the highest priority of the data packet; for the data packet corresponding to the data flow in the switching state, the preset weight is determined as the congestion weight of the data packet.

[0070] In the embodiments of the present application, the data flow will exist queue switching, in order to realize the accurate control and accurate information recording of the data flow, the queue switching state of each data flow can be recorded through the queue state field. For example, the switching device can record the data flow attribute information in the form of data flow entry, and the data flow attribute information includes the above-mentioned queue state field. If there is no data flow entry for a certain data flow, a data flow entry can be added, and the attribute information involved is set to the initial value (such as 0).

[0071] The field value of the queue state field can indicate the queue state of the data flow, and the queue state comprises at least one of the following: normal state, switching cooling state and switching state. The normal state indicates that the data packet corresponding to the data flow is forwarded by the port queue in the pre-configured mapping relationship, the switching state indicates that the data packet corresponding to the data flow is forwarded by the port queue after queue switching, and the switching cooling state is a transition state between the normal state and the switching state, indicating a state of preparing to switch back to the normal state.

[0072] The data flow in multiple queue states corresponds to multiple congestion weight determination manners. For example, data flow 1 corresponds to a data packet forwarded through queue 0, and data flow 1 is in a normal state before queue 0 generates congestion. If queue 0 generates congestion, the manner of calculating the congestion weight of each data packet in queue 0 is the same (for example, calculated according to the priority of the data packet and the highest priority). If the second congestion value of data flow 1 meets the congestion condition, data flow 1 is switched through the queue, and data flow 1 corresponds to a data packet forwarded through queue 1, at this time, data flow 1 is a target data flow and is in a switched state. It can be understood that queue 0 generates congestion and data flow 1 is switched, which indicates that the congestion of queue 0 is likely to be caused by data flow 1, and therefore, after switching the queue, a preconfigured preset weight can be used as the congestion weight of the data packet corresponding to data flow 1, so as to be distinguished from the congestion weight calculation logic of other data packets in queue 1 and the congestion weight calculation logic of data flow 1 in queue 0.

[0073] In the embodiments of the present application, the data flow in multiple queue states corresponds to multiple congestion weight determination manners, so that the manner of calculating the congestion weight of the same data packet changes with the queue state of the data flow, facilitating differentiated control of the same data flow before and after switching the queue, and quickly and accurately locating the data flow causing the congestion.

[0074] According to the embodiments of the present application, the preset weight is greater than the congestion weight determined according to the priority of the data packet and the highest priority, so that the change speed of the second congestion value of the data flow in the switched state is greater than the change speed of the second congestion value of the data flow in the normal state and / or the switched cooling state.

[0075] It can be understood that since the target data flow has been switched, it indicates that the congestion of the port queue where the data flow is located before the queue switching is likely to be caused by the data flow, and if the queue generates congestion again after the switching, a greater congestion weight can be set to make the second congestion value of the data flow accumulated faster, so as to quickly locate whether the congestion is caused by the data flow again.

[0076] According to the embodiments of the present application, the congestion weight of the data packet is determined according to the priority of the data packet and the highest priority, including: using the highest priority to standardize the relative difference between the priority of the data packet and the highest priority to obtain the congestion weight of the data packet.

[0077] For example, the relative difference between the priority of the data packet and the highest priority can be divided by the highest priority, and the division result can be multiplied by an adjustment coefficient to obtain the congestion weight of the data packet.

[0078] The process of determining the congestion weight according to the priority of the data packet and the highest priority can refer to the following formula (1):

[0079] (1)

[0080] wherein, represents the congestion weight of the data packet, P represents the priority of the data packet, Pmax represents the highest priority of the forwardable data packet, and 0.125 is an adjustment coefficient.

[0081] For example, if the data packet is forwarded through the first port queue, the first port queue is used to forward data packets of 0-10 priorities, and the priorities of the three data packets in the first port queue are 0, 2 and 5 respectively. The congestion weights of the three data packets are respectively: (10-0) / 10x0.125=0.125, (10-2) / 10x0.125=0.1, (10-5) / 10x0.125=0.0625.

[0082] It should be noted that the congestion weight of the data packet corresponding to the data stream in the switching state is a preset weight, which can be a fixed value 1, that is, the preset weight is 1.

[0083] In the embodiments of the present application, the data packets of different priorities can be distinguished by the difference between the priority of the data packet and the highest priority, so as to guarantee the data packets of high priority and the data streams corresponding to the data packets of high priority to a certain extent.

[0084] In one specific embodiment, the first congestion value and the congestion weight of each data packet in the same data stream can be weighted and summed to obtain a second congestion value of the data stream. The congestion value after weighting of the first congestion value is as formula (2):

[0085] (2)

[0086] wherein, Sq is the congestion value after weighting of the first congestion value, is the congestion weight, S is the first congestion value, and 1 is a fixed weight parameter.

[0087] According to one embodiment of the present application, for operation S110, the first congestion value of each of the at least one data packet is determined according to the attribute information of the at least one data packet, comprising: determining the first congestion value of each of the at least one data packet according to the ratio of the data packet length of each of the at least one data packet to the queue length of the first port queue.

[0088] According to the embodiments of the present application, the attribute information includes the data packet length, and the queue length of the first port queue can be pre-configured. Thus, for each data packet in the first port queue, the ratio of the data packet length to the queue length of the first port queue can be taken as the first congestion value to indicate the flow proportion of the data packet in the port queue.

[0089] The first congestion value is calculated as formula (3):

[0090] (3)

[0091] wherein S represents the first congestion value of the data packet, L represents the data packet length, and Q represents the queue length of the first port queue.

[0092] In the embodiments of the present application, the influence degree of the data packet queue on the congestion can be accurately determined according to the length of the data packet itself and the queue length of the first port queue, and the traffic proportion of each data packet in the first port queue.

[0093] In one specific embodiment, for the same data flow, the first congestion value and the congestion weight of each data packet corresponding to the data flow are weighted and summed to determine the second congestion value of the data flow. At this time, the second congestion value can be the instantaneous congestion value of each data flow at the current moment.

[0094] In actual application process, the traffic proportion of different data flows in the same port queue at different moments is different. For example, in the t0-t5 period, the port queue includes a large number of data packets of data flow 1 and a small number of data packets of data flow 2; at t6 moment, the port queue includes a small number of data packets of data flow 1 and a large number of data packets of data flow 2; in the t7-t9 period, the port queue includes a large number of data packets of data flow 1 and a small number of data packets of data flow 2. If the judgment is made according to the instantaneous second congestion value at t6 moment, data flow 2 may be determined as the data flow that needs to be switched. However, the congestion of the downstream device may be caused by the large number of data packets of data flow 2 transferred at t6 moment, or may be caused by the accumulation / spreading of the large number of data packets of data flow 1 transferred in the t0-t5 period. The judgment and queue switching according to the instantaneous congestion value of the data flow may not be able to alleviate the congestion. For example, if the congestion is caused by the accumulation / spreading of the large number of data packets of data flow 1, the queue switching of data flow 2 cannot alleviate the congestion, and the subsequent t7-t9 period will aggravate the congestion. The t0-t5 period and the t7-t9 period data flow 1 squeezes the traffic of data flow 2, and the t6 moment switches data flow 2, which will cause the phenomenon of "big flow starving small flow", and the bandwidth allocation between different data flows is unbalanced.

[0095] Thus, according to the embodiments of the present application, determining the second congestion value of each of the at least one data flow according to the first congestion value and the congestion weight of each of the at least one data packet comprises: determining the historical second congestion value of each of the at least one data flow according to the congestion value field in the data flow attribute information stored by the switching device; determining the current congestion value of each of the at least one data flow according to the first congestion value and the congestion weight of each of the at least one data packet corresponding to the same data flow; and summing the historical second congestion value and the current congestion value of each of the at least one data flow to obtain the second congestion value of each of the at least one data flow.

[0096] The switching device can record the data flow attribute information in the form of a data flow entry, and the data flow attribute information comprises the congestion value field. For each data flow, the field value of the congestion value field is the historical second congestion value relative to the current time. For the at least one data flow corresponding to the at least one data packet in the first port queue, the historical second congestion value of each data flow can be obtained according to the data flow entry of the switching device.

[0097] For the same data flow, the weighted congestion values of each data packet in formula (2) can be summed to obtain the current congestion value of each data flow. Then, the historical second congestion value and the current congestion value of the same data flow can be summed to obtain the second congestion value of the data flow. Since the historical second congestion value is the accumulation of the congestion value in the historical period, the sum of the historical second congestion value and the current congestion value can obtain the second congestion value of each data flow accumulated in the period dimension, so as to compare the second congestion value in the period dimension with the congestion condition for subsequent queue switching.

[0098] It can be understood that the calculation method of the historical second congestion value is the same as that of the second congestion value, and only the accumulation results at different times are different.

[0099] In the embodiments of the present application, the accumulation of the instantaneous current congestion value and the historical second congestion value in the historical period makes the second congestion value be able to indicate the accumulation of the data flow in the period dimension. Thus, the target data flow that may cause congestion can be accurately located by comparing the second congestion value in the period dimension with the congestion condition, and the queue switching can be performed to relieve the congestion.

[0100] For example, still taking the proportion of data packets of the data stream in the port queue in the t0-t5 period, the t6 moment and the t7-t9 period as an example. If the congestion of the downstream device is caused by a large number of data packets of the data stream 2 forwarded at the t6 moment, the second congestion value obtained at the t6 moment (the historical second congestion value in the t0-t5 period is smaller, and the current congestion value at the t6 moment is larger) can locate the data stream and perform queue switching. If the congestion of the downstream device is caused by a large number of data packets of the data stream 1 forwarded in the t0-t5 period, the second congestion value obtained at the t6 moment (the historical second congestion value in the t0-t5 period is larger, and the current congestion value at the t6 moment is smaller) can also locate the data stream and perform queue switching.

[0101] Figure 3 A flowchart for determining the second congestion value and performing congestion condition judgment according to an embodiment of the application is shown. If the determination of the second congestion value and the congestion condition judgment are implemented by the traffic recording module, the traffic recording module can implement operations S310-S370 as shown in the following table. Figure 3

[0102] In operation S310, a back pressure signal is received.

[0103] In operation S320, the data packets in the first port queue are parsed to obtain the five-tuple, the packet length and the priority of the data packets.

[0104] In operation S330, the first congestion value of the data packets is calculated.

[0105] In operation S340, the second congestion value of the data stream corresponding to each data packet is determined according to the five-tuple and the first congestion value of the data packet.

[0106] In operation S350, it is judged whether the second congestion value of the data stream is greater than the congestion threshold value. If the second congestion value is greater than the congestion threshold value, operation S360 is performed, and if the second congestion value is less than or equal to the congestion threshold value, operation S370 is performed.

[0107] In operation S360, the queue switching module is notified, and a warning event is reported to the detection server. After operation S360 is performed, operation S370 is performed.

[0108] In operation S370, the process ends.

[0109] According to an embodiment of the application, the method further comprises: performing time effectiveness detection on the congestion value field to obtain a time effectiveness detection result; and resetting the field value of the congestion value field to zero in a case where the time effectiveness detection result indicates that the congestion value field has not changed within a first predetermined time length.

[0110] ​In the embodiments of the present application, since the second congestion value is a second congestion value in a time period dimension, if the congestion value field is not updated in time, the historical second congestion value will gradually accumulate over time, and eventually meet the congestion condition. However, the above-mentioned scenario of meeting the congestion condition is not a scenario of actually causing congestion, but a false positive due to time accumulation. Therefore, the embodiments of the present application need to perform timeliness detection on the congestion value field to clear the historical second congestion value accumulated for a long time.

[0111] For example, the timeliness detection can be achieved by whether the field value of the congestion value field changes within the first predetermined time length, and a timeliness detection result is obtained. The timeliness detection result includes a result indicating that the congestion value field does not change within the first predetermined time length, and a result indicating that the congestion value field changes within the first predetermined time length. The first predetermined time length can be determined according to an empirical value.

[0112] If the congestion value field does not change within the first predetermined time length, it indicates that the port queue does not receive the data packet corresponding to the data flow from the upstream device within the first predetermined time length, or the downstream device and the port queue are no longer congested. In the above two cases, the data flow does not cause congestion, and the switching device no longer calculates the first congestion value, the second congestion value and updates the congestion value field in response to the back pressure signal. Therefore, the field value of the congestion value field of the data flow can be reset to zero.

[0113] In the embodiments of the present application, by performing timeliness detection on the congestion value field of each data flow and resetting the congestion value field based on the timeliness detection result (congestion value aging mechanism), false positives of data flow congestion caused by long-time congestion values can be avoided, and the positioning accuracy of congested data flows can be improved.

[0114] According to the embodiments of the present application, the method further comprises: for the data flow in which the second congestion value does not meet the congestion condition, updating the congestion value field by using the second congestion value until the updated congestion value of the congestion value field updated by the data packet updated by the first port queue meets the congestion condition, and / or until the updated congestion value field is reset to zero by timeliness detection on the updated congestion value field.

[0115] The second congestion value of part of the data flows in the at least one data flow can meet the congestion condition, and the second congestion value of part of the data flows can not meet the congestion condition. For the data flow in which the second congestion value does not meet the congestion condition, the field value of the congestion value field can be replaced by the second congestion value determined based on the historical second congestion value and the current congestion value to update the congestion value field. The congestion value of the updated congestion value field is the historical second congestion value at the current time relative to the next time.

[0116] If the upstream device continues to forward the data packet to the downstream device through the switching device at the next moment, the first port queue of the switching device is updated, that is, the new data packet is added. For the next moment, the switching device can calculate the first congestion value of the new data packet, update the second congestion value and the congestion value field based on the first congestion value, and compare the updated second congestion value with the congestion condition. If the updated second congestion value satisfies the congestion condition, the queue switching is performed; otherwise, the above operation is continued. In the above process, the operation of calculating the second congestion value at the next moment and comparing the second congestion value with the congestion condition can refer to the operation at the current moment, which will not be described here.

[0117] The upstream device can also no longer forward the data packet to the downstream device through the switching device within the first preset time length (determined by the service of the upstream device). Through the timeliness detection of the updated congestion value field, the time detection record is obtained. At this time, the time detection result indicates that the updated congestion value field has not changed within the first predetermined time length, and the updated congestion value field can be reset to zero.

[0118] In the embodiments of the present application, for the data flow whose second congestion value does not satisfy the congestion condition, the second congestion value is continued to be accumulated in the time dimension or the timeliness detection is performed, so that the data flow whose second congestion value does not satisfy the congestion condition can realize the congestion control closed loop.

[0119] After the switching device determines the target data flow and performs the queue switching, the congestion of the first port queue can be initially relieved (the number of data packets forwarded by the first port queue is reduced). However, the target data flow may or may not be the data flow that causes the congestion. Therefore, the switching device does not directly control the source of the target data flow, but continues to detect the target data flow by the detection server.

[0120] According to the embodiments of the present application, the switching device updates the second congestion value of the target data flow in the case of forwarding the data packet corresponding to the target data flow through the second port queue; in the case that the updated second congestion value of the target data flow again satisfies the congestion condition, the switching device sends the early warning event to the detection server again; and the congestion detection result of the target data flow is determined by the following method: the detection server determines the congestion detection result of the target data flow according to the number of times of receiving the early warning event within the second predetermined time length.

[0121] The switching device updates the second congestion value of the target data flow to 0 in the case of forwarding the data packet corresponding to the target data flow through the second port queue, so that the congestion values of the same data flow in the first port queue and the second port queue are isolated.

[0122] For the target data flow after the queue switching, the switch device can continue to forward the data packets corresponding to the target data flow through the second port queue similar to the forwarding in the first port queue. If the second port queue after the queue switching is not congested, the second congestion value of the target data flow in the second port queue is always zero. If the second port queue after the queue switching is congested, the downstream device can send a back pressure signal for the second port queue, indicating that the second port queue is congested. In response to receiving the back pressure signal, the switch device re-determines the first congestion value of each data packet of the target data flow, and re-determines the second congestion value of the target data flow through the preset weight (the congestion weight in the switching state) and the first congestion value, to obtain an updated second congestion value.

[0123] The detection server can determine whether the target data flow has performed multiple queue switchings in a short time and whether the congestion condition has been met multiple times by receiving the number of early warning events in the second predetermined time length. The second predetermined time length can be determined according to experience, for example, can be 10 ms, 5 ms, etc.

[0124] For example, in the case that the number of early warning events received in the second predetermined time length is greater than or equal to 2, it indicates that the updated second congestion value of the target data flow again meets the congestion condition, and the switch device again sends an early warning event to the detection server. At this time, the first port queue before the queue switching and the second port queue after the queue switching are both congested, and the second congestion values of the target data flow in the two port queues both meet the congestion condition, so the detection server can determine that the target data flow is a congested data flow.

[0125] In the case that the number of early warning events received in the second predetermined time length is less than 2, it indicates that the second port queue after the queue switching is not congested, or the updated second congestion value of the target data flow does not meet the congestion condition, so the detection server can determine that the target data flow is not a congested data flow.

[0126] In the embodiments of the present application, by receiving the number of early warning events in the second predetermined time length, the influence of the target data flow on the port queues before and after the queue switching can be determined from two dimensions of whether the target data flow has performed multiple queue switchings in a short time and whether the congestion condition has been met multiple times, so that the data flow causing congestion can be accurately located.

[0127] In other embodiments of the present application, the upstream device and the downstream device include a plurality of switching devices therebetween, the plurality of switching devices can communicate with each other, and the data packets received by the upstream device are forwarded to the downstream device through data packet forwarding among the plurality of switching devices. The detection server can communicate with the plurality of switching devices. In the case that the plurality of switching devices forward the data packets corresponding to the same data flow, if the first port queue of at least two switching devices is congested, and the second congestion value of the same target data flow in at least two switching devices satisfies the congestion condition and queue switching occurs, the detection server can also receive the pre-warning events sent by the at least two switching devices respectively. At this time, the detection server receives the pre-warning events for more than or equal to 2 times within the second predetermined time length, the target data flow has queue switching in the plurality of switching devices, and it can also be determined that the target data flow is a congested data flow.

[0128] According to an embodiment of the present application, the method further includes: the detection server is configured to send control information to the upstream device of the target data flow in the case that the congestion detection result indicates that the target data flow is a congested data flow, wherein the control information is used to reduce the rate of sending data packets corresponding to the target data flow by the upstream device of the target data flow.

[0129] For example, in the case that the congestion detection result indicates that the target data flow is a congested data flow, the detection server can send control information to the upstream device of the target data flow according to the source address, source port and / or protocol information of the upstream device of the target data flow, reduce the rate of sending data packets corresponding to the target data flow, and achieve source control of the target data flow to relieve the congestion of the switching device and the downstream device. In the case that the congestion detection result indicates that the target data flow is not a congested data flow, the detection server can only record the pre-warning events and does not perform source control, but relieves the congestion in a short time through queue switching.

[0130] In a specific embodiment, if the upstream device does not respond to the control information sent by the detection server, the rate of sending data packets corresponding to the target data flow can be indirectly reduced by sending an access control list (ACL) rule to the network access device of the upstream device to reduce the forwarding rate of the network access device to the data packets sent by the upstream device. The network access device can be arranged between the upstream device and the switching device and is configured to forward the data packets sent by the upstream device in the network.

[0131] In the embodiments of the present application, the rate of sending data packets corresponding to the target data flow is controlled by the detection server in the case that the congestion detection result indicates that the target data flow is a congested data flow, so that source control is achieved, and the sending rate is reduced from the source to relieve the congestion of the switching device and the downstream device.

[0132] According to an embodiment of the present application, for operation S130, in the case that there is a target data flow in which the second congestion value meets the congestion condition in the at least one data flow, switching the port queue used for forwarding the data packets corresponding to the target data flow from the first port queue to the second port queue comprises: in the case that there is a target data flow in which the second congestion value meets the congestion condition in the at least one data flow, obtaining the queue state of the target data flow; in the case that the queue state is a normal state, switching the port queue used for forwarding the data packets corresponding to the target data flow from the first port queue to the second port queue.

[0133] For example, in the case that the second congestion value of data flow 1 is greater than the congestion threshold, data flow 1 is determined as the target data flow, and the queue state of data flow 1 is obtained from the data flow attribute information stored by the switching device. If data flow 1 is in a normal state, the correspondence between the data flow and the port queue can be modified so that the port queue used for forwarding the data packets corresponding to the target data flow is switched from the first port queue to the second port queue with a lower priority. For example, the correspondence between the data flow and the port queue can be recorded by a hardware device, and the correspondence recorded in the hardware device can be modified. If data flow 1 is in a switching state or a switching cooling state, it is not modified.

[0134] According to an embodiment of the present application, the method further comprises: after switching the first port queue to the second port queue, updating the queue state of the target data flow to a queue switching state; and clearing the field value of the congestion value field of the target data flow to reset the historical second congestion value, so that when congestion occurs in the second port queue, the second congestion value of the target data flow is updated according to the reset historical second congestion value and the newly determined current congestion value.

[0135] For example, still taking data flow 1 as an example, after the port queue used for forwarding the data packets corresponding to data flow 1 is switched from the first port queue to the second port queue, the queue state of data flow 1 is adaptively updated from the normal state to the queue switching state, and the congestion value field is reset. It should be noted that the congestion weight of the same data flow is different under different queue states, and therefore, after the queue is switched and the queue state is updated, the congestion value field is reset, which can avoid the influence of the historical second congestion value accumulated in the first port queue on the congestion value calculation of the second port queue.

[0136] In the case that the port queue used for forwarding the data packets corresponding to data flow 1 is switched to the second port queue, if the switching device receives a PAUSE frame of the PFC indicating that the second port queue generates congestion sent by the downstream device, the current congestion value is recalculated based on the above similar manner, and the recalculated current congestion value and the reset historical second congestion value (reset to 0) are summed to obtain the updated second congestion value of data flow 1 in the second port queue.

[0137] In the embodiments of the present application, the target data flow whose second congestion value satisfies the congestion condition is switched to the second port queue of a lower priority, on the one hand, the congestion state of the high-priority queue can be relieved in a short time; on the other hand, the influence degree of the target data flow on the queue congestion state can be investigated through queue switching, so as to confirm again whether the target data flow is the data flow causing congestion, and ensure accurate positioning of the data flow causing congestion.

[0138] According to the embodiments of the present application, the method further comprises: in a case where the waiting duration after the first port queue is switched to the second port queue satisfies a time condition, switching the port queue used for forwarding the data packet corresponding to the target data flow back to the first port queue.

[0139] After the port queue used for forwarding the data packet corresponding to the target data flow is switched to the second port queue of a lower priority, although the congestion state of the first port queue can be relieved, the newly added data flow in the second port queue will affect the data packet forwarding of the second port queue. Therefore, the time condition can be set, and the target data flow corresponding to the switched-out data packet can be automatically switched back to the original first port queue by comparing the waiting duration after the first port queue is switched to the second port queue with the time condition.

[0140] For example, the time condition can be a duration threshold, so as to switch back to the first port queue in a case where the waiting duration is greater than the duration threshold. Similar to the operation of modifying the first port queue to the second port queue, the correspondence between the target data flow and the port queue can be modified again, so that the port queue used for forwarding the data packet corresponding to the target data flow is switched back to the first port queue from the second port queue.

[0141] In one specific embodiment, for the operations of switching the first port queue to the second port queue and switching the second port queue back to the first port queue, the switching device reports the queue switching event and the data flow attribute information of the target data flow to the detection server.

[0142] For example, the warning event and the queue switching event can be sent to the detection server through a simple network management protocol (SNMP).

[0143] In the embodiments of the present application, the port queue used for forwarding the data packet corresponding to the target data flow is switched back to the first port queue in a case where the waiting duration after the first port queue is switched to the second port queue satisfies the time condition, which can reduce the influence on the second port queue.

[0144] In the case that the waiting duration satisfies the time condition, the port queue for forwarding the data packet corresponding to the target data flow is switched back to the first port queue according to the embodiments of the present application, which includes: in the case that the waiting duration reaches a first duration threshold, updating the queue state from the queue switching state to a queue cooling state; in the case that the waiting duration reaches a second duration threshold, switching the port queue for forwarding the data packet corresponding to the target data flow back to the first port queue, wherein the second duration threshold is greater than the first duration threshold; and updating the queue state from the queue cooling state to a normal state.

[0145] For example, after the queue switching of the target data flow, if the second congestion value again satisfies the congestion condition before the waiting duration reaches the first duration threshold, the upstream device of the target data flow can be controlled by the detection server; if the second congestion value does not satisfy the congestion condition, the queue state is automatically updated from the queue switching state to the queue cooling state, and in the case that the waiting duration continues to reach the second duration threshold, the port queue for forwarding the data packet corresponding to the target data flow is switched back to the first port queue, and the queue state is updated from the queue cooling state to the normal state.

[0146] The first duration threshold and the second duration threshold can be determined according to experience, for example, the first duration threshold can be 10 ms, and the second duration threshold can be 100 ms.

[0147] In the application process, if the switching cooling state and the second duration threshold are not set, if the target data flow is a data flow that is easy to cause congestion, the port queue for forwarding the data packet corresponding to the target data flow is switched from the first port queue to the second port queue, and after being switched back to the first port queue after the waiting duration of the first duration threshold, the target data flow quickly appears congestion, and the first port queue will be switched to the second port queue again in a short time, which has a great influence on the original data packet of the second port queue (the priority of the second port queue is lower than that of the first port queue, and the data packet corresponding to the target data flow is preferentially forwarded after the queue switching). If the first duration threshold is increased to avoid frequent switching between queues, the first duration threshold is too long, and the cumulative time is easy to cause the second congestion value of the target data flow in the second port queue to satisfy the congestion condition again.

[0148] Therefore, the embodiments of the present application can ensure that the target data flow can be automatically switched back to the original port queue by setting two duration thresholds, and reduce the influence on the switched queue; further, by setting the switching cooling state and the second duration threshold, the influence on the switched queue caused by the congestion peak period switching between the first port queue and the second port queue can also be avoided.

[0149] In one embodiment, the waiting time can be compared with the first time threshold and the second time threshold by recording the waiting time in two timers in the switching device.

[0150] Figure 4 A flow chart of queue switching and queue switching back is shown. If the queue switching and queue switching back are implemented by a queue switching module, the queue switching module can implement the operations S410-S470 as shown. Figure 4

[0151] In operation S410, a notification of switching a port queue of a target data flow is received.

[0152] In operation S420, it is determined whether the target data flow is in a normal state. If the target data flow is in the normal state, operation S430 is performed; otherwise, operation S470 is performed.

[0153] In operation S430, a port queue in a hardware device for forwarding the target data flow is modified.

[0154] In operation S440, a queue state of the target data flow in a data flow entry is modified.

[0155] In operation S450, a queue switching timer of the target data flow is started.

[0156] In operation S460, a queue cooling timer of the target data flow is started.

[0157] In operation S470, the process ends.

[0158] For example, after the queue switching module receives the notification from the flow recording module, the corresponding data flow entry is searched according to the five-tuple of the target data flow in the notification. It is first determined whether the target data flow is in the normal state. If the target data flow is in the normal state, the port queue in the hardware device for forwarding the target data flow is modified, and the subsequent data packet of the target data flow is placed in the second port queue with a lower priority for forwarding, so as to complete the switching of the port queue of the target data flow. If the target data flow is in the switching state or the switching cooling state, no modification is performed, and the process directly ends. After the queue switching is completed, the queue state of the target data flow in the data flow entry is modified, and the queue state is changed from the normal state to the switching state, which is used for the weighted calculation of the second congestion value in the flow recording module. At the same time, the queue switching timer of the target data flow is started. If the time length exceeds 10 ms (i.e., the waiting time after the queue switching is 10 ms), the queue state is updated from the switching state to the switching cooling state, and the queue switching cooling timer is started. When the cooling timer exceeds 100 ms (the waiting time after the queue switching is 110 ms), the queue state is updated from the switching cooling state to the normal state. ​

[0159] Figure 5 A structural block diagram of a congestion control device according to an embodiment of the present application is shown. The congestion control device is applied to a switching device, which includes a plurality of port queues for forwarding data packets received from an upstream device to a downstream device in a receiving order, and a single port queue for forwarding data packets with at least one priority. As shown in the figure, the congestion control device 500 of this embodiment includes: Figure 5

[0160] A first determining module 510 is configured to determine a first congestion value of each of at least one data packet according to attribute information of the at least one data packet in response to receiving a back pressure signal sent by the downstream device, the first port queue being a port queue indicated by the back pressure signal to generate congestion.

[0161] A second determining module 520 is configured to determine a second congestion value of each of at least one data flow corresponding to the at least one data packet according to the first congestion value of each of the at least one data packet and the priority.

[0162] A switching module 530 is configured to switch the port queue for forwarding data packets corresponding to a target data flow from the first port queue to a second port queue in a case where the target data flow exists in the at least one data flow and the second congestion value satisfies a congestion condition, the priority of the second port queue being smaller than that of the first port queue.

[0163] A sending module 540 is configured to send a warning event indicating that the second congestion value satisfies the congestion condition to a detection server, so that the detection server controls a rate of sending data packets corresponding to the target data flow by the upstream device according to a congestion detection result for the target data flow in a case where the data packets are forwarded by the second port queue.

[0164] ​According to an embodiment of the present application, any of the modules of the first determining module 510, the second determining module 520, the switching module 530 and the sending module 540 can be combined in one module, or any of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of the modules can be combined with at least part of the functions of the other modules, and implemented in one module. According to an embodiment of the present application, at least one of the first determining module 510, the second determining module 520, the switching module 530 and the sending module 540 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. or implemented by hardware or firmware, or implemented in any one of software, hardware and firmware or in a proper combination of any of them. Alternatively, at least one of the first determining module 510, the second determining module 520, the switching module 530 and the sending module 540 can be at least partially implemented as a computer program module which can perform the corresponding functions when the computer program module is run.

[0165] In the embodiments of the present application, the operations that can be implemented by the congestion control device are described above in relation to the congestion control method, and thus are not described herein again.

[0166] Figure 6 A block diagram of a switching device suitable for implementing the congestion control method according to an embodiment of the present application is shown.

[0167] As shown in Figure 6 The switching device according to an embodiment of the present application can be an electronic device, such as the electronic device 600. The electronic device 600 includes a processor 601 which can perform various appropriate actions and processes according to programs stored in a read only memory (ROM) 602 or loaded from a storage portion 608 to a random access memory (RAM) 603. The processor 601 can include, for example, a general purpose microprocessor (e.g. a CPU), an instruction set processor and / or a related chipset and / or a special purpose microprocessor (e.g. an application specific integrated circuit (ASIC)), etc. The processor 601 can also include an on-board memory for cache use. The processor 601 can include a single processing unit or multiple processing units for performing different actions of the method processes according to embodiments of the present application.

[0168] In the RAM 603, various programs and data required for the operation of the electronic device 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via the bus 604. The processor 601 performs various operations of the method flow according to the embodiments of the present application by executing the programs in the ROM 602 and / or the RAM 603. It should be noted that the programs can also be stored in one or more memories other than the ROM 602 and the RAM 603. The processor 601 can also perform various operations of the method flow according to the embodiments of the present application by executing the programs stored in the one or more memories.

[0169] According to the embodiments of the present application, the electronic device 600 can further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 can further include one or more of the following components connected to the input / output (I / O) interface 605: an input part 606 including a keyboard, a mouse, and the like; an output part 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage part 608 including a hard disk, and the like; and a communication part 609 including a network interface card such as a LAN card, a modem, and the like. The communication part 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as necessary. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 610 as necessary, so that a computer program read therefrom is installed in the storage part 608 as necessary.

[0170] The present application also provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments; or can exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, when the one or more programs are executed, the method according to the embodiments of the present application is implemented.

[0171] According to an embodiment of the present application, the computer readable storage medium can be a non-transitory computer readable storage medium, for example, can include but not limited to: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this application, a computer readable storage medium can be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present application, the computer readable storage medium can include one or more of the above-described ROM 602 and / or RAM 603 and / or memories other than the ROM 602 and the RAM 603.

[0172] Embodiments of the present application also include a computer program product, which includes a computer program containing program codes for executing the methods shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the methods provided by the embodiments of the present application.

[0173] The above-described functions defined in the system / device / apparatus of the embodiments of the present application are performed when the computer program is executed by the processor 601. According to an embodiment of the present application, the above-described system, device, module, unit, etc. can be implemented by computer program modules.

[0174] In one embodiment, the computer program can rely on tangible storage media such as optical storage media, magnetic storage media, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of signals on network media. The computer program containing program codes can be transmitted by any appropriate network media, including but not limited to wireless, wired, etc., or any suitable combination of the foregoing.

[0175] In such an embodiment, the computer program can be downloaded and installed from the network by the communication part 609, and / or installed from the detachable medium 611. When the computer program is executed by the processor 601, the above-described functions defined in the system of the embodiments of the present application are performed. According to an embodiment of the present application, the above-described system, device, apparatus, module, unit, etc. can be implemented by computer program modules.

[0176] According to embodiments of the present application, program code for implementing the computer programs provided by embodiments of the present application can be written in any combination of one or more programming languages, and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Program code can execute entirely on a user's computing device, partly on the user's device, as a stand-alone software package, partly on a remote computing device, or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider.

[0177] The computer program instructions can also be loaded onto a computer or other programmable information processing apparatus to cause a series of operations to be performed on the computer or other programmable information processing apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable information processing apparatus implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0178] Those skilled in the art will understand that features recited in the various embodiments of the present application can be combined and / or integrated in various ways, even if such combinations or integrations are not expressly noted in the present application. In particular, features recited in the various embodiments of the present application can be combined and / or integrated in ways that are not expressly noted in the present application, without departing from the spirit and teachings of the present application. All such combinations and / or integrations are within the scope of the present application.

[0179] The embodiments of the present application are described above. However, these embodiments are merely for illustration purposes, and are not intended to limit the scope of the present application. Although each of the embodiments is described above separately, this does not mean that the measures in each of the embodiments cannot be used advantageously in combination. Those skilled in the art can make various substitutions and modifications without departing from the scope of the present application, and these substitutions and modifications shall fall within the scope of the present application.

Claims

1. A congestion control method, characterized in that, An application is made to a switching device, the switching device including multiple port queues, the port queues being used to forward data packets received from an upstream device to a downstream device in the order of reception, a single port queue being used to forward data packets having at least one priority, the method comprising: In response to receiving a backpressure signal sent by the downstream device, a first congestion value is determined for each of at least one data packet based on the attribute information of at least one data packet in the first port queue, wherein the first port queue is the port queue where congestion is indicated by the backpressure signal. Based on the target mapping relationship stored in the switching device, the highest priority of the data packets that can be forwarded by the first port queue is determined, wherein the target mapping relationship is the mapping relationship between the priority of the first port queue and the priority of the data packets that can be forwarded; Based on the priority of at least one of the data packets and the highest priority, a congestion weight is determined for each of the at least one data packet. Based on the first congestion value and the congestion weight of each of the at least one data packet, a second congestion value is determined for each of the at least one data stream corresponding to the at least one data packet; the first congestion value and the second congestion value respectively indicate the traffic proportion of the data packet and the data stream in the first port queue; If, in at least one of the data flows, there exists a target data flow whose second congestion value satisfies the congestion condition, the port queue used to forward the data packets corresponding to the target data flow is switched from the first port queue to the second port queue, wherein the priority of the second port queue is lower than that of the first port queue. An early warning event indicating that the second congestion value meets the congestion condition is sent to the detection server, so that the detection server, when forwarding the data packets corresponding to the target data stream through the second port queue, controls the rate at which the upstream device sends the data packets corresponding to the target data stream based on the congestion detection result for the target data stream.

2. The method according to claim 1, characterized in that, Determining the congestion weight of at least one of the data packets based on their respective priorities and the highest priority includes: Based on the queue status field in the data stream attribute information stored in the switching device, at least one queue status of the data stream is determined, wherein the queue status includes at least one of the following: normal status, switching cooling status, and switching status; For data packets corresponding to data streams in the normal state and / or the switching cooling state, the congestion weight of the data packets is determined based on the priority of the data packets and the highest priority. For the data packets corresponding to the data stream in the switching state, a preset weight is determined as the congestion weight of the data packets.

3. The method according to claim 2, characterized in that, The preset weight is greater than the congestion weight determined based on the priority of the data packet and the highest priority, such that the rate of change of the second congestion value of the data stream in the switching state is greater than the rate of change of the second congestion value in the normal state and / or the switching cooling state.

4. The method according to claim 2, characterized in that, Determining the congestion weight of a data packet based on its priority and the highest priority includes: Using the highest priority, the relative difference between the priority of the data packet and the highest priority is standardized to obtain the congestion weight of the data packet.

5. The method according to claim 1, characterized in that, Determining the second congestion value of each of the at least one data stream corresponding to the at least one data packet based on the first congestion value and the congestion weight of each of the at least one data packet includes: Based on the congestion value field in the data stream attribute information stored in the switching device, at least one historical second congestion value for each of the data streams is determined; Based on the first congestion value and the congestion weight of each of at least one of the data packets corresponding to the same data stream, determine the current congestion value of each of the at least one data stream; and The historical second congestion value and the current congestion value of each of at least one of the data streams are summed to obtain the second congestion value of each of the at least one data stream.

6. The method according to claim 5, characterized in that, The method further includes: Perform a timeliness check on the congestion value field to obtain the timeliness check result; If the timeliness detection result indicates that the congestion value field has not changed within a first predetermined time period, the field value of the congestion value field is reset to zero.

7. The method according to claim 6, characterized in that, The method further includes: For at least one of the data streams in which the second congestion value does not meet the congestion condition, the congestion value field is updated using the second congestion value until the congestion value of the congestion value field updated using the data packet updated by the first port queue meets the congestion condition, and / or until the updated congestion value field is reset to zero by detecting the timeliness of the updated congestion value field.

8. The method according to any one of claims 1 to 7, characterized in that, The attribute information includes the data packet length parsed from the data packet. Determining the first congestion value for each of at least one data packet based on its attribute information within the first port queue includes: A first congestion value is determined for each of the at least one data packet based on the ratio of its respective data packet length to the queue length of the first port queue.

9. The method according to claim 1, characterized in that, When the switching device forwards the data packet corresponding to the target data stream through the second port queue, it updates the second congestion value of the target data stream; when the updated second congestion value of the target data stream meets the congestion condition again, the switching device sends the warning event to the detection server again. The congestion detection result for the target data stream is determined by the following method: The detection server determines the congestion detection result of the target data stream based on the number of times the warning event is received within a second predetermined time period.

10. The method according to claim 9, characterized in that, The method further includes: The detection server is used to send control information to the upstream device of the target data stream when the congestion detection result indicates that the target data stream is a congested data stream. The control information is used to reduce the rate at which the upstream device of the target data stream sends data packets corresponding to the target data stream.

11. The method according to any one of claims 1 to 7, characterized in that, The method further includes: If the waiting time after switching the first port queue to the second port queue meets the time condition, the port queue used to forward the data packets corresponding to the target data stream will be switched back to the first port queue.

12. The method according to claim 11, characterized in that, The step of switching the port queue used to forward the data packets corresponding to the target data stream back to the first port queue when the waiting time after switching the first port queue to the second port queue meets the time condition includes: If the waiting time reaches the first time threshold, the queue status will be updated from queue switching status to queue cooling status. If the waiting time reaches a second time threshold, the port queue used to forward the data packets corresponding to the target data stream will be switched back to the first port queue, wherein the second time threshold is greater than the first time threshold; and Update the queue status from the queue cooling state to the normal state.

13. The method according to any one of claims 1 to 7, characterized in that, When at least one of the data flows contains a target data flow whose second congestion value meets the congestion condition, switching the port queue used to forward the data packets corresponding to the target data flow from the first port queue to the second port queue includes: If, in at least one of the data streams, there exists a target data stream whose second congestion value satisfies the congestion condition, the queue status of the target data stream is obtained; When the queue status is normal, the port queue used to forward the data packets corresponding to the target data stream will be switched from the first port queue to the second port queue.

14. The method according to claim 13, characterized in that, The method further includes: After switching the first port queue to the second port queue, the queue status of the target data stream is updated to the queue switching status; and The field value of the congestion value field of the target data stream is cleared to zero to reset the historical second congestion value, so that when congestion occurs in the second port queue, the second congestion value of the target data stream is updated according to the reset historical second congestion value and the re-determined current congestion value.

15. The method according to claim 1, characterized in that, The correspondence between at least one data packet and at least one data stream is determined in the following manner: Parse the data packet to obtain data packet forwarding information, wherein the data packet forwarding information includes at least one of the following: source address, destination address, source port, destination port, and transport protocol; and At least one data packet with the same forwarding information is identified as a data packet corresponding to the same data stream.

16. A congestion control device, characterized in that, An apparatus for use in a switching device, the switching device comprising multiple port queues for forwarding data packets received from an upstream device to a downstream device in the order of reception, wherein a single port queue is used to forward data packets having at least one priority, the apparatus comprising: The first determining module is configured to, in response to receiving a backpressure signal sent by the downstream device, determine a first congestion value for each of at least one data packet based on the attribute information of at least one data packet in the first port queue, wherein the first port queue is the port queue where congestion is indicated by the backpressure signal. The second determining module is configured to: determine the highest priority of the data packets that can be forwarded by the first port queue according to the target mapping relationship stored in the switching device, wherein the target mapping relationship is a mapping relationship between the priority of the first port queue and the priority of the data packets that can be forwarded; determine the congestion weight of each of the at least one data packet according to the priority of each of the at least one data packet and the highest priority; and determine the second congestion value of each of the at least one data stream corresponding to the at least one data packet according to the first congestion value and the congestion weight of each of the at least one data packet; wherein the first congestion value and the second congestion value respectively indicate the traffic proportion of the data packet and the data stream in the first port queue; The switching module is used to switch the port queue used to forward the data packets corresponding to the target data stream from the first port queue to the second port queue when there is a target data stream in at least one of the data streams whose second congestion value meets the congestion condition. The second port queue has a lower priority than the first port queue. The sending module is used to send an early warning event indicating that the second congestion value meets the congestion condition to the detection server, so that the detection server, when forwarding the data packets corresponding to the target data stream through the second port queue, controls the rate at which the upstream device sends the data packets corresponding to the target data stream based on the congestion detection result for the target data stream.

17. A switching device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 15.

18. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 15.

19. A computer program product storing a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Policing networks

    CN101116292A

  • Congestion control method, device and system, and storage medium

    CN113141313A