Flow control method and device, equipment and storage medium

By using DSCP labels to distinguish data packets and optimizing cache queue management during AI large model training, the problem of insufficient bandwidth utilization in credit value-based control schemes is solved, achieving more efficient network bandwidth utilization and training efficiency.

CN122093320APending Publication Date: 2026-05-26NEW H3C TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202610560429.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-24
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In training large AI models, credit-based traffic control schemes cannot fully utilize network bandwidth, leading to increased traffic completion time and hindering training efficiency.

Method used

Differential Service Code Point (DSCP) labels are used to distinguish between data packets that have not obtained and those that have obtained receiver credit values. Data packets that have not obtained credit values ​​are sent at line rate, while data packets that have obtained credit values ​​are sent at a rate controlled according to the credit value. Combined with buffer queue management and congestion handling mechanisms, data packet processing is optimized.

Benefits of technology

In AI large-scale model training scenarios, make full use of network bandwidth when the recipient's credit value is not obtained, reduce traffic completion time, and improve training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122093320A_ABST
    Figure CN122093320A_ABST
Patent Text Reader

Abstract

Provided in an embodiment of the present application are a flow control method, apparatus and device, and a storage medium, the method comprising: a network device receiving a plurality of data packets, the plurality of data packets comprising a first data packet and a second data packet, the first data packet carrying a first preset tag, the second data packet carrying a second preset tag, the first preset label indicates that the sender does not obtain the credit value allocated by the receiver, and the second preset label indicates that the sender has obtained the credit value allocated by the receiver; if the available length of the cache queue in the network equipment is greater than a first threshold value, writing the first data packet and the second data packet into the cache queue; and sending the data packet in the cache queue. According to the scheme, the network bandwidth can be fully utilized in an AI large model training scene, the flow completion time is shortened, and the training efficiency of the AI large model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a flow control method, apparatus, device and storage medium. Background Technology

[0002] As large-scale models with hundreds of billions of parameters become the new norm in artificial intelligence (AI) training, the frequency of all-to-all operations in distributed training clusters for scenarios such as parameter synchronization and data parallelism has increased significantly. All-to-all operations require full connectivity for data exchange between multiple nodes. Their many-to-many communication mode can generate massive amounts of small traffic in an instant, causing sudden overflow of network device buffers, i.e., the many-to-one (Incast) problem. This leads to microsecond (μs) level queue blocking and data packet retransmission, severely restricting the training efficiency of large AI models.

[0003] The current solution to the incast problem is a credit-based flow control scheme, where the receiver dynamically assigns credits to the sender, and the sender sends data packets to the receiver based on these credits. In this scheme, the assignment of credits requires at least one Round-Trip Time (RTT), meaning the sender must wait at least one RTT to acquire the credit before sending a data packet to the receiver. However, large-scale AI model training generates numerous small traffic flows that can be completed within one RTT. Therefore, using the credit-based flow control scheme in large-scale AI model training scenarios fails to fully utilize network bandwidth, increases traffic completion time, and hinders the training efficiency of large-scale AI models. Summary of the Invention

[0004] The purpose of this application is to provide a flow control method, apparatus, device, and storage medium to fully utilize network bandwidth, reduce flow completion time, and improve the training efficiency of large AI models in AI large-scale model training scenarios. The specific technical solution is as follows:

[0005] In a first aspect, embodiments of this application provide a flow control method applied to a network device. The method includes: receiving multiple data packets, the multiple data packets including a first data packet and a second data packet, the first data packet carrying a first preset tag, the second data packet carrying a second preset tag, the first preset tag indicating that the sender has not obtained a credit value assigned by the receiver, and the second preset tag indicating that the sender has obtained a credit value assigned by the receiver; if the available length of the buffer queue in the network device is greater than a first threshold, then writing the first data packet and the second data packet into the buffer queue; and sending the data packets in the buffer queue.

[0006] In some embodiments, the method further includes: if the available length of the cache queue is less than or equal to the first threshold, then trimming the first data packet to obtain a third data packet, writing the third data packet and the second data packet into the cache queue, wherein the length of the third data packet is less than the length of the first data packet, and the third data packet carries a third preset tag, wherein the third preset tag indicates that the data packet is a trimmed packet.

[0007] In some embodiments, the method further includes: if the available length of the cache queue is less than or equal to a second threshold, then discarding the first data packet and writing the second data packet into the cache queue, wherein the second threshold is less than the first threshold.

[0008] In some embodiments, the step of sending data packets in the buffer queue includes: if the available length of the buffer queue is less than or equal to a third threshold, adding a congestion flag to the data packets in the buffer queue; and sending data packets carrying the congestion flag.

[0009] In some embodiments, the first preset label, the second preset label, and the third preset label are Differentiated Services Code Point (DSCP) labels.

[0010] Secondly, embodiments of this application provide a flow control method applied to a sender. The method includes: acquiring a data packet to be sent; if a credit value allocated by a receiver is not obtained, adding a first preset tag to the data packet to be sent to obtain a first data packet; sending the first data packet at line speed, wherein the first preset tag indicates that the sender has not obtained the credit value allocated by the receiver; if a credit value allocated by the receiver is obtained, adding a second preset tag to the data packet to be sent to obtain a second data packet; and sending the second data packet based on the obtained credit value, wherein the second preset tag indicates that the sender has obtained the credit value allocated by the receiver.

[0011] In some embodiments, the method further includes: receiving a negative acknowledgment (NACK) packet sent by the receiver, the NACK packet carrying the current congestion level of the target forwarding path, the NACK packet indicating retransmission of the first data packet, the target forwarding path being the forwarding path from the sender to the receiver of the first data packet; and retransmitting the first data packet using a retransmission strategy corresponding to the current congestion level.

[0012] In some embodiments, the step of retransmitting the first data packet using a retransmission strategy corresponding to the current congestion level includes: if the current congestion level is mild congestion, then sending the first data packet after receiving the NACK packet; if the current congestion level is moderate congestion, then sending the first data packet after waiting for a first duration after receiving the NACK packet; if the current congestion level is severe congestion, then sending the first data packet after waiting for a second duration after receiving the NACK packet, wherein the second duration is longer than the first duration.

[0013] In some embodiments, the first preset label and the second preset label are DSCP labels.

[0014] Thirdly, embodiments of this application provide a flow control method applied to a receiver, the method comprising: receiving multiple data packets, the multiple data packets being data packets forwarded by a network device according to the method provided in the first aspect; and processing the multiple data packets.

[0015] In some embodiments, the plurality of data packets includes a third data packet, the third data packet carrying a third preset label, the third preset label indicating that the data packet is a truncated packet; the step of processing the plurality of data packets includes: determining the current congestion level of a target forwarding path, the target forwarding path being the forwarding path from the sender to the receiver corresponding to the third data packet; sending a NACK packet to the sender, the NACK packet carrying the current congestion level and the NACK packet indicating retransmission of a first data packet, the first data packet being the complete data packet corresponding to the third data packet.

[0016] In some embodiments, the plurality of data packets includes a third data packet and a fourth data packet carrying a congestion flag; the step of determining the current congestion level of the target forwarding path includes: determining a first number of third data packets received through the target forwarding path within a preset time window and a second number of fourth data packets received; and performing a weighted summation of the first number and the second number to obtain the current congestion level of the target forwarding path.

[0017] In some embodiments, the third preset tag is a DSCP tag.

[0018] Fourthly, this application provides a flow control device applied to a network device. The device includes: a receiving module for receiving multiple data packets, the multiple data packets including a first data packet and a second data packet, the first data packet carrying a first preset tag, and the second data packet carrying a second preset tag, the first preset tag indicating that the sender has not obtained a credit value assigned by the receiver, and the second preset tag indicating that the sender has obtained a credit value assigned by the receiver; a writing module for writing the first data packet and the second data packet into the cache queue if the available length of the cache queue in the network device is greater than a first threshold; and a sending module for sending the data packets in the cache queue.

[0019] Fifthly, embodiments of this application provide a flow control device applied to a sender. The device includes: an acquisition module for acquiring a data packet to be sent; and a sending module for adding a first preset tag to the data packet to be sent to obtain a first data packet if the sender has not obtained a credit value assigned by the receiver, and sending the first data packet at line speed, wherein the first preset tag indicates that the sender has not obtained a credit value assigned by the receiver; and for adding a second preset tag to the data packet to be sent to obtain a second data packet if the sender has obtained a credit value assigned by the receiver, and sending the second data packet based on the obtained credit value, wherein the second preset tag indicates that the sender has obtained a credit value assigned by the receiver.

[0020] In a sixth aspect, embodiments of this application provide a flow control device applied to a receiver. The device includes: a receiving module for receiving multiple data packets, wherein the multiple data packets are data packets forwarded by a network device according to the method provided in the first aspect; and a processing module for processing the multiple data packets.

[0021] In a seventh aspect, embodiments of this application provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; the processor is used to execute the program stored in the memory to implement any of the methods provided in the first aspect, or any of the methods provided in the second aspect, or any of the methods provided in the third aspect.

[0022] Eighthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods provided in the first aspect, or any of the methods provided in the second aspect, or any of the methods provided in the third aspect.

[0023] In a ninth aspect, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods provided in the first aspect, or any of the methods provided in the second aspect, or any of the methods provided in the third aspect.

[0024] In the technical solution provided in this application embodiment, the data packets sent by the sender include a first data packet sent when no credit value has been allocated by the receiver, and a second data packet sent when a credit value has been allocated by the receiver. These two types of data packets carry different tags, namely a first preset tag and a second preset tag. That is, the network device can distinguish between the first and second data packets using the first and second preset tags, and thus accurately process these two types of data packets. For example, if the available length of the buffer queue is greater than a first threshold, the first and second data packets are directly written into the buffer queue and then forwarded. When the network device can correctly distinguish between the first and second data packets, the sender can not limit the rate at which the first data packet is sent, i.e., it can send the first data packet at line speed without affecting other traffic already controlled by the credit value (such as the second data packet). In AI large-scale model training scenarios, this application embodiment can fully utilize the network bandwidth when no credit value has been allocated by the receiver (such as the first RTT), reducing traffic completion time and improving the training efficiency of AI large-scale models.

[0025] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

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

[0027] Figure 1 This is a network topology diagram;

[0028] Figure 2 This is a schematic diagram of a first flow control method provided in an embodiment of this application;

[0029] Figure 3 A schematic diagram illustrating the retransmission timing provided in an embodiment of this application;

[0030] Figure 4 This is a second flowchart illustrating the flow control method provided in an embodiment of this application;

[0031] Figure 5This is a third flowchart illustrating the flow control method provided in the embodiments of this application;

[0032] Figure 6 This is a fourth flowchart illustrating the flow control method provided in the embodiments of this application;

[0033] Figure 7 A fifth flowchart illustrating the flow control method provided in this application embodiment;

[0034] Figure 8 A sixth flowchart illustrating the flow control method provided in this application embodiment;

[0035] Figure 9 A schematic diagram of a flow control network provided in an embodiment of this application;

[0036] Figure 10 This is a schematic diagram illustrating the signaling interaction between the sender, network device, and receiver as provided in an embodiment of this application.

[0037] Figure 11 This is a schematic diagram of a first structure of the flow control device provided in the embodiments of this application;

[0038] Figure 12 This is a schematic diagram of a second structure of the flow control device provided in the embodiments of this application;

[0039] Figure 13 This is a schematic diagram of a third structure of the flow control device provided in the embodiments of this application;

[0040] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

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

[0043] Line speed: The maximum rate at which a network device can theoretically process or forward data packets.

[0044] Link capacity, or Bandwidth-Delay Product (BDP), is calculated as: egress bandwidth × Round-Trip Time (RTT). Link capacity represents the maximum amount of unacknowledged data a link can hold at any given time.

[0045] like Figure 1 In the network topology shown, senders 1 through 3 are connected to switch A, switch A is connected to switch B via the network, and switch B is connected to the receiver. The credit-based flow control process between senders 1 through 3 and the receiver is as follows:

[0046] 1) The receiver will calculate the link capacity of the last hop based on the outbound bandwidth of switching device B and the RTT from the receiver to switching device B, and use it as the overall credit value capacity.

[0047] 2) Senders 1 to 3 send real-time requests to the receiver through switching equipment A and switching equipment B to request credit values;

[0048] 3) The receiving party sends control messages to sender 1 to sender 3 respectively. The control messages carry the credit values ​​assigned to sender 1 to sender 3.

[0049] 4) Based on the obtained credit values, senders 1 through 3 send data packets to the receiver via switching device A and switching device B. One credit value corresponds to a number of bytes that can be sent. Each time a sender sends a data packet, it consumes the corresponding number of bytes of credit value.

[0050] This credit-based flow control scheme allows for more precise network bandwidth allocation, ensuring that the transmission rate always matches the receiver's processing capacity and network link status, thereby achieving rapid congestion convergence. However, in this credit-based flow control scheme, within the first RTT after connection establishment, the sender must wait for the receiver to return the allocated credit value before it can begin sending data packets. This results in the initial stage, before the sender has obtained the allocated credit value from the receiver, where network bandwidth cannot be fully utilized. This is particularly problematic in current AI large-scale model training scenarios where there are many small traffic flows, making it impossible to effectively reuse bandwidth, thus increasing the traffic completion time and hindering the training efficiency of large AI models.

[0051] To address the aforementioned problems, embodiments of this application provide a flow control method, such as... Figure 2 As shown, when applied to the sender, the method includes the following steps:

[0052] Step S201: Obtain the data packet to be sent; if the credit value assigned by the receiver has not been obtained, proceed to step S202; if the credit value assigned by the receiver has been obtained, proceed to step S203.

[0053] Step S202: Add a first preset tag to the data packet to be sent to obtain a first data packet. Send the first data packet at line speed. The first preset tag indicates that the sender has not received the credit value assigned by the receiver.

[0054] Step S203: Add a second preset tag to the data packet to be sent to obtain a second data packet. Send the second data packet based on the obtained credit value. The second preset tag indicates that the sender has obtained the credit value assigned by the receiver.

[0055] In the technical solution provided in this application embodiment, the data packets sent by the sender include a first data packet sent when no credit value has been allocated by the receiver, and a second data packet sent when a credit value has been allocated by the receiver. These two types of data packets carry different tags, namely a first preset tag and a second preset tag. That is, the network device can distinguish between the first and second data packets using the first and second preset tags, and thus accurately process these two types of data packets. For example, if the available length of the buffer queue is greater than a first threshold, the first and second data packets are directly written into the buffer queue and then forwarded. When the network device can correctly distinguish between the first and second data packets, the sender can not limit the rate at which the first data packet is sent, i.e., it can send the first data packet at line speed without affecting other traffic already controlled by the credit value (such as the second data packet). In AI large-scale model training scenarios, this application embodiment can fully utilize the network bandwidth when no credit value has been allocated by the receiver (such as the first RTT), reducing traffic completion time and improving the training efficiency of AI large-scale models.

[0056] In this embodiment, the sender is the source of the data packet. The sender can be an electronic device such as a personal computer, server, switching equipment, or router.

[0057] In step S201 above, the data packet to be sent is the data packet that needs to be sent to the receiver. The receiver is the electronic device corresponding to the destination address of the data packet to be sent. The data packet to be sent can be a data packet generated periodically or by an event triggered by the sender, or it can be a data packet input by the user; there is no limitation on this.

[0058] After receiving the data packet to be sent, the sender can determine whether it has obtained the credit value assigned by the receiver based on the destination address of the data packet. If the sender has not obtained the credit value assigned by the receiver, such as within the first RTT established between the sender and the receiver, the sender executes step S202 to add a first preset tag to the data packet to be sent. The data packet to be sent with the first preset tag is the first data packet. The sender sends the first data packet at line speed to make full use of network bandwidth and improve communication efficiency.

[0059] If the sender has obtained the credit value assigned by the receiver, such as after the first RTT when the connection between the sender and the receiver is established, the sender executes step S203 to add a second preset tag to the data packet to be sent. The data packet to be sent with the second preset tag is called the second data packet. The second data packet is sent based on the obtained credit value to ensure that the sending rate matches the receiver's processing capacity and network link status, thereby achieving fast congestion convergence.

[0060] Here, the method by which the sender obtains the credit value can be found in the existing credit value-based flow control scheme, and will not be repeated here.

[0061] In some embodiments, after sending the first data packet, the sender may also receive a negative acknowledgment (NACK) packet sent by the receiver. The NACK packet carries the current congestion level of the target forwarding path and indicates that the first data packet should be retransmitted. The target forwarding path is the forwarding path from the sender to the receiver of the first data packet. The first data packet is retransmitted using the retransmission strategy corresponding to the current congestion level.

[0062] In this embodiment, the receiver can calculate the congestion level on the target forwarding path, i.e., the current congestion level, and send a NACK packet corresponding to the first data packet to the sender when it is determined that the first data packet needs to be retransmitted. The method by which the receiver calculates the current congestion level will be described in detail below and will not be elaborated here.

[0063] The sender pre-configures a mapping relationship between congestion level and retransmission strategy. After receiving a NACK packet, the sender can extract the current congestion level from the NACK packet and then determine the retransmission strategy corresponding to the current congestion level, such as the target retransmission strategy. The first data packet is then retransmitted according to the target retransmission strategy.

[0064] In this embodiment, the sender can intelligently decide on the retransmission method based on the perceived level of congestion, thereby avoiding further aggravation of network congestion, reducing congestion recovery delay, and further accelerating traffic completion time.

[0065] In some embodiments, congestion levels can be categorized as mild, moderate, and severe congestion. Correspondingly, the retransmission strategies are immediate retransmission, retransmission after a first delay, and retransmission after a second delay, where the second delay is longer than the first delay. The first and second delays can be set according to actual needs. For example, the first delay can be 0.3 × RTT, and the second delay can be 0.6 × RTT, where RTT is the round-trip time between the sender and receiver.

[0066] In this case, the above-mentioned retransmission strategy corresponding to the current congestion level, which retransmits the first data packet, may include: if the current congestion level is mild, then the first data packet is sent after receiving the NACK packet; if the current congestion level is moderate, then the first data packet is sent after waiting for a first duration after receiving the NACK packet; if the current congestion level is severe, then the first data packet is sent after waiting for a second duration after receiving the NACK packet.

[0067] Upon receiving a NACK packet and obtaining the current congestion level, if the congestion level is detected as light, the sender immediately sends the first data packet to expedite traffic completion. If the congestion level is detected as moderate, the sender sends the first data packet after a first delay; if the congestion level is detected as severe, the sender sends the first data packet after a second delay. For example... Figure 3 The diagram showing the retransmission timing is as follows: the first duration Δt1 = t2 - t1, and the second duration Δt2 = t3 - t1. The sender receives the NACK packet corresponding to data packet 1 at time t1; under mild congestion, the sender immediately retransmits data packet 1 at time t1; under moderate congestion, the sender retransmits data packet 1 at time t2; under severe congestion, the sender retransmits data packet 1 at time t3.

[0068] In this embodiment, when the current congestion level is moderate or severe, the sender delays for a period of time before retransmitting the first data packet to avoid further aggravating network congestion and reduce congestion recovery delay. This approach helps to quickly adjust the retransmission strategy when congestion occurs, thereby optimizing network performance and resource utilization.

[0069] Furthermore, if the sender has not yet obtained the credit value allocated by the receiver when retransmitting the first data packet, it will directly send the data packet at line rate. For example, if the current congestion level is mild, the sender will immediately send the first data packet at line rate after receiving the NACK packet; if the current congestion level is moderate, the sender will wait for a first duration after receiving the NACK packet before sending the first data packet at line rate; if the current congestion level is severe, the sender will wait for a second duration after receiving the NACK packet before sending the first data packet at line rate.

[0070] When retransmitting the first data packet, if the sender has already obtained the credit value assigned by the receiver, it can modify the first preset tag carried in the first data packet to a second preset tag to obtain the second data packet, and send the second data packet according to the obtained credit value. For example, if the current congestion level is mild, the sender will immediately send the second data packet according to the obtained credit value after receiving the NACK packet; if the current congestion level is moderate, the sender will wait for a first period of time after receiving the NACK packet and then send the second data packet according to the obtained credit value; if the current congestion level is severe, the sender will wait for a second period of time after receiving the NACK packet and then send the second data packet according to the obtained credit value.

[0071] In this embodiment, after receiving the NACK packet, the sender enters the flow control mode of first preset label / second preset label + congestion level + credit value. The sender's retransmission of data packets is not only controlled by the credit value, but also needs to consider the current congestion level carried by the NACK packet, so as to optimize network performance and resource utilization.

[0072] In some embodiments, the first preset label and the second preset label may be carried in the Differentiated Services Code Point (DSCP) field.

[0073] The DSCP field is a 6-bit field in the Internet Protocol (IP) packet header used to identify the service level of traffic. Located within the Type of Service (ToS) field, the DSCP field defines differentiated Quality of Service (QoS) policies, enabling network devices to prioritize and allocate resources for specific traffic. In this embodiment, the DSCP field carries a first preset label and a second preset label to reuse existing fields, maintain compatibility with existing standards, and reduce implementation complexity. For example, the first and second preset labels can be represented by the following two DSCP labels to distinguish different states of the data packets.

[0074] 1) DSCP_FIRST_RTT (first preset tag).

[0075] The DSCP_FIRST_RTT phase is the first RTT communication cycle. DSCP_FIRST_RTT is marked when the data packet is sent on the endpoint. This phase is not controlled by the credit value assigned by the receiver.

[0076] 2) DSCP_NO_FIRST_RTT (Second Preset Tag).

[0077] The DSCP_NO_FIRST_RTT phase is a steady-state transmission phase controlled by a credit value allocated by the receiver after the first RTT. DSCP_NO_FIRST_RTT is marked when data packets are sent at the endpoint. The transmission rate is regulated by the credit value allocated by the receiver during this phase.

[0078] Corresponding to the above-described flow control method, this application also provides a flow control method, such as... Figure 4 As shown, applied to network devices, this method includes the following steps:

[0079] Step S401: Receive multiple data packets, including a first data packet and a second data packet. The first data packet carries a first preset tag, and the second data packet carries a second preset tag. The first preset tag indicates that the sender has not obtained the credit value assigned by the receiver, and the second preset tag indicates that the sender has obtained the credit value assigned by the receiver.

[0080] Step S402: If the available length of the cache queue in the network device is greater than the first threshold, then write the first data packet and the second data packet into the cache queue.

[0081] Step S403: Send the data packets in the buffer queue.

[0082] In the technical solution provided in this application embodiment, the data packets sent by the sender include a first data packet sent when no credit value has been allocated by the receiver, and a second data packet sent when a credit value has been allocated by the receiver. These two types of data packets carry different tags, namely a first preset tag and a second preset tag. That is, the network device can distinguish between the first and second data packets using the first and second preset tags, and thus accurately process these two types of data packets. For example, if the available length of the buffer queue is greater than a first threshold, the first and second data packets are directly written into the buffer queue and then forwarded. When the network device can correctly distinguish between the first and second data packets, the sender can not limit the rate at which the first data packet is sent, i.e., it can send the first data packet at line speed without affecting other traffic already controlled by the credit value (such as the second data packet). In AI large-scale model training scenarios, this application embodiment can fully utilize the network bandwidth when no credit value has been allocated by the receiver (such as the first RTT), reducing traffic completion time and improving the training efficiency of AI large-scale models.

[0083] In this embodiment, the network device is located on the forwarding path from the sender to the receiver, serving as an intermediate device on the forwarding path. The network device can be a switch or router directly connected to the sender, a switch or router directly connected to the receiver, or any other switch or router on the forwarding path from the sender to the receiver. There can be one or more senders, and one or more receivers. Regardless of the number of senders or receivers, the data packets exchanged between these senders and receivers are buffered in the same sending queue (i.e., buffer queue) on the network device. Data packets exchanged between the sender and receiver correspond to the sender.

[0084] In step S401 above, one or more senders transmit data packets. The network device receives these data packets from the senders, receiving a total of multiple data packets.

[0085] Among these senders, some have not yet received the credit value assigned by the corresponding receiver, such as during the first RTT after the connection between the sender and receiver is established; others have received the credit value assigned by the corresponding receiver, after the first RTT after the connection is established. Data packets sent by senders who have not yet received the credit value assigned by the corresponding receiver are designated as the first data packets, while data packets sent by senders who have received the credit value assigned by the corresponding receiver are designated as the second data packets.

[0086] In step S402 above, the first threshold can also be called the packet pruning threshold, and its size can be set according to actual needs. The buffer queue is a sending queue used to buffer multiple data packets. The available length of the buffer queue is the unoccupied space length that can be used to buffer data packets.

[0087] After receiving multiple data packets, the network device can check whether the available length of the buffer queue is greater than a first threshold. If so, indicating that the available length of the buffer queue is greater than the first threshold, it means that there is no network congestion. The network device can directly buffer these multiple data packets (including the first and second data packets) into the buffer queue, and then execute step S403 to send the first and second data packets in the buffer queue one by one. This can make full use of idle network bandwidth, reduce traffic completion time, especially in AI large model training scenarios where the reduction in completion time for small traffic is more significant, avoiding additional RTT waiting.

[0088] In some embodiments, such as Figure 5As shown, a flow control method is also provided, which is applied to a network device. The method may include steps S501 to S504. Steps S501 to S502 and S504 are the same as steps S401 to S403, and will not be described again here.

[0089] Step S503: If the available length of the cache queue in the network device is less than or equal to the first threshold, the first data packet is trimmed to obtain the third data packet. The third data packet and the second data packet are written into the cache queue. The length of the third data packet is less than the length of the first data packet, and the third data packet carries a third preset tag. The third preset tag indicates that the data packet is a trimmed packet.

[0090] In this embodiment, the length of the third data packet can be set according to actual needs. For example, the length of the third data packet can be 32 bytes, 64 bytes, 128 bytes, etc.

[0091] After receiving multiple data packets, the network device can check whether the available length of the buffer queue is greater than a first threshold. If not, that is, the available length of the buffer queue is less than or equal to the first threshold, it indicates that there is network congestion. The network device can then perform step S503 to perform packet trimming, that is, find the first data packet carrying the first preset tag from the multiple data packets, trim the first data packet, retain the header information of the first data packet, add a third preset tag to the header information of the first data packet to obtain a third data packet, or modify the first preset tag in the header information of the first data packet to the third preset tag to obtain a third data packet. Then, the third data packet and the second data packet are buffered in the buffer queue, and then step S504 is performed to send the third data packet and the second data packet in the buffer queue one by one.

[0092] After receiving the data packet, if the data packet is a third data packet carrying a third preset tag, the receiver can immediately notify the sender to adjust the transmission speed and retransmit. The specific retransmission method of the first data packet corresponding to the third data packet will be explained in detail below, and will not be elaborated here.

[0093] In the technical solution provided in this application embodiment, when the network is not congested, the network device directly buffers the first and second data packets to make full use of the network's idle bandwidth, reduce traffic completion time, and avoid additional RTT waiting. When the network is congested, the network device uses packet trimming technology to process data packets sent by the sender when they have not obtained a credit value allocated by the receiver (such as data packets sent during the first RTT), reducing the bandwidth occupied by data packets sent when they have not obtained a credit value allocated by the receiver, so that data packets sent when they have not obtained a credit value allocated by the receiver begin to arrive at the receiver, and ensuring the normal transmission of other traffic already controlled by the credit value in the network (such as the second data packet), avoiding short-term exacerbation of packet loss and incast problems of other traffic already controlled by the credit value.

[0094] In some embodiments, the third preset label can be carried in the DSCP field. The DSCP field is a 6-bit field in the IP packet header used to identify the service level of traffic. Located in the ToS field, the DSCP field defines differentiated QoS policies, enabling network devices to prioritize and allocate resources for specific traffic. In this embodiment, the third preset label is carried in the DSCP field to reuse existing fields, maintain compatibility with existing standards, and reduce implementation difficulty. For example, the third preset label can be represented by the following DSCP label to distinguish packet states.

[0095] 1) DSCP_TRIMMED (Third preset tag).

[0096] When network congestion occurs, after packet pruning, the packets need to be further marked with the DSCP_TRIMMED tag. This allows the receiver to detect network congestion and notify the sender, enabling the sender to adjust the transmission speed and retransmit.

[0097] In some embodiments, the first preset label and the second preset label can be carried in the DSCP field. For example, DSCP_FIRST_RTT is the first preset label, and DSCP_NO_FIRST_RTT is the second preset label.

[0098] In this embodiment of the application, if the available length of the cache queue is less than or equal to the first threshold, the network device may also discard the first data packet and write the second data packet into the cache queue, so as to ensure the normal transmission of other traffic that is already under credit value control in the network, and avoid the short-term aggravation of packet loss and incast problems of other traffic that is already under credit value control.

[0099] In some embodiments, such as Figure 6As shown, a flow control method is also provided, which is applied to a network device. The method may include steps S601 to S604. Steps S601 to S602 and S604 are the same as steps S401 to S403, and will not be described again here.

[0100] Step S603: If the available length of the buffer queue is less than or equal to the second threshold, then discard the first data packet and write the second data packet into the buffer queue. The second threshold is less than the first threshold.

[0101] In this embodiment, the second threshold can also be called the packet loss threshold, and the size of the second threshold can be set according to actual needs. After receiving multiple data packets, the network device can detect whether the available length of the buffer queue is greater than the first threshold and whether the available length of the buffer queue is less than or equal to the second threshold. If the available length of the buffer queue is greater than the first threshold, the network device can execute step S602. If the available length of the buffer queue is less than or equal to the first threshold and less than or equal to the second threshold, it indicates that the network is severely congested and meets the dropping condition. The network device can execute step S603, selectively dropping the first data packet of these multiple data packets, retaining other traffic (such as the second data packet) that is already under credit value control, buffering the second data packet of these multiple data packets to the buffer queue, and then executing step S604, sending the data packets in the buffer queue one by one.

[0102] In this embodiment of the application, while making full use of idle network bandwidth and reducing traffic completion time, when network congestion occurs, data packets sent before obtaining credit value assigned by the receiver are discarded first, which further protects the business units that are already under credit value control from the impact of congestion.

[0103] In some embodiments, such as Figure 7 As shown, a flow control method is also provided, applied to a network device. This method may include steps S701 to S705. In this embodiment, step S701 is the same as step S401. After obtaining multiple data packets in step S701, if the available length of the buffer queue is greater than a first threshold, then step S702 is executed, followed by step S705; if the available length of the buffer queue is less than or equal to the first threshold, and the available length is greater than a second threshold, then step S703 is executed, followed by step S705; if the available length of the buffer queue is less than or equal to the second threshold, then step S704 is executed, followed by step S705. In this embodiment, the description of steps S701 to S705 is relatively simple; for details, please refer to [link to relevant documentation]. Figures 4-6 Related descriptions for some parts.

[0104] In the technical solutions provided in the embodiments of this application, the network device incorporates... Figure 5 and Figure 6The proposed solution fully utilizes idle network bandwidth and reduces traffic completion time. When network congestion occurs, it employs two mechanisms—packet trimming and prioritizing the discarding of data packets sent before receiving a credit value assigned by the recipient—to ensure that business units already under credit value management are not affected by congestion to the greatest extent possible.

[0105] In some embodiments, if the available length of the buffer queue is less than or equal to the third threshold, step S403 above may be: adding a congestion mark to the data packets in the buffer queue; sending a data packet carrying the congestion mark.

[0106] In this embodiment, the third threshold can be set according to actual needs. The third threshold can be greater than or equal to the first threshold. The congestion flag can be an Explicit Congestion Notification (ECN) flag or other flags indicating congestion; there is no limitation on this.

[0107] After buffering the first, second, and / or third data packets into the buffer queue, the network device reads the data packets from the buffer queue one by one. The data packets read can be the first, second, or third data packets. If the available length of the current buffer queue is less than or equal to a third threshold, the network device adds a congestion mark to the read data packets and then sends the data packets carrying the congestion mark. By adding congestion marks, the receiver can easily perceive network congestion, which helps to quickly adjust the retransmission strategy when congestion occurs, thereby optimizing network performance and resource utilization.

[0108] Corresponding to the above-described flow control method, this application also provides a flow control method, such as... Figure 8 As shown, when applied to the receiver, the method includes the following steps:

[0109] Step S801: Receive multiple data packets, which are data packets forwarded by the network device according to the flow control method applied to the network device;

[0110] Step S802: Process multiple data packets.

[0111] In the technical solution provided in this application embodiment, the data packets sent by the sender include a first data packet sent when no credit value has been allocated by the receiver, and a second data packet sent when a credit value has been allocated by the receiver. These two types of data packets carry different tags, namely a first preset tag and a second preset tag. That is, the network device can distinguish between the first and second data packets using the first and second preset tags, and thus accurately process these two types of data packets. For example, if the available length of the buffer queue is greater than a first threshold, the first and second data packets are directly written into the buffer queue and then forwarded. When the network device can correctly distinguish between the first and second data packets, the sender can not limit the rate at which the first data packet is sent, i.e., it can send the first data packet at line speed without affecting other traffic already controlled by the credit value (such as the second data packet). In AI large-scale model training scenarios, this application embodiment can fully utilize the network bandwidth when no credit value has been allocated by the receiver (such as the first RTT), reducing traffic completion time and improving the training efficiency of AI large-scale models.

[0112] In this embodiment, the receiver is the destination of the data packet. The receiver can be an electronic device such as a personal computer, server, switching equipment, or router.

[0113] In step S801 above, the method by which the network device sends data packets can be found in [reference needed]. Figures 4-7 Related descriptions for some parts.

[0114] In step S802 above, the way the network device processes data packets can be set according to actual needs. For example, the network device can perform deep packet inspection on the received data packets, or input them into a large AI model for training.

[0115] In this embodiment, the multiple data packets received by the network device may include a first data packet and a second data packet, and may also include a third data packet. The third data packet carries a third preset tag, which indicates that the data packet is a cropped packet. The method for obtaining the third data packet can be found in [reference needed]. Figure 5 The relevant description is as follows. In some embodiments, when the network device receives multiple data packets including a third data packet, step S802 above may be: determining the current congestion level of the target forwarding path, the target forwarding path being the forwarding path from the sender to the receiver corresponding to the third data packet; sending a NACK packet to the sender, the NACK packet carrying the current congestion level, and the NACK packet indicating retransmission of the first data packet, the first data packet being the complete data packet corresponding to the third data packet.

[0116] After receiving the third data packet, the network device can determine the path to forward the third data packet, i.e. the target forwarding path, and then determine the current congestion level of the target forwarding path, i.e. the current congestion level. The current congestion level is added to the NACK packet and fed back to the sender.

[0117] In this embodiment of the application, the NACK packet may carry a flag indicating the network congestion level (CI), also known as a retransmit flag. Taking congestion levels including mild, moderate, and severe congestion as an example, the specific congestion level flags in the NACK packet are shown in Table 1.

[0118] Table 1

[0119]

[0120] Table 1 shows that when the congestion level CI value is less than 0.3, it indicates mild congestion, and the retransmission flag (i.e., the congestion level flag) is set to 0, with the corresponding retransmission strategy being immediate retransmission. When the congestion level CI value is between 0.3 and 0.7, it indicates moderate congestion, and the retransmission flag (i.e., the congestion level flag) is set to 1, with the corresponding retransmission strategy being low-latency retransmission, such as retransmitting the data packet after a first delay. When the congestion level CI value is greater than 0.7, it indicates severe congestion, and the retransmission flag (i.e., the congestion level flag) is set to 2, with the corresponding retransmission strategy being long-delay retransmission, such as retransmitting the data packet after a second delay. The sender can determine the retransmission strategy based on the congestion level flag in the NACK packet, and then retransmit the first data packet.

[0121] In the technical solution provided in this application embodiment, after receiving the third data packet, the network device quickly feeds back the congestion level to the sender through a NACK packet. This allows the sender to intelligently decide on the retransmission method based on the perceived congestion level and retransmit the corresponding first data packet. This helps to quickly adjust the retransmission strategy when congestion occurs, thereby optimizing network performance and resource utilization, avoiding further aggravation of network congestion, reducing congestion recovery delay, and further accelerating traffic completion time.

[0122] In some embodiments, the multiple data packets received by the network device include a third data packet and a fourth data packet carrying a congestion flag. In this case, determining the current congestion level of the target forwarding path can be achieved by: determining a first number of third data packets received through the target forwarding path within a preset time window and a second number of fourth data packets received; and performing a weighted summation of the first and second numbers to obtain the current congestion level of the target forwarding path.

[0123] In this embodiment, the length of the preset time window T_W can be set according to actual needs. The receiver maintains a preset time window T_W and tracks the number of third data packets (i.e., trimmed packets) and fourth data packets (i.e., data packets carrying congestion flags) received through the target forwarding path within this preset time window. The number of third data packets tracked is the first quantity, and the number of fourth data packets tracked is the second quantity.

[0124] In some examples, network devices may use the following formula (1) to determine the current level of congestion on the target forwarding path.

[0125] (1)

[0126] In formula (1), CI represents the current congestion level of the target forwarding path. Indicates the second quantity. Indicates the first quantity. , These represent the weights of the second quantity and the first quantity, respectively. Formula (1) is simple to calculate and easy to implement.

[0127] In some examples, network devices may use the following formula (2) to determine the current level of congestion on the target forwarding path.

[0128] (2)

[0129] In formula (2), CI represents the current congestion level of the target forwarding path. Indicates the second quantity. Indicates the first quantity. This indicates the total number of data packets received through the target forwarding path within a preset time window. , These represent the weights of the second quantity and the first quantity, respectively. Formula (2) normalizes the degree of congestion, which facilitates unified management of the entire network and optimizes the overall network performance and resource utilization.

[0130] In some examples, > .For example, The value is 0.1~0.3. The third data packet represents a more severe level of congestion than the fourth data packet. If the first threshold is less than the third threshold, then... > This is more in line with the actual network situation and accurately reflects the degree of network congestion.

[0131] In this embodiment of the application, the receiver may also use other methods to determine the degree of congestion, such as determining the degree of congestion based on the packet receiving rate or round-trip delay, and there is no limitation on this.

[0132] The following is combined Figure 9 The network topology shown Figure 10 The signaling interaction diagram of the sender, network device, and receiver shown herein provides a detailed description of the flow control method provided in the embodiments of this application. Figure 9 In the network shown, senders 1 through 3 are connected to switching device A, which in turn connects to the receiver via the network. Senders 1 through 3 obtain a credit value after one RTT (Round Trip) of establishing a connection with the receiver. The method by which the receiver assigns credit values ​​is described in existing technology and will not be repeated here. The first preset tag is DSCP_FIRST_RTT, the second preset tag is DSCP_NO_FIRST_RTT, and the third preset tag is DSCP_TRIMMED.

[0133] The signaling interaction between sender 1 to sender 3, switching device A (i.e., network device), and receiver may include the following steps:

[0134] Step S1001: The sender sends a data packet to the receiver.

[0135] like Figure 9 As shown, sender 1 transmits data packets P1 to P2 to the receiver at line speed, sender 2 transmits data packet P3 to the receiver at line speed, and sender 3 transmits data packets P4 to P5 to the receiver based on a credit value. Data packets P1 to P3 carry DSCP_FIRST_RTT, meaning they are the first data packets. Data packets P4 to P5 carry DSCP_NO_FIRST_RTT, meaning they are the second data packets. Switching device A receives data packets P1 to P5 transmitted by senders 1 to 3.

[0136] Step S1002: The network device detects the available length of the buffer queue. If the available length of the buffer queue is greater than the packet pruning threshold (i.e., the first threshold), then proceed to step S1003; if the available length of the buffer queue is less than or equal to the packet pruning threshold, but greater than the packet loss threshold (i.e., the second threshold), then proceed to step S1004; if the available length of the buffer queue is less than or equal to the packet loss threshold, then proceed to step S1005.

[0137] In step S1003, the network device writes all received data packets into the buffer queue and then executes step S1006.

[0138] For example, after receiving data packets P1 through P5, switching device A writes all data packets P1 through P5 into a buffer queue, such as... Figure 9 Queue 1 in the table corresponds to method 1.

[0139] In step S1004, the network device trims the first data packet to obtain the third data packet, writes the third data packet and the second data packet into the buffer queue, and then executes step S1006.

[0140] For example, after receiving data packets P1 to P5, switching device A trims data packets P1 to P3 to obtain data packets P11 to P13, and writes data packets P11 to P13 and data packets P4 to P5 into a buffer queue, such as... Figure 9 Queue 1 in the data corresponds to method 2. The DSCP tag in data packets P11 to P13 has been changed to DSCP_TRIMMED.

[0141] In step S1005, the network device discards the first data packet, writes the second data packet into the buffer queue, and then executes step S1006.

[0142] For example, after receiving data packets P1 through P5, switching device A discards data packets P1 through P3 and writes data packets P4 through P5 into a buffer queue, such as... Figure 9 Queue 1 in the table corresponds to method 3.

[0143] Step S1006: The network device detects the available length of the cache queue. If the available length of the cache queue is greater than the ECN threshold (i.e., the third threshold), then proceed to step S1007; if the available length of the cache queue is less than or equal to the ECN threshold, then proceed to step S1008.

[0144] In step S1007, the network device reads the data packets in the buffer queue and sends the data packets to the receiver.

[0145] In step S1008, the network device reads the data packets in the buffer queue, adds an ECN tag to the data packets, and sends the data packets carrying the ECN tag.

[0146] In step S1009, the receiver calculates the number of trimmed packets and congestion packets received within a preset time window, as well as the total number of received data packets, based on the DSCP_TRIMMED and ECN flags in the data packets. Trimmed packets are third-party data packets, i.e., data packets carrying the DSCP_TRIMMED flag, while congestion packets are data packets carrying the ECN flag.

[0147] In step S1010, the receiver determines the current congestion level using formula (2) based on the number of clipped packets and congestion packets and the total number of received data packets.

[0148] In step S1011, if the receiver receives the trimmed packet, it sends a NACK packet to the sender, which includes the current congestion level.

[0149] In this embodiment, if the receiver receives data packets P11 to P13, it sends NACK packet 1 to sender 1, indicating retransmission of data packets P1 to P2, and sends NACK packet 2 to sender 2, indicating retransmission of data packet P3. Simultaneously with sending the NACK packet, the receiver also assigns a credit value to the sender.

[0150] In step S1012, the sender determines the retransmission strategy based on the current congestion level in the received NACK packet.

[0151] In step S1013, the sender retransmits the first data packet according to the determined retransmission strategy.

[0152] For example, if the current congestion level is mild, such as a retransmission flag field value of 0 in the NACK packet, the sender determines the retransmission strategy as immediate retransmission. Taking sender 1 as an example, if it has not yet obtained the credit value allocated by the receiver, sender 1 transmits data packets P1 to P2 at line rate. If it has obtained the credit value allocated by the receiver, sender 1 modifies the DSCP_FIRST_RTT of data packets P1 to P2 to DSCP_NO_FIRST_RTT, obtaining data packets P21 to P22, and immediately transmits data packets P21 to P22 according to the obtained credit value.

[0153] If the current congestion level is moderate, such as a retransmission flag field value of 1 in the NACK packet, the sender determines the retransmission strategy to be low-latency retransmission. Taking sender 1 as an example, if it has not yet obtained the credit value allocated by the receiver, sender 1 waits for a first duration and then sends data packets P1 to P2 at line rate. If it has obtained the credit value allocated by the receiver, sender 1 modifies the DSCP_FIRST_RTT of data packets P1 to P2 to DSCP_NO_FIRST_RTT, obtaining data packets P21 to P22. After waiting for a first duration, it sends data packets P21 to P22 according to the obtained credit value.

[0154] If the current congestion level is severe, such as a retransmission flag value of 2 in the NACK packet, the sender determines the retransmission strategy to be long-delay retransmission. Taking sender 1 as an example, if it has not yet obtained the credit value allocated by the receiver, sender 1 waits for a second duration and then sends data packets P1 to P2 at line rate. If it has obtained the credit value allocated by the receiver, sender 1 modifies the DSCP_FIRST_RTT of data packets P1 to P2 to DSCP_NO_FIRST_RTT, obtaining data packets P21 to P22. After waiting for a second duration, it sends data packets P21 to P22 according to the obtained credit value.

[0155] In this embodiment, several DSCP tags are defined to distinguish data packets during the first RTT and non-first RTT periods, as well as data packets after packet trimming. During the first RTT, the sender does not need to wait to accumulate available credit points and directly sends data packets at line rate to fully utilize idle network bandwidth. When network congestion occurs, network devices use packet trimming technology to prioritize processing data packets sent during the first RTT, thereby ensuring the normal transmission of traffic sent during non-first RTT periods that is already under credit control. In addition, the receiver senses the network congestion status by collecting packet trimming and ECN information, and then quickly feeds back to the sender through NACK packets, allowing the sender to intelligently retransmit data packets (such as immediate / delayed retransmission decisions). This mechanism helps to quickly adjust transmission strategies when congestion occurs, optimizing network performance and resource utilization.

[0156] In this embodiment of the application, if the sender does not receive an acknowledgment (ACK) for the data packet (including the first data packet and the second data packet) within a certain period of time after sending the data packet, it will also retransmit the data packet. For example, if the credit value allocated by the receiver is still not obtained, the first data packet will be retransmitted at line speed; if the credit value allocated by the receiver has been obtained, the second data packet will be sent based on the obtained credit value.

[0157] Corresponding to the above-described flow control method, this application also provides a flow control device, such as... Figure 11 As shown, the device is applied to a network device and includes:

[0158] The receiving module 1101 is used to receive multiple data packets, including a first data packet and a second data packet. The first data packet carries a first preset tag, and the second data packet carries a second preset tag. The first preset tag indicates that the sender has not obtained the credit value assigned by the receiver, and the second preset tag indicates that the sender has obtained the credit value assigned by the receiver.

[0159] The writing module 1102 is used to write the first data packet and the second data packet into the cache queue if the available length of the cache queue in the network device is greater than the first threshold.

[0160] The sending module 1103 is used to send data packets in the buffer queue.

[0161] In some embodiments, the writing module 1102 is further configured to, if the available length of the cache queue is less than or equal to a first threshold, trim the first data packet to obtain a third data packet, write the third data packet and the second data packet into the cache queue, wherein the length of the third data packet is less than the length of the first data packet, and the third data packet carries a third preset tag, the third preset tag indicating that the data packet is a trimmed packet.

[0162] In some embodiments, the writing module 1102 is further configured to discard the first data packet and write the second data packet into the cache queue if the available length of the cache queue is less than or equal to a second threshold, wherein the second threshold is less than the first threshold.

[0163] In some embodiments, the sending module 1103 is specifically used to add a congestion mark to the data packets in the buffer queue if the available length of the buffer queue is less than or equal to a third threshold; and send the data packets carrying the congestion mark.

[0164] In some embodiments, the first preset label, the second preset label, and the third preset label are DSCP labels.

[0165] In the technical solution provided in this application embodiment, the data packets sent by the sender include a first data packet sent when no credit value has been allocated by the receiver, and a second data packet sent when a credit value has been allocated by the receiver. These two types of data packets carry different tags, namely a first preset tag and a second preset tag. That is, the network device can distinguish between the first and second data packets using the first and second preset tags, and thus accurately process these two types of data packets. For example, if the available length of the buffer queue is greater than a first threshold, the first and second data packets are directly written into the buffer queue and then forwarded. When the network device can correctly distinguish between the first and second data packets, the sender can not limit the rate at which the first data packet is sent, i.e., it can send the first data packet at line speed without affecting other traffic already controlled by the credit value (such as the second data packet). In AI large-scale model training scenarios, this application embodiment can fully utilize the network bandwidth when no credit value has been allocated by the receiver (such as the first RTT), reducing traffic completion time and improving the training efficiency of AI large-scale models.

[0166] Corresponding to the above-described flow control method, this application also provides a flow control device, such as... Figure 12 As shown, the device, applied to the sender, includes:

[0167] Module 1201 is used to acquire data packets to be sent;

[0168] The sending module 1202 is used to add a first preset tag to the data packet to be sent if the credit value assigned by the receiver is not obtained, to obtain a first data packet, and send the first data packet at line speed. The first preset tag indicates that the sender has not obtained the credit value assigned by the receiver. If the credit value assigned by the receiver is obtained, the sending module adds a second preset tag to the data packet to be sent, to obtain a second data packet, and sends the second data packet based on the obtained credit value. The second preset tag indicates that the sender has obtained the credit value assigned by the receiver.

[0169] In some embodiments, the flow control device may further include:

[0170] The receiving module is used to receive NACK packets sent by the receiver. The NACK packet carries the current congestion level of the target forwarding path and indicates that the first data packet should be retransmitted. The target forwarding path is the forwarding path from the sender to the receiver of the first data packet.

[0171] The retransmission module is used to retransmit the first data packet using the retransmission strategy corresponding to the current congestion level.

[0172] In some embodiments, the retransmission module is specifically configured to: if the current congestion level is mild congestion, send a first data packet after receiving a NACK packet; if the current congestion level is moderate congestion, send the first data packet after waiting for a first duration after receiving a NACK packet; if the current congestion level is severe congestion, send the first data packet after waiting for a second duration after receiving a NACK packet, wherein the second duration is longer than the first duration.

[0173] In some embodiments, the first preset label and the second preset label are DSCP labels.

[0174] In the technical solution provided in this application embodiment, the data packets sent by the sender include a first data packet sent when no credit value has been allocated by the receiver, and a second data packet sent when a credit value has been allocated by the receiver. These two types of data packets carry different tags, namely a first preset tag and a second preset tag. That is, the network device can distinguish between the first and second data packets using the first and second preset tags, and thus accurately process these two types of data packets. For example, if the available length of the buffer queue is greater than a first threshold, the first and second data packets are directly written into the buffer queue and then forwarded. When the network device can correctly distinguish between the first and second data packets, the sender can not limit the rate at which the first data packet is sent, i.e., it can send the first data packet at line speed without affecting other traffic already controlled by the credit value (such as the second data packet). In AI large-scale model training scenarios, this application embodiment can fully utilize the network bandwidth when no credit value has been allocated by the receiver (such as the first RTT), reducing traffic completion time and improving the training efficiency of AI large-scale models.

[0175] Corresponding to the above-described flow control method, this application also provides a flow control device, such as... Figure 13 As shown, the device, applied to the receiver, includes:

[0176] The receiving module 1301 is used to receive multiple data packets, which are data packets forwarded by the network device according to the flow control method applied to the network device;

[0177] Processing module 1302 is used to process multiple data packets.

[0178] In some embodiments, the plurality of data packets include a third data packet, the third data packet carrying a third preset tag, the third preset tag indicating that the data packet is a clipped packet;

[0179] The processing module 1302 is specifically used to determine the current congestion level of the target forwarding path, which is the forwarding path from the sender to the receiver corresponding to the third data packet; and to send a NACK packet to the sender, which carries the current congestion level and indicates that the first data packet is to be retransmitted, which is the complete data packet corresponding to the third data packet.

[0180] In some embodiments, the multiple data packets include a third data packet and a fourth data packet carrying a congestion flag; the processing module 1302 is specifically used to determine a first number of third data packets received through the target forwarding path within a preset time window and a second number of fourth data packets received; and to perform a weighted summation of the first number and the second number to obtain the current congestion level of the target forwarding path.

[0181] In some embodiments, the third preset label is a DSCP label.

[0182] In the technical solution provided in this application embodiment, the data packets sent by the sender include a first data packet sent when no credit value has been allocated by the receiver, and a second data packet sent when a credit value has been allocated by the receiver. These two types of data packets carry different tags, namely a first preset tag and a second preset tag. That is, the network device can distinguish between the first and second data packets using the first and second preset tags, and thus accurately process these two types of data packets. For example, if the available length of the buffer queue is greater than a first threshold, the first and second data packets are directly written into the buffer queue and then forwarded. When the network device can correctly distinguish between the first and second data packets, the sender can not limit the rate at which the first data packet is sent, i.e., it can send the first data packet at line speed without affecting other traffic already controlled by the credit value (such as the second data packet). In AI large-scale model training scenarios, this application embodiment can fully utilize the network bandwidth when no credit value has been allocated by the receiver (such as the first RTT), reducing traffic completion time and improving the training efficiency of AI large-scale models.

[0183] This application also provides an electronic device, such as... Figure 14 As shown, the system includes a processor 1401, a communication interface 1402, a memory 1403, and a communication bus 1404. The processor 1401, communication interface 1402, and memory 1403 communicate with each other via the communication bus 1404. The memory 1403 stores computer programs. When the processor 1401 executes the program stored in the memory 1403, it implements any of the flow control methods applied to the sender, any of the flow control methods applied to the network device, or any of the flow control methods applied to the receiver.

[0184] The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0185] The communication interface is used for communication between the aforementioned electronic devices and other devices.

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

[0187] 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.

[0188] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements any of the above-described flow control methods applied to the sender, or any of the above-described flow control methods applied to the network device, or any of the above-described flow control methods applied to the receiver.

[0189] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the above-described flow control methods applied to the sender, or to execute any of the above-described flow control methods applied to the network device, or to execute any of the above-described flow control methods applied to the receiver.

[0190] 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 as 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)).

[0191] 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.

[0192] 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, electronic devices, storage media, and program products are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0193] 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 flow control method, characterized in that, Applied to network devices, the method includes: Receive multiple data packets, including a first data packet and a second data packet. The first data packet carries a first preset tag, and the second data packet carries a second preset tag. The first preset tag indicates that the sender has not obtained the credit value assigned by the receiver, and the second preset tag indicates that the sender has obtained the credit value assigned by the receiver. If the available length of the cache queue in the network device is greater than the first threshold, then the first data packet and the second data packet are written into the cache queue; Send the data packets in the buffer queue.

2. The method according to claim 1, characterized in that, The method further includes: If the available length of the cache queue is less than or equal to the first threshold, the first data packet is trimmed to obtain a third data packet. The third data packet and the second data packet are written into the cache queue. The length of the third data packet is less than the length of the first data packet, and the third data packet carries a third preset tag, which indicates that the data packet is a trimmed packet.

3. The method according to claim 1 or 2, characterized in that, The method further includes: If the available length of the cache queue is less than or equal to the second threshold, the first data packet is discarded and the second data packet is written into the cache queue, where the second threshold is less than the first threshold.

4. The method according to claim 1 or 2, characterized in that, The step of sending the data packets in the buffer queue includes: If the available length of the buffer queue is less than or equal to the third threshold, add a congestion flag to the data packets in the buffer queue; and send data packets carrying the congestion flag.

5. The method according to claim 2, characterized in that, The first preset label, the second preset label, and the third preset label are Differential Service Code Point (DSCP) labels.

6. A flow control method, characterized in that, Applied to the sender, the method includes: Get the data packet to be sent; If the sender does not obtain the credit value assigned by the receiver, a first preset tag is added to the data packet to be sent to obtain a first data packet. The first data packet is then sent at line speed. The first preset tag indicates that the sender has not obtained the credit value assigned by the receiver. If the credit value assigned by the receiver has been obtained, a second preset tag is added to the data packet to be sent to obtain a second data packet. The second data packet is sent based on the obtained credit value. The second preset tag indicates that the sender has obtained the credit value assigned by the receiver.

7. The method according to claim 6, characterized in that, The method further includes: Receive a negative acknowledgment (NACK) packet sent by the receiver. The NACK packet carries the current congestion level of the target forwarding path and indicates that the first data packet should be retransmitted. The target forwarding path is the forwarding path from the sender to the receiver of the first data packet. The first data packet is retransmitted using the retransmission strategy corresponding to the current congestion level.

8. The method according to claim 7, characterized in that, The step of retransmitting the first data packet using the retransmission strategy corresponding to the current congestion level includes: If the current congestion level is mild, then after receiving the NACK packet, the first data packet is sent; If the current congestion level is moderate congestion, then after receiving the NACK packet, wait for a first period of time before sending the first data packet; If the current congestion level is severe congestion, then after receiving the NACK packet, wait for a second duration and then send the first data packet, where the second duration is longer than the first duration.

9. The method according to any one of claims 6-8, characterized in that, The first preset tag and the second preset tag are DSCP tags.

10. A flow control method, characterized in that, Applied to the receiver, the method includes: Receive multiple data packets, wherein the multiple data packets are data packets forwarded by the network device according to any one of claims 1-4; Process the multiple data packets.

11. The method according to claim 10, characterized in that, The plurality of data packets includes a third data packet, the third data packet carrying a third preset tag, the third preset tag indicating that the data packet is a cropped packet; The steps for processing the plurality of data packets include: Determine the current congestion level of the target forwarding path, where the target forwarding path is the forwarding path from the sender to the receiver corresponding to the third data packet; A NACK packet is sent to the sender, the NACK packet carrying the current congestion level and indicating that the first data packet is to be retransmitted, the first data packet being the complete data packet corresponding to the third data packet.

12. The method according to claim 11, characterized in that, The plurality of data packets includes a third data packet and a fourth data packet carrying a congestion flag; the step of determining the current congestion level of the target forwarding path includes: Determine the first number of third data packets received through the target forwarding path and the second number of fourth data packets received within a preset time window; The current congestion level of the target forwarding path is obtained by weighted summation of the first quantity and the second quantity.

13. The method according to claim 11 or 12, characterized in that, The third preset tag is the DSCP tag.

14. A flow control device, characterized in that, Applied to network devices, the device includes: A receiving module is used to receive multiple data packets, including a first data packet and a second data packet. The first data packet carries a first preset tag, and the second data packet carries a second preset tag. The first preset tag indicates that the sender has not obtained the credit value assigned by the receiver, and the second preset tag indicates that the sender has obtained the credit value assigned by the receiver. The writing module is configured to write the first data packet and the second data packet into the cache queue if the available length of the cache queue in the network device is greater than a first threshold. The sending module is used to send data packets from the buffer queue.

15. A flow control device, characterized in that, Applied to the sender, the device includes: The acquisition module is used to acquire data packets to be sent. The sending module is configured to, if it has not obtained a credit value assigned by the receiver, add a first preset tag to the data packet to be sent to obtain a first data packet, and send the first data packet at line speed, wherein the first preset tag indicates that the sender has not obtained a credit value assigned by the receiver; if it has obtained a credit value assigned by the receiver, add a second preset tag to the data packet to be sent to obtain a second data packet, and send the second data packet based on the obtained credit value, wherein the second preset tag indicates that the sender has obtained a credit value assigned by the receiver.

16. A flow control device, characterized in that, Applied to the receiver, the device includes: A receiving module is configured to receive multiple data packets, wherein the multiple data packets are data packets forwarded by the network device according to any one of claims 1-4; A processing module is used to process the multiple data packets.

17. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-13.

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

Citation Information

Patent Citations

  • Data transmission method, computing device, network device and data transmission system

    CN110661723A

  • Data congestion control method and device, storage medium and computer equipment

    CN116827868A

  • Data acquisition method and device based on industrial internet identification analysis system

    CN120152052A

  • Congestion control method and apparatus, and electronic device

    CN120200973A

  • Data transmission method and data transmission system

    WO2024061042A1