A congestion processing method and apparatus, a network device, and a storage medium

By setting up greedy flow tables in network devices, congestion control that identifies and retains greedy flows solves the congestion problem caused by micro-burst data flows, improving network bandwidth utilization and the fairness of congestion control.

CN113632426BActive Publication Date: 2026-05-29NEW H3C TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NEW H3C TECH CO LTD
Filing Date
2021-06-29
Publication Date
2026-05-29

Smart Images

  • Figure CN113632426B_ABST
    Figure CN113632426B_ABST
Patent Text Reader

Abstract

A congestion processing method and device, a network device and a storage medium, the method comprising: receiving, through a target port, a first data packet carrying a congestion flag; searching, in a preset greedy flow table, for a target entry comprising target flow information carried by the first data packet and an identifier of the target port, the preset greedy flow table storing flow information of a data flow with a flow greater than a preset flow threshold and an identifier of a port receiving the data flow corresponding to the flow information; if the target entry is found, processing the first data packet; if the target entry is not found, removing the congestion flag carried in the first data packet to obtain a second data packet, and processing the second data packet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of lossless transmission technology, and in particular to a congestion handling method, apparatus, network device, and storage medium. Background Technology

[0002] To alleviate network congestion and improve the quality of lossless Ethernet forwarding services, common packet transmission methods include: setting a PFC threshold for lossless transmission and an Explicit Congestion Notification (ECN) threshold for congestion control for each of the eight queues on each port of the network device; for a queue, when the amount of data packets buffered in the queue reaches the preset ECN threshold, each data packet buffered in the queue is marked with an ECN tag to obtain an ECN packet, which is then sent to the destination server; after receiving the ECN packet, the destination server sends a Congestion Notification Packet (CNP) back to the source server; upon receiving the CNP, the source server reduces the rate at which it sends data packets to prevent the amount of data packets buffered in the queue from reaching the preset PFC threshold.

[0003] The aforementioned data packet transmission method can alleviate network congestion and improve the quality of lossless Ethernet forwarding services. However, if the ratio of fan-in ports to fan-out ports in a network device is N:1, micro-bursts will occur. Furthermore, the larger N is, the higher the instantaneous rate of the micro-burst data stream. In this case, to alleviate network congestion and improve the quality of lossless forwarding services, the ECN threshold needs to be set to a smaller value.

[0004] However, setting the ECN threshold to a small value can alleviate network congestion and improve the quality of lossless forwarding services, but the rate at which the source server sends data packets will be very low, resulting in low utilization of network bandwidth.

[0005] Furthermore, a queue can buffer packets from multiple data streams. These data streams are categorized as elephant streams and mouse streams. Among these, elephant streams contribute more to congestion during micro-bursts. Therefore, when congestion occurs, network devices only need to notify elephant streams of congestion, thus enabling congestion control only for elephant streams. However, in the aforementioned packet transmission method, after adjusting the ECN threshold, the network device will notify all data streams of congestion based on this adjusted ECN threshold. This causes significant harm to mouse streams, making this congestion control mechanism unfair. Summary of the Invention

[0006] The purpose of this application is to provide a congestion handling method, apparatus, network device, and storage medium to reduce the harm to rat traffic, improve the fairness of congestion control, and increase the utilization of network bandwidth. The specific technical solution is as follows:

[0007] In a first aspect, embodiments of this application provide a congestion handling method, the method comprising:

[0008] Receive the first data packet carrying the congestion flag through the target port;

[0009] In a preset greedy flow table, a target entry is searched that includes the target flow information carried by the first data packet and the identifier of the target port. The preset greedy flow table stores the flow information of data flows with a flow rate greater than a preset flow rate threshold and the identifier of the port corresponding to the data flow that receives the flow information.

[0010] If the target entry is found, then process the first data packet;

[0011] If the target entry is not found, the congestion flag carried in the first data packet is removed to obtain the second data packet, and the second data packet is processed.

[0012] Secondly, embodiments of this application provide a congestion processing apparatus, the apparatus comprising:

[0013] The receiving unit is used to receive the first data packet carrying the congestion flag through the target port;

[0014] The lookup unit is used to look up a target entry in a preset greedy flow table, which includes the target flow information carried by the first data packet and the identifier of the target port. The preset greedy flow table stores the flow information of data flows with a flow rate greater than a preset flow rate threshold and the identifier of the port corresponding to the data flow that receives the flow information.

[0015] The processing unit is configured to process the first data packet if the target entry is found, and to remove the congestion flag carried in the first data packet to obtain a second data packet if the target entry is not found, and to process the second data packet.

[0016] Thirdly, embodiments of this application provide a network device, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions executable by the processor, and the processor is prompted by the machine-executable instructions to implement the following steps:

[0017] Receive the first data packet carrying the congestion flag through the target port;

[0018] In a preset greedy flow table, a target entry is searched that includes the target flow information carried by the first data packet and the identifier of the target port. The preset greedy flow table stores the flow information of data flows with a flow rate greater than a preset flow rate threshold and the identifier of the port corresponding to the data flow that receives the flow information.

[0019] If the target entry is found, the first data packet is processed; if the target entry is not found, the congestion flag carried in the first data packet is removed to obtain a second data packet, which is then processed.

[0020] Fourthly, embodiments of this application provide a machine-readable storage medium storing a computer program, which, when executed by a processor, implements any of the steps described above.

[0021] Fifthly, embodiments of this application provide a computer program that, when executed by a processor, implements any of the steps described above.

[0022] In the technical solution provided in this application embodiment, a greedy flow table is pre-set to identify greedy flows in the network, thereby preserving congestion control for greedy flows and releasing congestion control for non-greedy flows, reducing the harm to rat flows and improving the fairness of congestion control.

[0023] Furthermore, since the technical solution provided in this application addresses processing after the ECN threshold is triggered, it can independently identify greedy flows exceeding the ECN threshold and retain congestion control for these greedy flows. Therefore, even if the ECN threshold is set relatively high, the impact on congestion processing in this application embodiment is not significant. Thus, the technical solution provided in this application embodiment can use a larger ECN threshold for congestion control, which reduces harm to "rat flows," improves the fairness of congestion control, and effectively increases network bandwidth utilization.

[0024] Brief description of the attached figures

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

[0026] Figure 1 This is a schematic diagram of a lossless transmission system provided in an embodiment of this application.

[0027] Figure 2 for Figure 1A detailed schematic diagram of a lossless transmission system.

[0028] Figure 3 This is a flowchart illustrating an information processing method for a monitoring module of the control plane provided in an embodiment of this application.

[0029] Figure 4 for Figure 3 A schematic diagram of the CGF information collection process on the monitoring module side.

[0030] Figure 5 for Figure 3 A schematic diagram of the GF information collection process on the monitoring module side.

[0031] Figure 6 for Figure 3 A schematic diagram of the monitoring process on the monitoring module side.

[0032] Figure 7 for Figure 3 A schematic diagram of the CGF information acquisition process on the core module side.

[0033] Figure 8 for Figure 3 A schematic diagram of the GF information acquisition process on the core module side.

[0034] Figure 9 for Figure 3 A schematic diagram of the monitoring process on the core module side.

[0035] Figure 10 This is a schematic diagram of an information collection process provided in an embodiment of this application.

[0036] Figure 11 This is a schematic diagram of a monitoring module for a control plane provided in an embodiment of this application.

[0037] Figure 12 This is a schematic diagram of a core module of the data plane provided in an embodiment of this application.

[0038] Figure 13 This is a schematic diagram illustrating the physical state transition of a core module provided in an embodiment of this application.

[0039] Figure 14 This is a schematic diagram illustrating the data structure transition provided in an embodiment of this application.

[0040] Figure 15 This is a schematic diagram of a first type of congestion handling method provided in an embodiment of this application.

[0041] Figure 16 This is a schematic diagram of a second congestion handling method provided in an embodiment of this application.

[0042] Figure 17 This is a schematic diagram of the first type of pre-defined greedy flow table construction method provided in the embodiments of this application.

[0043] Figure 18 This is a second flowchart illustrating the preset greedy flow table construction method provided in the embodiments of this application.

[0044] Figure 19 for Figure 18 The first detailed schematic diagram of step S1711.

[0045] Figure 20 for Figure 18 The second detailed schematic diagram of step S1711.

[0046] Figure 21 for Figure 18 The third detailed schematic diagram of step S1711.

[0047] Figure 22 This is a schematic diagram of a first method for calculating the traffic of the data stream corresponding to the target candidate stream information provided in an embodiment of this application.

[0048] Figure 23 This is a second flowchart illustrating the traffic statistics method for the data stream corresponding to the target candidate stream information provided in the embodiments of this application.

[0049] Figure 24 This is a schematic diagram of a third method for calculating the traffic of the data stream corresponding to the target candidate stream information provided in the embodiments of this application.

[0050] Figure 25 This is a schematic diagram of the fourth method for traffic statistics of the data stream corresponding to the target candidate stream information provided in the embodiments of this application;

[0051] Figure 26 This is a schematic diagram of a data processing apparatus provided in an embodiment of this application.

[0052] Figure 27 This is a schematic diagram of a network device provided in an embodiment of this application. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are merely some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0054] For ease of understanding, the terms appearing in the embodiments of this application are explained below.

[0055] Elephant streams are data streams that continuously transmit large amounts of data over network links.

[0056] A rat stream is a data stream that transmits a small amount of data over a short period of time via a network link.

[0057] Greedy flow (GF) refers to a data flow whose flow rate exceeds a preset flow rate threshold. In this embodiment, greedy flow can be understood as elephant flow. Non-greedy flow can be understood as mouse flow.

[0058] A Greedy Flow Table (GFT) is a table in which each entry stores information about a Greedy Flow Table (GF).

[0059] A candidate greedy flow (CGF) refers to a data flow whose flow rate exceeds a preset candidate flow rate threshold. A candidate greedy flow is a data flow that is suspected of being a greedy flow.

[0060] A Candidate Greedy Flow Table (CGFT) is a table in which each entry stores information about a CGF (Choice of Greedy Flow).

[0061] Lossless packet transmission over Ethernet is achieved using Priority Flow Control (PFC). In a lossless network architecture, each port's buffer is configured with eight queues of different priorities, each with a corresponding PFC threshold. The queue priorities can be set according to actual needs. For example, queue priorities can be based on the 802.1p protocol or on the priorities defined in Request For Comments (RFC) 2474.

[0062] The source server sends data packets to the destination server through network devices. When the data stream rate of the data packets sent by the source server exceeds the processing rate of the network devices, the network devices buffer the data packets in the queue corresponding to the port where they are received.

[0063] When the amount of data packets cached in a queue (such as queue 1) is greater than or equal to the preset PFC threshold, the network device sends a congestion notification packet to the source server so that the source server temporarily stops sending data packets of the priority corresponding to queue 1 to the network device.

[0064] When the amount of data packets buffered in a queue (such as queue 1) is less than the preset PFC threshold, the network device sends a decongestion packet to the source server so that the source server can send data packets with the priority corresponding to queue 1.

[0065] The aforementioned backpressure method enables lossless data packet transmission, resolving packet loss issues. In this case, each queue is a lossless queue. However, when the amount of data packets buffered in a queue exceeds or equals the preset PFC threshold, it indicates that congestion has already occurred in the network device. This congestion problem is also a pressing issue that needs to be addressed.

[0066] Currently, to alleviate congestion, network devices are configured with an ECN threshold, also known as a preset ECN threshold. This preset ECN threshold is lower than the preset PFC threshold.

[0067] For a queue (such as queue 1), when the amount of data packets buffered in queue 1 reaches the preset ECN threshold, the network device marks each data packet in queue 1 that exceeds the preset ECN threshold with an ECN tag. When the preset ECN threshold is reached when data packet n is buffered, ECN tags are marked for data packets n+1 to X respectively, and an ECN data packet is obtained; the ECN data packet is sent to the destination server.

[0068] After receiving the ECN packet, the destination server sends a CNP response to the source server.

[0069] After receiving the CNP, the source server reduces the rate at which it sends data packets corresponding to the priority of queue 1 to prevent further congestion in the network devices and to prevent the data volume of the data packets buffered in queue 1 from reaching the preset PFC threshold due to further congestion, which would cause the entire network to stop sending data packets corresponding to the priority of queue 1.

[0070] In the aforementioned congestion mitigation methods, after detecting congestion, the network device sends n data packets before sending an ECN data packet, which may result in the inability to promptly notify the destination server of cache congestion.

[0071] To ensure timely notification of cache congestion to the destination server, the aforementioned congestion mitigation method is improved. Specifically, upon detecting congestion, the network device marks each data packet in the queue with an ECN tag. This allows for early notification of cache congestion to the destination server. This method is called Fast ECN.

[0072] Furthermore, among the congestion mitigation methods described above, if the path between the destination server and the source server is too long (i.e., the path for transmitting CNP is too long), the rate at which the source server sends data packets cannot be immediately reduced. This directly results in the source server stopping sending data packets when the amount of data packets buffered in the queue reaches the preset PFC threshold.

[0073] To address this issue, an improved approach is as follows: When forwarding data packets, network devices record the flow information of the data stream to which the data packet belongs in the flow table entry. When an ECN data packet is acquired, the network device constructs a corresponding CNP based on the learned flow information and sends the CNP to the source server. In this case, the CNP is sent to the source server by the network device located between the source and destination servers, shortening the transmission path. This allows for timely adjustment of the data packet sending rate by the source server, thereby reducing congestion in the network device's buffer. This method is called Fast CNP.

[0074] To maximize the quality of service for lossless Ethernet forwarding, a dynamic adjustment of the ECN threshold is currently employed to address congestion. In this method, the network device's control plane collects traffic characteristics and, based on the ratio of fan-in to fan-out ports, and the ratio of elephant flows to mouse flows, uses an Artificial Intelligence (AI) algorithm to determine the ECN threshold. This threshold is then configured into the network device's forwarding plane, enabling dynamic adjustment of the ECN threshold for the lossless queue. A larger number of fan-in ports can lead to increased burst pressure on the network device's buffer.

[0075] This method can theoretically prevent the amount of data packets cached by network devices from reaching the PFC threshold, and can meet the bandwidth requirements of latency-sensitive mouse flows and throughput-sensitive elephant flows as much as possible.

[0076] However, microbursts can occur in networks. When the instantaneous rate of a microburst data stream exceeds the forwarding capacity of a network device, the network device will buffer the microburst packets for later transmission.

[0077] For example, if port 1 and port 2 each send 5 megabytes (MB) of data to port 3 at a bit rate of 10 gigabits (Gbps), the total transmission rate is 10 + 10 = 20 Gbps. When the network device's buffer has only 1 MB, 4 MB of data will be dropped or backpressured due to insufficient buffer space.

[0078] Without considering overhead data such as inter-frame gaps, preambles, frame checksums, and packet headers, the duration of this burst is 5MB / 10Gbps = 4ms. Because this burst is so short, only a few milliseconds, it is virtually impossible for the control plane to identify such a data stream.

[0079] Network devices struggle to achieve millisecond-level data stream statistics for several reasons:

[0080] (1) The network device has many ports and cannot support high-density queries;

[0081] (2) Existing technology has limitations. For high-speed pipeline design, it is impossible to share the statistical storage unit between the fan-in port and the fan-out port, so it is impossible to know the data flow's consumption of cache space.

[0082] (3) There are many data streams, making it difficult to identify the data streams that contribute significantly to congestion from a macro perspective.

[0083] With the increasing prevalence of 25G / 40G / 50G / 100G / 400G ports, the control plane struggles to identify large data flows within micro-bursts. Using common netstream statistics methods, the control plane finds it difficult to identify bandwidth-intensive data flows within micro-bursts.

[0084] As discussed above, lossless networks can achieve zero packet loss due to PFC (Packet Flow Coordination). Therefore, all solutions aim to improve bandwidth utilization, reduce network device congestion, and minimize damage to the data flow while ensuring zero packet loss. However, due to the complexity of data flows, no solution can completely eliminate congestion while maintaining high bandwidth utilization.

[0085] The inventors conducted an in-depth analysis and discovered the following problems with current improvement methods:

[0086] 1. When congestion notifications are sent, all data streams sharing a queue send congestion notifications, thus implementing congestion control across all data streams in the shared queue. This is highly unfair to data streams with very small volumes (i.e., "mouse streams"). The ideal solution to congestion problems is to apply congestion control only to "elephant streams."

[0087] 2. When the ratio of fan-in ports to fan-out ports is N:1, it is difficult to identify the elephant flow in micro-bursts on a macroscopic level, and the control plane identification is very coarse. Therefore, dynamically adjusting the ECN threshold of the lossless queue based on the flow percentage of elephant flow and mouse flow is difficult to achieve practical results in some application scenarios.

[0088] Point 2 above easily leads to the idea of ​​processing congestion in the data plane to solve the problem. However, early technological limitations prevented the development of such a solution. While data plane processing has become feasible with technological advancements, numerous limitations and technical challenges remain. For instance, implementing algorithms and processes in the data plane requires careful consideration of hardware characteristics to avoid pipeline interlocking and subsequent transmission inefficiencies. Implementing overly complex algorithms and processes in the data plane can also lead to excessive resource consumption. Therefore, a systematic solution is currently lacking.

[0089] To reduce the harm to the rat flow during micro-bursts, improve the fairness of congestion control, and increase the utilization of network bandwidth, embodiments of this application provide a lossless transmission system, such as... Figure 1 As shown. The lossless transmission system includes a control plane 11 and a data plane 12. The control plane 11 includes a monitoring module 111 and a management module 112. The data plane 12 includes a core module 121 and a forwarding module 122.

[0090] The monitoring module 111 is used in conjunction with the core module 121 to implement the corresponding software functions.

[0091] The core module 121 includes hardware and software implementations for identifying the GF under high load on the forwarding plane and storing the flow information of the GF in the GFT; it listens to the CNP in the received data stream, parses the corresponding flow information, and queries the parsed flow information in the GFT. If the query is unsuccessful, the congestion mark of the data packet is cleared. If the query is successful, the data packet remains unchanged, and then the forwarding table is consulted to forward the data packet.

[0092] The management and control module 112 is used to manage and control modules such as the monitoring module 111 in the control plane 11, and modules such as the core module 121 and the forwarding module 122 in the data plane 12. The specific management and control logic of the management and control module 112 can be configured by the user and is not limited here. In this embodiment, the control plane 11 may include multiple management and control modules 112; only one management and control module 112 is described here as an example, and it is not intended to be limiting.

[0093] The forwarding module 122 includes multiple ports for forwarding data packets. In this embodiment, the data plane 12 may include multiple forwarding modules 122. This description uses only one forwarding module 122 as an example and is not intended to be limiting.

[0094] In this embodiment of the application, the control plane can also be a completely independent server, and the data plane can be a switching device.

[0095] In this embodiment of the application, the lossless transmission system can be a highly abstract representation of a network device.

[0096] For example, if the network device is a chassis router or switch, then the control plane 11 corresponds to the main control board of the network device, the forwarding module corresponds to the line card, multiple line cards constitute the data plane 12, and the Fabric connecting the control plane 11 and the data plane 12 corresponds to the network board.

[0097] If the network device is a box-type device, then the control plane 11 corresponds to the main control board of the network device, the forwarding module corresponds to the line card, and multiple line cards constitute the data plane 12. The Fabric connecting the control plane 11 and the data plane 12 can be a switching chip, or the Fabric can be degenerated into a point-to-point interconnection bus.

[0098] For high-volume data acquisition, the processing power of Application Specific Integrated Circuit (ASIC) chips can be utilized. However, implementing GF identification within an ASIC chip presents significant challenges. The main reasons are that hardware pipelines are not as flexible as software pipelines and are subject to resource constraints. If an ASIC chip is to perform GF identification on data streams of 10K or even 100K, meticulous design is required. Therefore, in this embodiment, when acquiring GF, a preliminary identification of CGF is first performed using a method more suited to the hardware characteristics, but this method has a significant margin of error. After identifying the CGF, further GF identification is performed within the range defined by the CGF.

[0099] Because many existing network devices are distributed chassis devices, containing multiple line cards, each with multiple ports, some of which have very large forwarding capacities, identifying the GF (Geometric Frame) in the data plane is inherently challenging, and identifying the GF of the entire chassis simultaneously is virtually impossible.

[0100] Therefore, the basic idea of ​​the technical solution provided in this application embodiment is: the core module 121, as an independent processing unit (similar to a line card), is attached to the Fabric of the lossless transmission system. The monitoring module 111 in the technical solution provided in this application embodiment mirrors the data streams sent by each physical port in the network device to the core module 121 in a round-robin manner for GF identification. Based on the identified GF, a GFT is formed. Then, based on the GFT, the received CNPs in the entire lossless transmission system are monitored. When the data stream corresponding to the CNP is a GF, the original CNP is forwarded to the destination address; if the data stream corresponding to the CNP is not a GF, the congestion flag in the CNP is cleared and forwarded to the destination address. Since the number of CNPs is small, all physical ports can be monitored.

[0101] The technical solutions provided in this application are applicable to the following scenarios:

[0102] 1. Most of the monitored data streams are long-term data streams. This is a prerequisite for the ECN / CNP mechanism to function, and the technical solutions provided in this application are no exception.

[0103] 2. While there are intervals in the GF identification of each physical port, any AI algorithm or other optimization scheme can only be effective if the data flow has inherent, unchanging characteristics amidst changes. The technical solution provided in this application is no exception. Therefore, once GFT exists, the technical solution provided in this application can function. Because of the fundamental role of PFC, lossless operation is possible, and the brief period of ineffectiveness will not lead to catastrophic consequences. Furthermore, once the technical solution provided in this application is running online, it will continuously optimize the flow control accuracy of CNP.

[0104] 3. The GF identification process is a continuous loop and can automatically adapt to changes in network topology.

[0105] 4. The technical solution provided in this application has wide applicability because it identifies the GF on a port-by-port basis, and therefore can be applied to network devices with large forwarding capacity.

[0106] 5. Congestion is often the result of multiple data streams working together, but it is only necessary to control some of the GFs (Gateways Flow Flows), not all GFs, to achieve the desired effect. Since the technical solution provided in this application runs continuously online and automatically makes adaptive adjustments, its effectiveness improves over time.

[0107] 6. It can effectively protect numerous small data streams (i.e., rat streams) to achieve greater fairness, while reducing the transmission peak of elephant streams in micro-bursts, thereby improving network forwarding capacity and network bandwidth utilization.

[0108] The technical solutions provided in this application mainly consider the following issues:

[0109] 1. High traffic volume. Some existing network devices have a single port forwarding capacity of 400G, so processing efficiency must be the primary consideration;

[0110] 2. Network devices handle a large volume of data flows, so the constraints of limited hardware resources must be fully considered;

[0111] 3. It should be able to identify large bandwidth-consuming data streams within micro-bursts (i.e., elephant streams);

[0112] 4. It must be able to adapt to environments with a high number of data streams;

[0113] 5. Hardware resources should be reusable, and resource recycling algorithms should be simple;

[0114] 6. Automatically adapts to changes in network topology;

[0115] 7. Perform selective flow control on data streams to avoid over-control of certain data streams.

[0116] Based on the applicable scenarios and problems considered above, the technical solutions provided in this application have the following features:

[0117] 1. It is implemented by the cooperation of the monitoring module of the control plane and the core module of the data plane. The former is embodied in the form of a software module, while the latter is a subsystem implemented by a combination of software and hardware.

[0118] 2. The monitoring module of the control plane is responsible for the configuration of the lossless transmission system and the transition of the physical state of the lossless transmission system, as well as the configuration of the periodically repeating lossless transmission system and the transition of the physical state of the lossless transmission system.

[0119] 3. The lossless transmission system operates in three physical states: idle state, information acquisition state, and listening state.

[0120] 4. Information acquisition status is divided into CGF information acquisition status and GF information acquisition status;

[0121] 5. By periodically acquiring GF information and monitoring GF in the control plane, the technical solution provided in this application embodiment can adapt to dynamic changes in network topology and data flow, etc.

[0122] 6. The core module based on the data plane realizes information acquisition and analysis, and can effectively identify GFs in micro-bursts;

[0123] 7. The implementation scheme has broad adaptability. With slight expansion, it can be used as an analysis tool for locating congestion in network devices such as routers or switches, and can be used to assist in network optimization.

[0124] 8. The implementation scheme fully considers the hardware resource constraints of the data plane, reuses hardware resources to complete different functions, and can support the application of large-scale chassis devices to the greatest extent.

[0125] 9. The monitoring module in the control plane has a monitoring port information table. This table stores the outgoing port information that needs to be collected from the GF (Global Data Framework). Each entry in this table stores one outgoing port information. Using this information, the data stream from the outgoing port can be mirrored to the information collection input port of the core module in the data plane through ACL configuration.

[0126] 10. The core modules of the data plane include CGFT and GFT;

[0127] 11. The newly added core modules of the solution can be inserted into the motherboard of the frame-type device as plug-in cards, or integrated into the motherboard of the box-type device;

[0128] 12. Since the technical solutions provided in this application are absolutely independent, the monitoring module of the control plane can also be implemented as a separate device. The monitoring module can reside anywhere, for example, the monitoring module can reside on the network controller; in addition, the forwarding table on which the monitoring module depends can also be obtained by various methods.

[0129] Based on the characteristics of the technical solutions provided in the embodiments of this application, the lossless transmission system provided in the embodiments of this application can be further refined, such as... Figure 2 As shown. In Fabric, independent data stream channels are provided (such as...) Figure 2 (as shown by the dashed lines with arrows) and control flow channels (such as...) Figure 2 (Solid lines with arrows shown in the diagram). The monitoring module 111 of the control plane may include timers, a core control module, and a monitoring port information table. The core module of the data plane may include a programmable switch chip, a central processing unit (CPU), and random access memory (RAM). The RAM contains CGFT, GFT, and a forwarding table (FWD). The CPU and the programmable switch chip can communicate via a high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIE) bus and Gigabit Ethernet (XGE) ports. The XGE bus includes 10GE, 40GE, 50GE, 100GE, and 400GE ports.

[0130] Based on the aforementioned lossless transmission system, embodiments of this application provide an information processing method for a monitoring module in a control plane, such as... Figure 3 As shown, it may include the following steps:

[0131] Step S31: Initialize the data plane and control plane.

[0132] To improve the accuracy of subsequent congestion handling, the monitoring module initializes various modules in the data plane and control plane. This initialization configuration may specifically include the initialization configuration of the monitoring module in the control plane and the core modules in the data plane.

[0133] Step S32: Execute the CGF information collection process.

[0134] In this embodiment, the monitoring module works in conjunction with the core module of the data plane to collect CGF information so that GF information can be subsequently determined from the CGF information.

[0135] Step S33: Determine if a stop operation has been received from the user. If not, proceed to step S34. If yes, end the current process.

[0136] After the CGF information is collected, the monitoring module listens in real time for whether the user enters a stop operation. If a stop operation is detected, it determines that the user does not need to update the GF information, and the monitoring module ends the current processing flow.

[0137] If no stop operation is detected, the monitoring module continues to execute the processing flow to update and improve the learned GF information, thereby improving the effectiveness of resolving congestion issues.

[0138] Step S34: Execute the GF information collection process.

[0139] Step S35: Determine if a stop operation has been received from the user. If not, proceed to step S36. If yes, end the current process.

[0140] After the GF information is collected, the monitoring module listens in real time for whether the user inputs a stop operation. If a stop operation is detected, it determines that the user does not need to update the GF information, and the monitoring module ends the current processing flow.

[0141] If no stop operation is detected, the monitoring module continues to execute the processing flow to update and improve the learned GF information, thereby improving the effectiveness of resolving congestion issues.

[0142] Step S36: Execute the listening process.

[0143] The monitoring module listens to the data streams forwarded by the data plane, identifies the "elephant streams" in the data streams, and performs congestion control only on the elephant streams in the data streams.

[0144] Step S37: Determine if a stop operation has been received from the user. If not, return to step S32. If yes, end the current process.

[0145] In this way, the monitoring module repeatedly executes the above processing flow, continuously updates and improves the learned GF information, and enhances the effectiveness of resolving congestion problems.

[0146] In one embodiment of this application, the initialization configuration of step S31 above may include the following process.

[0147] a) Control plane resource allocation and initialization, and related configuration of physical ports.

[0148] b) The monitoring module of the control plane and the core module of the data plane agree on the format of data packets, control packets, and return messages after transmission.

[0149] c) Based on the physical ports to be monitored in the lossless transmission system, the monitoring module of the control plane initializes the monitoring port information table, and the monitoring port information table is refreshed synchronously when the physical ports in the lossless transmission system change.

[0150] d) The monitoring module of the control plane sends a configuration management data packet to the core module of the data plane to configure the core module of the data plane.

[0151] e) The core module of the data plane receives the configuration management data packet, parses and allocates core module resources, and initializes the core module resources. The initialized resources include, but are not limited to, forwarding tables, CGFT, GFT, timers, and physical states.

[0152] f) After the core module of the data plane completes resource initialization, the core module presents the initialization completion status to the monitoring module of the control plane in an agreed manner, such as by sending an initialization completion message.

[0153] g) The entire lossless transmission system enters an idle state.

[0154] h) The monitoring module of the control plane periodically queries the physical status of the core module of the data plane, the core module of the data plane responds accordingly, and the monitoring module of the control plane queries the physical status of the responding core module.

[0155] In this embodiment, the control plane and data plane can be connected using a dedicated bus. The monitoring module can perform the aforementioned initialization configuration of the core module via the dedicated bus. In this embodiment, the monitoring module can also use other methods to implement the initialization configuration, and this is not limited.

[0156] After initial configuration is complete, the monitoring module of the control plane and the core module of the data plane work together to collect CGF information and GF information.

[0157] In one embodiment of this application, the CGF information acquisition process in step S32 is as follows: Figure 4 As shown, it may include the following steps:

[0158] Step S321: Obtain the program compilation result file related to CGF information acquisition through the external interaction port. This program compilation result file can be a P4 program compilation result file. For easy identification, the file name is P4Info1. This is not a limitation. The P4Info1 file contains the relevant information required to complete the CGF information acquisition. This information is the P4 program compilation result, used to configure the programmable switch chip to complete the CGF information acquisition.

[0159] Step S322: Notify the core module of the data plane to enter the configuration state, and query and wait for the data plane to respond and enter the corresponding state.

[0160] After obtaining the P4Info1 file, the monitoring module determines that the CGF information collection process needs to be executed. Therefore, it sends a configuration status message to the core module. Based on the configuration status message, the core module sets its physical state to the configuration state and returns a message to the monitoring module indicating that its physical state is configured. Upon receiving this message, the monitoring module determines that the data plane has entered the configuration state and can proceed with the corresponding configuration.

[0161] Step S323: Download the P4Info1 file to the core module of the data plane, query and wait for the data plane to respond and enter the corresponding state.

[0162] After the monitoring module determines that the core module's physical state is configured, it downloads the P4Info1 file to the core module in the data plane. The core module then downloads the P4Info1 file to the programmable switch chip, sets its physical state to idle, and sends a message to the monitoring module indicating that its physical state is idle. Upon receiving this message, the monitoring module confirms that the data plane configuration is complete and the system has entered an idle state, allowing the data plane to perform other processing, such as data acquisition.

[0163] Step S324: Determine whether the monitoring port information table has been traversed completely. If yes, end the process; otherwise, proceed to step S325.

[0164] In this embodiment of the application, each entry in the monitoring port information table is processed using the following steps S325-S328.

[0165] The monitoring module can process entries in the monitoring port information table in batches, and simultaneously perform steps S325-S328 on the output ports indicated by multiple entries. Alternatively, the monitoring module can process each entry in the monitoring port information table sequentially, and individually perform steps S325-S328 on the output port indicated by each entry.

[0166] The specific processing method can be determined based on the processing capacity of the data plane's execution information acquisition module and the bandwidth of the channel leading to that module.

[0167] Step S325: Using the information in the monitoring port information table, configure the monitored outgoing port to mirror the data stream of the outgoing port to the core module of the data plane.

[0168] Step S326: Send the port information for which CGF information needs to be collected to the core module of the data plane.

[0169] After the monitoring module sends the port information to the core module, the core module sets the physical state to information acquisition state, clears the registers storing the acquisition results in the programmable switch chip, clears the CGFT, and configures the RegToTB register. The RegToTB register is used to store the traffic threshold value of the identified elephant flow.

[0170] In this embodiment of the application, the physical state of the core module is the same as the physical state of the data plane.

[0171] After configuring the RegToTB register in the core module, CGF information collection begins.

[0172] Step S327: Check whether the collection of current port information is complete. If not, repeat step S327; if yes, proceed to step S328.

[0173] Step S328: Cancel the current port's traffic redirection and return to step S324.

[0174] If the monitoring module detects that the collection of information for the current port has not been completed, that is, the collection of CGF information for the current port has not been completed, then it will re-execute step S327 to check whether the collection of information for the current port has been completed.

[0175] If the monitoring module detects that the current port information collection is complete, that is, the CGF information collection of the current port is complete, then it executes step S328 to cancel the current port traffic redirection and can collect the CGF information of the next port until the CGF information collection of all ports is complete.

[0176] After the CGF information is collected, GF information is collected within the range of the CGF information. In one embodiment of this application, the GF information collection process in step S34 above is as follows: Figure 5 As shown, it may include the following steps:

[0177] Step S341: Obtain the program compilation result file related to GF information acquisition through the external interaction port. This program compilation result file can be a P4 program compilation result file. For ease of distinction, the file name is P4Info2. This is not a limitation. The P4Info2 file contains the relevant information required to complete GF information acquisition. This relevant information is the P4 program compilation result, used to configure the programmable switch chip to complete GF information acquisition.

[0178] Step S342: Notify the core modules of the data plane to enter the configuration state, and query and wait for the data plane's response to enter the corresponding state. See the description of step S322 above for details.

[0179] Step S343: Download the P4Info2 file to the data plane core module, query and wait for the data plane's response to enter the corresponding state. See the description in step S323 above for details.

[0180] Step S344: Determine whether the monitoring port information table has been traversed completely. If yes, end the process; otherwise, proceed to step S345. See step S324 above for details.

[0181] Step S345: Using the information in the monitoring port information table, configure the monitored outgoing port to mirror the data stream of the outgoing port to the core module of the data plane. See the description in step S325 above for details.

[0182] Step S346: The port information for which GF information needs to be collected is sent to the core module of the data plane. See step S326 above for details.

[0183] Step S347: Check whether the collection of current port information is complete. If not, repeat step S347; if yes, proceed to step S348. See the description of step S327 above for details.

[0184] Step S348: Cancel the current port's traffic redirection and return to step S344. See the description of step S328 above for details.

[0185] Through the above steps, the collection of GF information within the range of CGF information was completed.

[0186] After completing the GF information collection, based on the collected GF information, the monitoring module executes a listening process to identify elephant flows in the network and perform congestion control on these elephant flows. In one embodiment of this application, in step S36 above, the listening process is as follows: Figure 6 As shown, it may include the following steps:

[0187] Step S361: Obtain the program compilation result file related to monitoring GF information through the external interaction port. This program compilation result file can be a P4 program compilation result file. For ease of distinction, the file name is P4Info3. This is not a limitation. The P4Info3 file contains the relevant information required to complete GF monitoring. This information is the P4 program compilation result, used to configure the programmable switch chip to complete GF monitoring.

[0188] Step S362: Notify the core modules of the data plane to enter the configuration state, and query and wait for the data plane's response to enter the corresponding state. See the description in step S322 above for details.

[0189] Step S363: Download the P4Info3 file to the data plane core module, query and wait for the data plane's response to enter the corresponding state. See the description in step S323 above for details.

[0190] Step S364: Determine whether the monitoring port information table has been traversed completely. If yes, proceed to step S366; otherwise, proceed to step S365. See the description in step S324 above for details.

[0191] Step S365: Using the information in the monitoring port information table, configure the monitored outgoing port to mirror the congested data packets of the outgoing port to the core module of the data plane.

[0192] Congestion packets can include CPN and ECN packets.

[0193] In this embodiment, the monitoring module can configure Access Control List (ACL) rules to redirect received congestion packets to the input port of the core module in the data plane, and add relevant information to the packets, such as the port information for receiving the congestion packets. Furthermore, while redirecting the congestion packets to the core module, the monitoring module discards the original congestion packets to prevent the congestion packets from the "rat stream" from being transmitted to the corresponding devices, thereby hindering congestion control of the "rat stream" and causing harm to it.

[0194] The CNP mentioned above can be a data packet with the ECN-Echo flag, such as a TCP acknowledgment (ACK) data packet with the ECN-Echo flag. An ECN data packet is a data packet with the ECN flag, such as a TCP data packet with the ECN flag.

[0195] Step S366: Notify the core module of the data plane to enter the GF listening state and wait for the data plane to respond and enter the corresponding state.

[0196] Specifically, the monitoring module sends a GF listening status notification to the core module. Upon receiving this notification, the core module sets its physical state to listening state and returns a message to the monitoring module indicating that the core module's physical state is listening state.

[0197] The core module then listens to the received CNP and / or ECN data packets, matches the flow information of the received CNP and / or ECN data packets with the GF information, and then performs the corresponding processing.

[0198] Step S367: Check whether the data plane monitoring has ended.

[0199] The listening period for the data plane is preset. For example, the listening period can be 600 seconds or 700 seconds.

[0200] The monitoring module continuously detects whether the data plane monitoring has ended. If it detects that the data plane monitoring has not ended, it repeatedly executes step S367, waiting for the data plane monitoring to end. If it detects that the data plane monitoring has ended, it executes step S368.

[0201] Step S368: Determine whether the monitoring port information table has been traversed completely. If yes, end the process; otherwise, proceed to step S369.

[0202] Step S369: Cancel traffic redirection on the current port. Then, return to step S368.

[0203] After the monitoring module shuts down the traffic redirection on each port through the above steps S368 and 369, the listening process ends.

[0204] In one embodiment of this application, during the operation of the lossless transmission system, if the forwarding table changes, the monitoring module of the control plane sends the changed forwarding table to the core module of the data plane, waiting for the next cycle to execute the corresponding information collection.

[0205] Corresponding to the processing flow on the monitoring module side described above, this application embodiment also provides a processing flow on the core module side.

[0206] In one embodiment of this application, with Figure 4 Corresponding to the CGF information acquisition process of the monitoring module shown, this application embodiment provides a CGF information acquisition process on the core module side as follows: Figure 7 As shown, it may include the following steps:

[0207] Step S71: Receive the configuration status message sent by the monitoring module of the control plane, and set the physical status of the core module to the configuration status.

[0208] Step S72: Receive the P4Info1 file related to CGF information acquisition sent by the monitoring module of the control plane, and download the P4Info1 file to the programmable switching chip through the control channel to complete the corresponding configuration.

[0209] Understandably, the information in the P4Info1 file is configuration information for configuring the programmable switch chip.

[0210] Step S73: Set the physical state of the core module to idle state.

[0211] Step S74: Check whether port information for collecting CGF information has been received. If not, repeat step S74; if yes, proceed to step S75. The port information refers to the entry information in the monitoring port information table issued by the monitoring module.

[0212] Step S75: Set the physical state of the core module of the data plane to the information acquisition state for querying by the control plane, clear the registers storing the acquisition results of the programmable switching chip, clear CGFT, and configure register RegToTB.

[0213] Step S76: Start the non-periodic timer AperiodicTimer and start the periodic timer PeriodicTimer.

[0214] The expiration durations of AperiodicTimer and PeriodicTimer are user-defined collection durations. For example, the expiration duration of AperiodicTimer can be 1 second, and that of PeriodicTimer can be 20 milliseconds (ms). In this case, 50 CGF information entries can be collected within 1 second.

[0215] Step S77: Check if the AperiodicTimer has expired. If yes, proceed to step S78. If no, proceed to step S79.

[0216] Step S78: Stop PeriodicTimer and return to step S73.

[0217] Step S79: Check if the PeriodicTimer has expired. If not, return to step S77. If yes, proceed to step S710.

[0218] In step S710, the CGF information is obtained from the programmable switching chip through the control channel and refreshed into the CGFT, and then the process returns to step S77.

[0219] In an optional embodiment, step S710 can be refined into the following steps.

[0220] a) Retrieve register array A5.

[0221] In register array A5, each register corresponds to a hash value generated from the quintuple of the data streams, and each register stores the maximum flow rate of the corresponding data stream within a PeriodicTimer period. In practical applications, multiple data streams may have the same hash value for their quintuples. Therefore, these data streams correspond to the same register in register array A5, meaning one register corresponds to multiple data streams. Consequently, the flow rate of data corresponding to quintuples with the same hash value is grouped together.

[0222] b) Extract the registers in register array A5 whose values ​​are greater than the candidate threshold (ToC), and identify the data streams corresponding to these registers as CGF.

[0223] For each register that meets the conditions, the following processing is performed: Traverse the forwarding table and retrieve the corresponding entry information; perform hash calculation on the quintuple in each entry information to obtain the hash value; take the entry information whose calculated hash value is the same as the hash value corresponding to the register and add it to CGF.

[0224] The table entry information is the flow information, which includes a 5-tuple. The hash value corresponding to the register is the hash value generated from the 5-tuple of the data flow corresponding to that register. The hash value corresponding to the register is the index of that register. ToC represents the flow threshold at which the data flow is identified as a CGF, i.e., the preset candidate flow threshold value.

[0225] The hash calculation algorithm used in the core module is the same as that used in the programmable switch chip. For example, both the core module and the programmable switch chip use a byte-wise AND operation followed by modulo operation. Other hash calculation algorithms are also possible and are not limited thereto.

[0226] In one embodiment of this application, with Figure 5 Corresponding to the GF information acquisition process of the monitoring module shown, this application embodiment provides a GF information acquisition process on the core module side, such as... Figure 8 As shown, it includes the following steps:

[0227] Step S81: Receive the configuration status message sent by the monitoring module of the control plane, and set the physical status of the core module to the configuration status.

[0228] Step S82: Receive the P4Info2 file related to GF information acquisition sent by the monitoring module of the control plane, and download the P4Info2 file to the programmable switching chip through the control channel to complete the corresponding configuration.

[0229] Understandably, the information in the P4Info2 file is configuration information for configuring the programmable switch chip.

[0230] Step S83: Set the physical state of the core module to idle state.

[0231] Step S84: Check whether port information for collecting GF information has been received. If not, repeat step S84; if yes, proceed to step S85. The port information refers to the entry information in the monitoring port information table issued by the monitoring module.

[0232] Step S85: Set the physical state of the core module of the data plane to the information acquisition state for querying by the control plane; clear the lookup table and clear the registers of the programmable switch chip that store the acquisition results; add the flow information of the corresponding port in CGFT to the lookup table of the programmable switch chip through the control channel; configure the register RegToTB.

[0233] In an optional embodiment, the above-mentioned method of adding the flow information of the corresponding port in the CGFT to the lookup table of the programmable switch chip via the control channel can be specifically as follows: find the flow information of the corresponding port in the CGFT, select a preset number of flow information with the largest flow, construct an entry with the flow ID and register index value of the selected flow information, and add it to the lookup table of the programmable switch chip via the control channel.

[0234] Here, FlowID represents data stream information, which may include, but is not limited to, a 5-tuple. RegIndex is the register index value in the programmable switch chip that stores the acquisition results. The RegIndex value selected from CGFT corresponding to FlowID ranges from 0 to a preset number - 1. The preset number can be set according to actual needs. For example, the preset number can be 255.

[0235] Step S86: Start the non-periodic timer AperiodicTimer and start the periodic timer PeriodicTimer.

[0236] The expiration durations of AperiodicTimer and PeriodicTimer are user-defined collection durations. For example, the expiration duration of AperiodicTimer can be 2 seconds, and the expiration duration of PeriodicTimer can be 20 milliseconds. In this case, 100 GF information entries can be collected within 2 seconds.

[0237] Step S87: Check if the AperiodicTimer has expired. If yes, proceed to step S88. If no, proceed to step S89.

[0238] Step S88: Stop PeriodicTimer and return to step S83.

[0239] Step S89: Check if the PeriodicTimer has expired. If not, return to step S87. If yes, proceed to step S810.

[0240] In step S810, GF information is obtained from the programmable switching chip through the control channel, refreshed into GFT, and then the process returns to step S87.

[0241] In an optional embodiment, step S810 can be refined into the following steps.

[0242] a) Retrieve register array A5; where register array A5 includes a preset number + 1 registers, the first preset number of registers correspond one-to-one with the RegIndex selected from CGFT above, that is, the first preset number of registers correspond one-to-one with the data stream of FlowID selected from CGFT above, and the last register corresponds to all data streams except the data stream of the extracted FlowID.

[0243] b) Extract the registers in register array A5 (excluding the last register) whose values ​​are greater than the Greedy Flow Threshold (ToGF), and identify the data streams corresponding to these registers as GF.

[0244] For each register that meets the condition, the following processing is performed:

[0245] Based on the register index in the lookup table, query the CGFT and retrieve the corresponding entry information, which is the entry information of the GF. Based on the GF's entry information in the CGFT, query the GFT. If the GF's entry information exists in the GFT, set the aging count corresponding to the GF's entry information to the maximum value ff, and set the active value of the GF's entry information to the maximum value. Otherwise, add the GF's entry information to the GFT, set the aging count to the maximum value ff, and set the active value of the GF's entry information to the maximum value.

[0246] The ToGF mentioned above represents the traffic threshold at which a data stream is identified as a GF, i.e., the preset traffic threshold value.

[0247] In one embodiment of this application, with Figure 6 The monitoring process of the monitoring module shown corresponds to the monitoring process of the core module in this application embodiment, as follows: Figure 9 As shown, it may include the following steps:

[0248] Step S91: Receive the configuration status message sent by the monitoring module of the control plane, and set the physical status of the core module to the configuration status.

[0249] Step S92: Receive the GF information monitoring related P4Info3 file sent by the monitoring module of the control plane, and download the P4Info3 file to the programmable switch chip through the control channel to complete the corresponding configuration.

[0250] Understandably, the information in the P4Info3 file is configuration information for configuring the programmable switch chip.

[0251] In one embodiment of this application, after the above configuration is completed, the following two objectives need to be achieved:

[0252] a) Direct data packets received from Fabric to the core modules of the data plane;

[0253] b) Forward the data packets sent by the core module of the data plane to Fabric.

[0254] Step S93: Set the physical state of the core module to idle state.

[0255] Step S94: Receive a notification from the control plane to enter GF listening state, and set the physical state of the core module to listening state according to the notification.

[0256] At this point, the core module starts the aging timer for GF. This aging timer is a periodic timer. The period of the aging timer can be set according to actual needs, such as 1s, 2s, or 3s.

[0257] Step S95: Listen for whether a CNP is received. If not, repeat step S95; if yes, proceed to step S96.

[0258] In this embodiment, for the monitored port, the monitoring module of the control plane configures corresponding ACL rules to filter the data packets received by that port. The CNP is retained and processed accordingly, such as adding the port information receiving the CNP to the CNP. Simultaneously, the ACL-processed CNP is routed to the programmable switching chip. The programmable switching chip further routes the CNP to the core module of the data plane for further processing.

[0259] Step S96: Retrieve the flow information from the CNP and query the GFT using the flow information. If the flow information entry is found, proceed to step S97; otherwise, proceed to step S910. The flow information entry is the entry that includes the flow information.

[0260] Step S97: Decrement the activity value of the flow information entry in the GFT by 1, and then execute S98.

[0261] Step S98: Check if the activity value of the flow information entry in the GFT is 0. If yes, proceed to step S99; otherwise, proceed to step S911.

[0262] Step S99: Delete the flow information entry in the GFT. Then proceed to step S911.

[0263] Step S910: Remove the congestion flag. For example, remove the ECN-Echo flag, then proceed to step S911.

[0264] Step S911: Query the forwarding table. If the query is successful, proceed to step S912; otherwise, proceed to step S913.

[0265] Step S912: Forward the CNP to the source server address carried in the data stream, and reset the aging count of the stream information entry to the maximum value ff.

[0266] In step S912, the CNP received by the core module is a CNP derived from the programmable switching chip, and a corresponding ACL field has been added to this CNP. To ensure the normal forwarding of subsequent data packets and achieve data packet pass-through, the core module can also remove the added ACL field.

[0267] Step S913: Discard the CNP.

[0268] If the core module fails to query the forwarding table, it indicates a change in network topology. The CNP should be discarded to conserve network resources. Optionally, the core module can request synchronization of the forwarding table from the control plane to ensure the normal forwarding of subsequent data packets.

[0269] In one embodiment of this application, the core module can also monitor ECN packets. In this case, after the core module sets its physical state to the monitoring state, it can perform the following steps:

[0270] 1) Listen for whether an ECN packet has been received. If yes, proceed to step 2); otherwise, repeat step 1).

[0271] 2) Extract flow information from the ECN packet and use the flow information to query the GFT. If the flow information entry is found, proceed to 3); otherwise, proceed to 7).

[0272] 3) Decrement the activity value of the stream information entry in the GFT by 1, then execute 4);

[0273] 4) Check if the activity value of the stream information entry in the GFT is 0. If yes, proceed to step 5); otherwise, proceed to step 6).

[0274] 5) Delete the flow information entry in the GFT. Then proceed to step 6).

[0275] 6) Construct CNP, then execute 8).

[0276] 7) Remove the congestion flag. For example, remove the ECN flag, then proceed to step 8).

[0277] 8) Query the forwarding table. If the query is successful, proceed to step 9); otherwise, proceed to step 10).

[0278] 9) Forward the data packet to the source server address carried in the data stream; reset the aging count of the stream information entry to the maximum value ff.

[0279] 10) Otherwise, discard the packet.

[0280] In steps 9) and 10), the data packet includes the CNP constructed in step 6) and the data packet with the ECN flag removed.

[0281] In this embodiment, the core module starts an aging timer for the GF. When the core module receives the aging timer event, it iterates through the GFT and decrements the aging count by 1 for each GF entry. When the aging count reaches 0, the core module deletes the GF entry. If the core module does not receive the corresponding CNP or ECN for the GF entry within the maximum value ff, it is likely that the data stream corresponding to the GF entry no longer requires congestion control; deleting the GF entry saves GFT entry resources.

[0282] In one embodiment of this application, the acquisition of CGF information for the current port within each PeriodicTimer can be implemented using the P4 programming language. Specifically, the control module configures the programmable switch chip using the P4Info1 file. Based on the configuration, the core module acquires CGF information within each PeriodicTimer. When acquiring CGF information within each PeriodicTimer, the following configuration is pre-completed:

[0283] 1) The register RegToTB is defined inside the programmable switching chip; the core module of the data plane can read and write this register RegToTB through the control channel.

[0284] The RegToTB register stores the traffic threshold identified as heavily loaded based on the bandwidth occupancy of the current port within the statistical period. This traffic threshold can also be called the byte count threshold. The value stored in the RegToTB register can differ for different ports, and can be set according to the port's forwarding capacity. In this embodiment, a traffic threshold of τ1 is used as an example for illustration.

[0285] 2) In the input pipe stage, the core module parses data packets to identify various types of data packets. This embodiment uses the identification of TCP data packets as an example. The core module extracts the 5-tuple of the TCP data packet, calculates the hash value of the 5-tuple, and saves it to the input metadata IngMeta.

[0286] In this embodiment, a range of hash values ​​is preset, for example, 0 to 1023. This range can be set according to actual needs.

[0287] 3) Design multiple register arrays. The number of register arrays is the number of statistical periods divided into one calculation cycle plus 2. The following example uses four statistical periods divided into one calculation cycle as an example and is not intended to be limiting. In this case, design six register arrays: A0, A1, A2, A3, A4, and A5. Each register array includes multiple registers, and the initial value of the registers in register arrays A0, A1, A2, A3, A4, and A5 is 0. The number of registers in a register array is the same as the number of hash values ​​included in the predefined hash value range. For example, if the predefined hash value range is 0 to 1023, then each register array includes 1024 registers.

[0288] Design a register array BytesTotal containing multiple 32-bit registers, with the initial value of each register in BytesTotal being 0. The number of registers in BytesTotal is the same as the number of statistical periods into which one computation cycle is divided. The following example uses a computation cycle divided into 4 statistical periods, where the register array BytesTotal contains 4 registers.

[0289] Design a register Ta, with an initial value of 0.

[0290] In this embodiment of the application, during the output pipe stage:

[0291] Use the value in IngMeta to index a register array from A0 to A3. Assume the data stream computation period is T, and the statistical period is t, where t = T / 4, meaning the statistical period is one-quarter of the computation period. For ease of explanation, the statistical period t... i(i ranges from 0 to 3) corresponding to the time periods: 0 to T / 4, T / 4 to 2T / 4, 2T / 4 to 3T / 4, 3T / 4 to T; that is, t0 to t3 correspond to 0 to T / 4, T / 4 to 2T / 4, 2T / 4 to 3T / 4, 3T / 4 to T; then the time period t0 operates on the registers in A0, the time period t1 operates on the registers in A1, the time period t2 operates on the registers in A2, and the time period t3 operates on the registers in A3. In this embodiment, the calculation period T is approximately 1ms and the statistical period is approximately 256μs as an example for explanation.

[0292] The registers A0 to A3 are used to store the statistical flow of the data stream corresponding to the index value within the corresponding statistical period.

[0293] The A4 register is used to store the timestamp of the data stream corresponding to the index value within the PeriodicTimer period.

[0294] The A5 register is used to store the maximum flow statistics of the data stream corresponding to the index value within the PeriodicTimer period.

[0295] The registers in BytesTotal are used to store the total flow of the data stream corresponding to the index value within the corresponding statistical period.

[0296] Ta is used to record global timestamps.

[0297] Based on the metadata provided by the output pipe of the programmable switch chip, the time when the data packet arrives at the output port can be obtained, and the current statistical period can be calculated accordingly.

[0298] For example, based on the global timestamp (global_tstamp) field in the egress port internal metadata (egress_intrinsic_metadata_from_parser_t) provided by the parser, the time t when the current packet arrived at the output pipe can be obtained. a =global_tstamp>>shift. >> indicates shifting to the right. That is, t a This indicates that `global_tstamp` is shifted right by `shift`, which is equivalent to dividing by 2 raised to the power of `shift`. Because `global_tstamp` is in nanoseconds (ns), the calculation period in this embodiment is much coarser. The specific value of `shift` can be determined by the user. In this embodiment, `shift` is set to 10. If the calculation period `T` is approximately 1 ms, then `t`... a Each counting unit is approximately 1 μs. Therefore, shifting global_tstamp right by shift is equivalent to dividing by 2 to the power of 10 (i.e., 1024), which is approximately 1 μs. aShifting right is equivalent to dividing by 2 to the power of 10, which is approximately 1ms.

[0299] In this embodiment, the calculation period is determined by shifting the shift bit to the right. The calculation period is convenient and fast, saving computing resources and improving the efficiency of information collection.

[0300] In this embodiment of the application, when collecting CGF information for each port, the core module executes the above configuration to complete the configuration required for collecting CGF information for each port.

[0301] Based on the above configuration, CGF information is collected within each PeriodicTimer, such as... Figure 10 As shown, it may include the following steps:

[0302] Step S101: Set the index value in IngMeta to Index, and retrieve the value from register A4[Index] as t' a ; Retrieve the value from the Ta register as t” a Let t a The value of bits 8 and 9 is k; let t' a The value of bits 8 and 9 is k'; let t” a The value of bits 8 and 9 is k”; t” a After bitwise inversion and sum to t a The result of ANDing is used as temp.

[0303] Among them, t a Bits 0-9 record a duration of 2 to the power of 10, approximately 1 ms, which is the duration of one calculation cycle. a Bits 0-7 record a duration of 2 to the power of 8, approximately 256 μs, which is one-quarter of the calculation cycle and the duration of one statistical cycle. When t a When bits 8 to 9 change, it can be understood that at least one statistical period has elapsed.

[0304] The binary values ​​of bits 8 and 9 can be 00, 01, 10, and 11. It can be understood that when the binary value of bits 8 and 9 is 00, the current calculation period is in the first statistical period; when the binary value of bits 8 and 9 is 01, the current calculation period is in the second statistical period; when the binary value of bits 8 and 9 is 10, the current calculation period is in the third statistical period; and when the binary value of bits 8 and 9 is 11, the current calculation period is in the fourth statistical period.

[0305] When t a When bits 10 to 31 change, it can be understood that at least one calculation cycle has elapsed.

[0306] Step S102: Determine if the values ​​of bits 10-31 of temp are 0. If not, proceed to step S103. If yes, proceed to step S104.

[0307] temp is t” a After bitwise inversion and sum to t a AND the obtained value. As described in step S101, when t a When bits 10-31 change, it can be understood that at least one calculation cycle has elapsed; if t a If bits 10-31 remain unchanged, then the calculation is still within the current cycle. The binary AND operation rule is that 1 & 1 = 1, and all other AND operations result in 0. Based on this, if t” a For bits 10 to 31, the value is 0000, t a If bits 10-31 are 0001, then temp is 0001; if t” a For bits 10 to 31, the value is 0001, t a If bits 10-31 are 0011, then temp is 0010; if t” a For bits 10 to 31, the value is 0011, t a If bits 10-31 are 0100, then temp is 0100; otherwise, such as t” a For bits 10 to 31, the value is 0000, t a If bits 10 to 31 are 0000, then temp is 0000.

[0308] It can be seen that when at least one calculation cycle has elapsed, the values ​​of bits 10 to 31 of temp are not 0; otherwise, the values ​​of bits 10 to 31 of temp are 0.

[0309] Based on this, when the value of bits 10 to 31 of temp is determined to be 0 in step S102, it indicates that t” a and t a If bits 10-31 are the same, the current time is still within the calculation cycle, and step S104 is executed. Otherwise, if the global timestamp difference is greater than 1ms, it indicates that the global statistical data is too outdated, and the time has exceeded the duration of at least one calculation cycle, and step S103 is executed.

[0310] In this embodiment of the application, the core module can also adopt t” a and t a The difference is used as temp to accurately calculate whether a calculation cycle has elapsed. No restrictions are imposed on this.

[0311] Step S103: Clear the BytesTotal[0] to BytesTotal[3] registers; clear the values ​​of A0[Index], A1[Index], A2[Index] and A3[Index]. Then execute step S1011.

[0312] If the global timestamp difference exceeds 1ms, the timestamp of the current data stream is also confirmed to be 1ms. To ensure the accuracy of subsequent traffic statistics, clear the values ​​of BytesTotal[0] to BytesTotal[3], as well as the registers A0[Index], A1[Index], A2[Index] and A3[Index] corresponding to the current data stream.

[0313] Step S104: Determine whether k” is different from k. If yes, that is, k” is different from k, then proceed to step S105; if no, that is, k” is the same as k, then proceed to step S106.

[0314] Step S105: Clear BytesTotal[k]. Then proceed to step S106.

[0315] In this embodiment of the application, if k” is different from k, then as described in step S101, it means that at least one statistical period has passed in the global time, the time window is moved forward by T / 4, and step S105 is executed to clear BytesTotal[k] corresponding to the current statistical period so as to accurately count the traffic within the current statistical period k.

[0316] If k” is the same as k, it means that the global time has not passed through a statistical period and the time window has not moved forward by T / 4. Then proceed directly to step S106.

[0317] Step S106, t' a After bitwise inversion and sum to t a The result of ANDing is temp'.

[0318] Step S107: Determine if the values ​​of bits 10 to 31 of temp' are 0. If yes, proceed to step S109. If no, proceed to step S108.

[0319] The principle of step S107 is the same as that of step S102, and will not be repeated here.

[0320] When it is determined in step S107 that the value of bits 10 to 31 of temp' is 0, it indicates that t' a and t aIf bits 10-31 are the same, the current time is still within the calculation cycle, and step S109 is executed. Otherwise, if the difference between the timestamp of the last record in the current data stream and the current timestamp is greater than 1ms, it indicates that the statistical data of the current data stream is too old, and the time has passed for at least one calculation cycle, and step S108 is executed.

[0321] Step S108: Clear the values ​​of A0[Index], A1[Index], A2[Index], and A3[Index]. Then proceed to step S109.

[0322] Step S109: Determine whether k' is different from k. If yes, that is, k' is different from k, then proceed to step S1010; if no, that is, k' is the same as k, then proceed to step S1011.

[0323] Step S1010: Clear register Ak[Index]. Then proceed to step S1011.

[0324] In this embodiment, if k' is different from k, then as described in step S101, it indicates that the statistical time of the current data stream has exceeded one statistical period. The time window is moved forward by T / 4, and step S1010 is executed to clear the register Ak[Index] corresponding to the current data stream. For example, if k = 1, then register A1[Index] is cleared to accurately count the flow of the current data stream within the current statistical period k.

[0325] If k' is the same as k, it means that the current data stream's statistical time has not passed through a statistical cycle, the time window has not moved forward by T / 4, and step S1011 is executed directly.

[0326] Step S1011: Increase the value of register Ak[Index] by the current data packet length, and increase BytesTotal[k] by the current data packet length.

[0327] Step S1012, take t' a Bits 10 to 31 are used as temp1, and the current t is taken. a Bits 10 to 31 are used as temp2.

[0328] Step S1013: Determine whether temp1 and temp2 are the same. If they are not the same, proceed to step S1014; if they are the same, proceed to step S1019.

[0329] When temp1 and temp2 are different, it means that the statistical time of the current data stream has passed at least one calculation cycle. Execute step S1014 to determine the possible CGF within the current calculation cycle.

[0330] Step S1014: Calculate the cumulative value C2 of BytesTotal[0] to BytesTotal[3].

[0331] C2 represents the total flow rate within a calculation cycle.

[0332] Step S1015: Determine whether C2 is greater than the threshold value τ1. If yes, it means that the current statistical period has reached the heavy load threshold, and proceed to step S1016; otherwise, proceed to step S1019.

[0333] Step S1016: Calculate the cumulative value C1 of A0[Index], A1[Index], A2[Index] and A3[Index].

[0334] C1 represents the total flow of the current data stream corresponding to the Index within a calculation cycle.

[0335] Step S1017: Determine whether C1 is greater than A5[Index]. If yes, it means that the traffic counted in the current calculation period is greater than the traffic counted in the previous period, and proceed to step S1018; otherwise, proceed to step S1019.

[0336] A5[Index] stores the current data stream with the larger flow corresponding to the current index. C1 is compared with A5[Index]. If C1 is greater than A5[Index], then the flow counted in the current calculation period is larger than the previous flow, and step S1018 is executed. Otherwise,

[0337] Step S1018: Save C1 to A5[Index].

[0338] This method can be used to find the most severe burst value of the data stream corresponding to the Index that reaches heavy load in each calculation cycle within the current PeriodicTimer.

[0339] Step S1019, using t a Update the A4[Index] register and the Ta register.

[0340] Then, steps S101-S1019 can be executed repeatedly until a stop operation is received from the user.

[0341] In one embodiment of this application, the acquisition of GF information for the current port within each PeriodicTimer can be implemented using P4 programming language. Specifically, the control module configures the programmable switch chip using a P4Info2 file. Based on the configuration, the core module acquires GF information within each PeriodicTimer. When acquiring GF information within each PeriodicTimer, the following configuration is pre-completed.

[0342] 1) The register RegToTB is defined inside the programmable switching chip; the core module of the data plane can read and write this register RegToTB through the control channel.

[0343] The RegToTB register stores the traffic threshold for identified heavy loads based on the bandwidth occupancy of the current outgoing port within the statistical period. In this embodiment, a traffic threshold of τ1 is used as an example for illustration.

[0344] 2) During the input pipe stage, the core module parses the data packets to identify various types of data packets. In this embodiment, TCP data packets are identified as an example. The core module extracts the 5-tuple of the TCP data packet and queries the lookup table IngTable based on the extracted 5-tuple.

[0345] If the extracted quintuple matches an entry in the lookup table IngTable, the register index value is extracted from that entry and saved to the input metadata IngMeta. In this embodiment, it is assumed that the lookup table includes 256 entries, of which 255 entries include a FlowID and a register index value, and one is an empty entry. The range of the register index value in the lookup table IngTable is 0 to 254.

[0346] If the extracted quintuple does not match an entry in the lookup table IngTable, the maximum register index value is saved to the input metadata IngMeta. In this embodiment, it is assumed that the register index value ranges from 0 to 255, with a maximum index value of 255; the register index value can be obtained from 0 to 254 by searching the lookup table. When the extracted quintuple does not match an entry in the lookup table IngTable, the maximum register index value of 255 is saved to the input metadata IngMeta.

[0347] 3) Design multiple register arrays. The number of register arrays is the number of statistical periods divided into one calculation cycle plus 2. The following example uses four statistical periods divided into one calculation cycle as an example and is not intended to be limiting. In this case, design six register arrays: A0, A1, A2, A3, A4, and A5. Each register array includes multiple registers, and the initial values ​​of the registers in register arrays A0, A1, A2, A3, A4, and A5 are 0. The number of registers in a register array is the same as the number of values ​​included in the range of register index values. For example, if the range of register index values ​​is 0 to 255, then each register array includes 256 registers.

[0348] Design a register array BytesTotal containing multiple 32-bit registers, with the initial value of each register in BytesTotal being 0. The number of registers in BytesTotal is the same as the number of statistical periods into which one computation cycle is divided. The following example uses a computation cycle divided into 4 statistical periods, where the register array BytesTotal contains 4 registers.

[0349] Design a register Ta, with an initial value of 0.

[0350] In this embodiment, during the output pipe stage: if the data packet's output port is a discard port, no processing is performed. Otherwise, GF information collection is executed; the specific GF information collection process can be found in [reference needed]. Figure 10 As shown, this is no longer a limitation.

[0351] In this embodiment of the application, in order to achieve better results and improve the efficiency of GF information acquisition, the following conditions are met, and corresponding beneficial effects can be achieved.

[0352] 1. When implementing the scheme in a programmable switch chip, each stage of the pipe should not perform too many operations, referring to the Portable Switch Architecture (PSA) architecture specification; at the same time, for the efficiency of the pipeline, parsing and table lookup operations should be placed in the input pipe, and register operations should be placed in the output pipe.

[0353] 2. Since the number of data streams may be very large, for example, most of them are long-connection data streams with very small traffic, it is impossible to put all the data streams into the programmable switch chip at the beginning, because if all the data streams are put into the programmable switch chip, the resources of the programmable switch chip will not be sufficient; therefore, in this embodiment, a two-stage collection is adopted. The first stage only performs coarse hash clustering to collect potential elephant streams (i.e., CGF) and narrows down the range of data streams. In the second stage, the elephant streams (i.e., GF) are accurately captured.

[0354] 3. The two stages use different P4 programs corresponding to P4Info files, which is also for resource considerations. According to publicly available information, the inventors found that programming and loading the programmable switch chip through the Direct Memory Access (DMA) port takes less than 20ms. For small P4Info files, the time spent is even less. Therefore, the technical solution provided by the embodiments of this application based on P4Info files is practically feasible.

[0355] 4. In the implementation scheme, when capturing burst data streams with large traffic volumes, the total traffic volume is also taken into account. The purpose is that when the total traffic volume is large within the calculation period, capturing data streams that occupy a large bandwidth is more valuable, indicating that these data streams contribute significantly to congestion.

[0356] 5. For the statistics of each data stream, a circular queue consisting of 4 registers is used; and the queue changes over time, which can naturally release register resources.

[0357] 6. Inside the programmable switching chip, the capture granularity (i.e., calculation cycle) is about 1ms, and the statistical window moves with a period of about 0.25ms, achieving a precision that is difficult for the control plane to reach. The technical solution provided in this application embodiment can identify elephant flows (including elephant flows in micro-bursts) when congestion occurs, and perform precise congestion control on elephant flows that cause congestion, thereby mitigating micro-bursts and playing a significant role in improving the transmission quality of lossless networks.

[0358] 7. Each time CGF information is collected, CGFT will be cleared, but GFT will not be cleared. Instead, the entries in GFT will age naturally. When new GF information is collected, GFT will be refreshed. If no CNP of a certain GF is received for 256 consecutive seconds, and the GF is not identified as a GF again, the entry of that GF in GFT will be deleted.

[0359] 8. The aging count of GFT is used to control the duration of GF entries; the activity value is used to control the number of times the data stream is regulated. To avoid GF being over-regulated, the activity value can be set to a small number, such as 3 or 4. Each time GF is regulated, the activity value of the GF entry is reduced by 1. When the activity value of the GF entry is reduced to 0, the GF entry is deleted.

[0360] 9. For network devices implemented based on programmable switching chips, the GFT obtained in the technical solution provided in this application can also be distributed to the programmable switching chip. By querying the GFT, the ECN data packet of the GF corresponding to the entry in the GFT is constructed, instead of constructing an ECN data packet for each data flow; or, the core module that redirects the ECN data packet to the data plane is marked at the outgoing port; CNP response is performed on the ECN data packet that has the corresponding entry in the GFT, and the ECN data packet that does not have the corresponding entry in the GFT is discarded, thereby achieving optimized fast CNP.

[0361] Current networks face challenges such as ever-increasing traffic volume, larger data streams, more complex network applications, and the unavoidable occurrence of micro-bursts. Existing congestion control mechanisms are unable to identify the "elephant flows" within these micro-bursts, resorting to a one-size-fits-all approach to congestion control when congestion occurs, resulting in significant unfairness. This imprecise data flow regulation severely harms numerous small-volume data streams, ultimately hindering the improvement of network bandwidth utilization.

[0362] The technical solution provided in this application can identify "elephant flows" within micro-bursts. Through precise control, it can effectively protect numerous small-volume data flows, achieving greater fairness. By specifically reducing the transmission peaks of elephant flows within micro-bursts, it can effectively improve network forwarding capacity. Since the technical solution provided in this application runs continuously online and automatically makes adaptive adjustments, the congestion control effect will improve over time. Adopting the technical solution provided in this application can improve the user experience of the network and greatly enhance the competitiveness of the product.

[0363] Corresponding to the aforementioned lossless transmission system, in one embodiment of this application, a monitoring module for the control plane is provided, such as... Figure 11 As shown. This monitoring module may include: a monitoring port information table, a monitoring transaction table, a status management unit, a timer, an external interaction port, and a data plane port.

[0364] (I) Monitoring Port Information Table.

[0365] Each entry in the monitoring port information table can include the following information:

[0366] 1) Physical Port Identifier (InterfaceID): Used to identify a specific physical port. InterfaceID can be represented by a slot number, a port number, or a combination of both. This information is required when configuring and canceling traffic redirection during the information acquisition or monitoring phase. It corresponds to the OutIf statement in the GFT core module of the data plane.

[0367] 2) Threshold of Total Band (ToTB): This is used to represent the total traffic threshold of a port, i.e., the traffic threshold that is identified as heavy load. For example, if a physical port with a speed of 100 Gbits / s reaches 80 Gbits / s within a calculation period (assuming 1 ms), it is considered to be under heavy load. Under heavy load, identifying the GF (Frame Interval) is more valuable. At this time, meaningless bytes such as inter-frame gaps and preambles are ignored, and ToTB is converted to a byte threshold of 10M bytes.

[0368] 3) Threshold of Candidate (ToC): This represents the traffic threshold for an entry to be identified in the CGFT; for example, if the calculation period is 1ms, ToC can be set to 0.1M bytes.

[0369] 4) Greedy Flow Threshold (ToGF): Used to represent the flow threshold that is identified as an entry in GFT; for example, if the calculation period is 1ms, ToGF can be set to 0.05M bytes.

[0370] Because different ports have different bandwidths, their corresponding traffic thresholds also differ. Therefore, it is necessary to set individual traffic thresholds for each port. The monitoring module will send the information from the monitoring port information table to the data plane core module.

[0371] (ii) Monitoring Transaction Table.

[0372] The monitoring transaction table includes characteristics of the executed transactions, such as duration. Each transaction contains two characteristics:

[0373] 1) Transaction Type (TransType): 16-bit encoding, with the high 8 bits representing the primary type and the low 8 bits representing the subtype.

[0374] a) Configure transactions: 0x0000, download the P4Info1 file related to CGF information to the programmable switch chip; 0x0001, download the P4Info2 file related to GF information to the programmable switch chip; 0x0002, download the P4Info3 file related to GF information to the programmable switch chip; 0x0003, synchronize the forwarding table to the core module of the data plane; 0x0004, configure the specified port to be collected; 0x0005, cancel the collection of the specified port; 0x0006, configure the specified port to be listened to; cancel the listening to the specified port; ...

[0375] b) Acquire CGF transaction: 0x0100;

[0376] c) Acquire GF transaction: 0x0200;

[0377] d) Monitoring transaction: 0x0300;

[0378] 2) Expected execution time: 32-bit encoded, counted in seconds. Users can configure this according to their needs. For example:

[0379] a) For acquiring CGF transactions, the expected execution time is 1 second;

[0380] b) For acquiring GF transactions, the expected execution time is 2 seconds;

[0381] c) For the listener transaction, the expected execution time is 600 seconds;

[0382] This option is not effective for configuration transactions. You can check the status to determine whether the configuration transaction has been completed.

[0383] After the lossless transmission system completes basic initialization, timers need to be started to execute acquisition CGF transactions, acquisition GF transactions, or listening transactions. These time information is sent to the core module of the data plane as the duration of the timers for starting the relevant transactions.

[0384] (III) Status Management Unit.

[0385] The status management unit can perform the following functions:

[0386] 1) Interact with the core modules of the data plane to exchange status information;

[0387] 2) Receive information about changes in the forwarding table and coordinate with the core control logic to synchronize the forwarding table to the data plane;

[0388] 3) It works in conjunction with the core control logic to implement the configuration process.

[0389] (iv) Timers, providing various timer events.

[0390] (v) External interaction port.

[0391] It interacts with various modules, such as retrieving P4Info files from external storage media in conjunction with the core control logic, retrieving forwarding tables from external sources, or exchanging GF information with external entities.

[0392] (vi) Data plane port, used for interaction between the monitoring module and the core module of the data plane.

[0393] Corresponding to the aforementioned lossless transmission system, in one embodiment of this application, a core module of the data plane is provided, such as... Figure 12 As shown. This core module may include: monitoring status information, GF feature information table, CGFT, GFT, forwarding table, timer, data transceiver module, control channel, control module, and control plane port, etc.

[0394] (a) Monitoring status information.

[0395] The monitoring status information can include various physical states of the core module, which are used to characterize the current physical state of the core module, and can also be understood as the system state of the data plane.

[0396] In one example, the monitoring status information includes four physical states: configuration state, idle state, information collection state, and listening state. The transitions between physical states are as follows: Figure 13 As shown. Corresponding to the system states of the control plane. Due to limited hardware resources, different functions need to reuse hardware resources, requiring different configurations. To avoid system instability in the core modules, this application embodiment designs multiple physical states, and follows the following... Figure 13 The state transition is shown.

[0397] After the control plane issues each stage of operation to the data plane, it needs to query the physical state of the core modules of the data plane. Only if the data plane is in an idle state can the next stage of operation be executed. This method simplifies the implementation of the control plane.

[0398] (ii) GF Feature Information Table.

[0399] In the technical solution provided in this application embodiment, the GF feature information table of the core module of the data plane stores the GF features configured by the user, including:

[0400] 1) OutIf: Identifies the port, defined by the user;

[0401] 2) ToTB: Used to represent the traffic threshold identified as heavy load;

[0402] 3) ToC: Used to represent the flow threshold for entries identified in CGFT;

[0403] 4) ToGF: Used to represent the flow threshold that is identified as an entry in GFT;

[0404] Because different ports have different bandwidths, their corresponding traffic thresholds also differ. Therefore, individual traffic thresholds can be set for each port. The monitoring module's monitoring port information table contains ToTB, ToC, and ToGF. The monitoring module will then distribute this information from the monitoring port information table to the GF feature information table of the data plane core module.

[0405] (III) CGFT.

[0406] Each CGF entry in the CGFT includes:

[0407] 1) FlowID: Flow information, for example, a 5-tuple: source network protocol (Internet Protocol, IP) address, destination IP address, protocol number, source port, and destination port;

[0408] 2) OutIf;

[0409] 3) Hash value: The hash value calculated based on the FlowID of the data stream;

[0410] 4) RegValue: Acquisition results; acquired from the programmable switch chip and stored here; can be used for further extended applications, such as providing information for display on the control plane;

[0411] RegValue is the value stored in register A5 mentioned above.

[0412] 5) RegIndex: The register index value in the programmable switching chip that stores the acquisition results.

[0413] In programmable switching chips, due to resource constraints, it is impossible to directly perform bandwidth usage statistics on data streams. Therefore, statistics are performed on data streams with the same hash value. However, this can lead to different data streams having the same hash value, i.e., hash collisions. Therefore, in this embodiment, hash values ​​with the same hash value whose bandwidth usage meets a certain threshold are selected. Combined with information from the forwarding table, data streams whose FlowID hash value matches the threshold hash value are filled into the CGFT. These data streams are considered as data streams requiring further identification. During GF information acquisition initialization, the CGFT is sent to the flow table of the programmable switching chip for accurate GF statistics.

[0414] (iv) GFT.

[0415] The core module's GFT stores GFs that meet the flow threshold requirements. Each GF entry includes:

[0416] 1) FlowID;

[0417] 2) OutIf;

[0418] 3) Age: Aging count. In this embodiment, the maximum value of the aging count ff can be set to 255;

[0419] 4) Active: Activity value. In this embodiment, the maximum value of the active value can be set to 4. The active value decreases by 1 for each hit of the GF table entry.

[0420] During the listening phase, the data packets directed to the core module carry inbound port information. The port identifier in the inbound port information is matched with the port identifier in the OutIf, and then the FlowID is matched. If a match is found, the forwarding table is queried, and the data packets are forwarded out through Fabric based on the information in the forwarding table.

[0421] (v) Forwarding publications.

[0422] The forwarding table is issued by the control plane. Forwarding information can be obtained by looking up the table using the destination IP address. This forwarding information is used to construct the header of the data packet to be sent. This is similar to the forwarding table in the line card of a chassis device.

[0423] (vi) Timer, used to provide timer events and trigger corresponding processing.

[0424] (vii) Data transceiver module.

[0425] During the listening phase, when a data packet redirected to the core module hits a certain GF table entry, the forwarding table is further queried. Based on the forwarding information in the forwarding table and the flow information included in the data packet redirected to the core module, the data packet is reconstructed. Through the data transceiver module, the reconstructed data packet is sent to the programmable switch chip. The programmable switch chip, determined by relevant configuration, sends the reconstructed data packet to the corresponding output port of the network device through Fabric, and also sends it to the original destination device of the redirected data packet.

[0426] (viii) Control channels.

[0427] The control channel between the CPU of the core module and the programmable switch chip. Taking Intel's Tofino2 switch chip as an example, the control channel can be a PCIe channel. Through this control channel, the Tofino2 switch chip can be configured, and configuration information and programmable switch chip lookup table information can be exchanged with the Tofino2 switch chip through single read / write or DMA methods.

[0428] (ix) Control module, used to control the coordinated operation of various modules.

[0429] (x) Control plane port, used for interaction between the core module and the monitoring module of the control plane.

[0430] In this embodiment of the application, the programmed programmable switch chip may include the following: lookup table, key metadata, and registers.

[0431] (a) Lookup table.

[0432] The lookup table is used during the GF information collection phase, and each table entry contains two fields:

[0433] 1) FlowID: a quintuple; FlowID is used as the key for table lookup;

[0434] 2) RegIndex: The register index value corresponding to the data stream. The above 6 register arrays A0 to A5 are all indexed using RegIndex.

[0435] When a data packet is received, during the parsing phase of the input pipe, the IP header is extracted from the data packet header. During the control phase of the input pipe, a table lookup operation is performed using the 5-tuple as the key. After the table lookup is successful, RegIndex is retrieved and set into the metadata (IngMeta). In the output pipe, it is used to index the registers in the six register arrays A0 to A5.

[0436] (ii) Key metadata.

[0437] Key metadata includes the following fields:

[0438] 1) IngMeta stores the register index value determined in the input pipe, and uses the register index value stored in IngMeta in the output pipe; during the CGF information acquisition phase, this register index value is obtained by hashing the 5-tuple in the input pipe; during the GF acquisition phase, this register index value is obtained by querying the lookup table from the 5-tuple in the input pipe.

[0439] 2) Timestamp t a ,t' a and t” a ;

[0440] 3) Counters C1 and C2;

[0441] 4) The inherent metadata global_tstamp field provided by the Tofino switching chip architecture, such as the global_tstamp field in egress_intrinsic_metadata_from_parser_t mentioned above.

[0442] (III) Registers.

[0443] The programmable switch chip includes six register arrays, A0 to A5. Considering the large number of data streams, the array length is defined as 1024 in the CGF stage to reduce hash collisions. The six register arrays A0 to A5 can be represented as follows:

[0444] Register <bit <32> ,_>(1024)A0;

[0445] Register <bit <32> ,_>(1024)A1;

[0446] Register <bit <32> ,_>(1024)A2;

[0447] Register <bit <32> ,_>(1024)A3;

[0448] Register <bit <32> ,_>(1024)A4;

[0449] Register <bit <32> ,_>(1024)A5;

[0450] The above Register <bit <32> This indicates a 32-bit register, and _>(1024) indicates a total of 1024 registers.

[0451] In the GF acquisition phase, the register array length is defined as 256, meaning that 255 CGFs most likely to be GFs are selected for further acquisition. The remaining data streams, excluding these 255 CGFs, belong to the last register. At this point, the six register arrays A0 to A5 can be represented as follows:

[0452] Register <bit <32> ,_>(256)A0;

[0453] Register <bit <32> ,_>(256)A1;

[0454] Register <bit <32> ,_>(256)A2;

[0455] Register <bit <32> ,_>(256)A3;

[0456] Register <bit <32> ,_>(256)A4;

[0457] Register <bit <32> ,_>(256)A5;

[0458] The above Register <bit <32> _ represents a 32-bit register, and _>(256) represents a total of 256 registers.

[0459] In addition, the programmable switch chip also includes a register RegToTB, used to record the traffic threshold identified as heavily loaded based on the current port's bandwidth usage; a register array BytesTotal, used to count all received traffic on the port within a calculation period; and a register Ta, used to record a global timestamp. RegToTB, BytesTotal, and Ta can be represented as follows:

[0460] Register <bit <32> ,_>RegToTB;

[0461] Register <bit <32> ,_>(4)BytesTotal;

[0462] Register <bit <32> ,_>Ta;

[0463] The above Register <bit <32> _ indicates a 32-bit register, _> indicates a total of 1 register, and _>(4) indicates a total of 4 registers.

[0464] During the CGF and GF information acquisition phases, the output pipe processing is the same. The CGF register index value comes from the hash value of the data stream quintuple. The GF register index value is obtained by querying a lookup table. Specifically, if a corresponding entry is found in the lookup table, the register index value included in that entry is used as the GF register index value; if no corresponding entry is found in the lookup table, the register index value of the last register in the register array is used as the GF register index value.

[0465] During the GF information acquisition phase, such as Figure 14 As shown, the data plane core module selects up to 255 CGFs from the CGFT and downloads them to the lookup table of the programmable switch chip. The FlowID and RegIndex of these 255 CGFs both originate from the CGFT. The RegIndex may not exist in the CGFT and is replaced by an implicit positional relationship. The number of entries in the CGFT plus 1 equals the number of entries in the lookup table. Upon receiving a data packet, the core module constructs a lookup key based on the packet's flow information. If the lookup table lookup is successful, the register index value RegIndex is retrieved from the lookup table. RegIndex is used as the index value for subsequent register operations. If the lookup table lookup fails, the register index value of the last register in the register array is retrieved and used as the index value for subsequent register operations.

[0466] After acquiring GF information, the CGFT is queried in reverse based on the register index values ​​excluding the maximum register index value to obtain the flow information FlowID. The GFT is then updated using the FlowID and register statistics.

[0467] The technical solutions provided in this application are implemented through a combination of software and hardware. This combination of software and hardware gives the technical solutions provided in this application broad applicability.

[0468] 1. In the technical solution provided in the embodiments of this application, the newly added core module can be inserted into the motherboard of the frame device in the form of a plug-in card, or it can be integrated into the motherboard of the box device;

[0469] 2. Since the technical solutions provided in this application are absolutely independent, the core module of the control plane can also be implemented as a separate device, the monitoring module can reside anywhere, such as on the network controller, and the forwarding table on which the monitoring module depends can be obtained by multiple methods;

[0470] 3. For forwarding devices implemented with programmable switching chips, the GFT obtained by the technical solution provided in this application can also be sent to the programmable switching chip. By looking up the GFT, the ECN threshold of the GF corresponding to the entry in the GFT can be constructed, instead of constructing an ECN data packet for each data stream. In the technical solution provided in this application, the identification of the GF can also be integrated into the programmable switching chip.

[0471] 4. During the monitoring phase, the ECN data packets sent by the monitored port can be diverted to the technical solution provided in this application embodiment for CNP-like processing, and a fast CNP response can be performed for the GF.

[0472] 5. The technical solutions provided in this application can be used as analysis tools for locating congestion in routers or switches, and can be used to assist in network optimization.

[0473] Based on the aforementioned lossless transmission system, embodiments of this application provide a congestion handling method, such as... Figure 15 As shown. This method is applied to the above. Figure 2 The core module of the data plane shown includes the following steps:

[0474] Step S151: Receive the first data packet carrying the congestion flag through the target port.

[0475] In this embodiment, the data plane includes multiple ports, and the target port can be any port. This description uses only the target port as an example and does not limit its function. The first data packet is any data packet carrying a congestion flag received through the target port. This description uses only the first data packet as an example and does not limit its function. The congestion flag can be a CNP flag, i.e., an ECN-Echo flag; the congestion flag can also be an ECN flag.

[0476] After the congestion control function is enabled, the core module receives data packets through the target port and filters out the first data packet carrying the congestion flag from the received data packets.

[0477] Step S152: In the preset greedy flow table, search for a target entry that includes the target flow information carried by the first data packet and the identifier of the target port. The preset greedy flow table stores flow information of data flows with a flow rate greater than a preset flow rate threshold and the identifier of the port corresponding to the data flow receiving the flow information. If a target entry is found, proceed to step S153; if no target entry is found, proceed to step S154.

[0478] In this embodiment of the application, the flow information carried by the first data packet is used as the target flow information.

[0479] The core module pre-configures a greedy flow table, also known as a preset greedy flow table. Each entry in this preset greedy flow table stores the correspondence between flow information and port identifiers. The data flow corresponding to the flow information in this entry has a flow rate greater than a preset flow rate threshold, and the port corresponding to the flow information is the port that receives the corresponding data flow.

[0480] Upon receiving the first data packet, the core module searches the preset greedy flow table for a target entry that includes the target flow information and the identifier of the target port. If a target entry is found, it indicates that the traffic of the data flow to which the first data packet belongs is greater than the preset traffic threshold, meaning that the data flow to which the first data packet belongs is a greedy flow, and step S153 is executed.

[0481] If no target entry is found, it means that the traffic of the data stream to which the first data packet belongs is less than or equal to the preset traffic threshold, that is, the data stream to which the first data packet belongs is a non-greedy stream, and step S154 is executed.

[0482] Step S153: Process the first data packet.

[0483] If the data stream to which the first data packet belongs is determined to be a greedy stream, the core module directly processes the first data packet according to the forwarding table so that congestion control can be performed on the greedy stream to which the first data packet belongs in the future, thereby reducing network congestion.

[0484] Step S154: Remove the congestion flag carried in the first data packet to obtain the second data packet, and process the second data packet.

[0485] If the data stream to which the first data packet belongs is determined to be a non-greedy flow, the core module removes the congestion flag carried in the first data packet, obtaining the second data packet. Then, the core module can process the second data packet, which does not carry the congestion flag, according to the forwarding table. This avoids congestion control on the non-greedy flow to which the first data packet belongs, reducing the harm to the "rat flow" and improving the fairness of congestion control.

[0486] By applying the technical solution provided in the embodiments of this application, a greedy flow table is pre-set to identify greedy flows in the network, thereby preserving congestion control for greedy flows and releasing congestion control for non-greedy flows, reducing the harm to rat flows and improving the fairness of congestion control.

[0487] Furthermore, since the technical solution provided in this application addresses processing after the ECN threshold is triggered, it can independently identify greedy flows exceeding the ECN threshold and retain congestion control for these greedy flows. Therefore, even if the ECN threshold is set relatively high, the impact on congestion processing in this application embodiment is not significant. Thus, the technical solution provided in this application embodiment can use a larger ECN threshold for congestion control, which reduces harm to "rat flows," improves the fairness of congestion control, and effectively increases network bandwidth utilization.

[0488] In one embodiment of this application, each entry in the preset greedy flow table is set with an initial activity value. The initial activity value can be set according to actual needs. For example, the initial activity value can be 4, 5, or 6, etc.

[0489] In this case, such as Figure 16 The flowchart of congestion handling shown indicates that after executing step S152, if the target entry is found, steps S155 and S156 are executed.

[0490] Step S155: Subtract the first preset value from the current active value of the target entry to obtain the adjusted active value of the target entry.

[0491] Step S156: If the adjusted activity value of the target entry is less than or equal to the second preset value, then delete the target entry in the preset greedy flow table.

[0492] The first and second preset values ​​mentioned above can be set according to actual needs. For example, the first preset value can be 1, 2, or 3, etc., and the second preset value can be 0, 1, 2, or 3, etc. In one example, the first preset value is 1 and the second preset value is 0.

[0493] In this embodiment, whenever an entry matches the flow information of a data packet, the activity value of that entry is reduced by a first preset value. When the activity value of the entry decreases to a value less than or equal to a second preset value, the entry is deleted from the preset greedy flow table. Thus, when a data packet matching the entry is received, since the entry has been deleted, the core module will not find a matching entry in the preset greedy flow table, meaning it will not regulate the data flow to which the data packet belongs, thus solving the problem of over-regulation of the data flow.

[0494] In one embodiment of the application, if the first data packet is a CNP, then step S153 above can be refined as follows:

[0495] If the forwarding table includes target flow information, remove the target port identifier carried in the first data packet, forward the first data packet with the target port identifier removed, and reset the aging count of the target entry to the initial aging count; otherwise, discard the first data packet.

[0496] The above step S154 can be further refined as follows:

[0497] If the forwarding table includes target flow information, remove the target port identifier carried in the second data packet and forward the second data packet with the target port identifier removed; otherwise, discard the second data packet.

[0498] In another embodiment of the application, if the first data packet is an ECN data packet, then step S153 above can be refined as follows:

[0499] If the forwarding table includes target flow information, forward the CNP corresponding to the first data packet and reset the aging count of the target entry to the initial aging count; otherwise, discard the first data packet.

[0500] The above step S154 can be further refined as follows:

[0501] If the forwarding table includes target flow information, remove the target port identifier carried in the second data packet and forward the second data packet with the target port identifier removed; otherwise, discard the second data packet.

[0502] The initial aging count mentioned above can be set according to actual needs. For example, the initial aging count can be 256, 300, or 350, etc.

[0503] In another embodiment of this application, if the first data packet is an ECN data packet, then step S153 above can be refined as follows:

[0504] Construct a CNP corresponding to the first data packet. If the forwarding table includes target flow information, forward the CNP and reset the aging count of the target entry to the initial aging count; otherwise, discard the first data packet.

[0505] In one embodiment of this application, a pre-defined greedy flow table construction method is provided, such as... Figure 17 As shown, the method may include the following steps:

[0506] Step S171: Calculate the traffic of the data streams to which multiple data packets received through the target port belong during the first calculation period.

[0507] Before step S151 above, the core module counts the traffic of the data streams to which multiple data packets received through the target port belong during the first calculation cycle in order to construct a preset greedy flow table.

[0508] The duration of the first calculation cycle can be set according to actual needs. The duration of the first calculation cycle can be 1 second, 2 seconds, or 3 seconds, etc. See the above for instructions on setting the duration of the first calculation cycle. Figure 7 Settings for AperiodicTimer.

[0509] Step S172: From the candidate flow information included in the forwarding table, determine the candidate flow information of a preset number of data flows with the largest traffic as target candidate flow information. The candidate flow information is the flow information whose hash value is the same as the hash value of the flow information of the candidate flow, and the candidate flow is the data flow whose counted traffic is greater than the preset candidate traffic threshold value.

[0510] In this embodiment, the core module identifies data streams with traffic exceeding a preset candidate traffic threshold as candidate streams, and identifies streams with hash values ​​matching the hash values ​​of the candidate streams as candidate stream information. The core module then determines a preset number of data streams with the highest traffic from the candidate stream information included in the forwarding table, and identifies these as target candidate stream information.

[0511] The preset quantity can be set according to actual needs. For example, the preset quantity can be 256 or 300, etc.

[0512] Step S173: For each target candidate flow information, if the traffic of the data flow corresponding to the target candidate flow information is greater than the preset traffic threshold, then the target candidate flow information and the identifier of the target port are added as an entry to the preset greedy flow table.

[0513] For each target candidate flow information, the core module checks whether the traffic of the data flow corresponding to that target candidate flow information is greater than a preset traffic threshold. If it is greater than the preset traffic threshold, the data flow corresponding to that target candidate flow information is a greedy flow, and the target candidate flow information and the identifier of the target port are added as an entry to the preset greedy flow table. Otherwise, no processing is performed.

[0514] In this embodiment, the identification of greedy flows is completed by the core module of the data plane, and the duration of the first calculation cycle for identifying greedy flows can be very short. Therefore, micro-burst flows can be accurately identified, a corresponding preset greedy flow table can be established, and thus the greedy flows can be accurately controlled.

[0515] In one embodiment of this application, a pre-defined greedy flow table construction method is also provided, such as... Figure 18 As shown, step S171 above can be further refined as follows:

[0516] Step S1711: Calculate the first total traffic of all data streams to which the data packets received through the target port belong during the second calculation period, and the second total traffic of each group of data streams, wherein the hash values ​​of the flow information of a group of data streams are the same.

[0517] In this embodiment, the core module groups streams with the same hash value. Taking the total traffic of all data streams received through the target port as the first total traffic and the total traffic of a group of data streams received through the target port as the second total traffic as an example, the core module calculates the first total traffic within the second calculation period and the second total traffic within the second calculation period.

[0518] The duration of the second calculation cycle can be set according to actual needs. The first calculation cycle can be 1ms or 2ms, etc. The setting of the second calculation cycle can be found above. Figure 10 Setting the calculation period T.

[0519] Step S1712: If the first total flow is greater than the first preset candidate sub-threshold, for each group of data streams, if the second total flow of the group of data streams is greater than the second preset candidate sub-threshold, then when the second total flow of the group of data streams is greater than the recorded total flow of the group of data streams, the recorded total flow of the group of data streams is updated to the second total flow of the group of data streams.

[0520] After obtaining the first total traffic, the core module checks whether the first total traffic is greater than a first preset candidate sub-threshold. If it is greater than the first preset candidate sub-threshold, then for each data stream, the core module checks whether the second total traffic of that data stream is greater than a second preset candidate sub-threshold. If it is greater than the second preset candidate sub-threshold, the core module compares the second total traffic of that data stream with the recorded total traffic of that data stream. When the second total traffic of that data stream is greater than the recorded total traffic of that data stream, the core module updates the recorded total traffic of that data stream to the second total traffic of that data stream.

[0521] If the third calculation cycle is not reached, return to step S1711. If the third calculation cycle is reached, proceed to step S1713.

[0522] Step S1713: For each group of data streams, if the total flow of the recorded data streams is greater than the preset candidate flow threshold, the flow information of the data streams is added as an entry to the preset candidate greedy flow table, and the process returns to step S1711 until the first calculation cycle is reached.

[0523] The duration of the third calculation cycle can be set according to actual needs. The third calculation cycle can be 20ms or 30ms, etc. (Setting the third calculation cycle) Figure 7 The settings for PeriodicTimer.

[0524] In this embodiment, after calculating the first and second total traffic for a second calculation cycle, the core module checks whether a third calculation cycle has been reached. If the third calculation cycle has not been reached, it returns to step S1711 to calculate the first and second total traffic for the next second calculation cycle.

[0525] If the third calculation cycle is reached, for each data stream, the core module checks whether the total traffic of that data stream exceeds a preset candidate traffic threshold. If it does, the core module adds the flow information of that data stream as an entry to the preset candidate greedy flow table.

[0526] The above steps S1711-S1713 are repeated in this way until the first calculation cycle is reached.

[0527] For the specific implementation of steps S1711-S1713 above, please refer to the above. Figure 10 The description of steps S1014-S1018.

[0528] Through the above embodiments, data streams that are likely to be greedy streams can be filtered out as much as possible, narrowing the scope of greedy stream filtering and facilitating the identification of greedy streams in the data plane.

[0529] In one embodiment of this application, a traffic statistics method is also provided, such as... Figure 19 As shown in the figure. In this method, the second calculation cycle is divided into multiple statistical cycles. Each statistical cycle corresponds to a sub-length register array, and each statistical cycle corresponds to a total length register. Each sub-length register array includes sub-length registers corresponding to multiple hash values, and one hash value corresponds to one sub-time register.

[0530] The length register array can be found here. Figure 10 For some registers A0 to A3, and the total length register, please refer to [link / reference]. Figure 10 For details on the BytesTota register and the time-division register, please refer to [link / reference]. Figure 10 Part of register A4.

[0531] In this case, in step S1711 above, for each data packet received through the target port, the following steps can be performed:

[0532] Step S191: If the first time difference is less than the duration of the second calculation period, then when the first time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. Here, the first time difference is the time difference between the time stored in the total time register and the reception time of the data packet, and the target statistical period is the statistical period to which the reception time of the data packet belongs.

[0533] If the first time difference is less than the duration of the second calculation period, then when the first time difference is less than the duration of the statistical period, step S192 is executed directly.

[0534] Step S192: If the second time difference is greater than or equal to the duration of the second calculation cycle, then clear the length stored in each sub-length register corresponding to the target hash value. Here, the second time difference is the time difference between the time stored in the target sub-time register and the reception time of the data packet, and the target sub-time register is the sub-time register corresponding to the target hash value of the flow information carried by the data packet.

[0535] Step S193: Increase the length of the data packet in the target segment length register corresponding to the target statistical period, and increase the length of the data packet in the target total length register. The target segment length register corresponds to the target hash value.

[0536] Step S194: Update the reception time of the data packet into the total time register and the target time register.

[0537] Step S195: When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

[0538] In another embodiment of this application, based on Figure 19 This application also provides a traffic statistics method, such as... Figure 20 As shown. In this method, for each data packet received through the target port, the following steps may also be performed:

[0539] Step S196: If the first time difference is greater than or equal to the duration of the second calculation cycle, then clear the lengths stored in the multiple sub-length register arrays and the multiple total length registers.

[0540] Step S197: Increase the length of the data packet in the target partial length register and increase the length of the data packet in the target total length register.

[0541] Step S198: Update the reception time of the data packet into the total time register and the target time register.

[0542] Step S199: When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

[0543] In other embodiments of this application, based on Figure 19 or Figure 20 This application also provides a traffic statistics method, such as... Figure 21 As shown. In this method, for each data packet received through the target port, the following steps may also be performed:

[0544] Step S1910: If the first time difference is less than the duration of the second calculation cycle, then when the first time difference is greater than or equal to the duration of the statistical cycle, clear the length stored in the target total length register corresponding to the target statistical cycle.

[0545] Step S1911: If the second time difference is less than the duration of the second calculation cycle, then when the second time difference is greater than or equal to the duration of the statistical cycle, clear the length stored in the target length register.

[0546] If the second time difference is less than the duration of the second calculation period, then when the second time difference is less than the duration of the statistical period, step S1912 is executed directly.

[0547] Step S1912: Increase the length of the data packet in the target partial length register and increase the length of the data packet in the target total length register;

[0548] Step S1913: Update the reception time of the data packet into the total time register and the target time register;

[0549] Step S1914: When the second calculation cycle is reached, the length and value stored in multiple total length registers are counted as the first total flow, and the length and value stored in multiple sub-length registers corresponding to each hash value are counted as the second total flow of a set of data streams corresponding to each hash value.

[0550] In one embodiment of this application, based on Figure 17 This application also provides a method for traffic statistics of the data stream corresponding to the target candidate stream information, such as... Figure 22 As shown. The method may include the following steps:

[0551] Step S221: Calculate the third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation period, and the fourth total traffic of the target data stream corresponding to each target candidate stream information.

[0552] Step S222: When the third total flow is greater than the first preset flow sub-threshold, for each target data stream, if the fourth total flow of the target data stream is greater than the second preset flow sub-threshold, then when the fourth total flow of the target data stream is greater than the recorded flow of the target data stream, the recorded flow of the target data stream is updated to the fourth total flow of the target data stream.

[0553] If the fifth calculation cycle has not been reached, proceed to step S221. If the fifth calculation cycle has been reached, proceed to step S223.

[0554] Step S223: For each target data stream, if the recorded flow rate of the target data stream is greater than the preset flow rate threshold, the flow information of the target data stream is added as an entry to the preset greedy flow table, and the process returns to step S221 until the sixth calculation cycle is reached.

[0555] In one embodiment of this application, based on Figure 22 This application also provides a method for traffic statistics of the data stream corresponding to the target candidate stream information, such as... Figure 23 As shown in the figure. In this method, the fourth calculation cycle is divided into multiple statistical cycles. Each statistical cycle corresponds to a segmented length register array and a total length register. Each segmented length register array includes multiple first segmented length registers and one second segmented length register. One target data stream corresponds to one first segmented time register, and the second segmented length register corresponds to all data streams except the target data stream.

[0556] In step S221 above, for each data packet received through the target port, the following steps can be performed:

[0557] Step S2211: If the third time difference is less than the duration of the fourth calculation period, then when the third time difference is greater than or equal to the duration of the statistical period, clear the length stored in the target total length register corresponding to the target statistical period. Here, the third time difference is the time difference between the time stored in the total time register and the reception time of the data packet, and the target statistical period is the statistical period to which the reception time of the data packet belongs.

[0558] Step S2212: If the fourth time difference is greater than or equal to the duration of the fourth calculation cycle, then clear the length stored in each sub-length register corresponding to the data stream to which the data packet belongs. Here, the fourth time difference is the time difference between the time stored in the target sub-time register and the reception time of the data packet, and the target sub-time register is the sub-time register corresponding to the data stream to which the data packet belongs.

[0559] Step S2213: Increase the length of the data packet in the target sub-length register corresponding to the target statistical period, and increase the length of the data packet in the target total length register. The target sub-length register corresponds to the data stream to which the data packet belongs.

[0560] Step S2214: Update the reception time of the data packet into the total time register and the target time register;

[0561] Step S2215: When the fourth calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the third total flow, and the sum of the data stored in multiple sub-length registers corresponding to each target data stream is counted as the fourth total flow for each target data stream.

[0562] In another embodiment of this application, based on Figure 23 This application also provides a method for traffic statistics of the data stream corresponding to the target candidate stream information, such as... Figure 24 As shown. In this method, for each data packet received through the target port, the following steps may also be performed:

[0563] Step S2216: If the third time difference is greater than or equal to the duration of the fourth calculation cycle, then clear the lengths stored in the multiple sub-length register arrays and the multiple total length registers.

[0564] Step S2217: Increase the length of the data packet in the target partial length register and increase the length of the data packet in the target total length register;

[0565] Step S2218: Update the reception time of the data packet into the total time register and the target time register;

[0566] Step S2219: When the fourth calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the third total flow, and the sum of the data stored in multiple sub-length registers corresponding to each target data stream is counted as the fourth total flow for each target data stream.

[0567] In another embodiment of this application, based on Figure 23 and Figure 24 This application also provides a method for traffic statistics of the data stream corresponding to the target candidate stream information, such as... Figure 25 As shown. In this method, for each data packet received through the target port, the following steps may also be performed:

[0568] Step S22110: If the third time difference is less than the duration of the fourth calculation cycle, then when the third time difference is greater than or equal to the duration of the statistical cycle, clear the length stored in the target total length register corresponding to the target statistical cycle.

[0569] Step S22111: If the fourth time difference is less than the duration of the fourth calculation cycle, then when the fourth time difference is greater than or equal to the duration of the statistical cycle, clear the length stored in the target length register.

[0570] Step S22112: Increase the length of the data packet in the target partial length register and increase the length of the data packet in the target total length register;

[0571] Step S22113: Update the reception time of the data packet into the total time register and the target time register;

[0572] Step S22114: When the fourth calculation cycle is reached, the length and value stored in multiple total length registers are counted as the third total flow, and the length and value stored in multiple sub-length registers corresponding to each target data stream are counted as the fourth total flow for each target data stream.

[0573] In this embodiment of the application, through the above... Figures 19-25 This method uses registers to quickly and easily achieve traffic statistics, thereby improving the efficiency of constructing subsequent pre-defined greedy flow tables.

[0574] The above Figures 19-25 Some descriptions are relatively simple; please refer to the above for details. Figure 10 Partial description.

[0575] Corresponding to the congestion handling method described above, embodiments of this application also provide a congestion handling apparatus, such as... Figure 26 As shown, the device includes:

[0576] Receiver 261 is used to receive a first data packet carrying a congestion flag through the target port;

[0577] The lookup unit 262 is used to look up a target entry in a preset greedy flow table, which includes the target flow information carried by the first data packet and the identifier of the target port. The preset greedy flow table stores the flow information of data flows with a flow rate greater than a preset flow rate threshold and the identifier of the port corresponding to the data flow that receives the flow information.

[0578] The processing unit 263 is configured to process the first data packet if a target entry is found, and remove the congestion flag carried in the first data packet to obtain a second data packet if no target entry is found, and then process the second data packet.

[0579] In an optional embodiment, each entry in the preset greedy flow table is set with an initial activity value, and the congestion processing device may further include:

[0580] The setting unit is used to subtract a first preset value from the current activity value of the target entry if the target entry is found, so as to obtain the adjusted activity value of the target entry.

[0581] The deletion unit is used to delete the target entry in the preset greedy flow table if the adjusted active value of the target entry is the second preset value.

[0582] In an optional embodiment, the processing unit 263 may specifically be used for:

[0583] If the first data packet is a CNP, and the forwarding table includes destination flow information, then remove the destination port identifier carried in the first data packet, forward the first data packet with the destination port identifier removed, and reset the aging count of the destination entry to the initial aging count; otherwise, discard the first data packet; or...

[0584] If the forwarding table includes target flow information, remove the target port identifier carried in the second data packet and forward the second data packet with the target port identifier removed; otherwise, discard the second data packet.

[0585] In an optional embodiment, the processing unit 263 may specifically be used for:

[0586] If the first data packet is an ECN data packet, then if the forwarding table includes destination flow information, forward the CNP corresponding to the first data packet and reset the aging count of the destination entry to the initial aging count; otherwise, discard the first data packet; or,

[0587] If the forwarding table includes target flow information, remove the target port identifier carried in the second data packet and forward the second data packet with the target port identifier removed; otherwise, discard the second data packet.

[0588] In an optional embodiment, the congestion processing apparatus may further include:

[0589] The first statistics unit is used to count the traffic of multiple data packets received through the target port within the first calculation period before receiving the first data packet carrying the congestion flag through the target port.

[0590] The determining unit is used to determine the candidate flow information of a preset number of flows with the largest traffic from the candidate flow information included in the forwarding table, and use them as target candidate flow information. The candidate flow information is the flow information whose hash value is the same as the hash value of the flow information of the candidate flow, and the candidate flow is the data flow whose counted traffic is greater than a preset candidate traffic threshold value.

[0591] The addition unit is used to add the target candidate flow information and the target port identifier as an entry to the preset greedy flow table if the traffic of the data flow corresponding to the target candidate flow information is greater than the preset traffic threshold.

[0592] In an optional embodiment, the first statistical unit may specifically be used for:

[0593] The first total traffic of all data streams to which the data packets received through the target port belong during the second calculation period is calculated, and the second total traffic of each group of data streams is calculated, wherein the hash value of the flow information of a group of data streams is the same.

[0594] If the first total flow is greater than the first preset candidate sub-threshold, for each group of data streams, if the second total flow of the group of data streams is greater than the second preset candidate sub-threshold, then when the second total flow of the group of data streams is greater than the recorded total flow of the group of data streams, the recorded total flow of the group of data streams will be updated to the second total flow of the group of data streams.

[0595] If the third calculation cycle has not been reached, return to the step of performing the first total traffic of all data streams to which the data packets received through the target port during the second calculation cycle belong, and the second total traffic of each group of data streams;

[0596] If the third calculation cycle is reached, for each group of data streams, if the total traffic of the recorded group of data streams is greater than the preset candidate traffic threshold, the flow information of the group of data streams is added as an entry to the preset candidate greedy flow table, and the steps of performing the first total traffic of all data streams to which the data packets received through the target port belong during the second calculation cycle, as well as the second total traffic of each group of data streams, are returned until the first calculation cycle is reached.

[0597] In one optional embodiment, the second calculation cycle is divided into multiple statistical cycles, each statistical cycle corresponds to a sub-length register array, each statistical cycle corresponds to a total length register, each sub-length register array includes sub-length registers corresponding to multiple hash values, and one hash value corresponds to one sub-time register;

[0598] In this case, the first statistical unit can specifically be used for:

[0599] For each data packet received through the target port, perform the following steps:

[0600] If the first time difference is less than the duration of the second calculation period, then when the first time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. Here, the first time difference is the time difference between the time stored in the total time register and the time of receiving the data packet, and the target statistical period is the statistical period to which the time of receiving the data packet belongs.

[0601] If the second time difference is greater than or equal to the duration of the second calculation cycle, then the length stored in each sub-length register corresponding to the target hash value is cleared. Here, the second time difference is the time difference between the time stored in the target sub-time register and the time of receiving the data packet, and the target sub-time register is the sub-time register corresponding to the target hash value of the flow information carried by the data packet.

[0602] The length of the data packet is increased in the target segment length register corresponding to the target statistical period, and the length of the data packet is increased in the target total length register. The target segment length register corresponds to the target hash value.

[0603] Update the reception time of the data packet into the total time register and the target time register;

[0604] When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

[0605] In an optional embodiment, the first statistical unit may also be used for:

[0606] For each data packet received through the target port, perform the following steps:

[0607] If the first time difference is greater than or equal to the duration of the second calculation cycle, then clear the lengths stored in the multiple sub-length register arrays and the multiple total length registers;

[0608] Increase the length of the data packet in the target partial length register, and increase the length of the data packet in the target total length register;

[0609] Update the reception time of the data packet into the total time register and the target time register;

[0610] When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

[0611] In an optional embodiment, the first statistical unit may also be used for:

[0612] For each data packet received through the target port, perform the following steps:

[0613] If the first time difference is less than the duration of the second calculation period, then when the first time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared.

[0614] If the second time difference is less than the duration of the second calculation period, then when the second time difference is greater than or equal to the duration of the statistical period, the length stored in the target sub-length register is cleared.

[0615] Increase the length of the data packet in the target partial length register, and increase the length of the data packet in the target total length register;

[0616] Update the reception time of the data packet into the total time register and the target time register;

[0617] When the second calculation cycle is reached, the length and value stored in multiple total length registers are counted as the first total flow, and the length and value stored in multiple sub-length registers corresponding to each hash value are counted as the second total flow of a set of data streams corresponding to each hash value.

[0618] In an optional embodiment, the congestion processing apparatus may further include:

[0619] The second statistical unit is used to count the flow of the target data stream corresponding to each target candidate stream information, specifically for:

[0620] The third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation period is calculated, as well as the fourth total traffic of the target data stream corresponding to each target candidate stream information.

[0621] If the third total flow is greater than the first preset flow sub-threshold, for each target data flow, if the fourth total flow of the target data flow is greater than the second preset flow sub-threshold, then when the fourth total flow of the target data flow is greater than the recorded flow of the target data flow, the recorded flow of the target data flow will be updated to the fourth total flow of the target data flow.

[0622] If the fifth calculation cycle has not been reached, return to the step of performing the third total traffic of all data streams to which the data packets received through the target port during the fourth calculation cycle belong, and the fourth total traffic of the target data stream corresponding to each target candidate stream information;

[0623] If the fifth calculation cycle is reached, for each target data stream, if the recorded traffic of the target data stream is greater than the preset traffic threshold, the flow information of the target data stream is added as an entry to the preset greedy flow table, and the process returns to the step of performing the third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation cycle, as well as the fourth total traffic of the target data stream corresponding to each target candidate flow information, until the sixth calculation cycle is reached.

[0624] In an optional embodiment, the fourth calculation cycle is divided into multiple statistical cycles, each statistical cycle corresponds to a sub-length register array, each statistical cycle corresponds to a total length register, each sub-length register array includes multiple first sub-length registers and one second sub-length register, one target data stream corresponds to one first sub-time register, and the second sub-length register corresponds to all data streams except the target data stream;

[0625] The second statistical unit can be specifically used for:

[0626] For each data packet received through the target port, perform the following steps:

[0627] If the third time difference is less than the duration of the fourth calculation period, then when the third time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. Here, the third time difference is the time difference between the time stored in the total time register and the reception time of the data packet, and the target statistical period is the statistical period to which the reception time of the data packet belongs.

[0628] If the fourth time difference is greater than or equal to the duration of the fourth calculation cycle, then the length stored in each sub-length register corresponding to the data stream to which the data packet belongs is cleared. Here, the fourth time difference is the time difference between the time stored in the target sub-time register and the time of receiving the data packet, and the target sub-time register is the sub-time register corresponding to the data stream to which the data packet belongs.

[0629] The length of the data packet is increased in the target segment length register corresponding to the target statistical period, and the length of the data packet is increased in the target total length register. The target segment length register corresponds to the data stream to which the data packet belongs.

[0630] Update the reception time of the data packet into the total time register and the target time register;

[0631] When the fourth calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the third total flow, and the sum of the data stored in multiple sub-length registers corresponding to each target data stream is counted as the fourth total flow for each target data stream.

[0632] By applying the technical solution provided in the embodiments of this application, a greedy flow table is pre-set to identify greedy flows in the network, thereby preserving congestion control for greedy flows and releasing congestion control for non-greedy flows, reducing the harm to rat flows and improving the fairness of congestion control.

[0633] Furthermore, since the technical solution provided in this application addresses processing after the ECN threshold is triggered, it can independently identify greedy flows exceeding the ECN threshold and retain congestion control for these greedy flows. Therefore, even if the ECN threshold is set relatively high, the impact on congestion processing in this application embodiment is not significant. Thus, the technical solution provided in this application embodiment can use a larger ECN threshold for congestion control, which reduces harm to "rat flows," improves the fairness of congestion control, and effectively increases network bandwidth utilization.

[0634] Corresponding to the congestion handling method described above, embodiments of this application also provide a network device, such as... Figure 27As shown, the system includes a processor 271 and a machine-readable storage medium 272. The machine-readable storage medium 272 stores machine-executable instructions that can be executed by the processor 271. The processor 271 is prompted by the machine-executable instructions to implement the following steps:

[0635] Receive the first data packet carrying the congestion flag through the target port;

[0636] In the preset greedy flow table, search for the target entry that includes the target flow information carried by the first data packet and the identifier of the target port. The preset greedy flow table stores the flow information of data flows with a flow rate greater than a preset flow rate threshold and the identifier of the port corresponding to the data flow that receives the flow information.

[0637] If the target entry is found, the first data packet is processed; if the target entry is not found, the congestion flag carried in the first data packet is removed to obtain the second data packet, which is then processed.

[0638] Optionally, each entry in the pre-defined greedy flow table is set with an initial active value, and the processor is prompted by machine-executable instructions to perform the following steps:

[0639] If the target entry is found, the current activity value of the target entry is subtracted from the first preset value to obtain the adjusted activity value of the target entry.

[0640] If the adjusted activity value of the target entry is less than or equal to the second preset value, then the target entry is deleted from the preset greedy flow table.

[0641] Optionally, the processor is prompted by machine-executable instructions to implement specific steps:

[0642] If the first data packet is a CNP, and the forwarding table includes destination flow information, then remove the destination port identifier carried in the first data packet, forward the first data packet with the destination port identifier removed, and reset the aging count of the destination entry to the initial aging count; otherwise, discard the first data packet; or...

[0643] If the forwarding table includes target flow information, remove the target port identifier carried in the second data packet and forward the second data packet with the target port identifier removed; otherwise, discard the second data packet.

[0644] Optionally, the processor is prompted by machine-executable instructions to implement specific steps:

[0645] If the first data packet is an ECN data packet, then if the forwarding table includes destination flow information, forward the first data packet corresponding to the first data packet and reset the aging count of the destination entry to the initial aging count; otherwise, discard the first data packet; or,

[0646] If the forwarding table includes target flow information, remove the target port identifier carried in the second data packet and forward the second data packet with the target port identifier removed; otherwise, discard the second data packet.

[0647] Optionally, the processor may also implement the following steps, prompted by machine-executable instructions:

[0648] Before receiving the first data packet carrying the congestion flag through the target port, the traffic of the data streams to which multiple data packets received through the target port belong during the first calculation period is counted.

[0649] From the candidate flow information included in the forwarding table, determine the candidate flow information of the preset number of flows with the largest traffic as the target candidate flow information. The candidate flow information is the flow information whose hash value is the same as the hash value of the flow information of the candidate flow, and the candidate flow is the data flow whose traffic is greater than the preset candidate traffic threshold value.

[0650] For each target candidate flow information, if the traffic of the data flow corresponding to the target candidate flow information is greater than the preset traffic threshold, then the target candidate flow information and the identifier of the target port are added as an entry to the preset greedy flow table.

[0651] Optionally, the processor is prompted by machine-executable instructions to implement specific steps:

[0652] The first total traffic of all data streams to which the data packets received through the target port belong during the second calculation period is calculated, and the second total traffic of each group of data streams is calculated, wherein the hash value of the flow information of a group of data streams is the same.

[0653] If the first total flow is greater than the first preset candidate sub-threshold, for each group of data streams, if the second total flow of the group of data streams is greater than the second preset candidate sub-threshold, then when the second total flow of the group of data streams is greater than the recorded total flow of the group of data streams, the recorded total flow of the group of data streams will be updated to the second total flow of the group of data streams.

[0654] If the third calculation cycle has not been reached, return to the step of performing the first total traffic of all data streams to which the data packets received through the target port during the second calculation cycle belong, and the second total traffic of each group of data streams;

[0655] If the third calculation cycle is reached, for each group of data streams, if the total traffic of the recorded group of data streams is greater than the preset candidate traffic threshold, the flow information of the group of data streams is added as an entry to the preset candidate greedy flow table, and the steps of performing the first total traffic of all data streams to which the data packets received through the target port belong during the second calculation cycle, as well as the second total traffic of each group of data streams, are returned until the first calculation cycle is reached.

[0656] Optionally, the second calculation cycle is divided into multiple statistical cycles. Each statistical cycle corresponds to a sub-length register array and a total length register. Each sub-length register array includes sub-length registers corresponding to multiple hash values, and one hash value corresponds to one sub-time register.

[0657] The processor is driven by machine-executable instructions to implement specific steps:

[0658] For each data packet received through the target port, perform the following steps:

[0659] If the first time difference is less than the duration of the second calculation period, then when the first time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. Here, the first time difference is the time difference between the time stored in the total time register and the time of receiving the data packet, and the target statistical period is the statistical period to which the time of receiving the data packet belongs.

[0660] If the second time difference is greater than or equal to the duration of the second calculation cycle, then the length stored in each sub-length register corresponding to the target hash value is cleared. Here, the second time difference is the time difference between the time stored in the target sub-time register and the time of receiving the data packet, and the target sub-time register is the sub-time register corresponding to the target hash value of the flow information carried by the data packet.

[0661] The length of the data packet is increased in the target segment length register corresponding to the target statistical period, and the length of the data packet is increased in the target total length register. The target segment length register corresponds to the target hash value.

[0662] Update the reception time of the data packet into the total time register and the target time register;

[0663] When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

[0664] Optionally, the processor may also implement the following steps, prompted by machine-executable instructions:

[0665] For each data packet received through the target port, perform the following steps:

[0666] If the first time difference is greater than or equal to the duration of the second calculation cycle, then clear the lengths stored in the multiple sub-length register arrays and the multiple total length registers;

[0667] Increase the length of the data packet in the target partial length register, and increase the length of the data packet in the target total length register;

[0668] Update the reception time of the data packet into the total time register and the target time register;

[0669] When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

[0670] Optionally, the processor may also implement the following steps, prompted by machine-executable instructions:

[0671] For each data packet received through the target port, perform the following steps:

[0672] If the first time difference is less than the duration of the second calculation period, then when the first time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared.

[0673] If the second time difference is less than the duration of the second calculation period, then when the second time difference is greater than or equal to the duration of the statistical period, the length stored in the target sub-length register is cleared.

[0674] Increase the length of the data packet in the target partial length register, and increase the length of the data packet in the target total length register;

[0675] Update the reception time of the data packet into the total time register and the target time register;

[0676] When the second calculation cycle is reached, the length and value stored in multiple total length registers are counted as the first total flow, and the length and value stored in multiple sub-length registers corresponding to each hash value are counted as the second total flow of a set of data streams corresponding to each hash value.

[0677] Optionally, the processor, driven by machine-executable instructions, can also perform the following steps: Statistically calculate the flow rate of the target data stream corresponding to each target candidate stream information using the following steps:

[0678] The third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation period is calculated, as well as the fourth total traffic of the target data stream corresponding to each target candidate stream information.

[0679] If the third total flow is greater than the first preset flow sub-threshold, for each target data flow, if the fourth total flow of the target data flow is greater than the second preset flow sub-threshold, then when the fourth total flow of the target data flow is greater than the recorded flow of the target data flow, the recorded flow of the target data flow will be updated to the fourth total flow of the target data flow.

[0680] If the fifth calculation cycle has not been reached, return to the step of performing the third total traffic of all data streams to which the data packets received through the target port during the fourth calculation cycle belong, and the fourth total traffic of the target data stream corresponding to each target candidate stream information;

[0681] If the fifth calculation cycle is reached, for each target data stream, if the recorded traffic of the target data stream is greater than the preset traffic threshold, the flow information of the target data stream is added as an entry to the preset greedy flow table, and the process returns to the step of performing the third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation cycle, as well as the fourth total traffic of the target data stream corresponding to each target candidate flow information, until the sixth calculation cycle is reached.

[0682] Optionally, the fourth calculation cycle is divided into multiple statistical cycles. Each statistical cycle corresponds to a sub-length register array and a total length register. Each sub-length register array includes multiple first sub-length registers and one second sub-length register. One target data stream corresponds to one first sub-time register, and the second sub-length register corresponds to all data streams except the target data stream.

[0683] In this case, the processor can also perform the following steps, prompted by machine-executable instructions:

[0684] For each data packet received through the target port, perform the following steps:

[0685] If the third time difference is less than the duration of the fourth calculation period, then when the third time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. Here, the third time difference is the time difference between the time stored in the total time register and the reception time of the data packet, and the target statistical period is the statistical period to which the reception time of the data packet belongs.

[0686] If the fourth time difference is greater than or equal to the duration of the fourth calculation cycle, then the length stored in each sub-length register corresponding to the data stream to which the data packet belongs is cleared. Here, the fourth time difference is the time difference between the time stored in the target sub-time register and the time of receiving the data packet, and the target sub-time register is the sub-time register corresponding to the data stream to which the data packet belongs.

[0687] The length of the data packet is increased in the target segment length register corresponding to the target statistical period, and the length of the data packet is increased in the target total length register. The target segment length register corresponds to the data stream to which the data packet belongs.

[0688] Update the reception time of the data packet into the total time register and the target time register;

[0689] When the fourth calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the third total flow, and the sum of the data stored in multiple sub-length registers corresponding to each target data stream is counted as the fourth total flow for each target data stream.

[0690] By applying the technical solution provided in the embodiments of this application, a greedy flow table is pre-set to identify greedy flows in the network, thereby preserving congestion control for greedy flows and releasing congestion control for non-greedy flows, reducing the harm to rat flows and improving the fairness of congestion control.

[0691] Furthermore, since the technical solution provided in this application addresses processing after the ECN threshold is triggered, it can independently identify greedy flows exceeding the ECN threshold and retain congestion control for these greedy flows. Therefore, even if the ECN threshold is set relatively high, the impact on congestion processing in this application embodiment is not significant. Thus, the technical solution provided in this application embodiment can use a larger ECN threshold for congestion control, which reduces harm to "rat flows," improves the fairness of congestion control, and effectively increases network bandwidth utilization.

[0692] Corresponding to the congestion handling methods described above, this application also provides a machine-readable storage medium storing a computer program, which, when executed by a processor, implements any of the steps of the congestion handling methods described above.

[0693] Corresponding to the congestion handling methods described above, this application also provides a computer program that, when executed by a processor, implements any of the steps of the congestion handling methods described above.

[0694] Machine-readable storage media may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the machine-readable storage medium may also be at least one storage device located remotely from the aforementioned processor.

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

[0696] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0697] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0698] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, network devices, machine-readable storage media, and computer programs are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0699] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A congestion handling method, characterized in that, The method includes: Receive the first data packet carrying the congestion flag through the target port; In a preset greedy flow table, a target entry is searched that includes the target flow information carried by the first data packet and the identifier of the target port. The preset greedy flow table stores the flow information of data flows with a flow rate greater than a preset flow rate threshold and the identifier of the port corresponding to the data flow that receives the flow information. If the target entry is found, the first data packet is processed according to the forwarding table to perform congestion control on the greedy flow to which the first data packet belongs; If the target entry is not found, the congestion flag carried in the first data packet is removed to obtain the second data packet, and the second data packet is processed according to the forwarding table so that congestion control is not performed on the non-greedy flow to which the first data packet belongs.

2. The method according to claim 1, characterized in that, Each entry in the preset greedy flow table is set with an initial active value. If the target entry is found, the method further includes: Subtract a first preset value from the current activity value of the target entry to obtain the adjusted activity value of the target entry; If the adjusted activity value of the target entry is less than or equal to the second preset value, then the target entry is deleted from the preset greedy flow table.

3. The method according to claim 1 or 2, characterized in that, If the first data packet is a Congestion Notification Data Packet (CNP), then the step of processing the first data packet according to the forwarding table includes: If the target flow information is included in the forwarding table, the identifier of the target port carried in the first data packet is removed, the first data packet with the identifier of the target port removed is forwarded, and the aging count of the target entry is reset to the initial aging count; otherwise, the first data packet is discarded. The step of processing the second data packet according to the forwarding table includes: If the forwarding table includes the target flow information, then the identifier of the target port carried in the second data packet is removed, and the second data packet with the identifier of the target port removed is forwarded; otherwise, the second data packet is discarded.

4. The method according to claim 1 or 2, characterized in that, If the first data packet is an Explicit Congestion Notification (ECN) data packet, then the step of processing the first data packet according to the forwarding table includes: If the target flow information is included in the forwarding table, the congestion notification data packet (CNP) corresponding to the first data packet is forwarded, and the aging count of the target entry is reset to the initial aging count; otherwise, the first data packet is discarded. The step of processing the second data packet according to the forwarding table includes: If the forwarding table includes the target flow information, then the identifier of the target port carried in the second data packet is removed, and the second data packet with the identifier of the target port removed is forwarded; otherwise, the second data packet is discarded.

5. The method according to claim 1, characterized in that, Before receiving the first data packet carrying the congestion flag through the target port, the method further includes: The traffic of multiple data packets received through the target port during the first calculation period is statistically analyzed. From the candidate stream information included in the forwarding table, a preset number of data streams with the largest traffic are identified as candidate stream information, which are used as target candidate stream information. The candidate stream information is the stream information whose hash value is the same as the hash value of the stream information of the candidate stream, and the candidate stream is the data stream whose counted traffic is greater than a preset candidate traffic threshold value. For each target candidate flow information, if the traffic of the target data flow corresponding to the target candidate flow information is greater than the preset traffic threshold, then the target candidate flow information and the identifier of the target port are added as an entry to the preset greedy flow table.

6. The method according to claim 5, characterized in that, The step of calculating the traffic of the data streams to which multiple data packets received through the target port belong during the first calculation period includes: The first total traffic of all data streams to which the data packets received through the target port belong during the second calculation period is calculated, and the second total traffic of each group of data streams is calculated, wherein the hash value of the flow information of a group of data streams is the same; If the first total flow is greater than the first preset candidate sub-threshold, for each group of data streams, if the second total flow of the group of data streams is greater than the second preset candidate sub-threshold, then when the second total flow of the group of data streams is greater than the recorded total flow of the group of data streams, the recorded total flow of the group of data streams will be updated to the second total flow of the group of data streams. If the third calculation cycle has not been reached, return to the step of performing the first total traffic of all data streams to which the data packets received through the target port during the second calculation cycle belong, and the second total traffic of each group of data streams; If the third calculation cycle is reached, for each group of data streams, if the total traffic of the recorded group of data streams is greater than the preset candidate traffic threshold, the flow information of the group of data streams is added as an entry to the preset candidate greedy flow table, and the steps of calculating the first total traffic of all data streams to which the data packets received through the target port during the second calculation cycle belong, and the second total traffic of each group of data streams are returned, until the first calculation cycle is reached.

7. The method according to claim 6, characterized in that, The second calculation cycle is divided into multiple statistical cycles. Each statistical cycle corresponds to a sub-length register array and a total length register. Each sub-length register array includes multiple sub-length registers, and a hash value corresponds to a sub-time register. The step of calculating the first total traffic of all data streams to which the data packets received through the target port belong during the second calculation period, and the second total traffic of each group of data streams, includes: For each data packet received through the target port, perform the following steps: If the first time difference is less than the duration of the second calculation period, then when the first time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. Here, the first time difference is the time difference between the time stored in the total time register and the time of receiving the data packet, and the target statistical period is the statistical period to which the time of receiving the data packet belongs. If the second time difference is greater than or equal to the duration of the second calculation period, then the length stored in each sub-length register corresponding to the target hash value is cleared, wherein the second time difference is the time difference between the time stored in the target sub-time register and the time of receiving the data packet, and the target sub-time register is the sub-time register corresponding to the target hash value of the flow information carried by the data packet; The length of the data packet is increased in the target sub-length register corresponding to the target statistical period, and the length of the data packet is increased in the target total length register. The target sub-length register corresponds to the target hash value. The reception time of the data packet is updated in the total time register and the target time register; When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

8. The method according to claim 7, characterized in that, The method further includes: For each data packet received through the target port, perform the following steps: If the first time difference is greater than or equal to the duration of the second calculation cycle, then clear the lengths stored in the multiple sub-length register arrays and the multiple total length registers; The length of the data packet is increased in the target partial length register, and the length of the data packet is increased in the target total length register; The reception time of the data packet is updated in the total time register and the target time register; When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

9. The method according to claim 7 or 8, characterized in that, The method further includes: For each data packet received through the target port, perform the following steps: If the first time difference is less than the duration of the second calculation period, then when the first time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. If the second time difference is less than the duration of the second calculation period, then when the second time difference is greater than or equal to the duration of the statistical period, the length stored in the target sub-length register is cleared. The length of the data packet is increased in the target partial length register, and the length of the data packet is increased in the target total length register; The reception time of the data packet is updated in the total time register and the target time register; When the second calculation cycle is reached, the length and value stored in multiple total length registers are counted as the first total flow, and the length and value stored in multiple sub-length registers corresponding to each hash value are counted as the second total flow of a set of data streams corresponding to each hash value.

10. The method according to claim 5, characterized in that, The traffic volume of the target data stream corresponding to each target candidate stream is obtained by statistically analyzing the following steps: The third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation period is calculated, as well as the fourth total traffic of the target data stream corresponding to each target candidate stream information. When the third total flow is greater than the first preset flow sub-threshold, for each target data flow, if the fourth total flow of the target data flow is greater than the second preset flow sub-threshold, then when the fourth total flow of the target data flow is greater than the recorded flow of the target data flow, the recorded flow of the target data flow is updated to the fourth total flow of the target data flow. If the fifth calculation cycle has not been reached, return to the step of performing the third total traffic of all data streams to which the data packets received through the target port during the fourth calculation cycle belong, and the fourth total traffic of the target data stream corresponding to each target candidate stream information; If the fifth calculation cycle is reached, for each target data stream, if the recorded traffic of the target data stream is greater than the preset traffic threshold, the flow information of the target data stream is added as an entry to the preset greedy flow table, and the process of calculating the third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation cycle, and the fourth total traffic of the target data stream corresponding to each target candidate flow information, is returned until the sixth calculation cycle is reached.

11. The method according to claim 10, characterized in that, The fourth calculation cycle is divided into multiple statistical cycles. Each statistical cycle corresponds to a sub-length register array and a total length register. Each sub-length register array includes multiple first sub-length registers and one second sub-length register. One target data stream corresponds to one first sub-time register, and the second sub-length register corresponds to all data streams except the target data stream. The steps of calculating the third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation period, and the fourth total traffic of the target data stream corresponding to each target candidate stream information, include: For each data packet received through the target port, perform the following steps: If the third time difference is less than the duration of the fourth calculation period, then when the third time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. Here, the third time difference is the time difference between the time stored in the total time register and the reception time of the data packet, and the target statistical period is the statistical period to which the reception time of the data packet belongs. If the fourth time difference is greater than or equal to the duration of the fourth calculation cycle, then the length stored in each sub-length register corresponding to the data stream to which the data packet belongs is cleared, wherein the fourth time difference is the time difference between the time stored in the target sub-time register and the reception time of the data packet, and the target sub-time register is the sub-time register corresponding to the data stream to which the data packet belongs; The length of the data packet is increased in the target sub-length register corresponding to the target statistical period, and the length of the data packet is increased in the target total length register. The target sub-length register corresponds to the data stream to which the data packet belongs. The reception time of the data packet is updated in the total time register and the target time register; When the fourth calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the third total flow, and the sum of the data stored in multiple sub-length registers corresponding to each target data stream is counted as the fourth total flow for each target data stream.

12. A congestion handling device, characterized in that, The device includes: The receiving unit is used to receive the first data packet carrying the congestion flag through the target port; The lookup unit is used to look up a target entry in a preset greedy flow table, which includes the target flow information carried by the first data packet and the identifier of the target port. The preset greedy flow table stores the flow information of data flows with a flow rate greater than a preset flow rate threshold and the identifier of the port corresponding to the data flow that receives the flow information. The processing unit is configured to, if the target entry is found, process the first data packet according to the forwarding table to perform congestion control on the greedy flow to which the first data packet belongs; if the target entry is not found, remove the congestion flag carried in the first data packet to obtain a second data packet, and process the second data packet according to the forwarding table so as not to perform congestion control on the non-greedy flow to which the first data packet belongs.

13. The apparatus according to claim 12, characterized in that, Each entry in the preset greedy flow table is set with an initial active value, and the device further includes: The setting unit is used to subtract a first preset value from the current activity value of the target entry if the target entry is found, so as to obtain the adjusted activity value of the target entry. The deletion unit is used to delete the target entry in the preset greedy flow table if the adjusted activity value of the target entry is less than or equal to a second preset value.

14. The apparatus according to claim 12 or 13, characterized in that, The processing unit is specifically used for: If the first data packet is a Congestion Notification Packet (CNP), and if the target flow information is included in the forwarding table, then the identifier of the target port carried in the first data packet is removed, the first data packet with the target port identifier removed is forwarded, and the aging count of the target entry is reset to the initial aging count; otherwise, the first data packet is discarded; or... If the forwarding table includes the target flow information, then the identifier of the target port carried in the second data packet is removed, and the second data packet with the identifier of the target port removed is forwarded; otherwise, the second data packet is discarded.

15. The apparatus according to claim 12 or 13, characterized in that, The processing unit is specifically used for: If the first data packet is an Explicit Congestion Notice (ECN) data packet, then if the target flow information is included in the forwarding table, the corresponding Congestion Notice (CNP) data packet is forwarded, and the aging count of the target entry is reset to the initial aging count; otherwise, the first data packet is discarded; or... If the forwarding table includes the target flow information, then the identifier of the target port carried in the second data packet is removed, and the second data packet with the identifier of the target port removed is forwarded; otherwise, the second data packet is discarded.

16. The apparatus according to claim 12, characterized in that, The device further includes: The first statistics unit is used to count the traffic of the data streams to which multiple data packets received through the target port belong within the first calculation period before the first data packet carrying the congestion flag is received through the target port. The determining unit is used to determine the candidate flow information of a preset number of data flows with the largest traffic from the candidate flow information included in the forwarding table, and use them as target candidate flow information. The candidate flow information is the flow information whose hash value is the same as the hash value of the flow information of the candidate flow, and the candidate flow is the data flow whose counted traffic is greater than a preset candidate traffic threshold value. The addition unit is used to add the target candidate flow information and the identifier of the target port as an entry to the preset greedy flow table if the traffic of the target data flow corresponding to the target candidate flow information is greater than a preset traffic threshold.

17. The apparatus according to claim 16, characterized in that, The first statistical unit is specifically used for: The first total traffic of all data streams to which the data packets received through the target port belong during the second calculation period is calculated, and the second total traffic of each group of data streams is calculated, wherein the hash value of the flow information of a group of data streams is the same; If the first total flow is greater than the first preset candidate sub-threshold, for each group of data streams, if the second total flow of the group of data streams is greater than the second preset candidate sub-threshold, then when the second total flow of the group of data streams is greater than the recorded total flow of the group of data streams, the recorded total flow of the group of data streams will be updated to the second total flow of the group of data streams. If the third calculation cycle has not been reached, return to the step of performing the first total traffic of all data streams to which the data packets received through the target port during the second calculation cycle belong, and the second total traffic of each group of data streams; If the third calculation cycle is reached, for each group of data streams, if the total traffic of the recorded group of data streams is greater than the preset candidate traffic threshold, the flow information of the group of data streams is added as an entry to the preset candidate greedy flow table, and the steps of calculating the first total traffic of all data streams to which the data packets received through the target port during the second calculation cycle belong, and the second total traffic of each group of data streams are returned, until the first calculation cycle is reached.

18. The apparatus according to claim 17, characterized in that, The second calculation cycle is divided into multiple statistical cycles. Each statistical cycle corresponds to a sub-length register array and a total length register. Each sub-length register array includes sub-length registers corresponding to multiple hash values, and one hash value corresponds to one sub-time register. The first statistical unit is specifically used for: For each data packet received through the target port, perform the following steps: If the first time difference is less than the duration of the second calculation period, then when the first time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. Here, the first time difference is the time difference between the time stored in the total time register and the time of receiving the data packet, and the target statistical period is the statistical period to which the time of receiving the data packet belongs. If the second time difference is greater than or equal to the duration of the second calculation period, then the length stored in each sub-length register corresponding to the target hash value is cleared, wherein the second time difference is the time difference between the time stored in the target sub-time register and the time of receiving the data packet, and the target sub-time register is the sub-time register corresponding to the target hash value of the flow information carried by the data packet; The length of the data packet is increased in the target sub-length register corresponding to the target statistical period, and the length of the data packet is increased in the target total length register. The target sub-length register corresponds to the target hash value. The reception time of the data packet is updated in the total time register and the target time register; When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

19. The apparatus according to claim 18, characterized in that, The first statistical unit is further configured to: For each data packet received through the target port, perform the following steps: If the first time difference is greater than or equal to the duration of the second calculation cycle, then clear the lengths stored in the multiple sub-length register arrays and the multiple total length registers; The length of the data packet is increased in the target partial length register, and the length of the data packet is increased in the target total length register; The reception time of the data packet is updated in the total time register and the target time register; When the second calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the first total flow, and the sum of the data stored in multiple sub-length registers corresponding to each hash value is counted as the second total flow of a set of data streams corresponding to each hash value.

20. The apparatus according to claim 18 or 19, characterized in that, The first statistical unit is further configured to: For each data packet received through the target port, perform the following steps: If the first time difference is less than the duration of the second calculation period, then when the first time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. If the second time difference is less than the duration of the second calculation period, then when the second time difference is greater than or equal to the duration of the statistical period, the length stored in the target sub-length register is cleared. The length of the data packet is increased in the target partial length register, and the length of the data packet is increased in the target total length register; The reception time of the data packet is updated in the total time register and the target time register; When the second calculation cycle is reached, the length and value stored in multiple total length registers are counted as the first total flow, and the length and value stored in multiple sub-length registers corresponding to each hash value are counted as the second total flow of a set of data streams corresponding to each hash value.

21. The apparatus according to claim 16, characterized in that, The device further includes: The second statistical unit is used to count the flow of the target data stream corresponding to each target candidate stream information, specifically for: The third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation period is calculated, as well as the fourth total traffic of the target data stream corresponding to each target candidate stream information. When the third total flow is greater than the first preset flow sub-threshold, for each target data flow, if the fourth total flow of the target data flow is greater than the second preset flow sub-threshold, then when the fourth total flow of the target data flow is greater than the recorded flow of the target data flow, the recorded flow of the target data flow is updated to the fourth total flow of the target data flow. If the fifth calculation cycle has not been reached, return to the step of performing the third total traffic of all data streams to which the data packets received through the target port during the fourth calculation cycle belong, and the fourth total traffic of the target data stream corresponding to each target candidate stream information; If the fifth calculation cycle is reached, for each target data stream, if the recorded traffic of the target data stream is greater than the preset traffic threshold, the flow information of the target data stream is added as an entry to the preset greedy flow table, and the process of calculating the third total traffic of all data streams to which the data packets received through the target port belong during the fourth calculation cycle, and the fourth total traffic of the target data stream corresponding to each target candidate flow information, is returned until the sixth calculation cycle is reached.

22. The apparatus according to claim 21, characterized in that, The fourth calculation cycle is divided into multiple statistical cycles. Each statistical cycle corresponds to a sub-length register array and a total length register. Each sub-length register array includes multiple first sub-length registers and one second sub-length register. One target data stream corresponds to one first sub-time register, and the second sub-length register corresponds to all data streams except the target data stream. The second statistical unit is specifically used for: For each data packet received through the target port, perform the following steps: If the third time difference is less than the duration of the fourth calculation period, then when the third time difference is greater than or equal to the duration of the statistical period, the length stored in the target total length register corresponding to the target statistical period is cleared. Here, the third time difference is the time difference between the time stored in the total time register and the reception time of the data packet, and the target statistical period is the statistical period to which the reception time of the data packet belongs. If the fourth time difference is greater than or equal to the duration of the fourth calculation cycle, then the length stored in each sub-length register corresponding to the data stream to which the data packet belongs is cleared, wherein the fourth time difference is the time difference between the time stored in the target sub-time register and the reception time of the data packet, and the target sub-time register is the sub-time register corresponding to the data stream to which the data packet belongs; The length of the data packet is increased in the target sub-length register corresponding to the target statistical period, and the length of the data packet is increased in the target total length register. The target sub-length register corresponds to the data stream to which the data packet belongs. The reception time of the data packet is updated in the total time register and the target time register; When the fourth calculation cycle is reached, the sum of the lengths stored in multiple total length registers is counted as the third total flow, and the sum of the data stored in multiple sub-length registers corresponding to each target data stream is counted as the fourth total flow for each target data stream.

23. A network device, characterized in that, Includes a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn causes the processor to perform the following steps: Receive the first data packet carrying the congestion flag through the target port; In a preset greedy flow table, a target entry is searched that includes the target flow information carried by the first data packet and the identifier of the target port. The preset greedy flow table stores the flow information of data flows with a flow rate greater than a preset flow rate threshold and the identifier of the port corresponding to the data flow that receives the flow information. If the target entry is found, the first data packet is processed according to the forwarding table to perform congestion control on the greedy flow to which the first data packet belongs; If the target entry is not found, the congestion flag carried in the first data packet is removed to obtain the second data packet, and the second data packet is processed according to the forwarding table so that congestion control is not performed on the non-greedy flow to which the first data packet belongs.

24. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-11.