Congestion marking method, apparatus and device, and computer readable storage medium
By judging the occupancy status of the message receiving queue and the results of entering the sending queue, congested flows are accurately marked, solving the problem of mismarking in the existing technology and improving the processing accuracy and efficiency of network devices.
Patent Information
- Application Number
- CN202410539283.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies cannot accurately distinguish between congested and non-congested flows when network devices experience congestion, leading to the mislabeling of non-congested flow packets and affecting network performance.
By determining the occupancy information of the message receiving queue and combining it with the result of the message entering the sending queue, we can accurately determine whether the message is a congested flow and add a congestion mark to it when specific conditions are met.
It achieves accurate labeling of congested flows, reduces mislabeling of non-congested flows, and improves the processing accuracy and efficiency of network devices.
Smart Images

Figure CN120881001A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to congestion marking methods, apparatus, devices and computer-readable storage media. Background Technology
[0002] In the field of communication technology, if network devices experience congestion, they will add a mark to the packets to be sent, so that other devices in the network can process the packets carrying the mark as packets of the congestion flow.
[0003] In related technologies, when network devices experience congestion, they randomly add tags to packets to be sent based on the accumulation of packets in the packet sending queue. This can cause packets from non-congested flows to be tagged and processed as if they were from congested flows, resulting in inaccurate packet processing. Summary of the Invention
[0004] This application provides a congestion marking method, apparatus, device, and computer-readable storage medium to accurately mark congestion in packets. The technical solution is as follows:
[0005] In a first aspect, a congestion marking method is provided. The method is applied to a first device, which includes a message receiving queue and a message sending queue. The method includes: if a first message fails to enter the message sending queue from the message receiving queue, determining first occupancy information of the message receiving queue, wherein the first message is the message with the earliest reception time in the message receiving queue; and based on the first occupancy information satisfying a first condition, obtaining a first message carrying a first mark, wherein the first message carrying the first mark is used to send to a second device, wherein the first mark indicates that the first message is a message of a congested flow, and the first condition is used to indicate that there is congestion in the message receiving queue.
[0006] In one possible implementation, the first occupancy information includes at least one of the following: the queue depth of the packet receiving queue, the size of the space already occupied in the packet receiving queue, or the occupancy rate of the space used by the packet receiving queue for buffering packets. The queue depth of the packet receiving queue refers to the number of packets (packetnumber, PN) buffered in the packet receiving queue. The first occupancy information satisfying the first condition can be one or more of the following: the queue depth of the packet receiving queue is greater than or equal to a depth threshold, the size of the space already occupied in the packet receiving queue is greater than or equal to an occupancy threshold, or the occupancy rate of the space used by the packet receiving queue for buffering packets is greater than or equal to an occupancy rate threshold.
[0007] In this application, by determining whether the first occupancy information meets the first condition, it is determined whether there is congestion in the message receiving queue. By comprehensively considering the result of the first message entering the message sending queue and whether there is congestion in the message receiving queue, it is accurately determined whether the first message is a message of a congested flow. If the first message is a message of a congested flow, the first message carrying the first tag is obtained, thereby realizing the accurate tagging of messages of a congested flow.
[0008] In one possible implementation, there are multiple message receiving queues, and the number of these queues exceeds the number of messages allowed to enter a message sending queue at a time. Before determining the first occupancy information of a message receiving queue in the event that the first message fails to enter the message sending queue from the message receiving queue, the method further includes: obtaining indication information, which indicates the messages that should enter the message sending queue; if the first message is not indicated by the indication information, it is determined that the first message failed to enter the message sending queue. Based on the indication information, it is possible to accurately determine whether the first message was allowed to enter the message sending queue, thus accurately determining the result of the first message entering the message sending queue.
[0009] In one possible implementation, the indication information includes queue information of the message receiving queue to which the message entering the message sending queue belongs. Before determining that the first message failed to enter the message sending queue if the message indicated by the indication information does not include the first message, the following further applies: if the queue information does not include information about the message receiving queue to which the first message belongs, it is determined that the message indicated by the indication information does not include the first message. By determining whether the queue information includes information about the message receiving queue to which the first message belongs, it is possible to accurately and efficiently determine whether the first message can successfully enter the message sending queue.
[0010] In one possible implementation, before determining the first occupancy information of the message receiving queue in the case that the first message fails to enter the message sending queue from the message receiving queue, the method further includes: obtaining the second occupancy information of the message sending queue; and determining that the first message failed to enter the message sending queue based on the second occupancy information satisfying a second condition, where the second condition indicates that the unoccupied remaining space of the message sending queue is insufficient. Since the second condition indicates that the unoccupied remaining space of the message sending queue is insufficient, the second occupancy information satisfying the second condition means that the current remaining space of the message sending queue is insufficient to receive the first message, thus confirming that the first message failed to enter the message sending queue. This process is simple and efficient.
[0011] In one possible implementation, the second occupancy information includes the size of the unoccupied remaining space in the message sending queue. Before determining that the first message failed to enter the message sending queue based on the second occupancy information satisfying the second condition, the method further includes: determining that the second occupancy information satisfies the second condition based on the size of the remaining space being less than the size of the first message. When the size of the remaining space in the message sending queue is less than the size of the first message, it indicates that the message sending queue is unlikely to allow the first message to enter, thus it can be determined that the second occupancy information satisfies the second condition, thereby accurately determining that the first message failed to enter the message sending queue.
[0012] In one possible implementation, obtaining a first packet carrying a first tag based on the first occupancy information satisfying a first condition includes: obtaining a first packet carrying a first tag based on the first occupancy information satisfying the first condition and the first packet not including a second tag, wherein the second tag indicates that the first packet is a packet of a congested flow. If the first occupancy information satisfies the first condition, it represents that the first packet is a packet of a congested flow, and if the first packet does not include a second tag indicating that the first packet is a packet of a congested flow, the first device can directly obtain the first packet carrying the first tag, avoiding missing the tagging of packets of a congested flow. Optionally, the acquisition of a first packet carrying a first tag can be achieved by adding a first tag to the first packet.
[0013] In one possible implementation, obtaining a first message carrying a first tag based on the first occupancy information satisfying a first condition includes: if the first occupancy information satisfies the first condition and the first message includes a second tag satisfying a third condition, replacing the second tag with the first tag to obtain a first message carrying the first tag. The third condition is used to indicate the tag replacement, and the second tag indicates that the first message is a congested flow message. If the second tag satisfies the third condition indicating the tag replacement, then replacing the second tag with the first tag can ensure the accuracy of the tag carried by the first message.
[0014] In one possible implementation, before obtaining the first message carrying the first tag based on the first occupancy information satisfying the first condition, the method further includes: determining the congestion level of the message receiving queue based on the first occupancy information; and determining the first tag based on the congestion level, wherein the first tag indicates the congestion level. In this application, the first tag can not only indicate that the first message is a message in a congested flow, but also indicate the congestion level of the message receiving queue to which the first message belongs, making the congestion tag result more accurate and comprehensive.
[0015] In one possible implementation, after obtaining a first message carrying a first tag based on the first occupancy information satisfying a first condition, the method further includes: deleting the third tag from the second message based on the existence of a second message carrying a third tag in the message receiving queue; the third tag indicating that the second message is a congested flow message; and marking the second message as congested if it is the earliest received message in the message receiving queue. By deleting the third tag from the second message and re-marking the second message as congested if it is the earliest received message in the message receiving queue, the method re-evaluates whether the second message is a congested flow message, thereby avoiding the second message carrying an incorrect third tag, ensuring the accuracy of congestion marking of the second message, and reducing the number of incorrectly marked messages.
[0016] Secondly, a congestion control device is provided, which is applied to a first device, the first device including a message receiving queue and a message sending queue. The device includes: a determining module, configured to determine first occupancy information of the message receiving queue when the first message fails to enter the message sending queue from the message receiving queue, wherein the first message is the message with the earliest reception time in the message receiving queue; and an obtaining module, configured to obtain a first message carrying a first tag based on the first occupancy information satisfying a first condition, wherein the first message carrying the first tag is used to send to a second device, the first tag indicating that the first message is a message of a congested flow, and the first condition indicating that there is congestion in the message receiving queue.
[0017] In one possible implementation, there are multiple message receiving queues, and the number of multiple message receiving queues is greater than the number of messages allowed to enter the message sending queue at one time; the acquisition module is also used to acquire indication information, which is used to indicate the messages entering the message sending queue; the determination module is also used to determine that the first message failed to enter the message sending queue if the messages indicated by the indication information do not include the first message.
[0018] In one possible implementation, the indication information includes queue information of the message receiving queue to which the message entering the message sending queue belongs; the determining module is further configured to determine that the message indicated by the indication information does not include the first message if the queue information does not include information of the message receiving queue to which the first message belongs.
[0019] In one possible implementation, the acquisition module is further configured to acquire second occupancy information of the message sending queue; the determination module is further configured to determine, based on the second occupancy information satisfying a second condition, that the first message failed to enter the message sending queue, and the second condition is used to indicate that the remaining unoccupied space of the message sending queue is insufficient.
[0020] In one possible implementation, the second occupancy information includes the size of the remaining unoccupied space in the message sending queue; the determining module is further configured to determine that the second occupancy information satisfies the second condition based on the fact that the size of the remaining space is less than the size of the first message.
[0021] In one possible implementation, the acquisition module is configured to acquire a first message carrying a first tag based on the first occupancy information satisfying a first condition and the first message not including a second tag, wherein the second tag indicates that the first message is a message of a congested flow.
[0022] In one possible implementation, the acquisition module is used to replace the second tag with the first tag based on the first occupancy information satisfying the first condition and the first message including the second tag satisfying the third condition, thereby obtaining a first message carrying the first tag. The third condition is used to indicate the tag replacement, and the second tag indicates that the first message is a message of a congested flow.
[0023] In one possible implementation, the determining module is further configured to determine the congestion level of the message receiving queue based on the first occupancy information; and to determine a first flag based on the congestion level, the first flag indicating the congestion level.
[0024] In one possible implementation, the apparatus further includes a marking module. The marking module is used to delete the third mark from the second message based on the existence of a second message carrying a third mark in the message receiving queue. The third mark indicates that the second message is a message of congestion flow. If the second message is the message with the earliest reception time in the message receiving queue, the second message is marked as congested.
[0025] Thirdly, a congestion marking device is provided, the device including a processor coupled to a memory; the memory stores at least one instruction, which is loaded and executed by the processor to enable the congestion marking device to implement the congestion marking method as described in the first aspect or any possible implementation thereof.
[0026] Fourthly, a computer program (product) is provided, comprising: computer program code, which, when executed by a computer, causes the computer to perform the congestion marking method in the first aspect or any possible implementation thereof.
[0027] Fifthly, a computer-readable storage medium is provided that stores a program or instructions, wherein when the program or instructions are run on a computer, the congestion marking method in the first aspect or any possible implementation thereof is executed.
[0028] In a sixth aspect, a congestion marking system is provided, the system comprising a first device, a second device, and a third device; the third device is configured to send a first message to the first device; the first device is configured to receive the first message and implement the congestion marking method as described in the first aspect or any possible implementation thereof; and the second device is configured to receive the first message carrying a first mark sent by the first device.
[0029] In a seventh aspect, a chip is provided, including a processor for retrieving and executing instructions stored in a memory, causing a computer equipped with the chip to execute the congestion marking method in the first aspect or any possible implementation thereof.
[0030] Eighthly, another chip is provided, comprising: an input interface, an output interface, a processor, and a memory, wherein the input interface, the output interface, the processor, and the memory are connected by an internal connection path, the processor is used to execute code in the memory, and when the code is executed, a computer with the chip installed executes the congestion marking method in the first aspect or any possible implementation thereof.
[0031] It should be understood that the beneficial effects of the technical solutions and corresponding possible implementations of the second to eighth aspects of this application can be found in the technical effects of the first aspect or any possible implementation of the first aspect, and will not be repeated here. Attached Figure Description
[0032] Figure 1 A schematic diagram illustrating a congestion control process for related technologies;
[0033] Figure 2 A schematic diagram illustrating the possible values for an explicit congestion notification field, provided for related technologies;
[0034] Figure 3 A schematic diagram illustrating the process of a weighted random early detection algorithm for related technologies;
[0035] Figure 4 A schematic diagram illustrating the results of a weighted random early detection algorithm provided for related technologies;
[0036] Figure 5 A schematic diagram illustrating an implementation scenario provided in this application.
[0037] Figure 6 A flowchart illustrating a congestion marking method provided in an embodiment of this application;
[0038] Figure 7 A schematic diagram of an arbitration process provided for an embodiment of this application;
[0039] Figure 8 A schematic diagram of another arbitration process provided for an embodiment of this application;
[0040] Figure 9 This application provides another schematic diagram of an arbitration process.
[0041] Figure 10 A schematic diagram illustrating the process of a message entering a message sending queue, provided in an embodiment of this application;
[0042] Figure 11 A schematic diagram illustrating another process by which a message enters the message sending queue, as provided in an embodiment of this application;
[0043] Figure 12 A flowchart illustrating a re-evaluation mode provided in an embodiment of this application;
[0044] Figure 13 A schematic diagram of a congestion marking process provided in an embodiment of this application;
[0045] Figure 14 A schematic diagram illustrating another congestion marking process provided in this application embodiment;
[0046] Figure 15 A schematic diagram illustrating yet another congestion marking process provided in this application embodiment;
[0047] Figure 16 A schematic diagram of a congestion marking process provided for related technologies;
[0048] Figure 17 A schematic diagram illustrating another congestion labeling process provided for related technologies;
[0049] Figure 18 This is a schematic diagram of the structure of a congestion marking device provided in an embodiment of this application;
[0050] Figure 19 A schematic diagram of a congestion marking device provided in this application embodiment;
[0051] Figure 20 This is a schematic diagram of another congestion marking device provided in an embodiment of this application. Detailed Implementation
[0052] The terminology used in the implementation section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application.
[0053] In the field of communication technology, congestion may occur when devices forward data streams. For example, when multiple data streams simultaneously request access to the same outgoing port within the same device, and the sending rate of one or more data streams is too high, or when the device cannot process data streams at the arrival rate, the device becomes overloaded, resulting in congestion. For instance, due to the head-of-line blocking (HoLB) effect, when packets at the head of the device's ingress queue are blocked, these packets prevent other buffered packets from advancing, causing congestion and reducing the device's efficiency in forwarding data packets.
[0054] Since device congestion poses a serious threat to network operation, congestion control (CC) is commonly implemented in the communication technology field to prevent the impact of device congestion on the overall network performance. Congestion control is a key technology in network transmission used to prevent network congestion and can be implemented based on flow control (FC) technology. Flow control is a technique used to regulate the data flow transmitted between different devices in a network. Flow control ensures that the sending end (or source end) does not send excessively large data flows to the receiving end at an excessively high rate, avoiding overload of the receiving end and thus preventing congestion at the receiving end, preventing packet loss and network performance degradation. Therefore, by adjusting the rate at which the sending end injects data into the network according to the network congestion status through flow control technology, network congestion can be alleviated or avoided.
[0055] See Figure 1 This diagram illustrates a congestion control process provided by related technologies, which occurs within a data center network (DCN). The congestion control loop includes a reaction point (RP), a congestion point (CP), and a notification point (NP). The reaction point is the primary deployment location for the congestion control algorithm, used to regulate the data flow transmission rate within the network. The congestion point is used to detect, mark, or notify whether congestion has occurred. The notification point is used to notify the reaction point of congestion-related information, providing feedback so that the reaction point can cooperate to complete the full congestion control process based on this information.
[0056] exist Figure 1In the congestion control flowchart shown, the response point is the sender, the congestion point is the switch, and the notification point is the receiver. The sender transmits a data stream to the switch via its sender network interface controller (Sender NIC). The switch receives the data stream and forwards it to the receiver. The receiver receives the forwarded data stream via its receiver network interface controller (Receiver NIC) and processes it to implement the corresponding service. With the widespread adoption of smart network interface cards (NICs), the congestion control algorithm on the endpoint can be flexibly customized.
[0057] If the data stream sent by the sending end exceeds the data stream forwarding rate of the switch, it will cause data stream backlog on the switch. When the switch performs congestion detection, it will detect this backlog and determine that congestion has occurred. The switch will then mark the data streams as congested. When the receiving end receives the marked data streams, it will also determine that the switch is congested and will send this information back to the sending end. After receiving this feedback, the sending end will reduce the amount of data streams sent to the congested switch, thereby reducing the amount of data streams received by the switch. This allows the switch to process and forward the backlogged data streams, ending the congestion and completing the entire congestion control process.
[0058] In this context, switches can use explicit congestion notification (ECN) technology to add ECN tags indicating congestion to the data stream, thereby transmitting the network congestion status to the sender for congestion control. ECN technology is an important congestion notification technique in lossless DCN, and many congestion control protocols and algorithms rely on ECN technology.
[0059] The ECN field is a 2-bit field defined in the Internet Protocol (IP) header. Its value indicates whether the packet is experiencing congestion. Packet congestion means the packet is received and transmitted by a congested device. Some related technologies (such as photonic congestion notification (PCN)) improve the accuracy and effectiveness of congestion labeling by optimizing the ECN marking algorithm. Other related technologies (such as transmission congestion detection (TCD)) modify the ECN field definition, increasing the number of possible definitions from three to four, allowing for finer control in conjunction with the endpoint.
[0060] For example, see Figure 2 The diagram illustrates a possible value for the ECN field provided by related technologies. If the ECN field value is 00, it indicates that the device forwarding the packet does not support the ECN tag (not-ECN-capabletransport, Not-ECT); if the ECN field value is 0, it indicates that the device forwarding the packet supports the ECN tag (ECT), and the ECN tag type is 1, but the device forwarding the packet is not congested; if the ECN field value is 10, it indicates that the device forwarding the packet supports the ECN tag (ECT), and the ECN tag type is 0, but the device forwarding the packet is congested; if the ECN field value is 11, it indicates that the packet experienced congestion (CE), meaning the device forwarding the packet is congested. For detailed information on ECN, please refer to the relevant draft RFC 3168 published by the Internet Engineering Task Force (IETF), which will not be elaborated here.
[0061] ECN marking can trigger subsequent congestion control procedures, such as the receiver sending a notification packet (e.g., a congestion notification packet, CNP) to the sender. The sender, acting as a congestion control response point, then adjusts the transmission rate of the data stream corresponding to the ECN-marked packet. However, in scenarios with multiple data streams, the data stream that actually causes congestion (the congested stream) is tagged with other data streams using the same ECN marking algorithm and rules. This results in some non-congested stream packets being tagged, becoming victim streams. Regardless of whether the ECN-marked data stream is a congested or victim stream, the sender of the tagged data stream, upon receiving the congestion notification, will adjust the transmission rate of the data stream, thus affecting the transmission time of the complete data stream and causing a significant performance degradation of the complete data stream to which the victim stream belongs.
[0062] Therefore, the ability of a device to distinguish between congested and victimized flows is crucial for network performance. Related technology one provides a common algorithm for adding ECN tags: the Weighted Random Early Detection (WRED) algorithm. The WRED algorithm tags packets in the egress queue according to the probability of the packet backlog. The WRED algorithm sets three parameters: a low waterline (represented by k_min), a high waterline (represented by k_max), and the probability of adding a tag corresponding to the high waterline (represented by P_max). During the process of adding ECN tags based on the WRED algorithm, the device calculates the average queue depth of the egress queue. When the average queue depth is less than k_min, the device is considered not congested, and no packets in the egress queue are tagged. When the average queue depth is between k_min and k_max, the device is considered congested, and the probability of tagging packets in the egress queue increases linearly, with a probability of 0 for k_min and a probability of P_max for k_max. When the average queue depth is greater than k_max, the device is considered severely congested, and all packets in the egress queue are tagged. The probability of tagging a packet can also be called the discard probability.
[0063] For example, see Figure 3 and Figure 4 The diagrams show a process diagram and a result diagram of a WRED algorithm provided by related technology one. Figure 3 In this configuration, k_min is set to 20, k_max to 45, and P_max to 25%. The device counts the queue depth of the exit queue. When the average queue depth of the device's exit queue is between 0 and 20 (e.g., ...), ... Figure 4The device does not mark packets in the egress queue (based on the queue depth indicated by the 'a' message); when the average queue depth is between 20 and 45 (e.g., ...). Figure 4 The average queue depth (indicated by the queue depth indicated in the b message) reaches a set threshold. When this threshold is reached, the device randomly marks the messages in the outgoing queue. The probability of random marking increases linearly from 0 to 25%. When the average queue depth exceeds 45 (e.g., ...), the device... Figure 4 The queue depth indicated by the C message is used to mark all messages in the egress queue (fullmark).
[0064] However, when congestion occurs in a device, the relevant technology randomly or all packets are tagged. This tagging method cannot distinguish between congested flows and victim flows, which will lead to a decrease in the performance of victim flows.
[0065] This application provides a congestion marking method that accurately marks congestion in congested flows by combining the occupancy status of the message receiving queue to which the message belongs with the status of the message entering the message sending queue, thereby reducing the possibility of mismarking of victim flows.
[0066] See Figure 5 This diagram illustrates an implementation scenario provided by an embodiment of this application, which is a data center network. In the data center network, from top to bottom, the layers are: core switch, aggregate switch, top of rack switch (ToR switch), and server. A rack includes one or more servers and a top of rack switch.
[0067] A core switch can connect to one or more aggregation switches via wired or wireless connections. If the core switch and aggregation switches are connected via wired connections, the wired connection can be implemented using N (an integer greater than or equal to 1) lines, each with a bandwidth that can be the same or different. For example, if the core switch and aggregation switches can be connected via N lines with a bandwidth of 10 gigabits per second (Gbps), then the total bandwidth between the core switch and aggregation switches is N x 10 Gbps.
[0068] An aggregation switch can connect to one or more top-of-rack switches via wired or wireless connections. If the aggregation switch and the top-of-rack switch are connected via a wired connection, the bandwidth of that wired connection indicates the maximum number of data streams per second that can be transmitted between the aggregation switch and the top-of-rack switch. For example, if the bandwidth between the aggregation switch and the top-of-rack switch is 10 Gbps, then the maximum number of data streams per second that can be transmitted between the aggregation switch and the top-of-rack switch is 10 gigabits (Gb).
[0069] In a data center network, if the data flow rate between any two switches exceeds the bandwidth between those two switches, it may cause congestion in one or both of those switches. For example, if the bandwidth between the top-of-rack switch and the aggregation switch is 10Gbps, and the data flow rate sent from the top-of-rack switch to the aggregation switch exceeds 10Gbps, it may cause congestion in the aggregation switch.
[0070] Congestion can occur at any switch in a data center network, therefore the congestion marking method provided in this application can be applied to any switch in a data center network.
[0071] The above descriptions of implementation scenarios are merely examples. Besides the scenarios described above, the congestion marking method provided in this application can also be applied to communication networks or non-fixed networks outside of data center networks. In this application embodiment, the congestion marking method is applied to a first device, which can be any network element device in the communication network that has packet forwarding capabilities and supports the identification and marking of congestion flows, such as... Figure 1 The various switches in the system. The first device can be a traditional congestion point or an enhanced congestion point (ECP). The first device includes a packet receiving queue and a packet sending queue. The packet receiving queue, also known as the ingress queue, is used to buffer packets received by the first device. The packet sending queue, also known as the egress queue, is used to buffer packets to be sent by the first device. In this embodiment, the number of packet sending queues and packet receiving queues can be one or more.
[0072] Since ports on a device can be used for both sending and receiving messages, a port can be either an ingress port or an egress port, and a port can correspond to both a message receiving queue and a message sending queue. In this embodiment, ports are distinguished as ingress ports and egress ports according to the transmission direction of the messages, and an example is given where an ingress port corresponds to a message receiving queue and an egress port corresponds to a message sending queue.
[0073] See Figure 6The diagram illustrates a flow chart of a congestion marking method provided in an embodiment of this application. This method can be applied to... Figure 5 In the implementation scenario shown, the method includes, but is not limited to, S601 to S602 below.
[0074] S601, if the first message fails to enter the message sending queue from the message receiving queue, determine the first occupancy information of the message receiving queue, where the first message is the message with the earliest reception time in the message receiving queue.
[0075] After the first device receives each packet through the ingress port, it buffers each packet in the corresponding packet receive queue. The packet receive queue can buffer multiple received packets, which are ordered according to their reception time. When any packet becomes the earliest received packet in the receive queue, it reaches the head of the queue and attempts to enter the packet send queue. The packet send queue is a queue of packets to be sent buffered by the first device, and different packet send queues correspond to different egress ports on the first device.
[0076] When any message becomes the earliest received message in the message receiving queue, the first device performs congestion detection on the message according to the congestion marking method provided in this application embodiment to determine whether the message is a message in a congested flow, thereby accurately marking the message as congested. In this application embodiment, the process of the congestion marking method is described using the example of the earliest received message in the message receiving queue being the first message. The first message can be any message received by the first device.
[0077] When the first message attempts to enter the message sending queue, it may fail to do so. In one possible implementation, the reason for the first message's failure to enter the message sending queue is related to the architecture of the first device; that is, different architectures of the first device will result in different reasons for the failure. Optionally, the architecture of the first device may include a combined input & output queue (CIOQ) architecture, an output queue (OQ) architecture, or an input queue (IQ) architecture. Below, we will use cases 11 and 12 as examples to explain the reasons for the first message's failure to enter the message sending queue under different architectures.
[0078] Case 11: The architecture of the first device is CIOQ architecture.
[0079] In the CIOQ architecture, the first device typically has multiple message receive queues and one or more message send queues. However, messages from multiple receive queues may enter the same send queue, creating a "many-to-one" traffic pattern. The number of messages allowed to enter a send queue at one time (or within one cycle) is constrained by the hardware design cost and complexity of the first device under the CIOQ architecture. The more messages a send queue can accept at one time, the higher the required hardware design cost and the greater the implementation complexity of the first device.
[0080] Therefore, in the CIOQ architecture, the first device typically controls the number of packets entering the same packet sending queue at a time to control the cost and complexity of its hardware design. When the number of multiple packet receiving queues exceeds the number of packets allowed to enter a packet sending queue at one time, the first device can obtain indication information. If the packet indicated by the indication information does not include the first packet, it can be determined that the first packet failed to enter the packet sending queue. The indication information is used to indicate the packets entering the packet sending queue, and the indication information obtained by the first device each time can be the same or different.
[0081] This application does not limit the content of the indication information. For example, the indication information may include characteristic information of the packets allowed to enter the packet sending queue. The characteristic information may be the packet type, packet size, or source IP address in the packet, etc. Alternatively, the indication information may also include queue information of the packet receiving queue to which the packets allowed to enter the packet sending queue belong. The queue information may be, for example, the sequence number or starting address of the packet receiving queue.
[0082] If the indication information includes characteristic information of messages allowed to enter the message sending queue, and the characteristic information of the first message does not match the characteristic information included in the indication information, then it can be determined that the message indicated by the indication information does not include the first message. If the indication information includes queue information of the message receiving queue to which the message allowed to enter the message sending queue belongs, and the queue information does not include information about the message receiving queue to which the first message belongs, then it can be determined that the message indicated by the indication information does not include the first message. The fact that the message indicated by the indication information does not include the first message means that the message sending queue does not allow the first message to enter this time, thus it can be determined that the first message failed to enter the message sending queue.
[0083] In one possible implementation, queue information can be determined based on a speedup parameter. In the CIOQ architecture, the speedup parameter determines the number of receive queues to which a packet entering the same send queue belongs within the same period. For example, if the speedup parameter is 1, only one packet at the head of a receive queue can enter a send queue within the same period. If the speedup parameter is 2, packets at the head of two receive queues can enter the same send queue within the same period. The value of the speedup parameter can be adjusted based on the rate at which the first device receives and sends packets. A higher speedup results in a larger number of packets entering the same send queue within the same period, leading to higher packet forwarding efficiency for the first device and thus higher overall network throughput.
[0084] The speedup ratio parameter determines the number of message receive queues to which a message is allowed to enter the message sending queue at a time. Therefore, the first device can determine the queue information based on the speedup ratio parameter. For example, the number of message receive queues indicated by the speedup ratio parameter can be selected from multiple message receive queues to determine the queue information. The selection of message receive queues can be done randomly or in a round-robin manner.
[0085] Taking the selection of message receiving queues by rotation as an example, if the first device includes a total of 5 message receiving queues and the speedup parameter is 2, the first device can select message receiving queue 1 and message receiving queue 2 in the first round of rotation, message receiving queue 3 and message receiving queue 4 in the second round, message receiving queue 5 and message receiving queue 1 in the third round, and so on, selecting two message receiving queues in sequence each time.
[0086] After selecting the message receiving queue, queue information can be generated based on the selected queue. This queue information is then used to determine which messages can enter the message sending queue, thus determining whether the first message can enter the sending queue. The process of determining which messages can enter the sending queue based on queue information is called arbitration.
[0087] See Figure 7 This illustration shows a schematic diagram of an arbitration process provided in an embodiment of this application. Figure 7 As shown in the embodiments of this application, in accordance with the arbitration process described above, the in-queue arbitration of the exit queue is used to determine whether the message at the head of each message receiving queue can enter the message sending queue, and to identify messages that may be congested.
[0088] For example, see Figure 8This illustrates another arbitration process provided in an embodiment of this application. Figure 8 As shown, the first device includes five message receiving queues, namely message receiving queue 1 to message receiving queue 5. Messages buffered in different message receiving queues enter the first device through different ingresses. Messages at the head of message receiving queues 1 to 5 compete to enter the message sending queue corresponding to the designated egress within the same period. The speedup parameter used in the arbitration process is 1. If, within a period, the queue information indicates that the message belonging to message receiving queue 1 is eligible to enter the designated message sending queue, then the message at the head of message receiving queue 1 successfully enters the designated message sending queue within that period, and the first device copies the message at the head of message receiving queue 1 to the designated message sending queue. However, messages at the head of message receiving queues 2 to 5 fail to enter the designated message sending queue. If the first message is at the head of message receiving queues 2 to 5, then the first message fails arbitration within that period, and the first message fails to enter the message sending queue.
[0089] See Figure 9 This illustrates a schematic diagram of another arbitration process provided in an embodiment of this application. Figure 9 and Figure 8 The difference is that, Figure 9 The speedup parameter used in the arbitration process shown is 2. If, within a cycle, the queue information indicates that the message belonging to the message receiving queue that can enter the designated message sending queue belongs to message receiving queue 1 and message receiving queue 2, then the messages at the head of message receiving queue 1 and message receiving queue 2 successfully enter the designated message sending queue within that cycle, while the messages at the head of message receiving queues 3 to 5 fail to enter the designated message sending queue. Therefore, if the first message is the message at the head of message receiving queues 3 to 5, then the first message fails to enter the message sending queue within that cycle.
[0090] In this embodiment, by determining whether the queue information includes the information of the message receiving queue to which the first message belongs, it is possible to accurately and efficiently determine whether the first message can successfully enter the message sending queue. It should be noted that the arbitration process is not affected by the backlog of messages in the message sending queue; even if there are few messages in the message sending queue, the message sending queue may still refuse to let the first message join the queue.
[0091] Case 12: The architecture of the first device is OQ architecture.
[0092] In the OQ architecture, the message sending queue is a virtual output queue (VOQ), which is a storage structure that caches messages in memory. Under the OQ architecture, messages do not need to be copied from the message receiving queue to the message sending queue; therefore, speedup parameters are not bottlenecks preventing messages from entering the message sending queue. The first device does not limit the number of messages entering the message sending queue per cycle. For example... Figure 10 The process of a message entering the message sending queue is shown. Messages at the head of message receiving queues 1 to 5 can enter the message sending queue within the same period.
[0093] In one possible scenario, although the process of a packet moving from the packet receive queue to the packet send queue in the OQ architecture is not constrained by the speedup parameter, the space used by the packet send queue to buffer packets is still limited. For example, the space used by the packet send queue to buffer packets includes the memory space exclusively allocated to each packet receive queue and the shared memory space shared by all packet receive queues. Therefore, whether any packet can enter the packet send queue is determined based on the unoccupied remaining space of the packet send queue relative to the packet's corresponding packet receive queue. This remaining space includes the remaining space exclusively allocated to the packet receive queue and the remaining space shared by all packet receive queues.
[0094] In one possible implementation, the unoccupied remaining space in the message sending queue can be indicated by second occupancy information of the message sending queue. The second occupancy information may include the size of the remaining space of the message sending queue relative to each message receiving queue, or the space occupancy rate of the message sending queue relative to each message receiving queue. Since the second occupancy information reflects the space occupancy status of the message sending queue relative to each message receiving queue, in this embodiment, it can be determined whether a message in each message receiving queue can enter the message sending queue based on the second occupancy information.
[0095] For example, the first device can obtain second occupancy information of the message sending queue; based on the second occupancy information satisfying a second condition, it determines that the first message failed to enter the message sending queue. The second condition indicates that the remaining unoccupied space in the message sending queue is insufficient, and the second condition corresponds to the second occupancy information. For example, if the second occupancy information includes the size of the remaining space of the message sending queue relative to any message receiving queue, then the second condition can include the size of the remaining space being less than the size of the message at the head of that message receiving queue; if the second occupancy information includes the space occupancy rate of the message sending queue relative to any message receiving queue, then the second condition can include the space occupancy rate for that message receiving queue being greater than a space occupancy rate threshold.
[0096] After obtaining the second occupancy information, it can be determined whether the second occupancy information satisfies the second condition. Taking the second occupancy information including the size of the unoccupied remaining space in the message sending queue as an example, if the size of the remaining space is less than the size of the first message, it can be determined that the second occupancy information satisfies the second condition. Since the size of the remaining space is less than the size of the first message, the message sending queue cannot buffer the first message, and therefore it can be determined that the first message failed to enter the message sending queue.
[0097] See Figure 11 This diagram illustrates the process of a message entering a message sending queue according to an embodiment of this application. Under the OQ architecture, whether a message can enter the message sending queue is constrained by the shared memory space and the dedicated memory space of the message sending queue. If the first message is the head of message receiving queue 4 or 5, and the dedicated memory space of each message receiving queue in the message sending queue has already been occupied (e.g., occupied by message x in the diagram), and the shared memory space of each message receiving queue in the message sending queue has also been occupied by messages from message receiving queues 1 to 3, the VOQ's credit has been exhausted. Therefore, the remaining space in the message sending queue is insufficient to buffer the first message, and it can be determined that the first message failed to enter the message sending queue.
[0098] If the first packet fails to enter the packet sending queue, it indicates that arbitration for the first packet may have failed, and the first device may exhibit many-to-one traffic characteristics, potentially causing congestion. Alternatively, the failure of the first packet to enter the sending queue could also indicate insufficient unoccupied space in the sending queue, which could also lead to congestion on the first device. Therefore, regardless of the reason why the first packet cannot immediately enter the sending queue, it may trigger the first device to tag the first packet. For example... Figure 8 , Figure 9 or Figure 11 In the process, messages that fail to enter the message sending queue may be marked with ECN by the first device.
[0099] However, since the failure of the first message to enter the message sending queue does not necessarily indicate congestion in the first device, this embodiment of the application, after determining that the first message has failed to enter the message sending queue, can also obtain the first occupancy information of the message receiving queue to which the first message belongs. The first occupancy information may include at least one of the following: the queue depth of the message receiving queue, the size of the space already occupied in the message receiving queue, or the occupancy rate of the space used by the message receiving queue for buffering messages. The queue depth of the message receiving queue refers to the number of messages buffered in the message receiving queue.
[0100] This application does not limit the method by which the first device obtains the first occupancy information. For example, if the first occupancy information is the queue depth of the message receiving queue, the first device can count the number of messages in the message receiving queue to obtain the first occupancy information. If the first occupancy information is the size of the space already occupied in the message receiving queue, the first device can determine the starting and ending addresses of the occupied space and calculate the size of the occupied space based on these addresses. If the first occupancy information is the occupancy rate of the space used for buffering messages in the message receiving queue, the first device can obtain the size of the occupied space in the message receiving queue and the total size of the space used for buffering messages in the message receiving queue, respectively, and use the ratio of the occupied space size to the total space size as the space occupancy rate to obtain the first occupancy information.
[0101] By using the occupancy status of the message receiving queue reflected in the first occupancy information, it can be determined whether the first device is congested and whether the first message belongs to the congested flow, thereby avoiding mislabeling of messages of the victim flow and improving the accuracy of congestion labeling.
[0102] S602, based on the first occupancy information satisfying the first condition, a first message carrying a first tag is obtained. The first message carrying the first tag is used to send to the second device. The first tag indicates that the first message is a message of a congested flow. The first condition is used to indicate that there is congestion in the message receiving queue.
[0103] The first occupancy information satisfying the first condition can be one or more of the following: the queue depth of the message receiving queue is greater than or equal to a depth threshold; the size of the occupied space in the message receiving queue is greater than or equal to an occupancy threshold; or the occupancy rate of the space used for buffering messages in the message receiving queue is greater than or equal to an occupancy rate threshold. Since the first condition indicates that there is congestion in the message receiving queue, if the first occupancy information satisfies the first condition, it means that the message receiving queue to which the first message belongs is congested, and it can be determined that the first device is congested and the first message belongs to the congested flow.
[0104] Since the first message may not be the first time it experiences congestion at the first device, or the first message may not be the first time it fails to enter the message queue within the first device, and it may have already been marked by the first device, the first message may carry a second mark added by the first device or other devices. The second mark also indicates that the first message is a message from a congested flow. In the embodiments of this application, the method by which the first device obtains the first message carrying the first mark is different in the two cases: the first message includes the second mark and the first message does not include the second mark. Below, the method by which the first device obtains the first message carrying the first mark will be described using cases 21 and 22 as examples.
[0105] Case 21: The first occupancy information satisfies the first condition, and the first message does not include the second tag.
[0106] In scenario 21, obtaining the first message carrying the first tag may include: adding the first tag to the first message to obtain the first message carrying the first tag. This application embodiment does not limit the method by which the first device adds the first tag to the first message. For example, the method by which the first device adds the first tag to the first message may be determined based on at least one of the type of the first tag or the type of the first message.
[0107] Taking the method of adding a first tag to the first packet based on the type of the first packet as an example, if the first packet is an IP packet under various protocols, the first tag can be added to a specified field in the header of the first packet. The specified field could be, for example, the reserved field in the header of the first packet. Similarly, taking the method of adding a first tag to the first packet based on the type of the first tag as an example, if the first tag is an ECN tag, the first tag can be added by modifying the value in the ECN field.
[0108] In one possible implementation, the first tag can be obtained before the first packet carrying the first tag is obtained based on the first occupancy information satisfying the first condition. Optionally, the first tag can be an ECN tag or other types of tags. In the embodiments of this application, not only is the type of the first tag not limited, but the information indicated by the first tag is also not limited. The first tag can be used to indicate at least one of whether the packet is a congested flow packet, the severity of the congestion experienced by the packet, or the number of times the packet has experienced congestion.
[0109] Taking the first tag as an indicator of the severity of congestion experienced by a message as an example, the process of the first device obtaining the first tag may include: determining the congestion level of the message receiving queue based on the first occupancy information; determining the first tag based on the congestion level, wherein the first tag indicates the congestion level, and the congestion level is a quantitative representation of the severity of congestion experienced by the first message.
[0110] The initial occupancy information of the message receive queue reflects the space occupied by the message receive queue for buffering received messages. Taking the size of the occupied space in the message receive queue as an example, the larger the occupied space, the more messages the message receive queue buffers, and the more messages the first device has not yet processed; conversely, the smaller the occupied space, the fewer messages the message receive queue buffers, and the fewer messages the first device has not yet processed.
[0111] Since the congestion in the first device is caused by received but unprocessed messages, the number of unprocessed messages in the first device can reflect the severity of the congestion. Therefore, based on the first occupancy information of the message receiving queue, the congestion level of the message receiving queue can be determined.
[0112] This application does not limit the method for determining the congestion level of the message receiving queue based on the first occupancy information. For example, taking the first occupancy information as the size of the occupied space in the message receiving queue, different sizes of occupied space can be divided into different intervals, each corresponding to a different congestion level. For instance, if the total size of the message receiving queue is 100 kilobytes (KB), and the size of the occupied space is between 60KB and 75KB, then the occupied space belongs to the first interval, and the congestion level corresponding to the first interval is level one or low; if the occupied space is between 75KB and 90KB, then the occupied space belongs to the second interval, and the congestion level corresponding to the second interval is level two or medium; if the occupied space is between 90KB and 100KB, then the occupied space belongs to the third interval, and the congestion level corresponding to the third interval is level three or high. In this case, if the size of the occupied space in the first occupancy information is 80KB, then the occupied space belongs to the second interval, and the congestion level determined based on the first occupancy information is level two or medium.
[0113] Alternatively, if the first occupancy information includes the occupancy rate of the message receive queue, the first device can directly use the occupancy rate of the message receive queue as the congestion level. For example, if the occupancy rate of the message receive queue is 0.8, then the congestion level is 0.8.
[0114] After the first device determines the congestion level, it can determine the first marker based on the congestion level. In this embodiment, the congestion level can be directly used as the first marker, so that the first marker indicates the congestion level. Alternatively, the congestion level can be converted into binary form, and the binary form of the congestion level can be used as the first marker.
[0115] Furthermore, since the congestion level is a quantitative representation of the severity of congestion experienced by a message, the first flag can also indicate the severity of congestion experienced by the first message. For example, if the congestion level indicated by the first flag is level one or low, then the first flag indicates that the severity of congestion experienced by the message is mild; if the congestion level indicated by the first flag is level two or medium, then the first flag indicates that the severity of congestion experienced by the message is moderate; and if the congestion level indicated by the first flag is level three or high, then the first flag indicates that the severity of congestion experienced by the message is severe.
[0116] Optionally, the congestion level can also be a quantitative representation of the number of times the first message experiences congestion, with different numbers of times the first message experiences congestion corresponding to different congestion levels. For example, if the number of times the first message experiences congestion falls within range A, then the congestion level corresponding to that number of times is level A; if the number of times the first message experiences congestion falls within range B, then the congestion level corresponding to that number of times is level B. Furthermore, the first flag can also be a congestion counter that can directly indicate the number of times the first message experiences congestion.
[0117] In this embodiment, the first tag can not only indicate whether the first packet experiences congestion, but also the severity of the congestion experienced by the first packet or the number of times the first packet experienced congestion, making the congestion tag more accurate and specific. Furthermore, based on the first tag added in this embodiment, other devices in the network can determine a more precise congestion control scheme based on the more accurate and specific first tag. For example, based on the severity of the congestion experienced by the first packet indicated by the first tag, a control scheme for the transmission traffic of the source device sending the first packet can be accurately determined, thereby achieving more precise congestion control.
[0118] Case 22: The first occupancy information satisfies the first condition, and the first message includes a second tag that satisfies the third condition.
[0119] In case 22, obtaining the first message carrying the first tag may include: replacing the second tag with the first tag to obtain the first message carrying the first tag.
[0120] The third condition is used to indicate that the tag should be replaced. This third condition can be related to the content of the second and first tags. For example, if the content of the first and second tags is the number of times the first message experienced congestion, then the third condition can be that the second tag is different from the first tag. For instance, if the second tag is added by another device, and the second tag indicates the number of times the first message experienced congestion, then if the first occupancy information satisfies the first condition, it means that the first message experienced congestion again at the first device. Therefore, the number of times the first message experienced congestion indicated by the first tag is different from the number of times the first message experienced congestion indicated by the second tag. To ensure the accuracy of the tags in the first message, the third condition can be determined as the first tag being different from the second tag. This ensures that if the first tag is different from the second tag, the first device replaces the second tag with the newly determined first tag, guaranteeing that the first tag can correctly indicate the number of times the first message experienced congestion.
[0121] If the contents of the first and second tags represent the congestion levels experienced by the first message, then the third condition can be that the second tag is significantly different from the first tag. For example, if there are five congestion levels, from level one to level five, and the congestion levels indicated by the first and second tags are adjacent, then the second tag can be considered a tag with minimal difference from the first tag, and the second tag does not satisfy the third condition. If the congestion levels indicated by the first and second tags are not adjacent, then the second tag can be considered a tag with significant difference from the first tag, and the second tag satisfies the third condition.
[0122] For example, if the second flag indicates that the first message experienced a congestion level of level 2, and the first flag indicates that the first message experienced a congestion level of level 5, then the second flag can be considered to satisfy the third condition. Therefore, the second flag in the first message can be replaced with the first flag to obtain the first message carrying the first flag.
[0123] If the second label indicates that the first message experienced a congestion level of level 2, while the first label indicates that the first message experienced a congestion level of level 3, then the second label is considered not to meet the third condition. Therefore, there is no need to replace the second label with the first label, and the second label in the first message can be directly identified as the first label, and the first message can be directly regarded as the first message carrying the first label.
[0124] In one possible implementation, if the first tag is the same as the second tag, the first device does not modify the tag in the first message. The second tag carried by the first message is the first tag, and the first message itself is the first message carrying the first tag.
[0125] In this embodiment of the application, regardless of how the first device acquires the first message carrying the first tag, the first tag carried by the first message is relatively accurate, thereby ensuring accurate network congestion control based on the first message carrying the first tag, so as to ensure normal network transmission.
[0126] In some situations, when any device in the network becomes congested, causing its packet sending queue to fill up, the congestion may propagate to other switches due to the backpressure effect of link-level flow control (such as priority-based flow control, PFC), and may eventually reach any network resource in the network, thereby affecting the overall network performance, causing network overload, and resulting in packet loss and other phenomena.
[0127] For example, in a lossless DCN, when downstream nodes become congested, causing a severe backlog of packets in the packet sending queue, the downstream node will send a PFC frame to the upstream node, requesting the upstream node's output port to suspend sending packets to downstream nodes. This means the upstream node's packet sending queue enters a paused state. While the upstream node's packet sending queue is in a paused state, packets entering the upstream node's packet sending queue continue to accumulate. When the accumulated packets in the upstream node's packet sending queue become too large, and packets in the packet receiving queue cannot enter the packet sending queue, the upstream node will be triggered to mark the packets as congested.
[0128] However, in this case, the backlog of packets at the upstream node is only because the upstream node's output port has stopped sending packets to the downstream node, and not because the upstream node receives too many packets or has a 1 / 2 traffic pattern. Therefore, if the upstream node continues to mark packets as congested when the packet sending queue is in the Paused state, it may cause a large number of packets from the victim flow to be incorrectly marked as packets from the congested flow.
[0129] In one possible implementation, this application embodiment sets up a re-evaluation mode (or re-evaluation mechanism) to reduce the mislabeling of victimized flow packets by devices affected by backpressure effects (such as the upstream node mentioned above). Unlike the congestion labeling process for the first packet in the normal mode described above, in the re-evaluation mode, the first device references the congestion status of earlier packets at the same ingress port and re-evaluates packets that may be mislabeled. If the packet is mislabeled, the label is removed, allowing other devices to identify the packet as a non-congested flow packet and process it correctly.
[0130] In this embodiment, when the first device is in a congested state (or experiencing congestion), it can be triggered to activate a reassessment mode. In one possible implementation, whether the first device is in a congested state can be determined based on whether congestion flow packets appear in the first device. As explained above, if the first occupancy information meets the first condition, it indicates that the first packet is a congestion flow packet, thus determining that the first device is in a congested state, and the first device can activate the reassessment mode.
[0131] The reassessment mode refers to deleting potentially erroneous tags and reassessing whether mislabeled packets belong to congested flows, or updating potentially erroneous tags. For example, after obtaining a first packet carrying a first tag based on the first occupancy information satisfying the first condition, the process further includes: deleting the third tag from a second packet carrying a third tag based on the existence of such a packet in the packet receiving queue; and marking the second packet as congested if it is the earliest received packet in the packet receiving queue.
[0132] The third tag indicates that the second message is a congested flow message. Since the first device is in a congested state, the message backlog of the upstream device may be caused by the back pressure of the first device, while the upstream device of the first device is not actually congested. Therefore, the tag added by the upstream device of the first device in the message may be an erroneous tag, that is, the third tag in the second message may be an erroneous tag. So the first device can delete the third tag carried in the second message.
[0133] When the second message arrives at the head of the message receiving queue, the first device can evaluate whether the second message is a congestion flow message according to the same congestion marking method as in normal mode. If it is determined that the second message is a congestion flow message, the first device can obtain the second message carrying the fourth mark, which is a mark confirmed by the first device and indicates that the second message is a congestion flow message.
[0134] In one possible implementation, the first device can exit the re-evaluation mode under certain conditions. For example, when the first device determines that the first packet is a congestion flow packet, it can determine the range of packets to be re-evaluated based on the packets in the packet reception queue at that time. For example, the first device can record the queue depth of the packet reception queue at that time, identify the packet adjacent to the first packet in the current packet reception queue as the first packet to be re-evaluated, identify the packet with the latest reception time in the current packet reception queue as the last packet to be re-evaluated, and add a mark to the last packet to be re-evaluated to indicate that the packet carrying the mark is the last packet to be re-evaluated.
[0135] If, while the first device is still in reassessment mode, it identifies another packet belonging to the congestion flow in the packet reception queue to which the first packet belongs, the first device can redetermine the scope of packets to be reassessed. The method for redetermining the scope of packets to be reassessed can be the same as the method described above, and will not be repeated here. After the first device completes the reassessment of the last packet to be reassessed, it can exit reassessment mode and return to normal mode.
[0136] For example, see Figure 12 This diagram illustrates a flowchart of a re-evaluation mode provided in an embodiment of this application. White packets x represent congested flow packets, and white packets y represent non-congested flow packets. When no congestion occurs, the first device sends the character Xon to the upstream device, instructing the upstream device to continuously send data streams to the first device. When congestion occurs, the first device sends the character Xoff to the upstream device, instructing the upstream device to pause sending data streams to the first device, causing a PFC backpressure effect. This causes upstream devices to mis-mark non-congested flow packets, triggering the first device to initiate the re-evaluation mode.
[0137] When the first device is in reassessment mode, if the packet at the head of the packet receiving queue meets the congestion identification condition (i.e., the packet at the head of the packet receiving queue cannot immediately enter the packet sending queue), and the occupancy information of the packet receiving queue meets the first condition), then the packet is marked as a congested flow packet (represented by the black packet x indicated by ① in the figure). Simultaneously, it is considered that packets in the packet receiving queue at this time may have been mismarked at upstream nodes, so the tail position of the packet receiving queue is recorded (represented by the position indicated by ② in the figure), marking the affected range. For all packets between the head and tail (represented by the packet z indicated by ③ in the figure), a reassessment is required upon reaching the head of the queue, accurately distinguishing between congested flow packets and non-congested flow packets.
[0138] Through the re-evaluation mode set in this application embodiment, packets mislabeled as congested flows can be restored as non-congested flow packets in the first device, thereby reducing the number of mislabeled packets and improving the accuracy of congestion labeling. In this application embodiment, regardless of whether the first device is in re-evaluation mode, and regardless of whether the packet arriving at the head of the packet receiving queue belongs to the range of re-evaluated packets, if the packet at the head of the packet receiving queue fails to enter the packet sending queue, the first device can perform congestion detection on the packet to determine whether the packet is a congested flow packet, and modify or add tags according to the detection results, thereby reducing the possibility of each packet being mislabeled and improving the accuracy of congestion labeling.
[0139] Furthermore, in this embodiment of the application, after obtaining the first message carrying the first tag, the first message carrying the first tag will try to enter the message sending queue again. If the first message carrying the first tag fails to enter the message sending queue again, the first message carrying the first tag becomes the first message again, and the first device can re-mark it for congestion in order to update the first tag carried by the first message.
[0140] In some cases, the packet at the head of the packet receive queue will continuously attempt to enter the packet send queue until it successfully enters the send queue, at which point it is sent by the first device to the second device. Afterward, the packet adjacent to the packet at the head of the packet receive queue becomes the new head packet, i.e., the new first packet. If the new first packet fails to enter the queue, the first device is triggered to perform congestion detection and congestion marking on the new first packet.
[0141] Below, in conjunction with Figures 13 to 15 The illustrated congestion marking process provides a complete example to illustrate the congestion marking method provided in this application embodiment, making the congestion marking method provided in this application embodiment clearer.
[0142] When the device receives a packet, congestion detection activation is initiated. For packets in the packet receiving queue, congestion detection is performed sequentially according to steps 11 to 13. In step 11, it checks whether the packet is at the head of the packet receiving queue. If so, in step 12, it checks whether the packet has lost arbitration once or multiple times. If so, in step 13, it checks whether the queue occupancy rate of the packet receiving queue to which the packet belongs is too high. If so, the packet is determined to be a congested packet and marked as congested.
[0143] See Figure 14 Congesting flow packets (CP) and victim flow packets (VP) enter the switch through ports IP0 and IP1 respectively, and alternately enter the packet sending queue corresponding to OP2. 1. When a CP reaches the head of the packet receiving queue corresponding to IP0, it prepares to enter the packet sending queue corresponding to OP2. 2a. If the packet sending queue corresponding to OP2 is full, the CP is not allowed to join the queue. 2b. If the packet sending queue corresponding to OP2 is not full, but it competes with the head packet of the packet receiving queue corresponding to IP1, the CP arbitration fails, and the CP does not enter the packet sending queue corresponding to OP2. Figure 14 The content circled in the ellipse indicates two reasons why a message failed to enter the message sending queue. 3. The message receiving queue corresponding to IP0, where the CP is located, is severely backed up, and the queue depth exceeds the set threshold, meeting the congestion condition. Therefore, the CP at the head of the queue is marked as congested.
[0144] Please continue reading Figure 13After a message is marked as congested in the device, the device sends the marked message to downstream devices. When the message arrives at the downstream device, the downstream device performs step 21 on the message, that is, it determines whether previous messages in the message receiving queue to which the message belongs have been marked as congested flow messages; if so, the mark in the newly received message is cleared, the downstream device enters re-evaluation mode, and re-evaluates whether the newly received message is a congested flow message. After the re-evaluation is completed, the congestion detection ends.
[0145] See Figure 15 Switch A and switch B are connected, with switch A upstream and switch B downstream. Switch A's OP2 is connected to switch B's IP0. In step 1, due to severe backlog in the packet receive queue buffer corresponding to switch B's IP0, PFC backpressure is triggered. Upstream switch A's OP2 suspends packet transmission, causing a backlog in switch A's OP2 packet send queue. Switch A will not accept packets from any ingress into its OP2 packet send queue, resulting in a VP backlog in switch A, triggering switch A to perform congestion marking.
[0146] In step 2, packets from the congested flows in the packet receive queues corresponding to IP0 and IP1 of switch B all enter the packet send queue corresponding to OP2, forming a 2-against-1 traffic characteristic, causing congestion. If the cp at the head of the packet receive queue corresponding to IP0 of switch B meets the congestion determination condition, then the markers of other packets in the packet receive queue corresponding to IP0 are cleared, and a re-evaluation is required.
[0147] In step 3, in switch B, the CP in the packet receive queue corresponding to IP0 competes with the CP in the packet receive queue corresponding to IP1 to enter the packet send queue corresponding to OP2, and can continue to trigger congestion marking. However, the VP in the packet receive queue corresponding to IP0, although it was marked as a congested flow in switch A, has its marking cleared in switch B indicated by the arrow. Since the VP does not compete with other traffic for OP3 in switch B, it will not trigger congestion marking, thus avoiding erroneous congestion marking.
[0148] In summary, the congestion marking method provided in this application determines whether there is congestion in the message receiving queue by determining whether the first occupancy information meets the first condition, and comprehensively considers the result of the first message entering the message sending queue and whether there is congestion in the message receiving queue, so as to accurately determine whether the first message is a message of a congested flow. If the first message is a message of a congested flow, the first message carrying the first mark is obtained, thus ensuring the accuracy of congestion marking of the first message.
[0149] Furthermore, as can be seen from the above description of the congestion marking method provided in the embodiments of this application, the embodiments of this application can also remove the markings added by the devices affected by the backpressure effect in the packets of the victim flow when there is a backpressure effect in the network, thereby further improving the accuracy of congestion marking.
[0150] Related technologies also consider mislabeling caused by backpressure during the congestion labeling process, but the overall accuracy of congestion labeling remains low. For example, related technology two provides a method of non-paused explicit congestion notification (NP-ECN).
[0151] See Figure 16 and Figure 17 The diagram illustrates a congestion marking process provided by related technology two, which adds linkage with PFC to the WRED algorithm. See also... Figure 16 When a downstream node stops sending the Xon character and instead sends the Xoff character, it indicates congestion at the downstream node and requests the upstream node to stop sending new packets, causing the upstream node's egress queue to enter a paused state. When the upstream node's egress queue is in a paused state, the upstream node cannot determine whether newly added packets in the egress queue belong to the congested flow. Therefore, the upstream node suspends tagging packets in the egress queue but does not change the ECN (Electronic Communication Number) marking for packets that have been paused, resulting in some affected flow packets being partially marked with ECN. Simultaneously, the upstream node records the number of packets that have been paused in the egress queue at this time (counter packet number (PN)). Figure 16 In the egress queue of the upstream and midstream nodes, message d represents the message of the victim flow, and message c represents the message of the congested flow.
[0152] When a downstream node resends the Xon character to an upstream node, the upstream node changes from the Paused state to the resume state. Because there is a backlog in the upstream node's egress queue, packets with the recorded queue depth are not used for tagging. After the upstream node clears the backlog, it resumes the WRED tagging method, continuously marking congested flow packets with ECN (continuously marked with ECN) according to the degree of backlog in the egress queue (indicated by packets a, b, and c).
[0153] However, as Figure 17 As shown, x represents packets from congested flows, and y represents packets from victim flows. ① Downstream node congestion triggers PFC backpressure; ② Packets in the upstream node's egress queue accumulate rapidly; ③ Packets at the top of the upstream node's ingress queue may be identified as packets from congested flows; ④ Packets from victim flows may also be marked as packets from congested flows. Although Related Technology II reduces excessive ECN marking caused by PFC, it still randomly marks accumulated packets according to probability. Therefore, in the process of ECN marking packets, Related Technology II still cannot accurately distinguish between packets from congested flows and packets from victim flows, resulting in relatively low overall accuracy of congestion marking.
[0154] This application reduces mislabeling caused by PFC by using a re-evaluation mode. Furthermore, when re-evaluating a message, it comprehensively considers the occupancy of the message receiving queue to which the message belongs and the status of the message entering the message sending queue, ensuring the accuracy of congestion labeling for each message and thus making the overall congestion labeling more accurate.
[0155] The congestion marking method provided in the embodiments of this application has been described above. Corresponding to the above method, the embodiments of this application also provide a congestion marking device. This device is applied to a first device. The device is used to... Figure 18 Each module shown performs the above... Figure 6 The congestion marking method executed by the first device in the process. For example... Figure 18 As shown in the embodiments of this application, the congestion marking device includes the following modules.
[0156] The determination module 1801 is used to determine the first occupancy information of the message receiving queue when the first message fails to enter the message sending queue from the message receiving queue. The first message is the message with the earliest reception time in the message receiving queue. The acquisition module 1802 is used to acquire the first message carrying a first tag based on the first occupancy information satisfying a first condition. The first message carrying the first tag is used to send to the second device. The first tag indicates that the first message is a message of a congested flow. The first condition is used to indicate that there is congestion in the message receiving queue.
[0157] In one possible implementation, there are multiple message receiving queues, and the number of multiple message receiving queues is greater than the number of messages allowed to enter the message sending queue at one time; the acquisition module 1802 is also used to acquire indication information, which is used to indicate the messages entering the message sending queue; the determination module 1801 is also used to determine that the first message failed to enter the message sending queue if the messages indicated by the indication information do not include the first message.
[0158] In one possible implementation, the indication information includes queue information of the message receiving queue to which the message entering the message sending queue belongs; the determining module 1801 is further configured to determine that the message indicated by the indication information does not include the first message if the queue information does not include information of the message receiving queue to which the first message belongs.
[0159] In one possible implementation, the acquisition module 1802 is further configured to acquire second occupancy information of the message sending queue; the determination module 1801 is further configured to determine that the first message failed to enter the message sending queue based on the second occupancy information satisfying a second condition, wherein the second condition is used to indicate that the remaining unoccupied space of the message sending queue is insufficient.
[0160] In one possible implementation, the second occupancy information includes the size of the remaining unoccupied space in the message sending queue; the determining module 1801 is further configured to determine that the second occupancy information satisfies the second condition based on the fact that the size of the remaining space is less than the size of the first message.
[0161] In one possible implementation, the acquisition module 1802 is used to acquire a first message carrying a first tag based on the first occupancy information satisfying a first condition and the first message not including a second tag, wherein the second tag indicates that the first message is a message of a congested flow.
[0162] In one possible implementation, the acquisition module 1802 is used to replace the second mark with the first mark based on the first occupancy information satisfying the first condition and the first message including the second mark satisfying the third condition, to obtain a first message carrying the first mark. The third condition is used to indicate the replacement of the mark, and the second mark indicates that the first message is a message of a congested flow.
[0163] In one possible implementation, the determining module 1801 is further configured to determine the congestion level of the message receiving queue based on the first occupancy information; and determine a first flag based on the congestion level, the first flag indicating the congestion level.
[0164] In one possible implementation, the apparatus further includes a marking module. The marking module is used to delete the third mark from the second message based on the existence of a second message carrying a third mark in the message receiving queue. The third mark indicates that the second message is a message of congestion flow. If the second message is the message with the earliest reception time in the message receiving queue, the second message is marked as congested.
[0165] It should be understood that the above Figure 18 The beneficial effects that the provided device possesses in performing its function are... Figure 6 The provided congestion labeling method has the same beneficial effects, which will not be repeated here. Additionally, Figure 18The provided device, in implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.
[0166] See Figure 19 , Figure 19 A schematic diagram of an exemplary congestion marking device 1900 of this application is shown. The congestion marking device 1900 includes at least one processor 1901, a memory 1903, and at least one network interface 1904.
[0167] The processor 1901 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits or application-specific integrated circuits (ASICs), programmable logic devices (PLDs), other general-purpose processors or other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components, or any combination thereof used to implement the scheme of this application. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor. It is worth noting that the processor can be a processor supporting an advanced reduced instruction set machine (RISC) machine (ARM) architecture. It can implement or execute the various logic blocks, modules, and circuits described in conjunction with the disclosure of this application. A processor can also be a combination of components that perform computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
[0168] Optionally, the congestion marking device 1900 also includes a bus 1902. Bus 1902 is used to transmit information between the components of the congestion marking device 1900. Bus 1902 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. Bus 1902 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 19 The symbol is represented by only one line, but this does not mean that there is only one bus or one type of bus.
[0169] The memory 1903 may be, for example, volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache.
[0170] By way of example, but not limitation, many forms of ROM and RAM are available. For example, ROM is a compact disc read-only memory (CD-ROM). RAM includes, but is not limited to, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0171] Memory 1903 can also be other types of storage devices capable of storing static information and instructions. Alternatively, it can be other types of dynamic storage devices capable of storing information and instructions. It can also be other optical disc storage, optical disk storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. Memory 1903 may exist independently, for example, and be connected to processor 1901 via bus 1902. Memory 1903 may also be integrated with processor 1901.
[0172] Network interface 1904 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), or wireless local area network (WLAN). Network interface 1904 can include wired network interfaces and wireless network interfaces. Specifically, network interface 1904 can be an Ethernet interface, such as Fast Ethernet (FE), Gigabit Ethernet (GE), Asynchronous Transfer Mode (ATM), WLAN, cellular network, or combinations thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In some embodiments of this application, network interface 1904 can be used by congestion marking device 1900 to communicate with other devices.
[0173] In specific implementations, as some embodiments, processor 1901 may include one or more CPUs, such as Figure 19 The CPU0 and CPU1 shown are examples of processors. Each of these processors can be a single-core processor or a multi-core processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0174] In specific implementations, as some embodiments, the congestion marking device 1900 may include multiple processors, such as... Figure 19 The processors 1901 and 1905 are shown. Each of these processors can be a single-core processor or a multi-core processor. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).
[0175] In some embodiments, memory 1903 is used to store program instructions 1910 for executing the scheme of this application, and processor 1901 can execute the program instructions 1910 stored in memory 1903. That is, congestion marking device 1900 can implement the method provided in the method embodiment through processor 1901 and program instructions 1910 in memory 1903, i.e. Figure 6 The method is illustrated. Program instructions 1910 may include one or more software modules. Optionally, processor 1901 itself may also store program instructions for executing the scheme of this application.
[0176] In specific implementation, the congestion marking device 1900 of this application can correspond to the first device for executing the above method. The processor 1901 in the congestion marking device 1900 reads the instructions in the memory 1903, causing... Figure 19 The congestion marking device 1900 shown is capable of performing all or part of the steps in the method embodiments.
[0177] The congestion marking device 1900 can also correspond to the above. Figure 18 The device shown, Figure 18 Each functional module in the illustrated device is implemented using software from the congestion labeling device 1900. In other words, Figure 18 The device shown includes functional modules generated by the processor 1901 of the congestion marking device 1900 after reading the program instructions 1910 stored in the memory 1903.
[0178] in, Figure 6 Each step of the method shown is implemented through integrated logic circuits in the hardware or instructions in the software form of the processor of the congestion marking device 1900. The steps of the method embodiments disclosed in this application can be directly implemented by the hardware processor, or implemented by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other storage media mature in the art. Since this storage medium is located in memory, the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method embodiments; to avoid repetition, they will not be described in detail here.
[0179] See Figure 20 , Figure 20 A schematic diagram of the structure of an exemplary congestion marking device 2000 of this application is shown. The congestion marking device 2000 includes: a main control board 2010 and an interface board 2030. Figure 20 The congestion marking device 2000 shown is used to perform the above. Figure 6 The congestion marking method illustrated involves the following operations. The congestion marking device 2000 is, for example, a switch, router, controller, etc.
[0180] The main control board 2010, also known as the main processing unit (MPU) or route processor card, is used to control and manage the various components in the congestion labeling device 2000, including route calculation, device management, device maintenance, and protocol processing functions. The main control board 2010 includes a central processing unit 2011 and a memory 2012.
[0181] The interface board 2030, also known as a line processing unit (LPU), linecard, or service board, provides various service interfaces and enables packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, and, for example, flexible Ethernet clients (FlexE Clients). The interface board 2030 includes: a central processing unit 2031, a network processor 2032, a forwarding table entry memory 2034, and a physical interface card (PIC) 2033.
[0182] The central processing unit 2031 on the interface board 2030 is used to control and manage the interface board 2030 and communicate with the central processing unit 2011 on the main control board 2010.
[0183] The network processor 2032 is used to implement packet forwarding. The network processor 2032 can be in the form of a forwarding chip. Specifically, the network processor 2032 forwards received packets based on the forwarding table stored in the forwarding table entry memory 2034. If the destination address of the packet is the address of the congestion marking device 2000, the packet is sent to the CPU (such as the central processing unit 2011) for processing; if the destination address of the packet is not the address of the congestion marking device 2000, the next hop and outgoing interface corresponding to the destination address are looked up in the forwarding table according to the destination address, and the packet is forwarded to the outgoing interface corresponding to the destination address. Uplink packet processing includes: packet ingress interface processing, forwarding table lookup; downlink packet processing includes forwarding table lookup, etc.
[0184] The physical interface card 2033 is used to implement physical layer interfacing functions. Raw traffic enters the interface board 2030 through this card, and processed packets are sent out from the physical interface card 2033. The physical interface card 2033, also known as a daughter card, can be installed on the interface board 2030. It is responsible for converting photoelectric signals into packets, performing validity checks on the packets, and forwarding them to the network processor 2032 for processing. In some implementations, the central processing unit can also perform the functions of the network processor 2032, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for a network processor 2032 within the physical interface card 2033.
[0185] Optionally, the congestion marking device 2000 includes multiple interface boards. For example, the congestion marking device 2000 also includes an interface board 2040, which includes a central processing unit 2041, a network processor 2042, a forwarding table entry memory 2044, and a physical interface card 2043.
[0186] Optionally, the congestion marking device 2000 also includes a switching fabric unit (SFU). The switching fabric unit 2020 can also be referred to as a switch fabric unit (SFU). When the congestion marking device has multiple interface boards 2030, the switching fabric unit 2020 is used to complete data exchange between the interface boards. For example, interface boards 2030 and 2040 can communicate through the switching fabric unit 2020.
[0187] The main control board 2010 and interface board 2030 are coupled. For example, the main control board 2010, interface board 2030, interface board 2040, and switching network board 2020 communicate with each other via a system bus connected to the system backplane. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 2010 and interface board 2030, and communication between them occurs through the IPC channel.
[0188] Logically, the congestion labeling device 2000 includes a control plane and a forwarding plane. The control plane includes a main control board 2010 and a central processing unit 2031, while the forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 2034, a physical interface card 2033, and a network processor 2032. The control plane performs functions such as router operation, generating forwarding tables, processing signaling and protocol messages, and configuring and maintaining the device's status. The control plane distributes the generated forwarding tables to the forwarding plane. In the forwarding plane, the network processor 2032 uses the forwarding tables distributed by the control plane to look up and forward packets received by the physical interface card 2033. The forwarding tables distributed by the control plane can be stored in the forwarding table entry memory 2034. In some implementations, the control plane and the forwarding plane can be completely separated and not on the same device.
[0189] It's worth noting that a congestion labeling device may have one or more main control boards, including a primary and a backup main control board. It may also have one or more interface boards; the more data processing capabilities the congestion labeling device has, the more interface boards it provides. Each interface board may also have one or more physical interface cards. A switching network board may or may not exist; multiple boards can share the load and provide redundancy. In a centralized forwarding architecture, the congestion labeling device may not need a switching network board, as the interface boards handle the entire system's business data processing. In a distributed forwarding architecture, the congestion labeling device can have at least one switching network board, enabling data exchange between multiple interface boards and providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a distributed congestion labeling device are greater than those of a centralized architecture. Alternatively, the congestion labeling device can also be a single board, without a switching network board. The functions of the interface board and the main control board are integrated on this one board. In this case, the central processing unit on the interface board and the central processing unit on the main control board can be combined into a single central processing unit, executing the combined functions of both. This type of device has lower data exchange and processing capabilities (e.g., low-end switches or routers). The specific architecture adopted depends on the specific network deployment scenario, and no restrictions are imposed here.
[0190] In an exemplary embodiment, a congestion marking system is provided, comprising a first device, a second device, and a third device; the third device is configured to send a first message to the first device, and the first device is configured to receive the first message and perform [operations]. Figure 6 The method executed by the first device, wherein the second device is used to receive a first message carrying a first tag sent by the first device.
[0191] In an exemplary embodiment, a computer program (product) is provided, comprising: computer program code, which, when executed by a computer, causes the computer to perform... Figure 6 The method in the middle.
[0192] In an exemplary embodiment, a computer-readable storage medium is provided that stores a program or instructions, which, when executed on a computer, cause the computer to perform the aforementioned actions. Figure 6 The method in the middle.
[0193] In an exemplary embodiment, a chip is provided, including a processor for recalling and executing instructions stored in memory, causing a computer with the chip installed to perform... Figure 6 The method in the middle.
[0194] In an exemplary embodiment, another chip is provided, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected via internal interconnection paths. The processor is used to execute code in the memory. When the code is executed, a computer with the chip installed performs... Figure 6 The method in the middle.
[0195] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, 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 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) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer 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 drive).
[0196] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items with substantially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another.
[0197] It should also be understood that, in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0198] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple second devices means two or more second devices. The terms "system" and "network" are often used interchangeably herein.
[0199] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0200] It should also be understood that the term "and / or" as used herein refers to and covers any and all possible combinations of one or more of the associated listed items. The term "and / or" describes an association between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this application generally indicates that the preceding and following related objects are in an "or" relationship.
[0201] It should also be understood that the terms “if” and “if” can be interpreted as meaning “when” or “upon”, or “in response to determination” or “in response to detection”. Similarly, depending on the context, the phrases “if determination…” or “if detection [the stated condition or event]” can be interpreted as meaning “when determination…”, or “in response to determination…”, or “when detection [the stated condition or event]” or “in response to detection [the stated condition or event]”.
[0202] The above description is merely an embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A congestion labeling method, characterized in that, The method is applied to a first device, the first device including a message receiving queue and a message sending queue, the method including: If the first message fails to enter the message sending queue from the message receiving queue, the first occupancy information of the message receiving queue is determined, wherein the first message is the message with the earliest reception time in the message receiving queue. Based on the first occupancy information satisfying the first condition, a first message carrying a first tag is obtained. The first message carrying the first tag is used to send to the second device. The first tag indicates that the first message is a message of a congested flow. The first condition is used to indicate that there is congestion in the message receiving queue.
2. The method according to claim 1, characterized in that, The number of message receiving queues is multiple, and the number of multiple message receiving queues is greater than the number of messages allowed to enter the message sending queue at one time; before determining the first occupancy information of the message receiving queue in the case that the first message fails to enter the message sending queue from the message receiving queue, the method further includes: Obtain indication information, which is used to indicate the messages entering the message sending queue; If the message indicated by the indication information does not include the first message, it is determined that the first message failed to enter the message sending queue.
3. The method according to claim 2, characterized in that, The indication information includes the queue information of the message receiving queue to which the message entering the message sending queue belongs; Before determining that the first message failed to enter the message sending queue when the message indicated by the indication information does not include the first message, the method further includes: If the queue information does not include information about the message receiving queue to which the first message belongs, it is determined that the message indicated by the indication information does not include the first message.
4. The method according to claim 1, characterized in that, Before determining the first occupancy information of the message receiving queue in the event that the first message fails to enter the message sending queue from the message receiving queue, the method further includes: Obtain the second occupancy information of the message sending queue; Based on the second occupancy information satisfying the second condition, it is determined that the first message failed to enter the message sending queue. The second condition is used to indicate that the remaining unoccupied space of the message sending queue is insufficient.
5. The method according to claim 4, characterized in that, The second occupancy information includes the size of the remaining unoccupied space in the message sending queue; Before determining that the first message failed to enter the message sending queue based on the second condition met by the second occupancy information, the method further includes: Based on the fact that the size of the remaining space is less than the size of the first message, it is determined that the second occupancy information satisfies the second condition.
6. The method according to any one of claims 1-5, characterized in that, The step of obtaining a first message carrying a first tag based on the first occupancy information satisfying a first condition includes: Based on the first occupancy information satisfying the first condition, and the first message not including the second tag, the first message carrying the first tag is obtained, wherein the second tag indicates that the first message is a message of a congested flow.
7. The method according to any one of claims 1-5, characterized in that, The step of obtaining a first message carrying a first tag based on the first occupancy information satisfying a first condition includes: Based on the first occupancy information satisfying the first condition, and the first message including a second tag satisfying the third condition, the second tag is replaced with the first tag to obtain the first message carrying the first tag. The third condition is used to indicate that the tag is replaced, and the second tag indicates that the first message is a message of a congested flow.
8. The method according to any one of claims 1-7, characterized in that, Before obtaining the first message carrying the first tag based on the first occupancy information satisfying the first condition, the method further includes: Based on the first occupancy information, determine the congestion level of the message receiving queue; The first tag is determined based on the congestion level, and the first tag indicates the congestion level.
9. The method according to any one of claims 1-8, characterized in that, After obtaining the first message carrying the first tag based on the first occupancy information satisfying the first condition, the process further includes: Based on the existence of a second message carrying a third tag in the message receiving queue, the third tag in the second message is deleted, the third tag indicating that the second message is a congestion flow message; If the second message becomes the earliest received message in the message receiving queue, the second message is marked as congested.
10. A congestion marking device, characterized in that, The apparatus is applied to a first device, the first device including a message receiving queue and a message sending queue, the apparatus comprising: The determination module is used to determine the first occupancy information of the message receiving queue when the first message fails to enter the message sending queue from the message receiving queue, wherein the first message is the message with the earliest reception time in the message receiving queue. The acquisition module is used to acquire a first message carrying a first tag based on the first occupancy information satisfying a first condition. The first message carrying the first tag is used to send to a second device. The first tag indicates that the first message is a message of a congested flow. The first condition is used to indicate that there is congestion in the message receiving queue.
11. A congestion marking device, characterized in that, The device includes a processor coupled to a memory; the memory stores at least one instruction, which is loaded and executed by the processor to enable the congestion marking device to implement the congestion marking method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement the congestion marking method as described in any one of claims 1-9.
13. A computer program product, characterized in that, The computer program product includes a computer program or instructions that are executed by a processor to enable a computer to implement the congestion marking method as described in any one of claims 1-9.
14. A congestion labeling system, characterized in that, The system includes a first device, a second device, and a third device; The third device is used to send a first message to the first device; The first device is configured to receive the first message and implement the congestion marking method as described in any one of claims 1-9; The second device is configured to receive a first message carrying a first tag sent by the first device.