Congestion notification method based on queue scheduling and chip
By pre-storing the CNP queue in the forwarding chip and scheduling the output CNP based on the forwarding information of the IP message, the problem of long CNP reaction time in RoCEv2 technology is solved, and the efficiency of network congestion processing and the reduction of CPU load is improved.
Patent Information
- Application Number
- CN202410986017.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-12
AI Technical Summary
In the existing RoCEv2 technology, the response time of the congestion notification message (CNP) is longer, resulting in a low efficiency in handling network congestion.
The CNP queue is stored in advance in the forwarding chip, so that after receiving the IP message, the corresponding CNP queue is retrieved and dispatched from the flow information table based on the forward flow information, without reporting to the CPU to generate CNP, simplifying the CNP generation step and shorten feedback time.
It improves the processing efficiency of message congestion, reduces the CPU load and response time, and improves the processing capability of the network.
Smart Images

Figure CN118945128A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a congestion notification method and chip based on queue scheduling. Background Art
[0002] In order to solve the problems of high processing latency, low single-core throughput and high central processing unit (CPU) consumption caused by frequent kernel-based data copying and interrupt operations to transmit data, a remote direct memory access (RDMA) technology is proposed in the related art to offload the network stack to the network interface card (NIC), thereby achieving high throughput and ultra-low latency with near-zero CPU overhead.
[0003] In RDMA technology, the normal use of RDMA applications is usually supported by infinite bandwidth (IB) and remote direct memory access over converged Ethernet version 2 (RoCEv2) technology. In RoCEv2 technology, if there is congestion in the transmission of data, a congestion notification packet (CNP) can be used for congestion notification. Specifically, after the intermediate device finds congestion, it first uses the explicit congestion notification (ECN) technology to make a special mark in the Internet Protocol (IP) message header. After receiving the IP message, the receiving end generates the corresponding CNP according to the special mark and transmits the CNP to the sending end. The sending end controls the transmission speed of the IP message according to the CNP.
[0004] However, in the above congestion notification method, after the network finds congestion, the receiving end needs to generate and send a CNP, which results in a long reaction time to the network congestion.
[0005] In order to solve the problem of long CNP reaction time in the existing RoCEv2 technology, the related technology proposes a fast CNP solution to generate CNP in advance in the intermediate device. However, since the traditional forwarding chip focuses on high-speed forwarding and has almost no ability to process protocols and generate new messages, the CNP is generated by the general-purpose computing chip CPU in the intermediate device. Therefore, the fast CNP solution needs to send the congestion message to the CPU after the intermediate device finds congestion, which leads to low efficiency in handling congestion. Summary of the invention
[0006] The present application provides a congestion notification method and chip based on queue scheduling, which can improve the processing efficiency of message congestion.
[0007] In order to achieve the above objectives, this application adopts the following technical solutions:
[0008] In a first aspect, the present application provides a congestion notification method based on queue scheduling, which is applied to a forwarding chip in a message forwarding device, wherein the message forwarding device also includes a CPU, and the forwarding chip is coupled to the CPU. The method includes: receiving an IP message from a sending end device, and when congestion of a sending queue is detected, retrieving and determining a corresponding flow data entry from a flow information table according to forward flow information carried by the IP message, determining a first CNP queue corresponding to the flow data entry from at least one pre-stored CNP queue, and scheduling the first CNP queue to output a CNP, wherein the CNP is a message pre-sent by the CPU, and the CNP is used to characterize congestion in the transmission process of the IP message.
[0009] The forward flow information includes the IP address of the sending device of the IP message, the IP address of the receiving device, the user datagram protocol (UDP) port number of the sending device, the UDP port number of the receiving device, and the destination queue number (queue pair number, QPN) of the receiving device.
[0010] Based on the above technical solution, the congestion notification method based on queue scheduling provided by the embodiment of the present application stores at least one CNP queue in advance in the forwarding chip, so that after the forwarding chip receives the IP message from the sending end device, if the transmission queue is congested, it can retrieve and determine the corresponding flow data entry from the flow information table according to the forward flow information carried by the IP message, and determine the first CNP queue corresponding to the flow data entry from at least one pre-stored CNP queue to schedule the CNP pre-sent by the CPU in the first CNP queue out of the queue. There is no need to report the congestion information to the CPU to generate CNP after the congestion occurs, which simplifies the steps of generating CNP, shortens the response time of the feedback CNP, and improves the processing efficiency of message congestion.
[0011] In a first possible implementation manner of the first aspect, for each CNP queue in the at least one CNP queue: the CNP queue is used to store a CNP corresponding to a flow direction data entry, and there is a corresponding relationship between the CNP queue and the flow direction data entry; the CNP queue is used to output the CNP when congestion is detected in the flow direction corresponding to the CNP queue.
[0012] In a second possible implementation manner of the first aspect, the scheduling the first CNP queue to output the CNP includes: scheduling the first CNP queue by a scheduler to output the CNP; or increasing the number of tokens in the rate-limiting token bucket of the first CNP queue to a CNP length to output the CNP.
[0013] In a third possible implementation manner of the first aspect, for each CNP queue of the at least one CNP queue, a scheduling priority of the CNP queue is higher than a scheduling priority of the receiving queue.
[0014] In a fourth possible implementation manner of the first aspect, a congestion notification method based on queue scheduling provided by an embodiment of the present application also includes: receiving at least one CNP from a CPU and a flow data entry corresponding to each CNP in at least one CNP, generating a second CNP queue for each CNP in at least one CNP, the second CNP queue being a queue in at least one CNP queue, storing the CNP in the second CNP queue, storing the flow data entry in a flow information table, and establishing a correspondence between the flow data entry and the second CNP queue.
[0015] In the fifth possible implementation of the first aspect, a congestion notification method based on queue scheduling provided by an embodiment of the present application also includes: when the flow information table does not include a flow data entry corresponding to the forward flow information carried by the IP packet, sending the forward flow information carried by the IP packet to the CPU.
[0016] In a sixth possible implementation manner of the first aspect, a congestion notification method based on queue scheduling provided by an embodiment of the present application further includes: when congestion of the sending queue is not detected, not polling the CNP queue.
[0017] In a second aspect, the present application provides a chip, the chip comprising a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement a congestion notification method based on queue scheduling as described in the first aspect and any possible implementation method of the first aspect.
[0018] Specifically, the chip provided in the embodiment of the present application also includes a memory for storing computer programs or instructions.
[0019] In a third aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a chip, the chip executes a congestion notification method based on queue scheduling as described in the first aspect and any possible implementation of the first aspect.
[0020] In a fourth aspect, an embodiment of the present application provides a computer program product comprising instructions. When the computer program product runs on a chip, the chip executes a congestion notification method based on queue scheduling as described in the first aspect and any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic diagram of a transmission path for triggering a CNP notification in the related art;
[0022] Figure 2 It is a structural diagram of a message forwarding device with advanced CNP proposed in the related art;
[0023] Figure 3 A structural diagram of a message forwarding device provided in an embodiment of the present application;
[0024] Figure 4 One of the method flow charts of a congestion notification method based on queue scheduling provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of the scheduling principle of a trigger-type scheduler provided in an embodiment of the present application;
[0026] Figure 6 A schematic diagram of the scheduling principle of a trigger-type token bucket provided in an embodiment of the present application;
[0027] Figure 7 A second method flow chart of a congestion notification method based on queue scheduling provided in an embodiment of the present application;
[0028] Figure 8 A method flow chart of a congestion notification method based on queue scheduling provided in an embodiment of the present application;
[0029] Fig. 9 A fourth method flow chart of a congestion notification method based on queue scheduling provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] A congestion notification method and chip based on queue scheduling provided in an embodiment of the present application are described in detail below in conjunction with the accompanying drawings.
[0031] The term "and / or" in this article is merely a description of the corresponding relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0032] The terms "first" and "second" and the like in the specification and drawings of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0033] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0034] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0035] In the description of the present application, unless otherwise specified, “plurality” means two or more.
[0036] Traditional transmission control protocol (TCP) / IP network technology transmits data through frequent data copying and interrupt operations in the operating system kernel. However, this communication method based on the operating system kernel has problems such as high processing latency, low single-core throughput and high CPU consumption.
[0037] Therefore, by introducing RDMA technology to bypass the kernel and offload the network stack to the NIC, high throughput and ultra-low latency with close to zero CPU overhead can be achieved. However, RDMA technology has high requirements for network performance quality. If packet loss occurs in the network, it will have a huge impact on RDMA transmission performance. Therefore, in order to support upper-layer RDMA applications, IB technology and RoCEv2 technology are used to achieve near-lossless performance for the network. Specifically: through key technologies such as headroom buffer, priority-based flow control (PFC), and ECN, a lossless transmission channel is provided for RDMA at the network level.
[0038] In RoCEv2 technology, a CNP is defined for congestion notification. For example, in standard protocols (such as infiniBand architecture specification volume 1), a message in which the high 3 bits of the opcode field (opcode) in the base transport header (BTH) are filled with 100 is defined as a CNP.
[0039] In the related art, if packet loss actually occurs during the transmission process, a negative acknowledgment (NAK) is used to notify the packet loss; if congestion occurs in the intermediate device but the congestion is not to the extent of packet loss, it will trigger CNP to notify the congestion, prompting the sending device to slow down to avoid packet loss caused by increased congestion. After receiving the CNP, the sending device will associate with the queue (queue pair, QP) corresponding to the CNP and slow down the QP according to specific rules.
[0040] like Figure 1 The figure shows a transmission path diagram for triggering CNP notification in related technologies. In conventional IB and RoCEv2 technologies, the transmission protocol runs on the NICs at both ends. The intermediate device does not process the transmission protocol, but only forwards it. When transmitting a message, if the intermediate device finds congestion, it uses ECN technology to make a special mark in the message header and transmit it to the receiving NIC first. After the receiving NIC generates CNP, it is transmitted to the sending NIC. The sending NIC controls the transmission speed of the message according to CNP.
[0041] However, in this method of generating CNPs through a receiving device, the transmission path of the CNPs is poor and the processing efficiency of message congestion is low.
[0042] In order to solve the problem that the CNP transmission path is long and the processing efficiency of message congestion is low, an early CNP technology is proposed in the related art, such as Figure 2As shown in the figure, it is a structural diagram of the message forwarding device of the advance CNP. Since forwarding chips such as network processor (NP) / application specific integrated circuit (ASIC) / traffic management (TM) can only process specific message headers but cannot perform protocol processing, after the forwarding chip receives the IP message via the switching network, if queue congestion is detected, a special mark will be made in the IP message header and sent to the CPU (such as the CPU of the interface board or the CPU of the device main control board) for processing. The CNP is assembled with the help of the general computing power of the CPU, and then the CNP is sent to the forwarding chip and sent via the switching network.
[0043] However, the above-mentioned method of assembling CNPs using the general computing power of the CPU, on the one hand, in the case of congestion, each congested message must be sent to the CPU for processing, which will cause pressure on the CPU; on the other hand, after the congestion occurs, the message is sent to the CPU for processing. Since the processing is performed after the congestion event occurs, the response time is still relatively long, resulting in low processing efficiency for message congestion.
[0044] In this context, in order to solve the problem of low processing efficiency of message congestion in the related art, the present application provides a congestion notification method based on queue scheduling, by pre-storing at least one CNP queue in the forwarding chip, so that after receiving the IP message from the sending end device, if the forwarding chip detects that the transmission queue is congested, it can retrieve and determine the corresponding flow data entry from the flow information table according to the forward flow information carried by the IP message, and determine the first CNP queue corresponding to the flow data entry from at least one pre-stored CNP queue, so as to schedule the CNP pre-sent by the CPU in the first CNP queue out of the queue. There is no need to report the congestion information to the CPU to generate CNP after the congestion occurs, which simplifies the steps of generating CNP, shortens the response time of the feedback CNP, and improves the processing efficiency of message congestion.
[0045] like Figure 3 , which is a structural diagram of a message forwarding device provided in an embodiment of the present application. The message forwarding device 300 includes an interface board 310 and a switching network 320. The interface board 310 includes a forwarding chip 311 and a CPU 312. The forwarding chip 311 is coupled to the CPU 312.
[0046] The message forwarding device 300 can receive IP messages and send CNPs; the CPU 312 can generate CNPs and send them to the forwarding chip 311; the forwarding chip 311 can schedule the CNP queue to output the CNP when the sending queue is congested.
[0047] Exemplarily, the forwarding chip 311 can receive IP packet 1 via the switching network 320, and when detecting congestion in the sending queue, determine CNP queue 1 corresponding to the forward flow information carried by IP packet 1 from pre-stored CNP queue 1 and CNP queue 2, and schedule CNP queue 1 to output CNP1 pre-issued by CPU 312, and send CNP1 via the switching network 320.
[0048] Combine the following Figure 3 , refer to the following Figures 4 to 9 , describes the congestion notification method based on queue scheduling provided in an embodiment of the present application.
[0049] Figure 4 A method flow chart of a congestion notification method based on queue scheduling is provided in an embodiment of the present application. The subject executing the method can be a forwarding chip, or it can be various devices / modules in the forwarding chip, such as an integrated circuit. The embodiment of the present application does not make specific limitations on this.
[0050] For example, Figure 4 As shown, a congestion notification method based on queue scheduling provided in an embodiment of the present application may include the following S401 to S404:
[0051] S401: Receive an IP message from a sending device.
[0052] The IP message is a RoCEv2 message, which is encapsulated with an IP message header, a UDP message header, and a BTH message header. The source IP address and destination IP address of the IP message header, the source port number and destination port number of the UDP message header, and the destination QPN in the BTH header in the message can be used as forward flow information.
[0053] In the embodiment of the present application, the sending end device may be a communication device with data processing capability, for example, the sending end device may be a NIC device.
[0054] In an embodiment of the present application, an IP message from a sending device may be received via a switching network.
[0055] Furthermore, after receiving the IP message, it is also necessary to determine the sending queue into which the IP message needs to be queued according to the quality of service (QoS) level of the IP message.
[0056] For example, the forwarding chip includes three sending queues (sending queue 1, sending queue 2, and sending queue 3). Among them, the QoS level corresponding to sending queue 1 is 1, the QoS level corresponding to sending queue 2 is 2, and the QoS level corresponding to sending queue 3 is 3. If the QoS level of the received IP message is 2, it can be determined that the IP message needs to be queued in sending queue 2.
[0057] S402: When the sending queue is detected to be congested, the corresponding flow direction data entry is retrieved and determined from the flow direction information table according to the forward flow direction information carried by the IP message.
[0058] Optionally, after determining the sending queue to be enqueued according to the QoS level of the IP message, it is also necessary to perform congestion judgment on the sending queue.
[0059] In the embodiment of the present application, weighted random early detection (WRED) can be used to monitor whether the sending queue is congested. For example, by configuring the three parameters of the high threshold, low threshold, and discard probability in WRED, when the queue depth of the sending queue does not reach the low threshold, the message will not be judged as congested when entering the queue. When the queue depth of the sending queue reaches the low threshold but does not reach the high threshold, there is a certain probability that the message will be judged as congested when entering the queue. When the queue depth reaches the high threshold, the message will be judged as congested when entering the queue.
[0060] For example, if the upper threshold / lower threshold is 1000KB / 500KB respectively and the discard probability is 100%, if the queue depth of the sending queue is 800KB when the message is queued, there is a probability of 60%=100%*(800-500) / (1000-500) that the message is judged as congested.
[0061] Optionally, in an embodiment of the present application, the above-mentioned flow information table is a table maintained in the forwarding chip, and the above-mentioned flow information table stores multiple flow data entries, each flow data entry includes a dual-end IP address, a dual-end port number, and a dual-end QPN.
[0062] In an embodiment of the present application, when congestion of the sending queue is monitored, the flow data entry corresponding to the parameters in the forward flow information can be retrieved and determined from the flow information table based on the source / destination IP address, source / destination port number, and destination QPN in the forward flow information carried by the IP packet.
[0063] For example, the flow direction information table includes flow direction data entry A, flow direction data entry B and flow direction data entry C. Among them, flow direction data entry A includes IPA1, IPA2, portA1, portA2, QPNA1 and QPNA2; flow direction data entry B includes IPB1, IPB2, portB1, portB2, QPNB1 and QPNB2; flow direction data entry C includes IPC1, IPC2, portC1, portC2, QPNC1 and QPNC2. If the forward flow direction information of the received IP message includes IPB1, IPB2, portB1, portB2, QPNB2, then the flow direction data entry B can be directly determined as the flow direction data entry corresponding to the IP message.
[0064] Optionally, in the embodiment of the present application, when no congestion of the sending queue is detected, the CNP queue is not polled.
[0065] In the embodiment of the present application, if the sending queue is not detected to be congested, the scheduler in the forwarding chip will not poll the CNP queue in the forwarding chip during polling scheduling, that is, the CNP queue will not be scheduled out of the queue.
[0066] Furthermore, when it is determined that the sending queue where the IP message needs to be queued is not congested, the IP message is queued in the sending queue, and then the outbound interface of the IP message is determined by querying the forwarding information base (FIB), and then the IP message is forwarded to the interface board where the outbound interface is located through the switching network.
[0067] S403: Determine a first CNP queue corresponding to the flow data entry from at least one pre-stored CNP queue.
[0068] In the embodiment of the present application, each CNP queue is used to store a CNP corresponding to a flow data entry, and there is a corresponding relationship between the CNP queue and the flow data entry.
[0069] Exemplarily, in the CNP, the source IP address and destination IP address of the IP packet header, the source port number and destination port number of the UDP packet header, and the destination queue number in the BTH header correspond to the flow data included in a flow data entry in the flow information table.
[0070] For example, the flow information table includes flow data entry A, flow data entry B, and flow data entry C, wherein flow data entry A includes IPA1, IPA2, portA1, portA2, QPNA1, and QPNA2. Then the source / destination IP address of the IP packet header of the CNP corresponding to flow data entry A is IPA2 / IPA1, the source / destination port number of the UDP packet header is portA2 / portA1, and the destination queue number in the BTH header is QPNA1.
[0071] In the embodiment of the present application, the CNP queue is used to output the CNP when congestion is detected in the flow direction corresponding to the CNP queue.
[0072] Exemplarily, if congestion in the sending queue is detected, the CNP queue is used to retrieve and determine the corresponding flow data entry from the flow information table according to the forward flow information carried by the IP message, and output the CNP when it is determined that the flow data entry is the flow data entry corresponding to its own CNP queue.
[0073] In the embodiment of the present application, after the flow direction data entry corresponding to the IP packet is determined, the first CNP queue corresponding to the flow direction data entry may be determined from at least one pre-stored CNP queue.
[0074] For example, at least one CNP queue includes CNP queue A (corresponding to flow data entry A), CNP queue B (corresponding to flow data entry B), and CNP queue C (corresponding to flow data entry C). If flow data entry B is retrieved according to the forward flow information carried by the IP message, and flow data entry B corresponds to CNP queue B, then CNP queue B is determined as the first CNP queue.
[0075] S404: Schedule the first CNP queue to output the CNP.
[0076] CNP is used to indicate that congestion occurs during the transmission of IP packets.
[0077] Optionally, the CNP may instruct the sending end device to reduce the frequency of sending IP packets carrying forward flow information.
[0078] In an optional implementation, the first CNP queue may be scheduled to output the CNP by means of triggered scheduling.
[0079] It should be noted that the scheduler in the forwarding chip in the related art is a polling scheduler, which will cyclically schedule multiple queues mounted under it according to the specified polling rules. The scheduler in the embodiment of the present application is a trigger scheduler, which is scheduled to the queue mounted under it by event triggering. In the absence of event triggering, the multiple queues mounted under it will not be cyclically scheduled. Therefore, if congestion does not occur, the scheduler will not be scheduled, so the CNP queue will not be dequeued; and if congestion is determined to occur, the scheduler can be triggered in the form of an event to trigger the dequeuing of the CNP queue.
[0080] In the embodiment of the present application, the first CNP queue may be scheduled by a scheduler to output a CNP.
[0081] For example, Figure 5 As shown, a separate scheduler can be set for the CNP queue in the forwarding chip. After receiving IP packet 1, if a congestion event occurs in the sending queue, the scheduler corresponding to the CNP queue will be triggered to schedule the CNP queue to output CNP.
[0082] Optionally, in an embodiment of the present application, after the CNP queue outputs the CNP, the CNP queue is empty. At this time, if it is detected again that the sending queue of the flow information corresponding to the CNP queue is congested, triggering the scheduler scheduling, the CNP queue will not output the CNP, thereby avoiding continuous triggering of the CNP in a short period of time.
[0083] In another optional implementation, the CNP may be output by triggering a token bucket.
[0084] In the embodiment of the present application, the number of tokens in the rate-limiting token bucket of the first CNP queue may be increased, and the CNP may be output when the amount of data corresponding to the number of tokens is equal to or exceeds the length of the CNP message in the first CNP queue.
[0085] In an embodiment of the present application, the above-mentioned method of triggering the token bucket can be implemented based on a committed access rate (CAR).
[0086] It should be noted that CAR controls the rate through the number of tokens. In the embodiment of the present application, the token reply speed is set to 0. Therefore, when there is no congestion, the number of tokens in the bucket is always 0, and the CNP does not have enough tokens to dequeue. When a congestion event is detected, the operation of modifying the number of tokens can be triggered in the form of an event, and the number of tokens can be increased by 1 CNP size, thereby allowing 1 CNP to obtain a token, thereby triggering 1 CNP to dequeue.
[0087] For example, Figure 6As shown, the CAR speed limit can be set in the outbound direction of the CNP queue in the forwarding chip, and the token reply speed is set to 0, the initial number of tokens in the token bucket is 0, and the token bucket size is 1 CNP size. After receiving IP packet 1, if a congestion event is detected in the sending queue, it will trigger the modification of the number of tokens in the token bucket to 1 CNP size. At this time, the CNP queue can be scheduled to output CNP.
[0088] In this way, by scheduling the dequeue of the CNP queue by triggering the token bucket, it can be ensured that the CNP queue will not output CNP when there is no queue congestion.
[0089] Optionally, in the embodiment of the present application, in the case where the CNP is scheduled by triggering a token bucket, the scheduling priority of the CNP queue may also be set to the highest or second highest.
[0090] In an embodiment of the present application, the scheduling priority of the CNP queue is higher than the scheduling priority of the receiving queue.
[0091] In this way, by setting the scheduling priority of the CNP queue to the highest, it can be ensured that when queue congestion occurs, the CNP queue is scheduled to output the CNP in time without waiting for the scheduler to poll the CNP queue, thereby improving the speed of CNP dequeueing.
[0092] Furthermore, after scheduling the first CNP to output the CNP, the outbound interface of the CNP may be determined through the FIB, and then the CNP may be forwarded to the interface board where the outbound interface is located through the switching network.
[0093] In the embodiment of the present application, CNP indicates that there is a congestion problem in the transmission process of the message in the flow direction corresponding to the forward flow information carried by the IP message corresponding to the CNP. Therefore, after outputting the CNP, if the sending device receives the CNP, it can be known that congestion occurs in the transmission process of the message in the flow direction.
[0094] In a congestion notification method based on queue scheduling provided in an embodiment of the present application, at least one CNP queue is pre-stored in the forwarding chip, so that after receiving an IP message from a transmitting end device, if the forwarding chip detects that the transmission queue is congested, it can retrieve and determine the corresponding flow data entry from the flow information table according to the forward flow information carried by the IP message, and determine the first CNP queue corresponding to the flow data entry from at least one pre-stored CNP queue to schedule the CNP pre-sent by the CPU in the first CNP queue out of the queue. There is no need to report congestion information to the CPU to generate CNP after congestion occurs, which simplifies the steps of generating CNP, shortens the response time of feedback CNP, and improves the processing efficiency of message congestion.
[0095] The following is an exemplary description of the complete process of a congestion notification method based on queue scheduling provided in an embodiment of the present application:
[0096] For example, Figure 7 As shown, a congestion notification method based on queue scheduling provided in an embodiment of the present application may include the following S701 to S708:
[0097] S701. Receive IP packets via a switching network.
[0098] S702: Determine a target sending queue from multiple sending queues according to the QoS information of the IP message.
[0099] S703: Determine whether the target sending queue is congested. If yes, execute S704; if no, execute S708.
[0100] S704: According to the forward flow direction information carried by the IP message, retrieve and determine the flow direction data entry from the flow direction information table.
[0101] S705: Determine a first CNP queue from at least one CNP queue according to the flow direction data entry.
[0102] S706: Schedule the first CNP queue to output the CNP.
[0103] S707. Send the CNP via the switching network.
[0104] S708: Input the IP message into the target sending queue.
[0105] In this way, by pre-storing at least one CNP queue in the forwarding chip, after receiving an IP message from a sending end device, if the forwarding chip detects that the sending queue is congested, it can retrieve and determine the corresponding flow data entry from the flow information table according to the forward flow information carried by the IP message, and determine the first CNP queue corresponding to the flow data entry from at least one pre-stored CNP queue, and schedule the first CNP queue to output the CNP. It is not necessary to report the congestion information to the CPU to generate the CNP after the congestion occurs, which simplifies the steps of generating the CNP, shortens the response time of the feedback CNP, and improves the processing efficiency of the message congestion.
[0106] Optionally, in the embodiment of the present application, the CNP in the CNP queue may be obtained by generating in advance by the CPU and sending it to the CNP queue.
[0107] In an optional implementation manner, the CNP may be a CNP generated by the CPU according to forward flow direction information obtained through configuration.
[0108] For example, Figure 8As shown, a congestion notification method based on queue scheduling provided in an embodiment of the present application may also include the following S801 to S803:
[0109] S801. Receive at least one CNP from a CPU and a flow direction data entry corresponding to each CNP in the at least one CNP.
[0110] It should be noted that, for the relevant description of the flow direction data entry, reference may be made to the detailed description of the flow direction data entry in S402 above, which will not be repeated here.
[0111] In the embodiment of the present application, at least one CNP and the flow direction data entry corresponding to each CNP are generated by the CPU according to the configured flow direction information, and the flow direction data entry corresponding to each CNP is different.
[0112] S802: Generate a second CNP queue for each CNP in at least one CNP.
[0113] The second CNP queue is a queue in at least one CNP queue.
[0114] In the embodiment of the present application, after receiving the CNP sent by the CPU, a CNP queue may be generated for the CNP.
[0115] S803: Store the CNP into a second CNP queue, store the flow direction data entry into a flow direction information table, and establish a corresponding relationship between the flow direction data entry and the second CNP queue.
[0116] In an embodiment of the present application, after receiving the CNP and the flow direction data entry corresponding to the CNP, and generating the second CNP queue, the flow direction data entry can be stored in the flow direction information table, and a corresponding relationship between the second CNP queue and the flow direction data entry corresponding to the CNP is established, and then the CNP is stored in the second CNP queue.
[0117] For example, take the case where the flow direction data entry 1 corresponding to the CNP includes IP1, IP2, port1, port2, QPN1, and QPN2. The flow direction data entry 1 can be stored in the flow direction information table, and the IP1, IP2, port1, port2, QPN1, and QPN2 in the flow direction data entry 1 can be configured as the flow direction data entry corresponding to the second CNP queue, and then the CNP can be stored in the second CNP queue.
[0118] In this way, by constructing the corresponding relationship between the flow data entry corresponding to the CNP and the CNP queue, when the congestion of the IP packet carrying a certain forward flow information is subsequently monitored, the CNP queue can be directly determined, and the CNP queue can be scheduled to output the CNP, ensuring that the congestion of the IP packet carrying the flow information can be accurately fed back to the sending device.
[0119] In an optional implementation manner, the CNP may be a CNP generated by the CPU according to the flow direction information reported by the forwarding chip.
[0120] For example, Fig. 9 As shown, a congestion notification method based on queue scheduling provided in an embodiment of the present application may also include the following S901 to S904:
[0121] S901. When the flow direction information table does not include a flow direction data entry corresponding to the forward flow direction information carried by the IP message, send the forward flow direction information carried by the IP message to the CPU.
[0122] In an embodiment of the present application, after receiving an IP message, the flow information table can be retrieved to see whether there is a flow data entry corresponding to the forward flow information carried by the IP message. If not, the forward flow information carried by the IP message is sent to the CPU.
[0123] For example, the flow direction information table includes flow direction data entry 1, flow direction data entry 2, and flow direction data entry 3. If, according to the forward flow direction information carried by the received IP message, when searching the flow direction information table, no flow direction data entry 1 / 2 / 3 is matched, it indicates that there is no flow direction data entry corresponding to the forward flow direction information carried by the IP message in the flow direction information table, and at this time, the forward flow direction information carried by the IP message is sent to the CPU.
[0124] S902: Receive the CNP and the flow direction data entry corresponding to the CNP from the CPU.
[0125] In the embodiment of the present application, the CNP and the flow direction data entry corresponding to the CNP are generated by the CPU according to the forward flow direction information received and the reverse flow direction information received by the CPU.
[0126] The reverse flow information corresponds to the forward flow information, and the reverse flow information may be obtained by other forwarding chips receiving an IP message from a receiving device and reporting the reverse flow information carried in the IP message to the CPU.
[0127] In an embodiment of the present application, the reverse flow information may include source / destination IP addresses, source / destination port numbers, and destination QPN.
[0128] For example, the forward flow information reported by forwarding chip 1 received by the CPU includes IP1, IP2, port1, port2, and QPN2. If the reverse flow information reported by forwarding chip 2 received by the CPU includes IP2, IP1, port2, port1, and QPN1, the forward flow information and the reverse flow information can be combined to form a complete flow data entry and sent to forwarding chip 1.
[0129] S903: Generate a third CNP queue for the CNP.
[0130] The third CNP queue is a queue in at least one CNP queue.
[0131] S904: Store the CNP into a third CNP queue, store the flow direction data entry into a flow direction information table, and establish a corresponding relationship between the flow direction data entry and the third CNP queue.
[0132] It should be noted that the detailed description of S903 and S904 can refer to the detailed description of S802 and S803 above, which will not be repeated here.
[0133] In this way, by reporting the forward flow information and reverse flow information carried by the IP message, and then using the CPU to generate corresponding flow data entries and CNPs based on the forward flow information and the reverse flow information, when it is subsequently monitored that the IP message carrying the forward flow information is congested, the CNP can be directly output to ensure that the congestion of the IP message carrying the flow information can be accurately fed back.
[0134] Optionally, in the embodiment of the present application, the generation of CNP may be periodic.
[0135] In the embodiment of the present application, the periodic generation of CNP can be controlled by a CPU or a forwarding chip.
[0136] In an optional implementation, the periodic generation of the CNP may be controlled by the CPU. After the CPU generates the CNP for the first time, it may continuously generate the same CNP at a preset periodic interval and send it to the forwarding chip.
[0137] It should be noted that, since only one CNP can be stored in the CNP queue, if a CNP sent by the CPU is received while there are CNPs stored in the CNP queue, the CNP will be discarded.
[0138] For example, taking the storage of CNP1 in the CNP queue as an example, if CNP1 sent by the CPU is received again, the newly sent CNP1 will be discarded because the CNP queue is full.
[0139] For example, if CNP1 is not stored in the CNP queue, the CNP queue is temporarily empty because the CNP queue has been recently scheduled to output CNP1. If CNP1 sent by the CPU is received at this time, the newly sent CNP1 will be stored in the CNP queue because the CNP queue is empty.
[0140] In this way, since only one CNP can be stored in the CNP queue, if the CNP queue is continuously triggered and scheduled in a short period of time, only one CNP will be output, thereby avoiding continuous triggering of CNP in a short period of time.
[0141] In another optional implementation, the periodic generation of CNP can be controlled by the forwarding chip. The CPU generates CNP only once, and after generating CNP, the forwarding chip can put the CNP into the CNP queue. At this time, if the CNP queue is scheduled to output the CNP, the forwarding chip will replicate the CNP and fill the CNP queue again.
[0142] In the embodiment of the present application, the forwarding chip can control the period of CNP in the following two ways.
[0143] Implementation method 1: Mount two CAR rate limiters on the CNP queue, one CAR is responsible for switching, and the other CAR is responsible for controlling the CNP cycle.
[0144] Exemplarily, CAR rate limit 1 is responsible for scheduling CNPs in the CNP queue to be dequeued, and CAR rate limit 2 is responsible for outputting the CNPs scheduled by CAR rate limit 1 every preset time period (such as the above-mentioned period).
[0145] Implementation method 2: Set up two CNP queues in cascade. The first CNP queue is responsible for controlling the CNP cycle, and the second CNP queue is responsible for switching.
[0146] Exemplarily, the first CNP queue is responsible for releasing the CNP to the second CNP queue every preset time period (such as the above-mentioned period), and the second CNP queue is responsible for scheduling the CNP in the current CNP queue to be dequeued.
[0147] In this way, after the CNP in the CNP queue is dequeued, the CNP queue can be filled within a specific time, ensuring that there are available CNPs in the subsequent sending queue when congested, while avoiding continuous triggering of CNPs in a short period of time.
[0148] Optionally, in an embodiment of the present application, when a CNP queue is stored in the forwarding chip, if no IP packet with the same flow information as that corresponding to the CNP is received within a preset time period, deletion of the CNP queue is triggered, and the CNP in the CNP queue is deleted.
[0149] Furthermore, after the CNP queue is deleted, a signal indicating that the flow direction information has been deleted may be sent to the CPU to instruct the CPU to stop generating the CNP that carries the flow direction information.
[0150] It should be noted that the above-mentioned preset time period can be called an aging time. If no IP message carrying a certain flow direction information is received within the aging time, it indicates that the IP message has stopped transmitting.
[0151] In the embodiment of the present application, the aging time may be a manually set time, which may be flexibly adjusted according to the actual scenario. For example, the aging time may be 30 seconds.
[0152] In this way, after determining that the IP message carrying a certain flow information stops transmitting, by deleting the stored CNP queue corresponding to the flow information and notifying the CPU to stop generating the CNP carrying the flow information, resource consumption can be reduced as much as possible.
[0153] An embodiment of the present application provides a computer program product including instructions. When the computer program product is executed on a computer, the computer is enabled to execute the queue scheduling-based congestion notification method in the above method embodiment.
[0154] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the congestion notification method based on queue scheduling in the method flow shown in the above method embodiment.
[0155] Among them, the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0156] An embodiment of the present invention provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the following Figures 4 to 9 The congestion notification method based on queue scheduling described in.
[0157] Since the computer-readable storage medium and computer program product in the embodiments of the present invention can be applied to the above method, the technical effects that can be obtained can also refer to the above method embodiments, and the embodiments of the present invention will not be described in detail here.
[0158] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A congestion notification method based on queue scheduling, characterized in that: A forwarding chip applied to a message forwarding device, wherein the message forwarding device further includes a central processing unit (CPU), the forwarding chip is coupled to the CPU, and the method includes: Receiving Internet Protocol IP messages from a sending device; When the sending queue is detected to be congested, the corresponding flow direction data entry is retrieved and determined from the flow direction information table according to the forward flow direction information carried by the IP message; Determine a first CNP queue corresponding to the flow data entry from at least one pre-stored congestion notification message CNP queue; The first CNP queue is scheduled to output a CNP, where the CNP is a message sent in advance by the CPU, and the CNP is used to indicate that congestion occurs during the transmission of the IP message.
2. The method according to claim 1, characterized in that For each CNP queue in the at least one CNP queue: The CNP queue is used to store a CNP corresponding to a flow data entry, and there is a corresponding relationship between the CNP queue and the flow data entry; The CNP queue is used to output the CNP when congestion is detected in the flow direction corresponding to the CNP queue.
3. The method according to claim 1, characterized in that The scheduling the first CNP queue to output the CNP includes: Scheduling the first CNP queue by a scheduler and outputting the CNP; or, The number of tokens in the rate-limiting token bucket of the first CNP queue is increased to a CNP length to output the CNP.
4. The method according to claim 3, characterized in that For each CNP queue of the at least one CNP queue, a scheduling priority of the CNP queue is higher than a scheduling priority of a receiving queue.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: receiving at least one CNP from the CPU and a flow direction data entry corresponding to each CNP in the at least one CNP; For each CNP in the at least one CNP, generate a second CNP queue, where the second CNP queue is a queue in the at least one CNP queue; The CNP is stored in the second CNP queue, the flow direction data entry is stored in a flow direction information table, and a corresponding relationship between the flow direction data entry and the second CNP queue is established.
6. The method according to claim 5, characterized in that The method further comprises: In a case where the flow direction information table does not include a flow direction data entry corresponding to the forward flow direction information carried by the IP message, the forward flow direction information carried by the IP message is sent to the CPU.
7. The method according to claim 1, characterized in that The method further comprises: When no congestion in the sending queue is detected, the CNP queue is not polled.
8. A chip, characterized in that: include: A processor and a communication interface; the communication interface is coupled to the processor, and the processor is used to run a computer program or instruction to implement the method according to any one of claims 1 to 7.
