Congestion control method and related apparatus

WO2026194410A1PCT designated stage Publication Date: 2026-09-24HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/147952
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-03-17
Filing Date
2025-12-31
Publication Date
2026-09-24

Smart Images

  • Figure CN2025147952_24092026_PF_FP_ABST
    Figure CN2025147952_24092026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a congestion control method. The method is applied to a first device, and the first device comprises a first flow control apparatus. A second device is a downstream device of the first device, and the second device comprises a second flow control apparatus. The first flow control apparatus receives a first message sent by the second flow control apparatus, wherein the first message comprises first service information, and the first message is used for requesting the first device to perform congestion control processing on a service corresponding to the first service information. Upon receiving the first message, the first flow control apparatus may determine a second queue on the basis of the first service information and a second entry, and further reduce the sending rate of the second queue, thereby implementing congestion control processing of the service. The second entry comprises a correspondence between the first service information and an identifier of the second queue, and the second queue is a queue used by the first device to forward the service. By using the solution, the first flow control apparatus is deployed in the first device, and congestion control at a service granularity is implemented by means of the first flow control apparatus.
Need to check novelty before this filing date? Find Prior Art

Description

A congestion control method and related apparatus

[0001] This application claims priority to Chinese Patent Application No. 202510322954.2, filed on March 17, 2025, entitled "A Congestion Control Method and Related Apparatus", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of communication technology, and in particular to a congestion control method and related apparatus. Background Technology

[0003] Priority-based flow control (PFC) is a commonly used congestion control algorithm in data center networks. It is a technique to prevent packet loss under congestion conditions. PFC technology mainly operates on the ingress ports of switches (or other network devices such as routers), controlling the flow based on the queue length of the ingress port (or the length of the ingress queue). Specifically, it does this by sending indication messages to upstream ports to stop sending data.

[0004] Compared to data center networks, in wide area network (WAN) scenarios, due to the longer network transmission path between sending and receiving devices, tunneling is typically used to encapsulate the packets transmitted between them. For these reasons, PFC (Flow Control Function) technology is unsuitable for WAN scenarios. Furthermore, PFC performs flow control on inbound queues; since queues may carry multiple services, slowing down a particular queue will cause all services in that queue to be suspended, affecting the normal transmission of non-congestion-prone services carried by that queue.

[0005] Therefore, there is an urgent need for a congestion control method suitable for wide area network scenarios. Summary of the Invention

[0006] This application provides a congestion control method and device that can perform congestion control processing based on service granularity, thereby improving the correlation between congestion control and services and effectively enhancing user experience.

[0007] Firstly, this application provides a congestion control method applied to a first device, which includes a first flow control device. A second device is a downstream device of the first device and includes a second flow control device. The first flow control device receives a first message sent by the second flow control device. The first message includes first service information, which requests the first device to perform congestion control processing on the service corresponding to the first service information. The first service information is obtained by the second flow control device based on a first entry when a first queue used by the second device to forward the service becomes congested. The first entry includes at least the correspondence between the identifier of the first queue and the first service information. The first device stores a second entry, which includes the correspondence between the identifier of the first service information and the identifier of the second queue, where the second queue is the queue used by the first device to forward the service. After receiving the first message, the first flow control device can determine the second queue based on the first service information and the second entry, and further reduce the transmission rate of the second queue, thereby achieving congestion control processing on the service. By deploying a first flow control device in the first device, service-level congestion control is achieved through the first flow control device.

[0008] In one possible implementation, the second entry is generated by the first flow control device through self-learning. Specifically, the first flow control device acquires a first message sent by a third device to the first device, where the first message belongs to the service. The first flow control device determines the first service information based on the first message. The first flow control device obtains the second entry based on the first service information and the identifier of the second queue. After obtaining the second entry, the first flow control device can store it so that after subsequently receiving the first message, it can determine the second queue based on the first service information and the second entry, and further reduce the transmission rate of the second queue, thereby achieving congestion control processing for the service.

[0009] In one possible implementation, the first service information is information used to uniquely identify a certain service, wherein the service identified by the first service information is the service corresponding to the aforementioned first service information. This application does not specifically limit the first service information, as long as the first service information can uniquely identify a certain service. In one example, considering that a stream identifier, slice identifier, application identifier, and service identifier can all uniquely identify a service, the first service information can be a stream identifier, or a slice identifier, or an application identifier, or a service identifier.

[0010] In one possible implementation, the first flow control device runs on the forwarding chip (e.g., network processor (NP)) of the first device, or the central processing unit (CPU) of the first device, or the field programmable gate array (FPGA) of the first device, allowing for flexible implementation.

[0011] In one possible implementation, the first message also includes a desired rate. In this case, the first flow control device reduces the sending rate of the second queue to the desired rate. This approach allows for fine-grained control of the sending rate of the second queue, improving the precision of congestion control processing.

[0012] In one possible implementation, the first message includes a rate-reduction duration. In this case, the first flow control device can reduce the transmission rate of the second queue within the rate-reduction duration. This approach allows for reasonable control of the duration of the rate reduction in the second queue, preventing prolonged rate reductions that could impact the transmission efficiency of the service.

[0013] In this application, the first message can be carried by various carriers, allowing for flexible implementation. For example, the first message can be carried in a Transmission Control Protocol (TCP) message, a User Datagram Protocol (UDP) message, or an Internet Control Message Protocol (ICMP) message. Alternatively, the first message can be carried in an Internet Protocol (IP) message; or, the first message can be carried in a Layer 2 message within the Open Systems Interconnection (OSI) model.

[0014] In one possible implementation, when the first message is carried by the TCP packet, the payload field of the TCP packet is used to carry the first message. In this case, after receiving the TCP packet, the first flow control device can extract the first message from the payload of the TCP packet.

[0015] In one possible implementation, when the first message is carried by the UDP packet, the payload field of the UDP packet is used to carry the first message. In this case, after receiving the UDP packet, the first flow control device can extract the first message from the payload of the UDP packet.

[0016] In one possible implementation, when the first message is carried by the ICMP message, the payload field of the ICMP message is used to carry the first message. In this case, after receiving the ICMP message, the first flow control device can extract the first message from the payload of the ICMP message.

[0017] In one possible implementation, when the first message is carried by the IP packet, the IP packet may be, for example, an Internet Protocol version 6 (IPv6) packet. In this case, in one example, the IPv6 packet includes a hop-by-hop (HBH) header for carrying the first message. In this case, after receiving the IPv6 packet, the first flow control device can extract the first message from the HBH header of the IPv6 packet.

[0018] In one possible implementation, when the first message is carried by the IP packet, the IP packet may be, for example, an IPv6 packet. In this case, in one example, the IPv6 packet includes a destination option header (DOH) for carrying the first message. In this case, after receiving the IPv6 packet, the first flow control device can extract the first message from the DOH of the IPv6 packet.

[0019] In one possible implementation, when the first message is carried by the IP packet, the option field of the IP packet is used to carry the first message. In this case, after receiving the IP packet, the first flow control device can extract the first message from the option field of the IPv6 packet. The "option field" is also referred to as the "option field".

[0020] In one possible implementation, when the UDP packet carries the first message, the UDP packet also includes a first port number, which indicates that the UDP packet is a congestion notification packet carrying the first message. After receiving the UDP packet, the first flow control device can determine that the UDP packet carries the first message based on the first port number, and further parse the first message from the UDP packet.

[0021] In one possible implementation, when the ICMP message carries the first message, the ICMP message further includes a first type or a first code, wherein the first type or the first code indicates that the ICMP message is a congestion notification message carrying the first message. After receiving the ICMP message, the first flow control device can determine that the ICMP message carries the first message based on the first type or the first code, and further parse the first message from the ICMP message.

[0022] In one possible implementation, when the Layer 2 message carries the first message, the Layer 2 message also includes a first destination Media Access Control (MAC) address, which indicates that the Layer 2 message is a congestion notification message carrying the first message. After receiving the Layer 2 message, the first flow control device can determine that the Layer 2 message carries the first message based on the destination MAC address, and further parse the first message from the Layer 2 message.

[0023] In one possible implementation, when the Layer 2 message carries the first message, the Layer 2 message further includes a first Ethertype field, which indicates that the Layer 2 message is a congestion notification message carrying the first message. After receiving the Layer 2 message, the first flow control device can determine that the Layer 2 message carries the first message based on the first Ethertype, and further parse the first message from the Layer 2 message.

[0024] Secondly, this application provides a congestion control method applied to a second device, which includes a second flow control device. The second device uses a first queue to forward services corresponding to first service information. The second device stores a first entry, which includes an identifier of the first queue and a correspondence between the first service information and the first service information. When the utilization rate of the first queue is higher than a first utilization rate, the second flow control device determines the first service information based on the first entry, obtains a first message including the first service information, and sends the first message to the first flow control device of the first device. The first device is an upstream device of the second device, and the first message requests the first device to perform congestion control processing on the service corresponding to the first service information. Correspondingly, after receiving the first message, the first flow control device further performs congestion control processing on the service. Therefore, by deploying a second flow control device in the first device, detecting the utilization rate of the first queue, and notifying the first flow control device of the first device to perform congestion control processing on the service when the utilization rate of the first queue is high, congestion control at the service level is achieved.

[0025] In one possible implementation, the first entry further includes: the identifier of the upstream node of the service corresponding to the first queue, wherein the upstream node is the first device. In this case, the second flow control device can determine the identifier of the first device based on the first entry, and send the first message to the first flow control device of the first device based on the identifier of the first device, thereby realizing congestion control processing of the service.

[0026] In one possible implementation, the first entry further includes a first output port. Here, "the first entry includes a first output port" means that the first entry includes information about a first output port. The first output port is the port through which the second flow control device sends a congestion notification message to the upstream device when it determines that the service corresponding to the forwarding of the first service information is congested. In this case, the second flow control device can also query the first entry to obtain the first output port, and after generating the first message, the second flow control device can send the first message to the first flow control device of the first device through the first output port.

[0027] In one possible implementation, the aforementioned first entry also includes the first utilization rate. Therefore, the second flow control device can obtain the first utilization rate from the first entry, and when detecting the utilization rate of the first queue, compare the utilization rate of the first queue with the first utilization rate to determine whether congestion occurs when the outgoing port of the second device forwards the service.

[0028] In one possible implementation, the first entry is generated by the second flow control device through self-learning. Specifically, the second flow control device can obtain a second message sent from the first device to the second device, where the second message belongs to the service. The second flow control device determines the first service information based on the second message; the second flow control device obtains the first entry based on the first service information and the identifier of the first queue, so that when the utilization rate of the first queue is high, it can query the first entry to obtain the first service information, generate a first message including the first service information, and send the first message to the first flow control device, thereby achieving congestion control processing for the service.

[0029] In one possible implementation, the first entry may further include the identifier of the first output port and / or the first device. In this case, the second flow control device may also obtain the identifier of the first output port and / or the first device so as to combine the identifier of the first output port and / or the first device when generating the first entry.

[0030] In one possible implementation, if the first entry also includes the identifier of the first device, then the second flow control device needs to combine the identifier of the first device when generating the first entry. For example, the second flow control device can obtain a first entry including the first service information, the identifier of the first queue, and the identifier of the first device based on the first service information, the identifier of the first queue, and the identifier of the first device.

[0031] In one possible implementation, if the first entry also includes a first output port, the second flow control device needs to combine the first output port when generating the first entry. For example, the second flow control device obtains a first entry including the first service information, the identifier of the first queue, and the ingress port where the second device receives the second message, based on the first service information, the identifier of the first queue, and the ingress port where the second device receives the second message. The ingress port where the second device receives the second message is the first output port.

[0032] In one possible implementation, if the first entry also includes the identifier of the first output port and the identifier of the first device, then when the second flow control device generates the first entry, it also needs to combine the identifier of the first output port and the identifier of the first device. For example, the second flow control device obtains a first entry including the first service information, the identifier of the first queue, the identifier of the first device, and the ingress port of the second device that receives the second message based on the first service information, the identifier of the first queue, the identifier of the first device, and the ingress port of the second device.

[0033] In one possible implementation, the first service information includes one of the following: a stream identifier, a slice identifier, an application identifier, or a service identifier.

[0034] In one possible implementation, the second flow control device operates on the forwarding chip of the second device, or the central processing unit (CPU) of the second device, or the field-programmable gate array (FPGA) of the second device.

[0035] In one possible implementation, the first message includes the desired rate.

[0036] In one possible implementation, the first message includes the duration of the slowdown.

[0037] In one possible implementation, the first entry also includes the deceleration duration. In this case, the second flow control device can also obtain the deceleration duration based on the first entry, so as to obtain a first message including the first deceleration duration based on the deceleration duration.

[0038] In one possible implementation, the first message is carried in a Transmission Control Protocol (TCP) message, a User Datagram Protocol (UDP) message, or an Internet Control Message Protocol (ICMP) message; or, the first message is carried in an Internet Protocol (IP) message; or, the first message is carried in a Layer 2 message in the Open Systems Interconnection (OSI) model.

[0039] In one possible implementation, the payload field of the Transmission Control Protocol (TCP) message is used to carry the first message; or, the payload field of the User Datagram Protocol (UDP) message is used to carry the first message; or, the payload field of the Internet Control Message Protocol (ICMP) message is used to carry the first message; or, the hop-by-hop (HBH) header of the Internet Protocol (IP) message is used to carry the first message; or, the Destination Options (DOH) header of the IP message is used to carry the first message; or, the optional field of the IP message is used to carry the first message.

[0040] In one possible implementation, when the User Datagram Protocol (UDP) message carries the first message, the UDP message further includes a first port number, which indicates that the UDP message is a congestion notification message carrying the first message; or, when the ICMP message carries the first message, the ICMP message further includes a first type or a first encoding, which indicates that the ICMP message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first destination Media Access Control (MAC) address, which indicates that the Layer 2 message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first Ethertype field, which indicates that the Layer 2 message is a congestion notification message carrying the first message.

[0041] Thirdly, this application provides a congestion control device applied to a first device, the first device including a first flow control device, the first flow control device including: a receiving unit, configured to receive a first message sent by a second flow control device, the first message including first service information, the first message being used to request the first device to perform congestion control processing for the service corresponding to the first service information, the second flow control device being a second device, the second device being a downstream device of the first device, the first service information being obtained by the second flow control device according to a first entry when a first queue used by the second device to forward the service becomes congested, the first entry including the correspondence between the identifier of the first queue and the first service information; a processing unit, configured to determine a second queue corresponding to the first service information according to the first service information and a second entry, the second entry including the correspondence between the identifier of the first service information and the identifier of the second queue, the second queue being a queue used by the first device to forward the service; and reduce the transmission rate of the second queue.

[0042] In one possible implementation, the processing unit is further configured to: acquire a first message sent by a third device to the first device, wherein the first message belongs to the service; determine the first service information based on the first message; and obtain the second entry based on the first service information and the identifier of the second queue.

[0043] In one possible implementation, the first service information includes one of the following: a stream identifier, a slice identifier, an application identifier, or a service identifier.

[0044] In one possible implementation, the first flow control device operates on the forwarding chip of the first device, or the central processing unit (CPU) of the first device, or the field-programmable gate array (FPGA) of the first device.

[0045] In one possible implementation, the first message includes a desired rate, and reducing the sending rate of the second queue includes reducing the sending rate of the second queue to the desired rate.

[0046] In one possible implementation, the first message includes a slowdown period, and the reduction of the transmission rate of the second queue includes: reducing the transmission rate of the second queue during the slowdown period.

[0047] In one possible implementation, the first message is carried in a Transmission Control Protocol (TCP) message, a User Datagram Protocol (UDP) message, or an Internet Control Message Protocol (ICMP) message; or, the first message is carried in an Internet Protocol (IP) message; or, the first message is carried in a Layer 2 message in the Open Systems Interconnection (OSI) model.

[0048] In one possible implementation, the payload field of the Transmission Control Protocol (TCP) message is used to carry the first message; or, the payload field of the User Datagram Protocol (UDP) message is used to carry the first message; or, the payload field of the Internet Control Message Protocol (ICMP) message is used to carry the first message; or, the hop-by-hop (HBH) header of the Internet Protocol (IP) message is used to carry the first message; or, the Destination Options (DOH) header of the IP message is used to carry the first message; or, the optional field of the IP message is used to carry the first message.

[0049] In one possible implementation, when the User Datagram Protocol (UDP) message carries the first message, the UDP message further includes a first port number, which indicates that the UDP message is a congestion notification message carrying the first message; or, when the ICMP message carries the first message, the ICMP message further includes a first type or a first encoding, which indicates that the ICMP message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first destination Media Access Control (MAC) address, which indicates that the Layer 2 message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first Ethertype field, which indicates that the Layer 2 message is a congestion notification message carrying the first message.

[0050] Fourthly, this application provides a congestion control device applied to a second device, the second device including a second flow control device, the second flow control device comprising: a processing unit, configured to determine first service information according to a first entry when the utilization rate of a first queue is higher than a first utilization rate, the first entry including the identifier of the first queue and the correspondence between the first service information, the first queue being a queue for the second device to forward services corresponding to the first service information; and to obtain a first message according to the first service information; and a sending unit, configured to send the first message to the first flow control device of the first device, the first message including the first service information, the first message being used to request the first device to perform congestion control processing for the service corresponding to the first service information, the first device being an upstream device of the second device.

[0051] In one possible implementation, the first entry further includes: an identifier of the upstream node of the service corresponding to the first queue, wherein the upstream node is the first device; the processing unit is further configured to: determine the identifier of the first device based on the first entry; and the sending unit is configured to send the first message to the first flow control device of the first device based on the identifier of the first device.

[0052] In one possible implementation, the first entry further includes: a first output port; the sending unit is configured to: send the first message to a first flow control device of the first device through the first output port.

[0053] In one possible implementation, the first entry further includes the first utilization rate, and the processing unit is further configured to: obtain the first utilization rate based on the first entry.

[0054] In one possible implementation, the processing unit is further configured to: acquire a second message sent by the first device to the second device, wherein the second message belongs to the service; determine the first service information based on the second message; and obtain the first entry based on the first service information and the identifier of the first queue.

[0055] In one possible implementation, obtaining the first entry based on the first service information and the identifier of the first queue includes: obtaining the first entry based on the first service information, the identifier of the first queue, and the identifier of the first device; or, obtaining the first entry based on the first service information, the identifier of the first queue, and the ingress port of the second device receiving the second message, wherein the first ingress port is the first egress port of the second device sending the first message; or, obtaining the first entry based on the first service information, the identifier of the first queue, the identifier of the first device, and the ingress port of the second device receiving the second message.

[0056] In one possible implementation, the processing unit is further configured to: obtain the ingress port through which the second device receives the second message, and / or determine the identifier of the first device.

[0057] In one possible implementation, the first service information includes one of the following: a stream identifier, a slice identifier, an application identifier, or a service identifier.

[0058] In one possible implementation, the second flow control device operates on the forwarding chip of the second device, or the central processing unit (CPU) of the second device, or the field-programmable gate array (FPGA) of the second device.

[0059] In one possible implementation, the first message includes the desired rate.

[0060] In one possible implementation, the first message includes the duration of the slowdown.

[0061] In one possible implementation, the first entry further includes the deceleration duration, and the processing unit is further configured to: obtain the deceleration duration based on the first entry.

[0062] In one possible implementation, the first message is carried in a Transmission Control Protocol (TCP) message, a User Datagram Protocol (UDP) message, or an Internet Control Message Protocol (ICMP) message; or, the first message is carried in an Internet Protocol (IP) message; or, the first message is carried in a Layer 2 message in the Open Systems Interconnection (OSI) model.

[0063] In one possible implementation, the payload field of the Transmission Control Protocol (TCP) message is used to carry the first message; or, the payload field of the User Datagram Protocol (UDP) message is used to carry the first message; or, the payload field of the Internet Control Message Protocol (ICMP) message is used to carry the first message; or, the hop-by-hop (HBH) header of the Internet Protocol (IP) message is used to carry the first message; or, the Destination Options (DOH) header of the IP message is used to carry the first message; or, the optional field of the IP message is used to carry the first message.

[0064] In one possible implementation, when the User Datagram Protocol (UDP) message carries the first message, the UDP message further includes a first port number, which indicates that the UDP message is a congestion notification message carrying the first message; or, when the ICMP message carries the first message, the ICMP message further includes a first type or a first encoding, which indicates that the ICMP message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first destination Media Access Control (MAC) address, which indicates that the Layer 2 message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first Ethertype field, which indicates that the Layer 2 message is a congestion notification message carrying the first message.

[0065] Fifthly, this application provides an apparatus. The apparatus includes a processor and a memory. The memory is used to store instructions or computer programs. The processor is used to execute the instructions or computer programs in the memory to perform the methods described in the first aspect and any one thereof. Alternatively, the processor is used to execute the instructions or computer programs in the memory to perform the methods described in the second aspect and any one thereof.

[0066] Sixthly, this application provides a computer-readable storage medium including instructions or a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any one of the first aspects above, or causes the computer to perform the methods described in the second aspect and any one of the second aspects above.

[0067] In a seventh aspect, this application provides a computer program product comprising instructions or a computer program, which, when run on a computer, causes the computer to perform the method described in any one of the first aspects above, or causes the computer to perform the method described in the second aspect above and any one of the second aspects above.

[0068] Eighthly, this application provides a communication system comprising: a first device and a second device, wherein the first device is configured to perform the method described in the first aspect and any one of the first aspects above, and the second device is configured to perform the method described in the second aspect and any one of the second aspects above. Specifically, the first device includes a first flow control device configured to perform the method described in the first aspect and any one of the first aspects above, and the second device includes a second flow control device configured to perform the method described in the second aspect and any one of the second aspects above. Attached Figure Description

[0069] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0070] Figure 1a is a schematic diagram of a PFC scenario;

[0071] Figure 1b shows a schematic diagram of an NP architecture;

[0072] Figure 1c shows a schematic diagram illustrating the implementation principle of PFC technology;

[0073] Figure 2 is a schematic diagram of an exemplary application scenario provided by an embodiment of this application;

[0074] Figure 3 is a schematic diagram of signaling interaction of a congestion control method provided in an embodiment of this application;

[0075] Figure 4a is a schematic diagram of the structure of the first message in an embodiment of this application;

[0076] Figure 4b is a schematic diagram of another structure of the first message in an embodiment of this application;

[0077] Figure 4c is a schematic diagram of the structure of the first message in an embodiment of this application;

[0078] Figure 4d is a schematic diagram of a structure of the first message in an embodiment of this application;

[0079] Figure 5 is a flowchart illustrating a self-learning method for a second entry provided in an embodiment of this application;

[0080] Figure 6 is a flowchart illustrating a self-learning method for a first entry provided in an embodiment of this application;

[0081] Figures 7a to 7c show schematic diagrams of three congestion control methods;

[0082] Figure 8 is a schematic diagram of the structure of a first flow control device provided in an embodiment of this application;

[0083] Figure 9 is a schematic diagram of the structure of a second flow control device provided in an embodiment of this application;

[0084] Figure 10 is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation

[0085] This application provides a congestion control method and device that can perform congestion control processing based on service granularity, thereby improving the correlation between congestion control and services and effectively enhancing user experience.

[0086] First, let's introduce the traditional PFC.

[0087] For easier understanding, please refer to Figure 1a, which is a schematic diagram of a PFC scenario. An Ethernet link is established between Device A and Device B. Device A's transmit interface corresponds to 8 priority queues, and Device B's receive interface includes 8 corresponding receive buffers, with a one-to-one correspondence. When forwarding packets, Device A can determine the queue to forward the packet based on the service class carried in the packet. For example, if the service class value is 0, queue 1 is used to forward the packet; if the service class value is 1, queue 2 is used; and so on, up to queue i+1, where i ranges from 0 to 7. When congestion occurs in a receive buffer on Device B's receive interface, a backpressure signal "STOP" is sent to Device A, and Device A stops transmitting traffic from the corresponding priority queue. The congestion control methods described above, such as PFC, are typically suitable for short-distance data center networks. Here, STOP indicates stopping.

[0088] In wide area network (WAN) scenarios, the network transmission path between the sender and receiver is relatively long. While PFC (Power-Controlled Flow) technology alleviates network congestion by stopping traffic in the sending queue, the long path in a WAN means the receiver or network device may not be able to promptly notify the sender of this relief. Therefore, the sender's queue may continue to stop sending traffic. Furthermore, PFC performs flow control on inbound queues. Since there are many services transmitted in the network, but service levels (SLS) only have eight values ​​(0 to 7), different services may have the same SLS. In other words, for device A, the same queue may carry multiple services. Therefore, slowing down a particular queue causes multiple services carried by that queue to be suspended, affecting the normal forwarding of non-congested services carried by that queue.

[0089] Current PFC technology is applied to NP architecture.

[0090] See Figure 1b, which shows a schematic diagram of an NP architecture.

[0091] As shown in Figure 1b, the NP architecture includes subsystems such as CPU, NP datapath (NDP), NP streaming processor (NSP), traffic manager (TM), fabric interface component (FIC), and switch fabric. Among them:

[0092] The CPU belongs to the control plane, which can perform functions such as route learning, forwarding table distribution, and execution of other user configurations.

[0093] NDP is a collection of modules that move data from data packets to processing elements. It includes elements such as packet analysis, reassembly, packet editing, and receive buffers. NDP consists of ingress NDP (iNDP) and egress NDP (eDNP). iNDP processes data received at the ingress port (i.e., ingress traffic), while eDNP processes data about to be forwarded through the egress interface (i.e., egress traffic). NDP is not programmable.

[0094] An Network Service Provider (NSP) is a collection of modules that analyze and transform data packets according to user-defined programs and configurations. An NSP includes ingress NSPs (iNSPs) and egress NSPs (eNSPs). iNSPs interact with iNDPs to process ingress traffic, while eNSPs interact with eNDPs to process egress traffic. NSPs can implement routing, bridging, and access control list (ACL) functions. NSPs can be programmable or non-programmable.

[0095] Traffic Management Modules (TMs) are a collection of modules providing large packet memory, congestion avoidance, traffic shaping, multi-level traffic scheduling, and traffic congestion control. A TM includes an ingress TM (iTM) and an egress TM (eTM). The iTM processes ingress traffic, and the eTM processes egress traffic. TMs are not programmable.

[0096] FIC enables data exchange, transferring traffic from multiple local and remote ingress planes to multiple egress planes via a switching matrix. FIC is not programmable.

[0097] The relationships between the various subsystems of the NP architecture and the specific operations performed by each subsystem are not detailed here.

[0098] Next, referring to Figure 1c, we will introduce the current implementation method of PFC.

[0099] Referring to Figure 1c, Figure 1c shows a schematic diagram of the implementation principle of PFC technology.

[0100] As shown in Figure 1c, the execution process of PFC includes the following steps:

[0101] 1. The egress media access control (eMAC) receives PFC frames from downstream devices, and the outgoing port stops sending this priority message. In Figure 1c, the PFC frame is represented by "PFC".

[0102] 2. When the number of packets in the priority queue of the outgoing port in eTM exceeds the backpressure threshold, eTM triggers backpressure, which is then applied to the pull-on-push (POP) scheduler of eFIC.

[0103] 3. For all uplink board virtual output queues (VOQs) corresponding to this port priority, the POP scheduler suspends the allocation of tokens (credits).

[0104] 4. If all uplink VOQ boards fail to receive credit from the downlink scheduler, stop scheduling the VOQ message to the switching network.

[0105] 5. As the VOQ messages accumulate and exceed the threshold, backpressure is triggered to the iMAC.

[0106] 6. iMAC then sends the PFC frame to the upstream device.

[0107] As described above, current FPCs are mainly implemented on the data channels of NPs (including eTM, iTM, and MAC), and are unrelated to programmable NSPs. The MAC in Figure 1c can correspond to the "port" in Figure 1b, for example, it is a part of the port in Figure 1b.

[0108] Furthermore, PFC technology can only implement port-level congestion control; specifically, it can only detect port-level congestion states and backpressure. PFC technology cannot implement massive-scale service-level congestion control; specifically, it cannot detect service-level congestion states and backpressure.

[0109] In view of this, this application provides a congestion control method and related apparatus, which can realize congestion control processing at the service level.

[0110] Next, with reference to the accompanying drawings, the congestion control method and related apparatus provided in the embodiments of this application will be described.

[0111] Referring to Figure 2, this figure is a schematic diagram of an exemplary application scenario provided by an embodiment of this application.

[0112] As shown in Figure 2, User Equipment 1 can send data to User Equipment 2. The data sent by User Equipment 1 is transmitted to User Equipment 2 via path 101, which is: Customer-Premises Equipment (CPE) → Network Device 1 → Network Device 2 → Network Device 3 → Network Device 4.

[0113] User device 1 may be, for example, a terminal device or a server. User device 2 may also be a terminal device or a server; in one example, user device 2 may be, for example, a device in a smart computing center.

[0114] Referring to Figure 3, this figure is a schematic diagram of the signaling interaction of a congestion control method provided in an embodiment of this application.

[0115] The congestion control method shown in Figure 3 can be applied to, but is not limited to, the application scenarios shown in Figure 2.

[0116] The second flow control device in Figure 3 is the flow control device on the second equipment, and the first flow control device in Figure 3 is the flow control device on the first equipment. Wherein:

[0117] The first flow control device may run on the forwarding chip (e.g., NP) of the first device, or the first flow control device may run on the CPU of the first device, or the first flow control device may run on the FPGA of the first device. The first flow control device is a programmable device.

[0118] Similarly, the second flow control device can run on the forwarding chip (e.g., NP) of the second device, or it can run on the CPU of the second device, or it can run on the FPGA of the second device. The second flow control device is a programmable device.

[0119] When the method shown in Figure 3 is applied to the scenario shown in Figure 2, the first device can correspond to any network device in path 101 shown in Figure 2, and the second device can be a downstream device of the first device in path 101. For example, the first device is network device 1, and the second device is network device 2, network device 3, or network device 4; or the first device is network device 2, and the second device is network device 3 or network device 4; or the first device is network device 3, and the second device is network device 4.

[0120] The method shown in Figure 3 includes the following steps S101-S106.

[0121] S101: When the utilization rate of the first queue is higher than the first utilization rate, the second flow control device determines the first service information according to the first entry. The first entry includes the identifier of the first queue and the correspondence between the first service information. The first queue is the queue in which the second device forwards the service corresponding to the first service information.

[0122] In this application, the first queue is a queue used by the second device to forward the service corresponding to the first service information. Before forwarding the packet corresponding to the service, the second device caches the packet corresponding to the service in the first queue. The first queue mentioned in this application includes, but is not limited to, a subscriber queue (SQ), a virtual subscriber queue (VSQ), or a flow queue (FQ).

[0123] The second device stores a first entry, which is an entry related to the first queue. Specifically, the first entry includes at least the correspondence between the identifier of the first queue and the first service information. The identifier of the first queue may be, for example, the number of the first queue or the name of the first queue, or other information that can identify the first queue.

[0124] The first service information is information used to uniquely identify a certain service, wherein the service identified by the first service information is the service corresponding to the aforementioned first service information. This application embodiment does not specifically limit the first service information, as long as the first service information can uniquely identify a certain service. In one example, considering that a flow identifier, slice identifier, application (APP) identifier, and service identifier can all uniquely identify a service, the first service information can be a flow identifier, or a slice identifier, or an application identifier, or a service identifier. In one example, the first service information and the first queue have a certain association. For example, when the first service information is a flow identifier, the first queue is FQ; when the first service information is a slice identifier, the first queue is SQ; when the first service information is an application identifier or a service identifier, the first queue is SQ or VSQ.

[0125] In this application, the second flow control device detects the usage of the first queue. For example, the second flow control device can detect the utilization rate of the first queue to determine whether congestion occurs when the outgoing port of the second device forwards the service. In one example, if the utilization rate of the first queue is higher than a first utilization rate, it indicates that the utilization rate of the first queue is high, and the possibility of congestion when the outgoing port of the second device forwards the service is greater. Therefore, when the second flow control device determines that the utilization rate of the first queue is higher than the first utilization rate, it determines the first service information based on the first table entry. Specifically, the second flow control device queries the first table entry using the identifier of the first queue as an index to obtain the first service information.

[0126] This application does not specifically limit the first utilization rate; for example, the first utilization rate may be an empirical value. In one example, the aforementioned first entry also includes the first utilization rate. Therefore, the second flow control device can obtain the first utilization rate from the first entry, and when detecting the utilization rate of the first queue, compare the utilization rate of the first queue with the first utilization rate to determine whether congestion occurs when the outgoing port of the second device forwards the service.

[0127] S102: The second flow control device obtains a first message based on the first service information. The first message is used to request the first device to perform congestion control processing for the service corresponding to the first service information. The first message includes the first service information.

[0128] After obtaining the first service information, the second flow control device can generate a first message based on the first service information. Specifically, the second flow control device can generate a first message including the first service information. The first message is used to request congestion control processing for the service corresponding to the first service information.

[0129] In one example, the first entry also includes the identifier of the upstream node of the service corresponding to the first queue. The service corresponding to the first queue is the service corresponding to the first service information. The upstream node mentioned here is the first device. That is, the first entry also includes the identifier of the first device. In this case, the first message is specifically used to request the first device to perform congestion control processing for the service corresponding to the first service information. The identifier of the first device includes, but is not limited to, the address of the first device; for example, the identifier of the first device is the IP address of the first device.

[0130] In one example, the first message may also carry information guiding the first device to perform congestion control processing on the service, thereby improving the granularity of the congestion control processing. For example, the first message may also include a desired rate, which refers to the rate at which the first device sends the service after performing congestion control processing on the service. As another example, the first message may also include a reduction duration, which indicates the duration for which the first device performs congestion control processing on the service. In one example, the reduction duration may also be obtained by the second flow control device querying the aforementioned first entry. That is, the first entry also includes the reduction duration. The aforementioned rate at which the first device sends the service refers to the rate at which the first device sends the message corresponding to the service.

[0131] S103: The second flow control device sends the first message to the first flow control device.

[0132] After obtaining the first message, the second flow control device can send the first message to the first flow control device of the first device. Specifically, in a scenario where the first entry includes the identifier of the first device, the second flow control device can determine the identifier of the first device based on the aforementioned first entry, and send the first message to the first flow control device of the first device based on the identifier of the first device. For example, if the identifier of the first device is the IP address of the first device, the second flow control device can generate a first message with the IP address of the first device as the destination IP address and send the first message, thereby realizing the sending of the first message to the first flow control device of the first device.

[0133] In another example, the first entry also includes a first outgoing port. Here, "including a first outgoing port" means that the first entry includes information about the first outgoing port, such as its number or name, or other information that identifies the first outgoing port. The first outgoing port is the port through which the second flow control device sends a congestion notification message to the upstream device when it determines that the service corresponding to the forwarding of the first service information is congested. In this case, the second flow control device can also query the first entry to obtain the first outgoing port, and after generating the first message, the second flow control device can send the first message to the first flow control device of the first device through the first outgoing port.

[0134] In one example, the first entry may be pre-configured on the second device.

[0135] In another example, the first entry can be obtained by the second device through self-learning. Specifically, the first entry can be generated by the second device through self-learning after receiving a message belonging to the service. For details on how the second device obtains the first entry through self-learning, please refer to the description of the method shown in Figure 6 below; it will not be described in detail here.

[0136] S104: The first flow control device receives the first message sent by the second flow control device.

[0137] S105: The first flow control device determines the second queue corresponding to the first service information based on the first service information and the second table entry. The second table entry includes the correspondence between the first service information and the identifier of the second queue. The second queue is the queue used by the first device to forward the service.

[0138] After the second flow control device sends the first message, the first flow control device can receive the first message and parse it to obtain the first service information.

[0139] The first device stores a second entry, which includes the correspondence between the first service information and the identifier of the second queue. The second queue is used by the first device to forward the service; before forwarding the message corresponding to the service, the first device caches the message corresponding to the service in the second queue.

[0140] After the first flow control device parses and obtains the first service information, it can use the first service information as an index to query the second table entry, thereby obtaining the identifier of the second queue. For information on the identifier of the second queue and the second queue itself, please refer to the previous description of the first queue; it will not be repeated here.

[0141] In one example, the second entry may be pre-configured on the first device.

[0142] In another example, the second entry can be obtained by the first device through self-learning. Specifically, the second entry can be generated by the first device itself after receiving a message belonging to the service. For details on how the first device obtains the second entry through self-learning, please refer to the description of the method shown in Figure 5 below; it will not be described in detail here.

[0143] S106: The first flow control device reduces the transmission rate of the second queue.

[0144] After obtaining the identifier of the second queue based on the second entry, the first flow control device can reduce the transmission rate of the second queue, thereby achieving congestion control for the service corresponding to the first service information.

[0145] In one example, if the first message includes a desired rate, the first flow control device can reduce the sending rate of the second queue to the desired rate. If the first message does not include a desired rate, the first flow control device can, for example, reduce the rate of the second queue according to certain measurements, such as reducing the rate of the second queue to a preset rate, etc., which will not be described in detail here.

[0146] In another example, if the first message includes a reduction duration, the first flow control device can reduce the transmission rate of the second queue during the reduction duration and restore the transmission rate of the second queue after the reduction duration has elapsed. If the first message does not include a reduction duration, the first flow control device can reduce the transmission rate of the second queue for a certain period of time (e.g., a preset duration), or the first flow control device can restore the transmission rate of the second queue after receiving a congestion control release message from the second flow control device.

[0147] The first message in this application embodiment has several possible implementations, which will be described below.

[0148] Implementation Method 1:

[0149] The first message is carried in a TCP packet, a UDP packet, or an ICMP packet.

[0150] In one example, the payload field of a TCP packet, a UDP packet, or an ICMP packet may be used to carry the first message. It is understood that, in the aforementioned TCP, UDP, or ICMP packets, other fields besides the payload field may also be used to carry the first message. Furthermore, since the first message may include various types of information, different fields may be used to carry various types of information within the first message in the aforementioned TCP, UDP, or ICMP packets; this embodiment does not impose any limitations on this.

[0151] In one example, when the UDP packet carries the first message, the UDP packet also includes a first port number, which indicates that the UDP packet is a congestion notification packet carrying the first message. After receiving the UDP packet, the first flow control device can determine that the UDP packet carries the first message based on the first port number, and further parse the first message from the UDP packet.

[0152] In one example, when the ICMP message carries the first message, the ICMP message also includes a first type or a first code, the first type or the first code indicating that the ICMP message is a congestion notification message carrying the first message. After receiving the ICMP message, the first flow control device can determine that the ICMP message carries the first message based on the first type or the first code, and further parse the first message from the ICMP message.

[0153] For example, please refer to Figure 4a, which is a schematic diagram of the structure of the first message in an embodiment of this application. Taking a UDP packet carrying the first message as an example, the UDP packet includes: an IPv4 / IPv6 destination address, an IPv4 / IPv6 source address, a source port, a destination port, a length, a checksum, and a payload field. The destination port is used to carry a first port number, which indicates that the UDP packet is a congestion notification message carrying the first message. The payload field carries the content included in the first message, such as: first service information, expected rate, and rate reduction duration.

[0154] For example, please refer to Figure 4b, which is another structural diagram of the first message in an embodiment of this application. Taking an ICMPv6 message carrying the first message as an example, the ICMPv6 message includes an IPv6 header and a payload field. The payload field includes a type field, a code field, a length field, and the content included in the first message. The type field carries a first type, which indicates that the ICMPv6 message is a congestion notification message carrying the first message. Alternatively, the code field carries a first code, which indicates that the ICMPv6 message is a congestion notification message carrying the first message. The content included in the first message may include, for example, first service information, expected rate, and rate reduction duration. The ICMPv6 message is an IPv6-based ICMP message.

[0155] Implementation Method Two:

[0156] The first message is carried in an IP packet, or an IPv6 packet.

[0157] In one example, the first message is carried in the HBH header of the IPv6 packet, or the first message is carried in the DOH header of the IPv6 packet. Another example is that the first message is carried in the option field of the IP packet.

[0158] Please refer to Figure 4c, which is a schematic diagram of the structure of the first message in an embodiment of this application. Taking an IPv6 packet as an example, the IPv6 packet includes fields such as: IPv6 destination address, IPv6 source address, SRH header, type, and length. The SRH header is an optional field. The HBH header or DOH of the IPv6 packet carries the content of the first message, such as: first service information, desired rate, and rate reduction duration.

[0159] Implementation method three:

[0160] The first message is carried in Layer 2 packets according to the OSI model. The OSI model defines a seven-layer model: Physical Layer, Data Link Layer, Network Layer, Transport Layer, Session Layer, Presentation Layer, and Application Layer. Layer 2 packets in the OSI model also refer to Data Link Layer packets.

[0161] In one example, the payload field of the Layer 2 message carries the first message.

[0162] In one example, when the Layer 2 message carries the first message, the Layer 2 message also includes a first destination MAC address, which indicates that the Layer 2 message is a congestion notification message carrying the first message. After receiving the Layer 2 message, the first flow control device can determine that the Layer 2 message carries the first message based on the first destination MAC address, and further parse the first message from the Layer 2 message.

[0163] In one example, when the Layer 2 message carries the first message, the Layer 2 message also includes a first Ethernet type field, which indicates that the Layer 2 message is a congestion notification message carrying the first message. After receiving the Layer 2 message, the first flow control device can determine that the Layer 2 message carries the first message based on the first Ethernet type, and further parse the first message from the Layer 2 message.

[0164] Please refer to Figure 4d, which is a schematic diagram of the structure of the first message in an embodiment of this application. Taking a Layer 2 message as an example, the Layer 2 message includes: destination MAC address, source MAC address, ethertype, and payload field. Wherein:

[0165] The destination MAC field can carry a first destination MAC address, which is a newly defined MAC address used to indicate that the Layer 2 message is a congestion notification message carrying the first message. Alternatively, the ethertype field can carry a first ethertype field, which is a newly defined ethertype field indicating that the Layer 2 message is a congestion notification message carrying the first message. The payload of the Layer 2 message carries the content of the first message, such as: first service information, desired rate, and rate reduction duration. In this case, the first message is similar to a PFC anti-pressure frame. After receiving the Layer 2 message carrying the first message, the first flow control device identifies the Layer 2 message as a congestion notification message carrying the first message based on the first destination MAC address or the first ethertype field. Then, the first flow control device reads the first message carried in the payload of the Layer 2 message, thereby further performing congestion control processing on the service corresponding to the first service information.

[0166] Next, referring to Figure 5, the method by which the first device learns the second entry will be described. Figure 5 is a flowchart illustrating a self-learning method for the second entry provided in an embodiment of this application. The method shown in Figure 5 is executed by the first device, specifically by the first flow control device on the first device. The method shown in Figure 5 includes the following steps S201-S203.

[0167] S201: The first flow control device obtains a first message sent by the third device to the first device, and the first message belongs to the service.

[0168] In this application, the third device is an upstream device of the first device. Specifically, during the transmission of the service, it first passes through the third device and then through the first device. For example, if the first device is network device 1 as shown in Figure 2, then the third device can be a CPE; if the first device is network device 2 as shown in Figure 2, then the third device can be network device 1; and so on, which will not be described in detail here.

[0169] A third device sends a first message to a first device, which can receive the first message. The first flow control device acquires the first message received by the first device. For example, the first flow control device can acquire the first message received by the first device from its receiving module.

[0170] S202: The first flow control device determines the first service information based on the first message.

[0171] After receiving the first message, the first flow control device can determine the first service information based on the first message. Specifically, the first flow control device can determine the first service information based on some information included in the first message. In one example, the first flow control device can use the value of a specific field in the first message as the first service information. In another example, the first flow control device can calculate the values ​​of some fields in the first message to obtain the first service information. For example, the first flow control device can extract the 5-tuple information of the first message and perform calculations (e.g., hash calculations) on the 5-tuple information of the first message to obtain the first service information.

[0172] S203: The first flow control device obtains the second entry based on the first service information and the identifier of the second queue.

[0173] In addition, the first flow control device can also determine the queue used by the first device to forward the first packet. Specifically, the first flow control device can interact with the NP of the first device to determine the queue used by the first device to forward the first packet, wherein the NP can determine the queue it uses to forward the second packet. In this application, the queue used by the first device to forward the first packet is the aforementioned second queue. After the first flow control device determines the identifier of the second queue, it can obtain the second entry based on the first service information and the identifier of the second queue.

[0174] Next, referring to Figure 6, the method by which the second device learns the first entry will be described. Figure 6 is a flowchart illustrating a self-learning method for the first entry provided in an embodiment of this application. The method shown in Figure 6 is executed by the second device, specifically by the second flow control device on the second device. The method shown in Figure 6 includes the following steps S301-S303.

[0175] S301: The second flow control device obtains a second message sent by the first device to the second device, and the second message belongs to the service.

[0176] The first device sends a second message to the second device, which can receive the second message. The second flow control device acquires the second message received by the second device. For example, the second flow control device can acquire the second message received by the second device from the receiving module of the second device.

[0177] S302: The second flow control device determines the first service information based on the second message.

[0178] The implementation principle of S302 is the same as that of S202. Therefore, for the specific implementation of S302, please refer to the description of S202 above. It will not be repeated here.

[0179] S303: The second flow control device obtains the first entry based on the first service information and the identifier of the first queue.

[0180] In addition, the second flow control device can also determine the queue used by the second device to forward the second packet. Specifically, the second flow control device can interact with the NP of the second device to determine the queue used by the second device to forward the second packet. In this application, the queue used by the second device to forward the second packet is the aforementioned first queue. After determining the identifier of the first queue, the second flow control device can obtain a first entry that includes the correspondence between the first service information and the identifier of the first queue based on the first service information and the identifier of the first queue.

[0181] As described above, the first entry may further include a first output port and / or the identifier of the first device. In this case, the second flow control device may also obtain the first output port and / or the identifier of the first device so as to combine the first output port and / or the identifier of the first device when generating the first entry. Obtaining the first output port refers to obtaining information about the first output port. The first output port may be the ingress port where the second device receives the second message; that is, the second flow control device may determine the ingress port where the second device receives the second message and use that ingress port as the first output port.

[0182] In one example, if the first entry also includes the identifier of the first device, the second flow control device needs to combine the identifier of the first device when generating the first entry. For example, the second flow control device can obtain a first entry including the first service information, the identifier of the first queue, and the identifier of the first device based on the first service information, the identifier of the first queue, and the identifier of the first device.

[0183] In another example, if the first entry also includes a first output port, the second flow control device needs to combine the first output port when generating the first entry. For example, the second flow control device obtains a first entry including the first service information, the identifier of the first queue, and the ingress port of the second device receiving the second message based on the first service information, the identifier of the first queue, and the ingress port of the second device receiving the second message.

[0184] In another example, if the first entry also includes the identifier of the first output port and the identifier of the first device, the second flow control device needs to combine the first output port and the identifier of the first device when generating the first entry. For example, the second flow control device obtains a first entry including the first service information, the identifier of the first queue, the identifier of the first device, and the ingress port of the second device that receives the second message based on the first service information, the identifier of the first queue, the identifier of the first device, and the ingress port of the second device.

[0185] In addition, as mentioned above, the first entry may also include a deceleration duration. In this case, the deceleration duration may be a duration pre-configured on the second device. The second flow control device can obtain the pre-configured duration and further generate the first entry based on the pre-configured duration.

[0186] Next, referring to Figures 7a to 7c, several possible implementations of the embodiments of this application will be introduced. Figures 7a to 7c show schematic diagrams of three congestion control methods.

[0187] As shown in Figure 7a:

[0188] The upper part of Figure 7a corresponds to the second device, which includes a second flow control device that operates on the NP of the second device. The lower part of Figure 7a corresponds to the first device, which includes a first flow control device that operates on the NP of the first device.

[0189] The second flow control device detects the utilization rate of the first queue. When the utilization rate of the first queue exceeds the waterline (i.e., the first utilization rate), it queries the first table entry. Specifically, it queries the first table entry using the identifier of the first queue as an index to obtain the first service information, the first outgoing port, and the IP address of the upstream device. The IP address of the upstream device is the same as the IP address of the first device. Based on the first service information obtained from the query of the first table entry, the second flow control device generates a first message including the first service information and sends the first message to the first device through the first outgoing port. The first flow control device of the first device receives the first message.

[0190] In one example, the NP of the second device and the eTM of the second device can be interconnected via peripheral component interconnect express (PCIE), thereby enabling the second flow control device to detect the usage of the first queue.

[0191] After receiving the first message, the first flow control device can extract the first service information from the first message, and use the first service information as an index to query the second table entry to obtain the identifier of the second queue, and further reduce the sending rate of the second queue.

[0192] In one example, the NP of the first device and the eTM of the first device can also be interconnected via PCIe, thereby enabling the first flow control device to control the rate of the second queue.

[0193] The congestion control method shown in Figure 7b is basically the same as the congestion control method shown in Figure 7a. The difference between Figure 7b and Figure 7a is that in Figure 7b, the first flow control device runs on the CPU of the first device, and the second flow control device runs on the CPU of the second device. In this case, the first message sent by the second flow control device is sent to the first device via the NP of the second device. Similarly, after receiving the first message, the NP of the first device passes the first message to the first flow control device.

[0194] The operations performed by the first and second flow control devices in Figure 7b are described in detail here.

[0195] The congestion control method shown in Figure 7c has the same flow as the congestion control method shown in Figure 7a. The difference between Figure 7c and Figure 7a is that in Figure 7c, the first flow control device runs on the FPGA of the first device, and the second flow control device runs on the FPGA of the second device. The operations performed by the first and second flow control devices in Figure 7c are described in detail here.

[0196] By comparing Figure 7a (or Figure 7b or Figure 7c) and Figure 1c, it can be seen that with this scheme, the congestion control process no longer depends solely on the data path. The first device introduces an additional first flow control device, and the second device introduces an additional second flow control device, thereby realizing service-level congestion control processing.

[0197] Based on the methods provided in the above embodiments, this application also provides corresponding apparatus and devices. Next, the apparatus and devices provided in this application will be described in conjunction with the accompanying drawings.

[0198] Referring to Figure 8, this figure is a structural schematic diagram of a first flow control device provided in an embodiment of this application. The first flow control device belongs to the first equipment. The first flow control device 800 shown in Figure 8 is used to perform the steps performed by the first flow control device provided in the above embodiments.

[0199] As shown in Figure 8, the first flow control device 800 includes a receiving unit 801 and a processing unit 802.

[0200] The receiving unit 801 is used to receive a first message sent by the second flow control device. The first message includes first service information. The first message is used to request the first device to perform congestion control processing for the service corresponding to the first service information. The second flow control device is a second device, which is a downstream device of the first device. The first service information is obtained by the second flow control device according to a first table entry when the first queue used by the second device to forward the service becomes congested. The first table entry includes the identifier of the first queue and the correspondence between the first service information.

[0201] The processing unit 802 is configured to determine, based on the first service information and the second entry, a second queue corresponding to the first service information, wherein the second entry includes a correspondence between the first service information and the identifier of the second queue, and the second queue is a queue used by the first device to forward the service; and reduce the transmission rate of the second queue.

[0202] In one possible implementation, the processing unit 802 is further configured to: acquire a first message sent by a third device to the first device, wherein the first message belongs to the service; determine the first service information based on the first message; and obtain the second entry based on the first service information and the identifier of the second queue.

[0203] In one possible implementation, the first service information includes one of the following: a stream identifier, a slice identifier, an application identifier, or a service identifier.

[0204] In one possible implementation, the first flow control device operates on the forwarding chip of the first device, or the central processing unit (CPU) of the first device, or the field-programmable gate array (FPGA) of the first device.

[0205] In one possible implementation, the first message includes a desired rate, and reducing the sending rate of the second queue includes reducing the sending rate of the second queue to the desired rate.

[0206] In one possible implementation, the first message includes a slowdown period, and the reduction of the transmission rate of the second queue includes: reducing the transmission rate of the second queue during the slowdown period.

[0207] In one possible implementation, the first message is carried in a Transmission Control Protocol (TCP) message, a User Datagram Protocol (UDP) message, or an Internet Control Message Protocol (ICMP) message; or, the first message is carried in an Internet Protocol (IP) message; or, the first message is carried in a Layer 2 message in the Open Systems Interconnection (OSI) model.

[0208] In one possible implementation, the payload field of the Transmission Control Protocol (TCP) message is used to carry the first message; or, the payload field of the User Datagram Protocol (UDP) message is used to carry the first message; or, the payload field of the Internet Control Message Protocol (ICMP) message is used to carry the first message; or, the hop-by-hop (HBH) header of the Internet Protocol (IP) message is used to carry the first message; or, the Destination Options (DOH) header of the IP message is used to carry the first message; or, the optional field of the IP message is used to carry the first message.

[0209] In one possible implementation, when the User Datagram Protocol (UDP) message carries the first message, the UDP message further includes a first port number, which indicates that the UDP message is a congestion notification message carrying the first message; or, when the ICMP message carries the first message, the ICMP message further includes a first type or a first encoding, which indicates that the ICMP message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first destination Media Access Control (MAC) address, which indicates that the Layer 2 message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first Ethertype field, which indicates that the Layer 2 message is a congestion notification message carrying the first message.

[0210] Referring to Figure 9, this figure is a structural schematic diagram of a second flow control device provided in an embodiment of this application. The second flow control device belongs to the second equipment category. The second flow control device 900 shown in Figure 9 is used to perform the steps performed by the second flow control device provided in the above embodiments.

[0211] As shown in Figure 9, the second flow control device 900 includes a processing unit 901 and a sending unit 902.

[0212] The processing unit 901 is configured to determine first service information based on a first entry when the utilization rate of the first queue is higher than the first utilization rate. The first entry includes the identifier of the first queue and the correspondence between the first service information and the first queue. The first queue is the queue in which the second device forwards the service corresponding to the first service information. Based on the first service information, a first message is obtained.

[0213] The sending unit 902 is used to send the first message to the first flow control device of the first device. The first message includes the first service information. The first message is used to request the first device to perform congestion control processing for the service corresponding to the first service information. The first device is an upstream device of the second device.

[0214] In one possible implementation, the first entry further includes: the identifier of the upstream node of the service corresponding to the first queue, wherein the upstream node is the first device; the processing unit 901 is further configured to: determine the identifier of the first device based on the first entry; the sending unit 902 is configured to send the first message to the first flow control device of the first device based on the identifier of the first device.

[0215] In one possible implementation, the first entry further includes: a first output port; the sending unit 902 is configured to: send the first message to the first flow control device of the first device through the first output port.

[0216] In one possible implementation, the first entry further includes the first utilization rate, and the processing unit 901 is further configured to: obtain the first utilization rate based on the first entry.

[0217] In one possible implementation, the processing unit 901 is further configured to: acquire a second message sent by the first device to the second device, wherein the second message belongs to the service; determine the first service information based on the second message; and obtain the first entry based on the first service information and the identifier of the first queue.

[0218] In one possible implementation, obtaining the first entry based on the first service information and the identifier of the first queue includes: obtaining the first entry based on the first service information, the identifier of the first queue, and the identifier of the first device; or, obtaining the first entry based on the first service information, the identifier of the first queue, and the ingress port of the second device receiving the second message, wherein the first ingress port is the first egress port of the second device sending the first message; or, obtaining the first entry based on the first service information, the identifier of the first queue, the identifier of the first device, and the ingress port of the second device receiving the second message.

[0219] In one possible implementation, the processing unit 901 is further configured to: obtain the ingress port through which the second device receives the second message, and / or determine the identifier of the first device.

[0220] In one possible implementation, the first service information includes one of the following: a stream identifier, a slice identifier, an application identifier, or a service identifier.

[0221] In one possible implementation, the second flow control device operates on the forwarding chip of the second device, or the central processing unit (CPU) of the second device, or the field-programmable gate array (FPGA) of the second device.

[0222] In one possible implementation, the first message includes the desired rate.

[0223] In one possible implementation, the first message includes the duration of the slowdown.

[0224] In one possible implementation, the first entry further includes the deceleration duration, and the processing unit 901 is further configured to: obtain the deceleration duration based on the first entry.

[0225] In one possible implementation, the first message is carried in a Transmission Control Protocol (TCP) message, a User Datagram Protocol (UDP) message, or an Internet Control Message Protocol (ICMP) message; or, the first message is carried in an Internet Protocol (IP) message; or, the first message is carried in a Layer 2 message in the Open Systems Interconnection (OSI) model.

[0226] In one possible implementation, the payload field of the Transmission Control Protocol (TCP) message is used to carry the first message; or, the payload field of the User Datagram Protocol (UDP) message is used to carry the first message; or, the payload field of the Internet Control Message Protocol (ICMP) message is used to carry the first message; or, the hop-by-hop (HBH) header of the Internet Protocol (IP) message is used to carry the first message; or, the Destination Options (DOH) header of the IP message is used to carry the first message; or, the optional field of the IP message is used to carry the first message.

[0227] In one possible implementation, when the User Datagram Protocol (UDP) message carries the first message, the UDP message further includes a first port number, which indicates that the UDP message is a congestion notification message carrying the first message; or, when the ICMP message carries the first message, the ICMP message further includes a first type or a first encoding, which indicates that the ICMP message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first destination Media Access Control (MAC) address, which indicates that the Layer 2 message is a congestion notification message carrying the first message; or, when the Layer 2 message carries the first message, the Layer 2 message further includes a first Ethertype field, which indicates that the Layer 2 message is a congestion notification message carrying the first message.

[0228] For details on the specific implementation of the above devices 800 and 900, please refer to the description of the congestion control method provided in the embodiments of this application above, which will not be repeated here.

[0229] In this application, the aforementioned communication devices 800 and 900 may have a hardware structure as shown in Figure 10, which is a schematic diagram of the structure of a device provided in an embodiment of this application.

[0230] Please refer to Figure 10. The device 1000 includes a processor 1010, a communication interface 1020, and a memory 1030. The device 1000 may have one or more processors 1010; Figure 10 shows an example with one processor. In this embodiment, the processor 1010, communication interface 1020, and memory 1030 can be connected via a bus system or other means; Figure 10 shows an example of connection via a bus system 1040.

[0231] Processor 1010 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. Processor 1010 may further include hardware chips. These hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0232] Memory 1030 may include volatile memory, such as random-access memory (RAM); memory 1030 may also include non-volatile memory, such as flash memory, hard disk drive (HDD), or solid-state drive (SSD); memory 1030 may also include combinations of the above types of memory. When the device 1000 shown in FIG. 10 is a first device including a first flow control device, the memory 1030 may be used, for example, to store the aforementioned second entry; when the device 1000 shown in FIG. 10 is a second device including a second flow control device, the memory 1030 may be used, for example, to store the aforementioned first entry.

[0233] Optionally, the memory 1030 stores an operating system and programs, executable modules, or data structures, or subsets thereof, or extended sets thereof. The programs may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and handling hardware-based tasks. The processor 1010 can read the programs in the memory 1030 to implement the congestion control method provided in this embodiment.

[0234] The bus system 1040 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus system 1040 can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used in Figure 10, but this does not indicate that there is only one bus or one type of bus.

[0235] This application also provides a computer-readable storage medium, including instructions or a computer program, which, when run on a computer, causes the computer to perform the congestion control method provided in the above embodiments. For example, it causes the computer to perform the method steps provided in the above embodiments executed by a first flow control device; or, for example, it causes the computer to perform the method steps provided in the above embodiments executed by a second flow control device.

[0236] This application also provides a computer program product comprising instructions or a computer program, which, when run on a computer, causes the computer to execute the congestion control method provided in the above embodiments. For example, it causes the computer to execute the method steps provided in the above embodiments executed by a first flow control device; or, for example, it causes the computer to execute the method steps provided in the above embodiments executed by a second flow control device.

[0237] This application also provides a communication system, which includes the first device and the second device mentioned in the above embodiments. The first device includes a first flow control device, which is used to perform the operations performed by the first flow control device provided in the above embodiments. The second device includes a second flow control device, which is used to perform the operations performed by the second flow control device provided in the above embodiments.

[0238] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0239] The embodiments of this application have been described in detail above. The steps in the method of the embodiments of this application can be scheduled, merged or deleted in sequence according to actual needs; the modules in the device of the embodiments of this application can be divided, merged or deleted according to actual needs.

[0240] It should be understood that the phrase "an embodiment" or "one embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in one embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence number of the above-described processes does not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0241] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0242] It should be understood that in the embodiments of this application, "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.

[0243] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0244] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

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

[0246] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

Claims

1. A congestion control method, characterized in that, The method is applied to a first device, the first device including a first flow control device, the method comprising: The first flow control device receives a first message sent by the second flow control device. The first message includes first service information. The first message is used to request the first device to perform congestion control processing for the service corresponding to the first service information. The second flow control device belongs to the second device, which is a downstream device of the first device. The first service information is obtained by the second flow control device based on a first table entry when the first queue used by the second device to forward the service becomes congested. The first table entry includes the identifier of the first queue and the correspondence between the first service information. The first flow control device determines the second queue corresponding to the first service information based on the first service information and the second table entry. The second table entry includes the correspondence between the first service information and the identifier of the second queue. The second queue is the queue used by the first device to forward the service. The first flow control device reduces the sending rate of the second queue.

2. The method according to claim 1, characterized in that, The method further includes: The first flow control device acquires a first message sent by the third device to the first device, and the first message belongs to the service. The first flow control device determines the first service information based on the first message; The first flow control device obtains the second entry based on the first service information and the identifier of the second queue.

3. The method according to claim 1 or 2, characterized in that, The first business information includes one of the following: Stream identifier, or slice identifier, or application identifier, or service identifier.

4. The method according to any one of claims 1-3, characterized in that, The first flow control device operates on the forwarding chip of the first device, or the central processing unit (CPU) of the first device, or the field-programmable gate array (FPGA) of the first device.

5. The method according to any one of claims 1-4, characterized in that, The first message includes a desired rate, and the first flow control device reduces the transmission rate of the second queue, including: The first flow control device reduces the sending rate of the second queue to the desired rate.

6. The method according to any one of claims 1-5, characterized in that, The first message includes a reduction duration, and the first flow control device reduces the transmission rate of the second queue, including: The first flow control device reduces the transmission rate of the second queue during the deceleration period.

7. The method according to any one of claims 1-6, characterized in that, The first message is carried in a Transmission Control Protocol (TCP) message, a User Datagram Protocol (UDP) message, or an Internet Control Message Protocol (ICMP) message; Alternatively, the first message may be carried in an Internet Protocol (IP) packet; Alternatively, the first message may be carried as a Layer 2 message in the Open Systems Interconnection (OSI) model.

8. The method according to claim 7, characterized in that, The payload field of the Transmission Control Protocol (TCP) message is used to carry the first message; Alternatively, the payload field of the User Datagram Protocol (UDP) message may be used to carry the first message; Alternatively, the payload field of the Internet Control Message Protocol (ICMP) message may be used to carry the first message; Alternatively, the hop-by-hop option HBH header of the Internet Protocol (IP) packet may be used to carry the first message; Alternatively, the Destination Options (DOH) header of the Internet Protocol (IP) packet may be used to carry the first message; Alternatively, the optional field of the Internet Protocol (IP) packet may be used to carry the first message.

9. The method according to claim 7 or 8, characterized in that, When the User Datagram Protocol (UDP) message carries the first message, the UDP message also includes a first port number, which is used to indicate that the UDP message is a congestion notification message carrying the first message. Alternatively, when the ICMP message carries the first message, the ICMP message may further include a first type or a first code, wherein the first type or the first code indicates that the ICMP message is a congestion notification message carrying the first message; Alternatively, when the Layer 2 message carries the first message, the Layer 2 message also includes a first destination Media Access Control (MAC) address, the first destination MAC address indicating that the Layer 2 message is a congestion notification message carrying the first message; Alternatively, when the Layer 2 message carries the first message, the Layer 2 message may also include a first Ethertype field, which indicates that the Layer 2 message is a congestion notification message carrying the first message.

10. A congestion control method, characterized in that, The method is applied to a second device, the second device including a second flow control device, the method comprising: When the utilization rate of the first queue is higher than the first utilization rate, the second flow control device determines the first service information according to the first entry. The first entry includes the identifier of the first queue and the correspondence between the first service information. The first queue is the queue in which the second device forwards the service corresponding to the first service information. The second flow control device obtains a first message based on the first service information and sends the first message to the first flow control device of the first device. The first message includes the first service information and is used to request the first device to perform congestion control processing for the service corresponding to the first service information. The first device is the upstream device of the second device.

11. The method according to claim 10, characterized in that, The first entry also includes: the identifier of the upstream node of the service corresponding to the first queue, wherein the upstream node is the first device; Sending the first message to the first flow control device of the first device includes: The identifier of the first device is determined based on the first entry, and the first message is sent to the first flow control device of the first device based on the identifier of the first device.

12. The method according to claim 10 or 11, characterized in that, The first entry further includes: a first output port; sending the first message to the first flow control device of the first device includes: The first message is sent to the first flow control device of the first device through the first output port.

13. The method according to any one of claims 10-12, characterized in that, The first entry also includes the first usage rate, and the method further includes: The first utilization rate is obtained based on the first table entry.

14. The method according to any one of claims 10-13, characterized in that, The method further includes: The second flow control device acquires a second message sent by the first device to the second device, wherein the second message belongs to the service; The second flow control device determines the first service information based on the second message; The second flow control device obtains the first entry based on the first service information and the identifier of the first queue.

15. The method according to claim 14, characterized in that, The second flow control device obtains the first entry based on the first service information and the identifier of the first queue, including: The second flow control device obtains the first entry based on the first service information, the identifier of the first queue, and the identifier of the first device; or, The second flow control device obtains the first entry based on the first service information, the identifier of the first queue, and the ingress port of the second device receiving the second message, wherein the first ingress port is the first egress port of the second device sending the first message; or, The second flow control device obtains the first entry based on the first service information, the identifier of the first queue, the identifier of the first device, and the ingress port of the second device for receiving the second message.

16. The method according to claim 15, characterized in that, The method further includes: The second flow control device obtains the ingress port where the second device receives the second message, and / or determines the identifier of the first device.

17. The method according to any one of claims 10-16, characterized in that, The first business information includes one of the following: Stream identifier, or slice identifier, or application identifier, or service identifier.

18. The method according to any one of claims 10-17, characterized in that, The second flow control device operates on the forwarding chip of the second device, or the central processing unit (CPU) of the second device, or the field-programmable gate array (FPGA) of the second device.

19. The method according to any one of claims 10-18, characterized in that, The first message includes the desired rate.

20. The method according to any one of claims 10-19, characterized in that, The first message includes the duration of the slowdown.

21. The method according to claim 20, characterized in that, The first entry also includes the deceleration duration, and the method further includes: The second flow control device obtains the deceleration duration based on the first entry.

22. The method according to any one of claims 10-21, characterized in that, The first message is carried in a Transmission Control Protocol (TCP) message, a User Datagram Protocol (UDP) message, or an Internet Control Message Protocol (ICMP) message; Alternatively, the first message may be carried in an Internet Protocol (IP) packet; Alternatively, the first message may be carried as a Layer 2 message in the Open Systems Interconnection (OSI) model.

23. The method according to claim 22, characterized in that, The payload field of the Transmission Control Protocol (TCP) message is used to carry the first message; Alternatively, the payload field of the User Datagram Protocol (UDP) message may be used to carry the first message; Alternatively, the payload field of the Internet Control Message Protocol (ICMP) message may be used to carry the first message; Alternatively, the hop-by-hop option HBH header of the Internet Protocol (IP) packet may be used to carry the first message; Alternatively, the Destination Options (DOH) header of the Internet Protocol (IP) packet may be used to carry the first message; Alternatively, the optional field of the Internet Protocol (IP) packet may be used to carry the first message.

24. The method according to claim 22 or 23, characterized in that, When the User Datagram Protocol (UDP) message carries the first message, the UDP message also includes a first port number, which is used to indicate that the UDP message is a congestion notification message carrying the first message. Alternatively, when the ICMP message carries the first message, the ICMP message may further include a first type or a first code, wherein the first type or the first code indicates that the ICMP message is a congestion notification message carrying the first message; Alternatively, when the Layer 2 message carries the first message, the Layer 2 message also includes a first destination Media Access Control (MAC) address, the first destination MAC address indicating that the Layer 2 message is a congestion notification message carrying the first message; Alternatively, when the Layer 2 message carries the first message, the Layer 2 message may also include a first Ethertype field, which indicates that the Layer 2 message is a congestion notification message carrying the first message.

25. A communication device, characterized in that, The device includes multiple functional modules that interact with each other to implement the method as described in any one of claims 1-24.

26. A communication device, comprising a processor and a memory, the memory for storing program code, the processor for calling the program code in the memory to cause the communication device to perform the method as described in any one of claims 1-24.

27. A computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-24.

28. A computer program product, characterized in that, Includes program code that, when a computer runs the computer program product, causes the computer to perform the method as described in any one of claims 1-24.

29. A communication system, characterized in that, The system includes: A first device for performing the method according to any one of claims 1-9, and a second device for performing the method according to any one of claims 10-24.