A method for sending data stream and related device
By acquiring and analyzing the status information of the network device port and selecting non-congested paths to forward data flows, the problem of inaccurately bypassing the congested paths in the prior art is solved, and more efficient network congestion mitigation is achieved.
Patent Information
- Application Number
- CN202210943978.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-07-01
- Filing Date
- 2022-08-05
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-08-05
AI Technical Summary
When handling network congestion, the prior art cannot accurately determine whether the congestion path is bypassed after data flow forwarding, resulting in insufficient accuracy of port handover.
By obtaining the status information of the port, including local congestion information and downstream congestion information, selecting a non-congested path forwarding data flow to alleviate network congestion.
Improve the accuracy of data flow forwarding, ensuring that data flow bypasses congestion paths, thereby effectively alleviating network congestion.
Smart Images

Figure CN117376258B_ABST
Abstract
Description
[0001] This application claims the priority of the Chinese patent application filed with the China Patent Office on July 1, 2022, with application number 202210773271.5 and application name “A load balancing method, device and system based on congestion feedback”, the entire contents of which are incorporated by reference in this application. Technical Field
[0002] The embodiments of the present application relate to the field of computers, and in particular to a method for sending a data stream and a related device. Background Art
[0003] Congestion often occurs in the data center network. For example, if a switch forwards two data streams from the same port at the same time, congestion will occur on the port.
[0004] In order to prevent the congestion of ports from affecting communication, in an example of the prior art, switch 1 forwards the data flow from port A to switch 2. If the port of switch 2 leading to the destination switch is congested, switch 2 will send an ARN message to switch 1 to notify the congestion. Based on the ARN message, switch 1 changes the data flow to be forwarded from port B to switch 3, thereby bypassing switch 2, and switch 3 forwards the data flow to the destination switch.
[0005] However, in the above solution, switch 1 cannot determine whether the port of switch 3 leading to the destination switch is also congested, and the accuracy of port switching is insufficient. Summary of the invention
[0006] The embodiments of the present application provide a method for sending a data stream and a related device, which are used to forward the data stream from a non-congested path to alleviate congestion in the network.
[0007] A first aspect of an embodiment of the present application provides a method for sending a data stream:
[0008] The first network device obtains state information of the first port, the state information including local congestion information and downstream congestion information of the first port, the local congestion information is used to indicate the congestion level of the first port, and the downstream congestion information is used to indicate the congestion level of the downstream path corresponding to the first port. The first network device sends a first data stream from the first port according to the state information.
[0009] In the present application, the first network device can obtain status information of the first port. When the status information meets the preset situation, the first network device sends the first data stream from the first port, so that the first data stream can bypass the congested path, thereby alleviating the congestion in the network.
[0010] In a possible implementation, the first network device receives a first message from a first port, the first message including downstream congestion information, and the first network device can obtain the downstream congestion information of the first port according to the first message.
[0011] In the present application, the first network device obtains the downstream congestion information of the port by receiving messages, thereby improving the accuracy of the downstream congestion information.
[0012] In a possible implementation, the first network device receives a PFC frame from the first port, the PFC frame indicating that a downstream path corresponding to the first port is congested. The first network device obtains downstream congestion information of the first port according to the PFC frame.
[0013] In the present application, the first network device obtains the downstream congestion information of the port by receiving the PFC frame, thereby improving the accuracy of the downstream congestion information.
[0014] In a possible implementation, the first network device receives a second message from a second port, the second message includes information indicating the first data flow, and the second message is used to notify that the first data flow causes congestion in the downstream path of the second port, and the second port is a port through which the first network device sends the first data flow. The first network device determines, based on the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port, and the first network device switches the port through which the first data flow is sent from the second port to the first port.
[0015] In the present application, since the first data flow causes congestion in the downstream path of the second port, the first network device changes the egress port of the first data flow to the first port with the least congestion, thereby alleviating congestion in the network.
[0016] In a possible implementation, the first network device receives a PFC frame from the second port, and the first network device determines, based on the PFC frame, that the first data flow causes congestion in a downstream path of the second port. The first network device determines, based on state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port, and the first network device switches the port for sending the first data flow from the second port to the first port.
[0017] In the present application, since the first data flow causes congestion in the downstream path of the second port, the first network device changes the egress port of the first data flow to the first port with the least congestion, thereby alleviating congestion in the network.
[0018] In one possible implementation, the first network device determines that local congestion occurs on the second port sending the first data stream. The first network device determines, based on status information of the first port, that the congestion level of the first port is the smallest among all ports except the second port. The first network device switches the port sending the first data stream from the second port to the first port.
[0019] In the present application, since the first data flow causes local congestion on the second port, the first network device changes the egress port of the first data flow to the first port with the least congestion, thereby alleviating the congestion in the network.
[0020] In a possible implementation, the first network device determines, based on the status information of the first port, that the congestion level of the first port is the smallest among all ports except the second port. Specifically, the first network device determines that the congestion level indicated by the downstream congestion information of the first port is the smallest among all ports except the second port.
[0021] In the present application, when the downstream path of the second port is congested, the first data flow is switched to the first port with the smallest congestion level indicated by the downstream congestion information for transmission, thereby improving the pertinence of switching the data flow.
[0022] In a possible implementation, before the first network device switches the port for sending the first data stream from the second port to the first port, the first network device sends a first request message from the first port, where the first request message is used to request that the first data stream be sent through a path corresponding to the first port. The first network device receives a first permission message in response to the first request message from the first port, where the first permission message is used to indicate that the first data stream is allowed to be sent through the path corresponding to the first port.
[0023] In the present application, the first network device switches the port for sending the first data flow from the second port to the first port only after receiving the first permission message, thereby ensuring that benefits can be obtained after the switch.
[0024] In a possible implementation, the first network device sends a second request message from the third port, the second request message being used to request that the first data flow be sent through a path corresponding to the third port. The first network device receives a second permission message in response to the request message from the third port, the second permission message being used to indicate that the first data flow is not allowed to be sent through the path corresponding to the third port.
[0025] In the present application, since the first network device receives the second permission message from the third port, the first network device will not switch the port for sending the first data stream from the second port to the third port, so as to avoid failure to obtain benefits after the switch.
[0026] In a possible implementation, the first network device determines, based on the status information of the first port, that the congestion level of the first port is the smallest among all ports except the second port. Specifically, the first network device determines that the congestion level indicated by the local congestion information of the first port is the smallest among all ports except the second port.
[0027] In the present application, when local congestion occurs on the second port, the first data stream is switched to the first port with the smallest congestion level indicated by the local congestion information for transmission, thereby improving the pertinence of switching the data stream.
[0028] In a possible implementation, before the first network device switches the port for sending the first data flow from the second port to the first port, the first network device further determines that a time difference between two adjacent messages belonging to the first data flow is received is greater than a preset value.
[0029] In the present application, message disorder caused by switching data streams is avoided.
[0030] In one possible implementation, the congestion levels include a first congestion level, a second congestion level, and a third congestion level. The first congestion level indicates that the utilization rate and the queue length of the port are both greater than preset values, or the port is in a PFC state. The second congestion level indicates that the utilization rate of the port is greater than the preset value, and the queue length is less than the preset value. The third congestion level indicates that the utilization rate and the queue length of the port are less than the preset value.
[0031] In a possible implementation, the first network device is a TOR switch in a two-level Clos topology, or a switch in a direct-connect topology, or a TOR switch, a LEAF switch, or a SPINE switch in a three-layer Fattree topology.
[0032] In a possible implementation, the first message and the second message are remote direct memory access (RDMA) messages.
[0033] A second aspect of the present application provides a network device, the network device being used as a first network device:
[0034] The method comprises multiple functional modules, which interact with each other to implement the method in the first aspect. The multiple functional modules can be implemented based on software, hardware or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on specific implementation.
[0035] A third aspect of the present application provides a network device, the network device being used as a first network device:
[0036] It includes a processor and a memory, the processor is coupled to the memory, and the memory is used to store instructions. When the instructions are executed by the processor, the network device executes the method in the first aspect.
[0037] A fourth aspect of the present application provides a computer-readable storage medium having computer instructions or programs stored thereon. When the computer instructions or programs are executed, the first network device executes the method in the first aspect described above.
[0038] A fifth aspect of the present application provides a computer program product, including computer instructions or programs, which, when executed, enable a first network device to execute the method in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of port congestion in an embodiment of the present application;
[0040] Figure 2 Another schematic diagram of port congestion in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of sending data stream in the prior art;
[0042] Figure 4 A schematic diagram of an application scenario in an embodiment of the present application;
[0043] Figure 5 Another schematic diagram of an application scenario in an embodiment of the present application;
[0044] Figure 6 Another schematic diagram of an application scenario in an embodiment of the present application;
[0045] Figure 7 A schematic diagram of a flow chart of a method for sending a data stream in an embodiment of the present application;
[0046] Figure 8a Another schematic diagram of an application scenario in an embodiment of the present application;
[0047] Figure 8b Another schematic diagram of an application scenario in an embodiment of the present application;
[0048] Fig. 9 Another schematic diagram of an application scenario in an embodiment of the present application;
[0049] Fig.10 Another schematic diagram of an application scenario in an embodiment of the present application;
[0050] Fig.11 Another schematic diagram of an application scenario in an embodiment of the present application;
[0051] Fig.12 A schematic diagram of the structure of the first network device in the embodiment of the present application;
[0052] Fig.13 This is another structural diagram of the first network device in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the described embodiments are only embodiments of a part of the present application, rather than all embodiments. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0054] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0055] Data centers can use a variety of different network topologies, such as two-layer Clos topology, direct connection topology, and three-layer Fattree topology. However, no matter which network topology is used, congestion may still occur in the network. Figure 1 For example, in a two-level Clos topology, server 1 and server 2 send data stream 1 and data stream 2 to switch 1 respectively. Switch 1 forwards data stream 1 and data stream 2 to switch 2 through the same port. Therefore, data stream 1 and data stream 2 will conflict on the port, causing congestion on the port. Alternatively, refer to Figure 2 , switch 4 receives data stream 1 from switch 1 and data stream 2 from switch 2. Switch 4 forwards data stream 1 and data stream 2 to switch 3 through the same port. Therefore, data stream 1 and data stream 2 will conflict on the port, causing congestion on the port.
[0056] In order to prevent the congestion of ports from affecting communication, it is a feasible method to forward data streams around the congested ports. Figure 3In an example of the prior art, the source node sends a data stream to node A, which forwards the data stream to the destination node. Node A sends the data stream from the port leading to node B, which forwards the data stream to the destination node. If the port leading to the destination node of node B is congested, node B will send an ARN message to node A to notify the congestion. Based on the ARN message, node A changes the data stream to be sent from the port leading to node C, and node C forwards the data stream to the destination node, thereby bypassing node B. However, node A cannot be sure whether the port leading to the destination node of node C is still congested, and cannot predict whether it can obtain benefits after port switching, and the accuracy of port switching is insufficient.
[0057] The embodiments of the present application provide a method for sending a data stream and a related device, which are used to forward the data stream from a non-congested path to alleviate congestion in the network.
[0058] The embodiments of the present application can be applied to Figure 4 , Figure 5 as well as Figure 6 In the network topology shown, the following are introduced respectively:
[0059] See also Figure 4 , Figure 4 A schematic diagram of a 2-level Clos topology is shown. The topology is divided into three layers: one layer for servers, one layer for TOR switches, and one layer for SPINE switches. The downlink port of the TOR switch is connected to the server, and the uplink port is connected to the SPINE switch. There can be one or more links between the TOR switch and the SPINE switch. Figure 5 , Figure 5 A schematic diagram of a direct-connect topology is shown. The topology includes multiple switch groups, each switch group includes multiple switches, one or more links exist between switches, one or more links exist between switch groups, and servers are connected to each switch. Figure 6 , Figure 6A schematic diagram of a three-layer Fattree topology is shown. The topology is divided into four layers, one layer for the server, one layer for the TOR switch, one layer for the LEAF switch, and one layer for the SPINE switch. The uplink port of the LEAF switch is connected to the SPINE switch, the uplink port of the TOR switch is connected to the LEAF switch, and the downlink port is connected to the server. Different PODs are divided in this topology, for example, TOR switch 1, TOR switch 2, LEAF switch 1 and LEAF switch 2 are one POD, and TOR switch 3, TOR switch 4, LEAF switch 3 and LEAF switch 4 are one POD. The first network device in the embodiment of the present application can be a TOR switch in a secondary Clos topology, or a switch in a direct-connected topology, or a TOR switch, LEAF switch or SPINE switch in a three-layer Fatree topology.
[0060] The following describes the process of the method for sending a data stream in the embodiment of the present application in combination with different network topologies:
[0061] 1. 2-level Clos topology.
[0062] See also Figure 7 , the process of the method for sending a data stream in the embodiment of the present application is introduced below in combination with the 2-level Clos topology:
[0063] 701. A first network device obtains status information of a first port, where the status information includes local congestion information and downstream congestion information of the first port, where the local congestion information is used to indicate a congestion level of the first port, and the downstream congestion information is used to indicate a congestion level of a downstream path corresponding to the first port.
[0064] See also Figure 8a In this topology, each TOR switch is an ECMP Group. Taking TOR switch 1 as an example, TOR switch 1 maintains a corresponding path status table for each ECMP Group except itself, including the path status table maintained for TOR switch 2 and the path status table maintained for TOR switch 3. Taking the path status table maintained for TOR switch 3 as an example, please refer to Table 1:
[0065] Table 1
[0066]
[0067] As shown in Table 1, the path status table records all ports from TOR switch 1 to TOR switch 3, as well as the local congestion information and downstream congestion information of each port. Among them, the local congestion information is used to indicate the congestion level of the port, and the downstream congestion information is used to indicate the congestion level of the downstream path from the port to TOR switch 3, which is determined according to the status information of the port of the downstream switch. The above-mentioned congestion level of the downstream path can be understood as the congestion level of the path that the data flow passes through when reaching TOR switch 3 after TOR switch 1 sends the data flow from the port. In addition, the path status table also records the identifier of the ECMP Group corresponding to TOR switch 3. Please refer to Table 2, which shows the path status table maintained by TOR switch 1 for TOR switch 2:
[0068] Table 2
[0069]
[0070] Similar to that shown in Table 1, the path state table records all ports from TOR switch 1 to TOR switch 2, as well as local congestion information and downstream congestion information of each port, and because TOR switch 2 corresponds to ECMPGroup2, the path state table also records the identifier of ECMP Group2. Similarly, TOR switch 2 maintains corresponding path state tables for TOR switch 1 and TOR switch 3; TOR switch 3 maintains corresponding path state tables for TOR switch 1 and TOR switch 2; each SPINE switch maintains corresponding path state tables for TOR switch 1, TOR switch 2, and TOR switch 3. The specific form of the path state table is similar to that shown in Table 1 and Table 2, and will not be repeated here.
[0071] The local congestion information of the port is determined by detecting the relevant conditions of the port. For example, if the port is in the PFC pause state due to receiving the PFC pause frame, the local congestion information of the port is the first degree of congestion, which can also be understood as congestion; if the utilization rate and queue length of the port are both greater than the preset value, the local congestion information of the port is also the first degree of congestion; if the utilization rate of the port is greater than the preset value, but the queue length is less than the preset value, the local congestion information of the port is the second degree of congestion, which can also be understood as the port is overloaded; if the utilization rate and queue length of the port are both less than the preset value, the local congestion information of the port is the third degree of congestion, which can also be understood as the port is in a light load state; if the utilization rate of the port is greater than the preset value, but the queue length is greater than the preset value, the local congestion information of the port is the fourth degree of congestion, which can also be understood as instantaneous congestion of the port.
[0072] For the downstream congestion information of the port, the downstream congestion information of each port in all the path status tables maintained by all the switches defaults to the third degree of congestion in the initial state. Among them, the TOR switch can update the downstream congestion information of the port based on the message received by the port for indicating the downstream congestion information. Exemplarily, if the SPINE switch 1 detects that the utilization rate and queue length of port 6 leading to the TOR switch 3 are greater than the preset value, the SPINE switch 1 records the local congestion information of port 6 as the first degree of congestion, and the SPINE switch 1 also determines the congested data flow that causes the congestion degree of port 6 to be the first degree of congestion. Exemplarily, the congested data flow is sent from port 1 of the TOR switch 1, and is sent to the TOR switch 3 through port 4 and port 6 of the SPINE switch 1 in turn. The above determination method can be a mechanism using ECN marking, or it can be other determination methods, which are not specifically limited. Please refer to Table 3, which shows the path status table maintained by the SPINE switch 1 for the TOR switch 3:
[0073] Table 3
[0074]
[0075] As shown in Table 3, the local congestion level of port 6 is the first level of congestion, and there are no other ports whose local congestion level and downstream congestion level are both the third level of congestion. Figure 8b Therefore, SPINE switch 1 sends message 1 including indication information and the identifier of the ECMP Group corresponding to TOR switch 3 from port 5, and the above indication information is used to indicate that the downstream congestion information is the first degree of congestion. In addition, SPINE switch 1 will also send message 2 including indication information, the identifier of the ECMP Group corresponding to TOR switch 3 and the information indicating the above congested data flow from port 4, and the above indication information is used to indicate that the downstream congestion information is the first degree of congestion. The information indicating the above congested data flow can be, for example, a five-tuple, a two-tuple or a one-tuple. Correspondingly, TOR switch 1 will receive the above message 2, and TOR switch 2 will receive the above message 1. Please refer to Table 4. Taking TOR switch 1 as an example, TOR switch 1 receives the above message 2 through port 1, and obtains the indication information, the information indicating the congested data flow and the identifier of the ECMP Group in message 2, and updates the downstream congestion information of port 1 to the first degree of congestion in the path state table maintained for TOR switch 3 according to the indication information and the identifier of the ECMP Group.
[0076] Table 4
[0077]
[0078] Please refer to Table 5. Taking TOR switch 2 as an example, TOR switch 2 receives the above-mentioned message 1 through port 7, obtains the indication information and the identifier of the ECMP Group in the message, and updates the downstream congestion information of port 7 to the first degree of congestion in the path state table maintained for TOR switch 3 based on the indication information and the identifier of the ECMP Group.
[0079] Table 5
[0080]
[0081] It should be noted that the local congestion information of the ports in Table 4 and Table 5 can be determined in the manner described above, and is not shown in the table for the sake of brevity.
[0082] Alternatively, referring to Table 6, in another case, if the SPINE switch 1 detects that the utilization of port 6 is greater than a preset value, but the queue length is less than a preset value, the SPINE switch 1 records the local congestion information of port 6 as the second degree of congestion.
[0083] Table 6
[0084]
[0085] Since in the path state table maintained by SPINE switch 1 for TOR switch 3, the local congestion level of port 6 is the second level of congestion, and there are no other ports whose local congestion level and downstream congestion level are both the third level of congestion, SPINE switch 1 will send message 3 including indication information and the identifier of the ECMP Group corresponding to TOR switch 3 from port 4 and port 5, and the above indication information is used to indicate that the downstream congestion information is the second level of congestion. Correspondingly, TOR switch 1 and TOR switch 2 will receive the above message 3. Please refer to Table 7, taking TOR switch 1 as an example, TOR switch 1 receives the above message 3 through port 1, and according to the indication information and the identifier of the ECMP Group in message 3, updates the downstream congestion information of port 1 to the second level of congestion in the path state table maintained for TOR switch 3.
[0086] Table 7
[0087]
[0088] The TOR switch 2 processes the message 3 in a similar manner, which will not be described in detail here.
[0089] The above example introduces the mechanism by which the TOR switch updates the downstream congestion information. It should be understood that the mechanism is applicable to all TOR switches in the topology. Through the above-described method, the TOR switch and the SPINE switch can determine the local congestion information and downstream congestion information corresponding to each port in the path state table.
[0090] In this embodiment, the first network device is TOR switch 1, and the first port is port 3. Assuming that the utilization rate and queue length of the first port are both less than the preset value, and the first port has not received the message carrying the downstream congestion information of the ECMP Group identifier corresponding to TOR switch 3, then in the path state table maintained by the first network device for TOR switch 3, the local congestion information and downstream congestion information of the first port are both the third degree of congestion.
[0091] 702. The first network device sends a first data stream from the first port according to the state information of the first port.
[0092] In the above steps, if the first network device receives message 2 through port 1, the first network device needs to switch the congested data flow to other ports for transmission after updating the downstream congestion information of port 1 to the first degree of congestion in the corresponding path state table. Since the destination of the congested data flow is TOR switch 3, the first network device determines the above port based on the path state table maintained for TOR switch 3. Based on the above, please refer to Table 8, which shows a possible situation of the path state table maintained by the first network device for TOR switch 3:
[0093] Table 8
[0094]
[0095] Since the downstream congestion information of port 1, which originally sent the congested data flow, is the first degree of congestion, in one implementation, the first network device directly switches the congested data flow to the target port for transmission, and the target port is the port whose downstream congestion information is the third degree of congestion in Table 8, and on this basis, the port whose local congestion information is also the third degree of congestion is preferably selected. As can be seen from Table 8, the local congestion information and downstream congestion information of port 3 are both the third degree of congestion, so the first network device can directly switch the congested data flow to port 3 for transmission, and the first data flow is the congested data flow. Correspondingly, please refer to Table 9, if the first network device updates the port for emitting the congested data flow from port 1 to port 3, and if the congested data flow exists in the data flow table maintained by the first network device, it is also necessary to change the outgoing port of the congested data flow in the data flow table from port 1 to port 3, if it does not exist, add the data flow in the data flow table, and mark the outgoing port as port 3.
[0096] Table 9
[0097] Data flow information Outgoing port Congested Data Flow 3 ...
[0098] Alternatively, in another implementation, the first network device first determines the port whose downstream congestion information is the third degree of congestion as an alternative port, that is, the above-mentioned port 2 and port 3 are determined as alternative ports. Afterwards, the first network device sends a request message from port 2 or port 3, and the request message carries information indicating the congested data flow. For example, the first network device sends a request message from port 2, and correspondingly, the SPINE switch 2 receives the request message, and determines whether there is a switchable port in an available state in the path state table maintained for the TOR switch 3 based on the information indicating the congested data flow, and the downstream congestion information is the third degree of congestion. If it exists, the SPINE switch 2 sends a permission message 1 to the port 2 of the first network device, and the permission message 1 is used to indicate that the SPINE switch 2 allows the congested data flow to be sent to the destination through the above-mentioned switchable port. It should be noted that if the SPINE switch 2 sends the above-mentioned permission message 1 to the first network device, the SPINE switch 2 will also mark the above-mentioned switchable port as being in an unavailable state, and the unavailable state is eliminated after a preset time interval.
[0099] Exemplarily, in this embodiment, SPINE switch 2 sends permission message 2 to port 2 of the first network device, and permission message 2 is used to indicate that the above-mentioned switchable port does not exist in SPINE switch 2. Afterwards, the first network device sends the same request message from port 3. After receiving the request message, SPINE switch 3 undergoes similar processing as SPINE switch 2, and sends permission message 1 to port 3 of the first network device. After receiving permission message 1 from port 3, the first network device changes the congested data flow to be sent from port 3. In one implementation, if the congested data flow exists in the data flow table of the first network device, the first network device also needs to change the egress port of the congested data flow in the data flow table from port 1 to port 3; if it does not exist, the congested data flow needs to be added to the data flow table, and its egress port needs to be marked as port 3. Subsequent messages of the congested flow are forwarded according to the egress recorded in the flow table. In one implementation, after the first network device determines to change the congested data flow to be sent from port 3, it needs to determine that the time difference between two adjacent messages belonging to the congested data flow is greater than a preset value before changing the congested data flow to be sent from port 3.
[0100] In the above steps, if the first network device receives a data flow destined for the TOR switch 3, if the data flow exists in the data flow table of the first network device, the first network device sends the data flow according to the egress port corresponding to the data flow in the data flow table; if it does not exist, the first network device determines the port for sending the data flow in the path state table maintained for the TOR switch 3. Based on the above description, please refer to Table 10, which shows a possible situation of the path state table maintained by the first network device for the TOR switch 3:
[0101] Table 10
[0102]
[0103] Since the downstream congestion information of port 1 in the path state table is the second degree of congestion, and the local congestion information and downstream congestion information of port 2 and port 3 are both the third degree of congestion, the first network device can select one between port 2 and port 3 as the port for sending the above data flow, and add the corresponding information in the data flow table. For example, the first network device sends the data flow from port 3, and the data flow is the first data flow. The first network device adds the outgoing port of the data flow as port 3 in the data flow table.
[0104] Or in another implementation, after receiving the above data stream, the first network device selects a port for sending the data stream based on ECMP, for example, the selected port is port 1. After the port selection is completed, the local congestion information and downstream congestion information of port 1 are queried in Table 9 to determine whether port 1 is a suitable port. Since the downstream congestion information of port 1 is the second degree of congestion, the first network device re-determines the port whose local congestion information and downstream congestion information are the third degree of congestion based on Table 9 as the port for sending the data stream, for example, port 3, and adds the corresponding information in the data flow table. If the outgoing port selected based on ECMP is port 3, after the port selection is completed, the local congestion information and downstream congestion information of port 3 are queried in Table 9 to determine that port 3 is a suitable port, and there is no need to record the port for sending the data stream in the data flow table.
[0105] The above describes the case where the downstream congestion information of port 1 is the first degree of congestion. The following describes the case where the local congestion information of port 1 is the first degree of congestion:
[0106] Exemplarily, the path state table maintained by the first network device for the TOR switch 3 is shown in Table 11:
[0107] Table 11
[0108]
[0109] Since the local congestion information of port 1 is the first degree of congestion, the first network device will determine the congested data flow that causes the local congestion information of port 1 to be the first degree of congestion. Exemplarily, the congested data flow is sent from port 1 and the destination is TOR switch 3. Afterwards, the first network device switches the congested data flow to the target port in Table 10 for sending. The target port is the port whose local congestion information is the third degree of congestion, and preferably the downstream congestion information is also the third degree of congestion. Therefore, the first network device switches the above congested data flow to port 3 for sending.
[0110] In an embodiment of the present application, the first network device can determine the local congestion information and downstream congestion information of each port, and select a suitable port to send the data flow based on the information, so that the data flow can bypass the congested path, thereby alleviating the congestion in the network.
[0111] In the above, one case of the method for sending a data stream in an embodiment of the present application is introduced in combination with a 2-level Clos topology. Please refer to step A01 to step A02. Next, another case of the method for sending a data stream in an embodiment of the present application is introduced in combination with a 2-level Clos topology:
[0112] A01. The first network device obtains status information of the first port, where the status information includes local congestion information and downstream congestion information of the first port, where the local congestion information is used to indicate the congestion level of the first port, and the downstream congestion information is used to indicate the congestion level of the downstream path corresponding to the first port;
[0113] In this embodiment, the method of dividing ECMP Group and the method of obtaining local congestion information of the port are the same as those described above. Figure 7 In this embodiment, the downstream congestion information of the port is updated based on the PFC pause frame received by the port, see Fig. 9, illustratively, TOR switch 1 sends data stream 1 from port 1 to SPINE switch 1, TOR switch 2 sends data stream 2 from port 7 to SPINE switch 1, and SPINE switch 1 sends data stream 1 and data stream 2 from port 6 to TOR switch 3, thus causing data stream 1 and data stream 2 to conflict at port 6. Afterwards, SPINE switch 1 sends PFC frames to TOR switch 1 and TOR switch 2 through port 4 and port 5 respectively. Taking TOR switch 1 as an example, TOR switch 1 receives the above PFC frame from port 1, thus detecting the data stream sent from port 1, and updating the downstream congestion information of port 1 to the first degree of congestion in the corresponding path state table based on the destination of the detected data stream. For example, TOR switch 1 detects that data stream 1 is sent from port 1, and obtains that the destination of data stream 1 is TOR switch 3, so TOR switch 1 updates the downstream congestion information of port 1 to the first degree of congestion in the path state table maintained for TOR switch 3, and the processing of other data streams sent from port 1 is similar, which will not be repeated here. Assume that the utilization rate and queue length of port 2 of TOR switch 1 are both less than the preset value, and port 2 does not receive the PFC pause frame, so in all path state tables maintained by TOR switch 1, the local congestion information and downstream congestion information of port 2 are both third degree congestion. In this embodiment, the first network device is TOR switch 1, the first port is port 2, and data flow 1 is the first data flow.
[0114] A02. The first network device sends a first data stream from the first port according to the state information of the first port.
[0115] In this embodiment, after receiving the PFC pause frame, port 1 of the first network device needs to select whether to switch all data streams sent from port 1 to other ports with a probability of 50%. If so, taking the above data stream 1 as an example, the destination of data stream 1 is TOR switch 3, so the first network device uses the port with downstream congestion information of the third degree of congestion as the first port for sending data stream 1 in the path state table maintained for TOR switch 3. Since in the above path state table, the local congestion information and downstream congestion information of the first port are both the third degree of congestion, the first network device can switch data stream 1 to the first port for sending.
[0116] Alternatively, after receiving the PFC pause frame, port 1 of the first network device must switch part of the data streams sent from port 1 to other ports, and each data stream chooses whether to switch to other ports for sending according to a probability of 50%. For example, there is a 50% probability that data stream 1 is switched to other ports for sending. If it is determined that switching is required according to the probability, data stream 1 is switched to the first port for sending according to the above method.
[0117] In addition, in this embodiment, the processing method for the local congestion information of port 1 when it is the first degree of congestion is the same as the above Figure 7 The similarities to those in the illustrated embodiment will not be repeated here.
[0118] Two and three-layer Fattree topology.
[0119] The method for sending a data stream in the embodiment of the present application is introduced above in combination with the two-level Clos topology, please refer to step B01 to step B02. The method for sending a data stream in the embodiment of the present application is introduced below in combination with the three-layer Fattree topology:
[0120] B01. The first network device obtains status information of the first port, where the status information includes local congestion information and downstream congestion information of the first port, where the local congestion information is used to indicate the congestion level of the first port, and the downstream congestion information is used to indicate the congestion level of the downstream path corresponding to the first port;
[0121] See also Fig.10 In the three-layer Fattree topology, TOR switch 1, TOR switch 2, LEAF switch 1 and LEAF switch 2 are POD1, and TOR switch 3, TOR switch 4, LEAF switch 3 and LEAF switch 4 are POD2. For each switch, each TOR switch in the POD where it is located is an ECMP Group, and the remaining PODs are an ECMP Group for each POD. The switch maintains a corresponding path state table for each ECMP Group except itself, that is, the switch in the POD maintains a corresponding path state table for the remaining TOR switches in the POD where it is located, and maintains a corresponding path state table for the remaining PODs. For example, TOR switch 1 maintains a corresponding path state table for TOR switch 2 in the same POD, and maintains a corresponding path state table for POD2. The SPINE switch maintains a corresponding path state table for each POD. The specific form of the path state table is similar to that described above and will not be repeated here.
[0122] Exemplarily, the local congestion level of port 1 of LEAF switch 3 leading to TOR switch 3 is the first degree of congestion. Since there are no other ports whose local congestion level and downstream congestion level are both the third degree of congestion in the path state table maintained by LEAF switch 3 for TOR switch 3, LEAF switch 3 will determine the congested data flow that causes the local congestion level of port 1 to be the first degree of congestion. Exemplarily, the congested data flow is sent from port 2 of TOR switch 1, passes through port 7 and port 5 in sequence, and is sent from port 1 to the destination TOR switch 3. Since LEAF switch 3 receives the above-mentioned congested data flow from port 3, LEAF switch 3 sends message A from port 3, and message A includes indication information, the identifier of the ECMP Group corresponding to TOR switch 3, information indicating the congested data flow, and congestion indication information. The above-mentioned indication information is used to indicate that the downstream congestion information is the first degree of congestion, and the congestion indication information includes the congestion level and the congested port direction. Take the TOR switch as the first layer, the LEAF switch as the second layer, and the SPINE switch as the third layer as an example, so the congestion level is the second layer; and port 1 is the downstream port of the LEAF switch 3, so the congested port direction is the downstream port. In addition, the LEAF switch 3 will also send message B from port 4 and port 12. Message B includes indication information and the identifier of the ECMPGroup corresponding to the TOR switch 3. The above indication information is used to indicate that the downstream congestion information is the first degree of congestion. After the SPINE switch 1 receives message A through port 5, since message A comes from POD2, the SPINE switch 1 updates the downstream congestion information of port 5 to the first degree of congestion in the path state table maintained for POD2, and since there is no local congestion information and other ports whose downstream congestion information is the third degree of congestion in the path state table, the SPINE switch 1 sends message C to the LEAF switch 1. Message C includes indication information, the identifier of the ECMP Group corresponding to POD2, information indicating the congested data flow, and congestion indication information. The indication information is used to indicate that the downstream congestion information is the first degree of congestion. After SPINE switch 2 receives message B through port 6, since message B comes from POD2, SPINE switch 2 updates the downstream congestion information of port 6 to the first degree congestion in the path state table maintained for POD2, and since there is no local congestion information and other ports whose downstream congestion information is the third degree congestion in the path state table, SPINE switch 2 sends message D to LEAF switch 1. Message D includes indication information and the identifier of the ECMP Group corresponding to POD2. The above indication information is used to indicate that the downstream congestion information is the first degree congestion.
[0123] LEAF switch 1 receives the above message C from port 7 and the above message D from port 8, and updates the downstream congestion information of port 7 and port 8 in the path state table maintained for POD2 to the first degree of congestion. Since there is no local congestion information and other ports whose downstream congestion information is the third degree of congestion in the path state table, LEAF switch 1 sends message E to TOR switch 1 and message F to TOR switch 2. Message E is similar to the above message C, and message F is similar to the above message D. Taking TOR switch 1 as an example, TOR switch 1 receives message E from port 2, and according to the identifier of the ECMP Group corresponding to POD2 in message E, updates the downstream congestion information of port 2 in the path state table maintained for POD2 to the first degree of congestion. Assuming that the utilization rate and queue length of port 2 and port 9 of TOR switch 1 are less than the preset value, and port 9 has not received the message indicating the downstream congestion information including the ECMP Group identifier corresponding to POD2, the path state table maintained by TOR switch 1 for POD2 is shown in Table 12:
[0124] Table 12
[0125]
[0126] In this embodiment, the first network device is TOR switch 1, and the first port is port 9.
[0127] B02. The first network device sends a first data stream from the first port according to the state information of the first port.
[0128] Since the downstream congestion information of port 2 is the first degree of congestion and the congested data flow causes the congestion, the first network device needs to switch the congested data flow to other ports for transmission. In one implementation, since the local congestion information and downstream congestion information of the first port are both the third degree of congestion, the first network device can directly switch the congested data flow to the first port for transmission.
[0129] Or in another case, the first network device sends a request message from the first port, and the request message includes information indicating the congested data flow and congestion indication information. After receiving the request message, the LEAF switch 2 determines whether there is a port with local congestion information and downstream congestion information of the third degree congestion from the path state table maintained for POD2 based on the information indicating the congested data flow. If not, a permission message 1 is sent to the TOR switch 1, and the permission message 1 is used to indicate that the TOR switch 1 is not allowed to send the congested data flow from the first port to the LEAF switch 2. If it exists, the LEAF switch 2 further determines whether it is the switch corresponding to the congestion level, and whether the port forwarding the congested data flow is consistent with the direction of the congested port. In this embodiment, in the path state table maintained by the LEAF switch 2 for POD2, the local congestion information and downstream congestion information of port 10 and port 11 are both third degree congestion, and the LEAF switch 2 is the switch corresponding to the congestion level. However, since the port through which the LEAF switch 2 forwards the congested data flow is an uplink port rather than a downlink port, that is, it is inconsistent with the direction of the congested port, the LEAF switch 2 sends the same request message from port 10 or port 11. For example, the LEAF switch 2 sends a request message from port 11, and after receiving the request message, the SPINE switch 4 sends a request message to the LEAF switch 4 after similar processing. Since the LEAF switch 4 is a switch corresponding to the congestion level, the port through which it forwards the congested data flow is also a downlink port, and in the path state table maintained by the LEAF switch 4 for the TOR switch 3, there is a switchable port whose local congestion information and downstream congestion information are both third-degree congested and in an available state, so the LEAF switch 4 sends a permission message 2 to the TOR switch 1, and the permission message 2 is used to instruct the LEAF switch 4 to allow the congested data flow to be sent from the above-mentioned switchable port to the TOR switch 3. After receiving the permission message from the first port, the TOR switch 1 switches the congested data flow to the first port for transmission.
[0130] 3. Direct connection topology.
[0131] Please refer to step C01 to step C02. The method for sending a data stream in the embodiment of the present application is introduced below in combination with the direct connection topology:
[0132] C01. The first network device obtains status information of the first port, where the status information includes local congestion information and downstream congestion information of the first port, where the local congestion information is used to indicate the congestion level of the first port, and the downstream congestion information is used to indicate the congestion level of the downstream path corresponding to the first port;
[0133] See also Fig.11In the direct connection topology, for each switch, each switch in the switch group it is in is an ECMP Group, and each of the remaining switch groups is an ECMP Group. Taking switch 9 as an example, switch 9 maintains corresponding path state tables for switch group 1, switch group 2, and switch group 4, respectively, and maintains corresponding path state tables for switch 8, switch 10, and switch 11 in switch group 3, respectively.
[0134] If congestion occurs at port 1 of switch 9 connected to switch group 2, then in the path state table maintained by switch 9 for switch group 2, the local congestion information of port 1 is first degree congestion. It should be noted that the path state table only includes the shortest path from switch 9 to switch group 2, that is, only port 1, so there is no other port in the path state table whose local congestion information and downstream congestion information are all third degree congestion. Therefore, switch 9 will determine that the congested data flow that causes the local congestion information of port 1 is the first degree congestion. Exemplarily, the congested data flow is sent from port 2 of switch 8 and sent to switch group 2 through port 1. Switch 9 sends message 1 to port 1, which includes indication information, ECMP Group identifier corresponding to switch group 2, and information indicating the above congested data flow, and the above indication information is used to indicate that the downstream congestion degree is the first degree congestion. In addition, switch 9 will also send message 2 to switches 10 and 11, and the message 2 includes indication information and ECMP Group identifier corresponding to switch group 2, and the above indication information is used to indicate that the downstream congestion information is the first degree congestion. Taking switch 8 as an example, after receiving message 1 at port 2, switch 8 updates the downstream congestion information of port 2 in the path state table maintained by switch group 2 to the first degree of congestion.
[0135] In this embodiment, the first network device is switch 8, and the first port is port 3. Assume that the utilization rate and queue length of port 3 are both less than the preset value, and no message including downstream congestion information is received, so in the above path state table, the local congestion information and downstream congestion information of port 3 are both third degree congestion.
[0136] C02. The first network device sends a first data stream from the first port according to the state information of the first port.
[0137] The first network device needs to switch the congested data flow to the port whose downstream congestion information in the above-mentioned path state table is the third degree of congestion for transmission. Since in the above-mentioned path state table, the local congestion information and the downstream congestion information of the first port are both the third degree of congestion, the first network device can directly switch the congested data flow to the first port for transmission. The congested data flow is the first data flow.
[0138] The method for sending a data stream in the embodiment of the present application is introduced above. The first network device in the embodiment of the present application is introduced below:
[0139] See also Fig.12 The first network device in the embodiment of the present application includes an acquisition unit 1201 and a transceiver unit 1202.
[0140] The acquisition unit 1201 is used to acquire status information of the first port, where the status information includes local congestion information and downstream congestion information of the first port, where the local congestion information is used to indicate the congestion level of the first port, and the downstream congestion information is used to indicate the congestion level of the downstream path corresponding to the first port.
[0141] The transceiver unit 1202 is configured to send a first data stream from a first port according to the state information.
[0142] In one possible implementation,
[0143] The acquiring unit 1201 is specifically configured to receive a first message from a first port, where the first message includes the downstream congestion information.
[0144] The acquiring unit 1201 is specifically configured to acquire downstream congestion information of a first port according to a first message.
[0145] In one possible implementation,
[0146] The acquiring unit 1201 is specifically configured to receive a PFC frame from a first port, where the PFC frame indicates that a downstream path corresponding to the first port is congested.
[0147] The acquiring unit 1201 is specifically configured to acquire downstream congestion information of the first port according to the PFC frame.
[0148] In one possible implementation,
[0149] The acquisition unit 1201 is further used to receive a second message from a second port, the second message including information indicating the first data flow, the second message being used to notify that the first data flow causes congestion in the downstream path of the second port, and the second port is the port through which the first network device sends the first data flow.
[0150] The transceiver unit 1202 is specifically configured to determine, according to the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port.
[0151] The transceiver unit 1202 is specifically configured to switch a port for sending the first data stream from the second port to the first port.
[0152] In one possible implementation,
[0153] The acquiring unit 1201 is further configured to receive a PFC frame from the second port.
[0154] The acquiring unit 1201 is further configured to determine, according to the PFC frame, that the first data flow causes congestion in the downstream path of the second port.
[0155] The transceiver unit 1202 is specifically configured to determine, according to the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port.
[0156] The transceiver unit 1202 is specifically configured to switch a port for sending the first data stream from the second port to the first port.
[0157] In one possible implementation,
[0158] The acquiring unit 1201 is further configured to determine that local congestion occurs on the second port that sends the first data stream.
[0159] The transceiver unit 1202 is specifically configured to determine, according to the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port.
[0160] The transceiver unit 1202 is specifically configured to switch a port for sending the first data stream from the second port to the first port.
[0161] In one possible implementation,
[0162] The transceiver unit 1202 is specifically configured to determine that the congestion level indicated by the downstream congestion information of the first port is the smallest among all ports except the second port.
[0163] In one possible implementation,
[0164] The transceiver unit 1202 is further configured to send a first request message from the first port, where the first request message is used to request that the first data flow be sent through a path corresponding to the first port.
[0165] The transceiver unit 1202 is further configured to receive a first grant message in response to the first request message from the first port, wherein the first grant message is used to indicate that the first data flow is permitted to be sent through a path corresponding to the first port.
[0166] In one possible implementation,
[0167] The transceiver unit 1202 is further configured to send a second request message from the third port, where the second request message is used to request that the first data flow be sent through a path corresponding to the third port.
[0168] The transceiver unit 1202 is further configured to receive a second permission message in response to the request message from the third port, wherein the second permission message is used to indicate that the first data flow is not permitted to be sent through the path corresponding to the third port.
[0169] In one possible implementation,
[0170] The transceiver unit 1202 is specifically configured to determine that the congestion level indicated by the local congestion information of the first port is the smallest among all ports except the second port.
[0171] In one possible implementation,
[0172] The transceiver unit 1202 is further configured to determine whether a time difference between two adjacent messages belonging to the first data stream received is greater than a preset value.
[0173] In one possible implementation, the congestion levels include a first congestion level, a second congestion level, and a third congestion level. The first congestion level indicates that the utilization rate and the queue length of the port are both greater than a preset value, or the port is in a PFC state. The second congestion level indicates that the utilization rate of the port is greater than a preset value, and the queue length is less than a preset value. The third congestion level indicates that the utilization rate and the queue length of the port are less than a preset value.
[0174] In a possible implementation, the first network device is a TOR switch in a two-level Clos topology, or a switch in a direct-connect topology, or a TOR switch, a LEAF switch, or a SPINE switch in a three-layer Fattree topology.
[0175] In a possible implementation manner, the first message and the second message are RDMA messages.
[0176] Fig.13 1 is a schematic diagram of a first network device provided by the present application, which is used to implement the methods in the above-mentioned embodiments. The first network device 1300 may include one or more central processing units (CPU) 1301 and a memory 1305, in which one or more application programs or data are stored.
[0177] Among them, the memory 1305 can be a volatile storage or a persistent storage. The program stored in the memory 1305 may include one or more modules, and each module may include a series of instruction operations in the server. Further, the central processor 1301 can be configured to communicate with the memory 1305 and execute a series of instruction operations in the memory 1305 on the first network device 1300. The first network device 1300 may also include one or more power supplies 1302, one or more wired or wireless network interfaces 1303, one or more input and output interfaces 1304, and / or, one or more operating systems.
[0178] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0179] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0180] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0181] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0182] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A method for sending a data stream, characterized in that: include: The first network device acquires state information of the second port, where the state information of the second port includes local congestion information and downstream congestion information of the second port, where the local congestion information is used to indicate a congestion level of the second port, and the downstream congestion information is used to indicate a congestion level of a downstream path corresponding to the second port; The first network device sends a first data stream from a first port according to the state information of the second port, the second port being different from the first port, The first network device acquires the status information of the second port, including: The first network device receives a first message from the second port, the first message includes the downstream congestion information, and the first message is sent by the network device on the downstream path when the port is congested.
2. The method according to claim 1, characterized in that The congestion level of the downstream path includes the congestion level of an egress port of a network device on the downstream path.
3. The method according to claim 2, characterized in that The first network device is a LEAF switch, and the network device on the downstream path is a SPINE switch.
4. The method according to any one of claims 1 to 3, characterized in that: The first message includes information indicating the first data flow, the first message is used to notify that the first data flow causes congestion in the downstream path of the second port, and the second port is a port through which the first network device sends the first data flow before port switching; The first network device sends a first data stream from a first port according to the state information of the second port, including: The first network device determines, based on the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port; The first network device switches the port for sending the first data flow from the second port to the first port.
5. The method according to any one of claims 1 to 3, characterized in that The method further comprises: The first network device determines that the second port that sends the first data flow before the port switching is locally congested; The first network device sending the first data stream from the first port according to the state information of the second port includes: The first network device determines, based on the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port; The first network device switches the port for sending the first data flow from the second port to the first port.
6. The method according to claim 4, characterized in that The first network device determines, according to the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port, including: The first network device determines that a congestion level indicated by the downstream congestion information of the first port is the smallest among all ports except the second port.
7. The method according to claim 6, characterized in that Before the first network device switches the port for sending the first data flow from the second port to the first port, the method further includes: The first network device sends a first request message from the first port, where the first request message is used to request that the first data flow be sent through a path corresponding to the first port; The first network device receives a first grant message in response to the first request message from the first port, where the first grant message is used to indicate that the first data flow is allowed to be sent through a path corresponding to the first port.
8. The method according to claim 6, characterized in that The method further comprises: The first network device sends a second request message from the third port, where the second request message is used to request that the first data flow be sent through a path corresponding to the third port; The first network device receives a second grant message in response to the second request message from the third port, where the second grant message is used to indicate that the first data flow is not allowed to be sent through a path corresponding to the third port.
9. The method according to claim 5, characterized in that The first network device determines, according to the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port, including: The first network device determines that the congestion level indicated by the local congestion information of the first port is the smallest among all ports except the second port.
10. The method according to claim 4, characterized in that Before the first network device switches the port for sending the first data stream from the second port to the first port, the method further includes: the first network device determining that a time difference between two adjacent messages belonging to the first data stream received is greater than a preset value.
11. The method according to any one of claims 1 to 3, characterized in that The congestion degree includes a first degree of congestion, a second degree of congestion and a third degree of congestion. The first degree of congestion indicates that the utilization rate and the queue length of the port are both greater than a preset value, or the port is in a PFC state. The second degree of congestion indicates that the utilization rate of the port is greater than the preset value and the queue length is less than the preset value. The third degree of congestion indicates that the utilization rate and the queue length of the port are less than the preset value.
12. The method according to claim 1, characterized in that The first network device is a switch in a direct connection topology, or a TOR switch, a LEAF switch or a SPINE switch in a three-layer Fattree topology, and the network device on the downstream path is a switch in the direct connection topology, or a LEAF switch or a SPINE switch in a three-layer Fattree topology.
13. The method according to any one of claims 1 to 3, characterized in that The first message is a remote direct data access RDMA message.
14. A network device, the network device being used as a first network device, characterized in that: include: an acquiring unit, configured to acquire status information of a second port, wherein the status information of the second port includes local congestion information and downstream congestion information of the second port, wherein the local congestion information is used to indicate a congestion degree of the second port, and the downstream congestion information is used to indicate a congestion degree of a downstream path corresponding to the second port; a transceiver unit, configured to send a first data stream from a first port according to state information of the second port, the second port being different from the first port; The acquisition unit is specifically configured to receive a first message from the second port, wherein the first message includes the downstream congestion information, and the first message is sent by a network device on the downstream path when a port is congested.
15. The network device according to claim 14, characterized in that: The congestion level of the downstream path includes the congestion level of an egress port of a network device on the downstream path.
16. The network device according to claim 15, characterized in that: The first network device is a LEAF switch, and the network device on the downstream path is a SPINE switch.
17. The network device according to any one of claims 14 to 16, characterized in that: The first message includes information indicating the first data flow, the first message is used to notify that the first data flow causes congestion in the downstream path of the second port, and the second port is a port through which the first network device sends the first data flow before port switching; The transceiver unit is specifically configured to determine, based on the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port; The transceiver unit is specifically configured to switch a port for sending the first data stream from the second port to the first port.
18. The network device according to any one of claims 14 to 16, characterized in that: The acquisition unit is further used to determine that the second port sending the first data flow before the port switching occurs local congestion; The transceiver unit is specifically configured to determine, based on the state information of the first port, that the congestion level of the first port is the smallest among all ports except the second port; The transceiver unit is specifically configured to switch a port for sending the first data stream from the second port to the first port.
19. The network device according to claim 17, characterized in that: The transceiver unit is specifically configured to determine that the congestion level indicated by the downstream congestion information of the first port is the smallest among all ports except the second port.
20. The network device according to claim 19, characterized in that: The transceiver unit is further used to send a first request message from the first port, where the first request message is used to request that the first data flow be sent through a path corresponding to the first port; The transceiver unit is further used to receive a first permission message in response to the first request message from the first port, wherein the first permission message is used to indicate that the first data flow is allowed to be sent through a path corresponding to the first port.
21. The network device according to claim 19, characterized in that: The transceiver unit is further used to send a second request message from the third port, where the second request message is used to request that the first data flow be sent through a path corresponding to the third port; The transceiver unit is further configured to receive a second permission message in response to the second request message from the third port, wherein the second permission message is used to indicate that the first data flow is not permitted to be sent through a path corresponding to the third port.
22. The network device according to claim 18, characterized in that: The transceiver unit is specifically configured to determine that the congestion level indicated by the local congestion information of the first port is the smallest among all ports except the second port.
23. The network device according to claim 18, characterized in that: The transceiver unit is further configured to determine whether a time difference between two adjacent messages belonging to the first data flow is received is greater than a preset value.
24. The network device according to any one of claims 14 to 16, characterized in that: The congestion degree includes a first degree of congestion, a second degree of congestion and a third degree of congestion. The first degree of congestion indicates that the utilization rate and the queue length of the port are both greater than a preset value, or the port is in a PFC state. The second degree of congestion indicates that the utilization rate of the port is greater than the preset value and the queue length is less than the preset value. The third degree of congestion indicates that the utilization rate and the queue length of the port are less than the preset value.
25. The network device according to claim 14, characterized in that: The first network device is a switch in a direct connection topology, or a TOR switch, a LEAF switch or a SPINE switch in a three-layer Fattree topology, and the network device on the downstream path is a switch in a direct connection topology, or a LEAF switch or a SPINE switch in a three-layer Fattree topology.
26. The network device according to any one of claims 14 to 16, characterized in that: The first message is a remote direct data access RDMA message.
27. A network device, characterized in that: Used as a first network device, the network device comprises a processor and a memory, the processor is coupled to the memory, the memory is used to store instructions, when the instructions are executed by the processor, the network device performs any one of the methods in the preceding claims 1 to 13.
28. A computer-readable storage medium having computer instructions or programs stored thereon, characterized in that: When the computer instructions or program are executed by the processor, the first network device executes the method according to any one of claims 1 to 13.
29. A computer program product comprising computer instructions or a program, characterized in that When the computer instructions or program are executed by the processor, the first network device executes the method according to any one of claims 1 to 13.
30. A system for sending a data stream, characterized in that: The system includes: a first network device and a network device on a downstream path corresponding to a second port of the first network device; The first network device is used to perform the method according to any one of claims 1 to 13; The network device on the downstream path is used to send the first message to the first network device when a port of the network device on the downstream path is congested.
Citation Information
Patent Citations
Congestion information collection method, optimal path determination method and network switch
CN112787925A