Data stream transmission methods, systems, devices and equipment

By acquiring fault information from the communication device and adjusting the transmission path, the problem of data flow interruption caused by link failure between data centers was solved, achieving reliable data flow transmission and improved link utilization.

CN123123250APending Publication Date: 2026-11-17HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611242545.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

When transmitting data streams between multiple data centers, link failures can cause data stream transmission interruptions. Existing technologies struggle to continue transmitting data streams under fault conditions, leading to link congestion between data centers and a decline in training performance.

Method used

By acquiring fault information from the communication device, the transmission path of the data stream is adjusted to avoid the faulty link. The transmission path is switched using higher priority port relationships to ensure that the transmission rate of the data stream matches at the near end and the far end, thus avoiding congestion.

Benefits of technology

It enables reliable data stream transmission in the event of link failure, improves the utilization of transmission links between data centers and the reliability of data stream transmission, avoids link congestion at remote ends, and enhances the data stream transmission performance between data centers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123250A_ABST
    Figure CN123123250A_ABST
Patent Text Reader

Abstract

This application discloses a data stream transmission method, system, apparatus, and device, belonging to the field of communication technology. The method includes: a first communication device transmitting a first data stream received at the first input port to a second communication device through a first output port according to a first correspondence relationship corresponding to a first input port; after obtaining fault information indicating at least one of a faulty link or a first data stream transmitted through a faulty link, determining a second correspondence relationship corresponding to the first data stream based on the fault information; the second correspondence relationship instructing the first data stream received at the first input port to be transmitted through a second output port; and transmitting subsequent messages of the first data stream to the second communication device through the second output port, wherein the subsequent messages of the first data stream are transmitted through a link between the first and second communication devices that does not include the faulty link, to avoid the subsequent messages of the transmitted first data stream passing through the faulty link.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202510271012.6 and the original application date is March 5, 2025. The entire contents of the original application are incorporated herein by reference. Technical Field

[0002] This application relates to the field of communication technology, and in particular to data stream transmission methods, systems, apparatus and equipment. Background Technology

[0003] In the field of communication technology, data streams are transmitted between multiple data centers (DCs). Taking the training of large-scale artificial intelligence (AI) models as an example, since a single DC cannot provide the computing resources required to train a large AI model, multiple DCs are used for collaborative training. During the collaborative training process, data streams are transmitted between the multiple DCs. However, link failures may occur during the operation of DCs. Therefore, how to transmit data streams under link failure conditions has become an urgent problem to be solved. Summary of the Invention

[0004] This application provides a data stream transmission method, system, apparatus, and device for transmitting data streams in the event of a link failure. The technical solution is as follows.

[0005] A first aspect provides a data stream transmission method applied to a first communication device, the first communication device being connected to a second communication device via a first output port and a second output port. The method includes: receiving a first data stream through a first input port; transmitting the first data stream to the second communication device through the first output port according to a first correspondence relationship corresponding to the first input port, the first correspondence relationship indicating that the data stream received at the first input port is transmitted through the first output port; acquiring fault information, the fault information indicating at least one of a faulty link or a first data stream transmitted through the faulty link, the faulty link being a link between the first communication device and the second communication device; determining a second correspondence relationship corresponding to the first data stream based on the fault information, the second correspondence relationship indicating that the first data stream received at the first input port is transmitted through the second output port; and transmitting subsequent messages of the first data stream to the second communication device through the second output port, wherein the link through which the subsequent messages of the first data stream are transmitted between the first communication device and the second communication device does not include the faulty link.

[0006] Since the first data stream passes through a faulty link when sent from the first output port to the second communication device, but not when sent from the second output port, a second correspondence is established for the first data stream. This allows the first communication device to receive the first data stream using the first input port and then send it using the second output port, avoiding the transmission of subsequent messages through the faulty link. This enables switching of the transmission link for the first data stream, and the switching process is simple. Because the first communication device is used to send the first data stream, it is located near the origin of the first data stream. By adjusting the output port for transmitting the first data stream at the near end, the transmission rate of the first data stream can be matched between the near and far ends, preventing congestion at the far end due to the inability to transmit the first data stream in a timely manner.

[0007] In one possible implementation, a first correspondence corresponding to the first input port indicates that the data stream received by the first input port of the first communication device is sent through the first output port. This first correspondence may include setting the output port corresponding to the first input port as the first output port. Determining a second correspondence corresponding to the first data stream includes adjusting the output port corresponding to the first input port in the first correspondence from the first output port to the second output port, thus obtaining the second correspondence. In this case, the data stream received through the first input port can be sent through the second output port.

[0008] In one possible implementation, the second correspondence has a higher priority than the first correspondence. Because the second correspondence has a higher priority than the first correspondence, even if the first communication device stores both the first and second correspondences, it will look up the second correspondence when forwarding the first data stream. This avoids the situation where the first data stream is mistakenly sent using the first output port due to a misreading of the first correspondence during transmission.

[0009] In one possible implementation, the port number of the second output port is consecutive to the port number of the first output port. In this case, an output port with a consecutive port number to the first output port can be selected as the second output port. The process of selecting the second output port is simple and has low operational complexity.

[0010] In one possible implementation, the first communication device stores a third correspondence corresponding to the second input port. This third correspondence indicates that the data stream received by the second input port of the first communication device is sent through the second output port. The method further includes: receiving a second data stream through the second input port and sending the second data stream to the second communication device through the second output port. The link through which the second data stream is transmitted between the first and second communication devices is the same as the link through which subsequent messages of the first data stream are transmitted between the first and second communication devices. In this case, even if the second output port is also used to transmit the second data stream to the second communication device, since the second and first data streams share the same path throughout, and are sent through the same second output port and received through the same input port in the second communication device, the transmission rate of the data streams (first and second data streams) at the first communication device matches the transmission rate of the data streams at the second communication device, thus preventing congestion on the link connected to the second communication device due to the inability to transmit data streams in a timely manner.

[0011] In one possible implementation, obtaining fault information includes receiving fault information sent by the control device. Since the control device can determine the global network state, fault information sent based on the global network state has high accuracy.

[0012] In one possible implementation, after transmitting subsequent messages of the first data stream to the second communication device via the second output port, the method further includes: in the event of recovery from a faulty link, determining a fourth correspondence corresponding to the first input port, the fourth correspondence indicating that the data stream received by the first input port is sent through the first output port; receiving messages to be transmitted in the first data stream through the first input port; and transmitting the messages to be transmitted in the first data stream to the second communication device through the first output port. After recovery from a faulty link, the fourth correspondence is used to restore the output port corresponding to the first input port when forwarding the first data stream from the second output port back to the first output port, so as to promptly utilize the recovered link to transmit the first data stream, resulting in high link utilization.

[0013] In one possible implementation, determining the fourth correspondence corresponding to the first input port includes: obtaining recovery information, which indicates at least one of a faulty link recovering from a fault or a first data stream transmitted through the recovered faulty link; and determining the fourth correspondence based on the recovery information. This application does not limit the recovery information; it can indicate the faulty link recovering from a fault, the first data stream, or both, offering high flexibility. In one possible scenario, the fourth correspondence can be the first correspondence or a newly created port correspondence; this application does not limit this.

[0014] In one possible implementation, the first output port and the second output port are connected to the second communication device via a third communication device and a fourth communication device. This application does not limit the connection between the first and second communication devices; they can be indirectly connected via multiple communication devices, making it applicable to indirect connection scenarios.

[0015] In one possible implementation, the faulty link connects the first communication device and the third communication device, or the faulty link connects the third communication device and the fourth communication device, or the faulty link connects the fourth communication device and the second communication device. This application does not limit the faulty link; it can be directly connected to the first communication device or indirectly connected, making it applicable to various fault scenarios and highly versatile.

[0016] In one possible implementation, the first and third communication devices are located in the first data center, with the third communication device located at the exit of the first data center; the second and fourth communication devices are located in the second data center, with the fourth communication device located at the entrance of the second data center. This application is applicable to long-distance scenarios across data centers and has a wide range of applications.

[0017] In one possible implementation, the first communication device and the second communication device are leaf switches. The data stream transmission method provided in this application can be applied to data centers with a spine-leaf network structure. It can continue to transmit the first data stream between leaf switches even when a link in the spine-leaf network fails, thereby improving the reliability of data stream transmission in the spine-leaf network.

[0018] In a second aspect, a transmission system is provided, comprising a first communication device and a second communication device. The first communication device is connected to the second communication device via a first output port and a second output port. The first communication device is configured to receive a first data stream via a first input port. The first communication device is further configured to transmit the first data stream to the second communication device via the first output port according to a first correspondence relationship corresponding to the first input port, wherein the first correspondence relationship indicates that the data stream received at the first input port is transmitted via the first output port. The first communication device is further configured to acquire fault information, wherein the fault information indicates at least one of a faulty link or a first data stream transmitted via the faulty link, wherein the faulty link is a link between the first communication device and the second communication device. The first communication device is further configured to determine a second correspondence relationship corresponding to the first data stream based on the fault information, wherein the second correspondence relationship indicates that the first data stream received at the first input port is transmitted via the second output port. The first communication device is further configured to transmit subsequent messages of the first data stream to the second communication device via the second output port. The second communication device is configured to receive subsequent messages of the first data stream, wherein the link through which the subsequent messages of the first data stream are transmitted between the first communication device and the second communication device does not include the faulty link.

[0019] In one possible implementation, the second correspondence has a higher priority than the first correspondence.

[0020] In one possible implementation, the port number of the second output port is consecutive to the port number of the first output port.

[0021] In one possible implementation, the first communication device stores a third correspondence corresponding to the second input port, the third correspondence indicating that the data stream received by the second input port of the first communication device is sent through the second output port; the first communication device is also used to receive the second data stream through the second input port and send the second data stream to the second communication device through the second output port; the second communication device is also used to receive the second data stream, the link through which the second data stream is transmitted between the first communication device and the second communication device is the same as the link through which subsequent messages of the first data stream are transmitted between the first communication device and the second communication device.

[0022] In one possible implementation, a first communication device is used to receive fault information sent by the control device.

[0023] In one possible implementation, the first communication device is further configured to, in the event of recovery of a faulty link, determine a fourth correspondence corresponding to the first input port, the fourth correspondence indicating that the data stream received by the first input port is sent through the first output port; receive a message to be transmitted in the first data stream through the first input port, and transmit the message to be transmitted in the first data stream to the second communication device through the first output port; the second communication device is further configured to receive the message to be transmitted in the first data stream.

[0024] In one possible implementation, a first communication device is configured to acquire recovery information, which indicates at least one of a faulty link that has recovered from a fault or a third data stream transmitted through the faulty link that has recovered from a fault; and to determine a fourth correspondence based on the recovery information.

[0025] In one possible implementation, the system further includes a third communication device and a fourth communication device, with the first output port and the second output port connected to the second communication device via the third communication device and the fourth communication device.

[0026] In one possible implementation, a first communication device is used to transmit subsequent messages of the first data stream to a third communication device through a second output port; the third communication device is used to receive subsequent messages of the first data stream and transmit subsequent messages of the first data stream to a fourth communication device according to the port correspondence of the first data stream in the third communication device; the fourth communication device is used to receive subsequent messages of the first data stream and transmit subsequent messages of the first data stream to a second communication device according to the port correspondence of the first data stream in the fourth communication device.

[0027] In one possible implementation, the faulty link connects the first communication device and the third communication device, or the faulty link connects the third communication device and the fourth communication device, or the faulty link connects the fourth communication device and the second communication device.

[0028] In one possible implementation, the first communication device and the third communication device are located in the first data center, the third communication device is located at the exit of the first data center, the second communication device and the fourth communication device are located in the second data center, and the fourth communication device is located at the entrance of the second data center.

[0029] In one possible implementation, the first communication device and the second communication device are leaf switches.

[0030] Thirdly, a data stream transmission device is provided. The device is applied to a first communication device, which is connected to a second communication device through a first output port and a second output port. The device includes: a transceiver module for performing receiving and / or sending related operations in the first aspect or any possible implementation of the first aspect; and a processing module for performing other operations besides receiving and / or sending related operations in the first aspect or any possible implementation of the first aspect.

[0031] In one possible implementation, the transceiver module is configured to receive a first data stream through a first input port; the transceiver module is further configured to transmit the first data stream to a second communication device through a first output port according to a first correspondence relationship corresponding to the first input port, the first correspondence relationship indicating that the data stream received at the first input port is transmitted through the first output port; the transceiver module is further configured to acquire fault information, the fault information indicating at least one of a faulty link or a first data stream transmitted through the faulty link, the faulty link being a link between the first communication device and the second communication device; the processing module is configured to determine a second correspondence relationship corresponding to the first data stream according to the fault information, the second correspondence relationship indicating that the first data stream received at the first input port is transmitted through the second output port; the transceiver module is further configured to transmit subsequent messages of the first data stream to the second communication device through the second output port, the subsequent messages of the first data stream being transmitted through a link between the first communication device and the second communication device not including the faulty link.

[0032] In one possible implementation, the second correspondence has a higher priority than the first correspondence.

[0033] In one possible implementation, the port number of the second output port is consecutive to the port number of the first output port.

[0034] In one possible implementation, the first communication device stores a third correspondence corresponding to the second input port. The third correspondence indicates that the data stream received by the second input port of the first communication device is sent through the second output port. The transceiver module is also used to receive the second data stream through the second input port and send the second data stream to the second communication device through the second output port. The link through which the second data stream is transmitted between the first communication device and the second communication device is the same as the link through which subsequent messages of the first data stream are transmitted between the first communication device and the second communication device.

[0035] In one possible implementation, a transceiver module is used to receive fault information sent by the control device.

[0036] In one possible implementation, the processing module is further configured to determine a fourth correspondence corresponding to the first input port in the event of recovery from a faulty link, wherein the fourth correspondence indicates that the data stream received at the first input port is sent through the first output port; the transceiver module is further configured to receive a message to be transmitted in the first data stream through the first input port and transmit the message to be transmitted in the first data stream to the second communication device through the first output port.

[0037] In one possible implementation, the transceiver module is used to acquire recovery information, which indicates at least one of the faulty link that has recovered from the fault or the first data stream transmitted through the faulty link that has recovered from the fault; the processing module is used to determine a fourth correspondence based on the recovery information.

[0038] In one possible implementation, the first output port and the second output port are connected to the second communication device via a third communication device and a fourth communication device.

[0039] In one possible implementation, the faulty link connects the first communication device and the third communication device, or the faulty link connects the third communication device and the fourth communication device, or the faulty link connects the fourth communication device and the second communication device.

[0040] In one possible implementation, the first communication device and the third communication device are located in the first data center, the third communication device is located at the exit of the first data center, the second communication device and the fourth communication device are located in the second data center, and the fourth communication device is located at the entrance of the second data center.

[0041] In one possible implementation, the first communication device and the second communication device are leaf switches.

[0042] Fourthly, a data stream transmission device is provided, the device including a processor and a memory coupled together, the memory for storing at least one instruction, and the processor for loading and executing the at least one instruction to cause the data stream transmission device to perform the methods in the above aspects.

[0043] In one possible implementation, the device includes a memory.

[0044] Fifthly, a computer-readable storage medium is provided, wherein at least one instruction is stored therein, the instruction being loaded and executed by a processor to implement the methods in the above aspects.

[0045] In a sixth aspect, a computer program (product) is provided, comprising computer programs / instructions, which are executed by a processor to enable a computer to perform the methods described in the foregoing aspects.

[0046] A seventh aspect provides a communication device comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal interconnection path. The memory stores instructions, and the processor executes the instructions stored in the memory to control the transceiver to receive and transmit signals. When the processor executes the instructions stored in the memory, it performs the methods described in the preceding aspects. Optionally, the communication device may be a chip.

[0047] Optionally, there may be one or more processors and one or more memories.

[0048] Alternatively, the memory can be integrated with the processor, or the memory can be set up separately from the processor.

[0049] In the specific implementation process, the memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set on different chips. This application does not limit the type of memory or the way the memory and processor are set.

[0050] Eighthly, a chip is provided, including a processor for calling and running program instructions or code stored in a memory, causing a device equipped with the chip to perform the methods in the foregoing aspects.

[0051] Ninthly, 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 via an internal connection path, the processor being used to execute code in the memory, and when the code is executed, the processor being used to perform the methods in the above aspects.

[0052] It should be understood that the apparatus mentioned in the third or seventh aspect above can be the chip mentioned in the eighth or ninth aspect, or the data stream transmission device of the fourth aspect. The beneficial effects achieved by the technical solutions and corresponding possible implementations of the second to ninth aspects of this application can be found in the above description of the technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description

[0053] Figure 1 This application provides a schematic diagram of a spine-leaf network structure. Figure 2 This is a schematic diagram of another spine-leaf network structure provided in an embodiment of this application; Figure 3 This is a schematic diagram of another spine-leaf network structure provided in the embodiments of this application; Figure 4 This is a schematic diagram of another spine-leaf network structure provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an implementation environment provided in an embodiment of this application; Figure 6 A flowchart illustrating a data stream transmission method provided in an embodiment of this application; Figure 7 A schematic diagram illustrating a link failure as provided in an embodiment of this application; Figure 8 A schematic diagram illustrating another link failure provided in an embodiment of this application; Figure 9 A flowchart illustrating another data stream transmission method provided in this application embodiment; Figure 10 This is a schematic diagram of the structure of a data stream transmission device provided in an embodiment of this application; Figure 11 This application provides a schematic diagram of the structure of a network device according to an embodiment of the present application. Figure 12 This is a schematic diagram of another network device provided in an embodiment of this application. Detailed Implementation

[0054] The terminology used in the embodiments section of this application is only for explaining specific embodiments of this application and is not intended to limit this application. To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0055] In the field of communication technology, a data center includes communication devices and servers. Servers are used to process and distribute data streams, while communication devices connect to servers and are responsible for transmitting the data streams generated by the servers. Taking the training scenario of a large AI language model as an example, servers within the data center are used to execute the computational tasks involved in model training and interact with data streams based on the computation results. By integrating the computing power of multiple data centers for remote training, the training performance of large models can be improved.

[0056] Figure 1 This is a schematic diagram of a data center structure provided in an embodiment of this application. Figure 1 The data center in the middle uses a spine-leaf network. Figure 1 The leaf and spine switches in the diagram correspond to the communication devices. See also... Figure 1 The server connects to the leaf switch, the leaf switch connects to the spine switch, and the spine switches between different DCs are interconnected to form a connection relationship between different DCs.

[0057] Optionally, Figure 1 The connections shown are intended to illustrate relationships, not to limit the actual number of links. A link between a leaf switch and a spine switch can be... Figure 1 The example shown can contain one or more lines. See also... Figure 2 , Figure 2 The system includes two data centers, DC1 and DC2. Each data center consists of one spine switch and two leaf switches, connected by four links between the leaf switches and the spine switches. Furthermore, different leaf switches can... Figure 1As shown, different Leaf switches can be connected to different ports on the Spine switch, just as they are connected to the same port on the Spine switch. Figure 2 The leaf2 and leaf1 switches in the middle are connected to different ports in the spine1 switch.

[0058] Furthermore, the number of input ports and output ports of the communication device can be different, for example... Figure 2 The Spine1 and Spine2 switches shown have the following configurations: Spine1 has 8 input ports and 4 output ports, while Spine2 has 4 input ports and 8 output ports. In some cases, the number of input and output ports on a communication device can be the same, for example... Figure 2 The leaf1-leaf4 switches shown have 4 inbound ports and 4 outbound ports each. Or as... Figure 3 As shown, Figure 3 The leaf1-leaf4 switches each have 2 ingress and 2 egress ports, while the spine1 and spine2 switches each have 4 ingress and 4 egress ports.

[0059] In some cases, other connections can exist between servers, leaf switches, and spine switches. For example, between a server and a leaf switch, there could be connections such as... Figure 1 The diagram shows a single-rail network structure where one server is connected to only one leaf switch. However, it's also possible to connect multiple leaf switches to a single server, for example... Figure 4 As shown, Figure 4 In this example, a server is configured with multiple network interface cards (NICs), each NIC corresponding to one port. Server 1 and Server 2 are connected to Leaf1 and Leaf2 switches, respectively. Taking Leaf and Spine switches as another example, a Leaf switch can... Figure 1 As shown, multiple Spine switches can be connected, or as shown in the diagram. Figure 2-4 The diagram shows a connection to a Spine switch.

[0060] Regardless of the data center architecture, in multi-data center scenarios, packet loss during long-distance transmission is common due to insufficient buffering at data center interconnect (DCI) switches, leading to reduced training performance. Therefore, it's crucial to avoid packet loss caused by long-distance congestion. In some cases, load balancing can mitigate network congestion. Load balancing strategies include static load balancing and dynamic load balancing. Static load balancing allocates forwarding paths for each data stream according to pre-defined rules, while dynamic load balancing adjusts data streams from heavily loaded links to less loaded links based on dynamic changes in network conditions. Here, network conditions refer to the data streams transmitted within the network.

[0061] Because the data streams in large language model training scenarios are characterized by large volume, small quantity, and periodicity, and network conditions do not change dynamically, a static load balancing strategy can be used to manage the transmission of data streams between data centers. Based on the load balancing strategy, the forwarding paths of the data streams between data centers are determined, and these forwarding paths include all communication devices traversed by the data streams.

[0062] Optionally, centralized load balancing can be used to determine the forwarding path of data flows. In centralized load balancing, communication devices within the data center report network status and other information to the centralized controller. The centralized controller determines the forwarding path of each data flow between data centers based on the network status and other information of each communication device, and then distributes the path information to the communication devices. Distributed load balancing, on the other hand, relies on the local decision-making of the head node. The head node can be each communication device or the communication device located at the first hop in each group. The head node determines the forwarding path of each data flow passing through it through local decision-making.

[0063] After receiving a data stream, the communication device determines the next-hop device based on the forwarding path of the data stream. In determining the next-hop device, the corresponding input and output ports are used to determine the output port, thus identifying the next-hop device.

[0064] by Figure 2 Taking the spine-leaf network shown as an example, Figure 2 The ingress port of the leaf2 switch is connected to the egress port of server 1. Figure 2 (Not shown in the image), the output port of the leaf3 switch is connected to the input port of server 2 ( Figure 2(Not shown in the image) The forwarding path of the data stream from server 1 to server 2 is: server 1 -> leaf2 switch -> spine1 switch -> spine2 switch -> leaf3 switch -> server 2. After receiving the data stream through leaf2-1, the leaf2 switch determines that the next hop device is the spine1 switch. Since there are four outgoing ports in leaf2 connected to the spine1 switch, in this case, the leaf1 switch can look up the local port mapping and determine that the outgoing port corresponding to leaf2-1 is leaf2-5. The received data stream is then forwarded to the spine1 switch through leaf2-5.

[0065] After receiving the data stream via Spine1-5, the Spine1 switch, based on the next-hop device being Spine2, selects Spine1-9 (corresponding to Spine1-5) from the four outgoing ports connected to Spine2, and sends the data stream to Spine2-1 via Spine1-9. Upon receiving the data stream, the Spine2 switch, based on the next-hop device being the Leaf3 switch and having four outgoing ports connecting to Leaf3, finds the corresponding outgoing port for Spine2-1 as Spine2-5, and sends the data stream to Leaf3-1 via Spine2-5. Finally, after receiving the data stream via Leaf3-1, the Leaf3 switch, based on the port correspondence, sends the data stream to Server 2 via Leaf3-5 (corresponding to Leaf3-1).

[0066] Among them, spine1-5 are Figure 2 Port 5 on the Spine1 switch, and ports 9 on Spine1 are... Figure 2 The port numbered 9 on the Spine1 switch, leaf2-1 is... Figure 2 The port numbered 1 on the leaf2 switch, and leaf2-5 are... Figure 2 The fifth port on the leaf2 switch, spine2-1, is... Figure 2 The port numbered 1 on the Spine2 switch, and Spine2-5 are... Figure 2 The port numbered 5 on the Spine2 switch, leaf3-1 is... Figure 2 The port numbered 1 on the leaf3 switch, and port numbers leaf3-5 are... Figure 2 The port numbered 5 on the leaf3 switch.

[0067] However, as models become larger, the probability of data center failures also increases; for example, a failure in the optical module within a communication device can lead to a disconnect between communication devices. Therefore, there is an urgent need for a data stream transmission method to continue transmitting data even in the event of a link failure.

[0068] Based on this, embodiments of this application provide a data stream transmission method. Figure 5 A schematic diagram of an implementation environment provided for an embodiment of this application is shown below. Figure 5 The implementation environment includes a first communication device 01 and a second communication device 02. The first communication device 01 includes a first input port (corresponding to...). Figure 5 Port 0), second input port (corresponding to) Figure 5 Port 1), First output port (corresponding to) Figure 5 Port 2) and the second output port (corresponding to Figure 5 Port 3). There is a first correspondence between the first input port and the first output port, and a third correspondence between the second input port and the second output port. The first communication device 01 is connected to the second communication device 02 through the first output port and the second output port.

[0069] For example, the first communication device 01 and the second communication device 02 can be indirectly connected. For instance, the first output port and the second output port of the first communication device 01 can be connected to the second communication device through a third communication device and a fourth communication device. Optionally, the first communication device 01, the second communication device 02, the third communication device, and the fourth communication device can be any device with data transmission capabilities, such as a switch or a router.

[0070] In some cases, the first communication device 01 and the third communication device are configured in the first data center, with the third communication device located at the exit of the first data center, and the fourth communication device and the second communication device 02 are configured in the second data center, with the fourth communication device located at the entrance of the second data center. When the first communication device 01, the second communication device 02, the third communication device, and the fourth communication device are located in a spine-leaf network structure, the first communication device 01 and the second communication device 02 can be leaf switches, and the third communication device and the fourth communication device can be spine switches.

[0071] Using spine-leaf networking as Figure 1 As shown in the example, the first communication device 01 can be any leaf switch in DC1, the third communication device can be any spine switch in DC1, the fourth communication device can be any spine switch in DC2, and the second communication device 02 can be any leaf switch in DC2. The network is structured as a spine-leaf topology. Figure 2 or Figure 3 As shown in the example, the first communication device 01 can be a leaf1 switch or a leaf2 switch, the third communication device can be a spine1 switch, the fourth communication device can be a spine2 switch, and the second communication device 02 can be a leaf3 switch or a leaf4 switch. Taking a spine-leaf network as an example... Figure 4 For example, the first communication device 01 and the third communication device are located in one spine-leaf network, and the fourth communication device and the second communication device 02 are located in another spine-leaf network. The two spine-leaf networks are connected through a spine switch. Then, the first communication device 01 and the second communication device 02 can be a leaf1 switch or a leaf2 switch, and the third communication device and the fourth communication device can be spine switches.

[0072] Let's take the first communication device 01 as an example for now. Figure 2 The leaf2 switch shown has a third communication device. Figure 2 The Spine1 switch shown has a fourth communication device. Figure 2 The Spine2 switch shown has a second communication device 02. Figure 2 The leaf3 switch shown has its first output port as follows: Figure 2 The second output port of port 5 in the leaf2 switch shown (hereinafter referred to as leaf2-5) is... Figure 2 Port number 6 in the leaf2 switch shown (hereinafter referred to as leaf2-6) has its first ingress port as follows: Figure 2 The second ingress port of the leaf2 switch shown is port number 1 (hereinafter referred to as leaf2-1). Figure 2 Taking port 2 (hereinafter referred to as leaf2-2) of the leaf2 switch as an example, this illustrates the process of executing the data stream transmission method provided in this application embodiment when the link between the first communication device 01 and the second communication device 02 fails. See [link to relevant documentation]. Figure 6 This includes the following steps 601-605.

[0073] In step 601, the leaf2 switch receives the first data stream through the first ingress port leaf2-1.

[0074] Optionally, the first data stream can be any data stream transmitted between the leaf2 and leaf3 switches, such as a data stream generated during AI model training. The first data stream can be a data stream that has already transmitted a portion of the message, or a data stream that has just begun transmission. The transmission of the first data stream between the leaf2 and leaf3 switches can involve the source device of the first data stream being connected to the leaf2 switch, and the destination device of the first data stream being connected to the leaf3 switch. For example, the source device could be the aforementioned embodiment or server 1 connected to the leaf2 switch, and the destination device could be server 2 connected to the leaf3 switch. In some cases, server 1's output port 1 is connected to the first input port leaf2-1 of the leaf2 switch; therefore, the first data stream sent by server 1 through output port 1 will be received by the leaf2 switch through leaf2-1.

[0075] In step 602, according to the first correspondence relationship corresponding to the first input port leaf2-1, the first data stream is transmitted to the leaf3 switch through the first output port leaf2-5. The first correspondence relationship indicates that the data stream received by the first input port leaf2-1 is sent through the first output port leaf2-5.

[0076] In one possible implementation, the leaf2 switch stores a port mapping relationship, indicating the output port corresponding to each input port. This is used to determine the output port corresponding to the input port of the received data stream based on the port mapping relationship. Optionally, the port mapping relationship can be determined by the control device based on the interconnection between communication devices, or it can be set by the leaf2 switch. For example, a hash mapping calculation can be performed on the input ports to determine the output port corresponding to each input port based on the hash result. Table 1 shows a port mapping relationship provided by an embodiment of this application.

[0077] Table 1

[0078] In Table 1, leaf2-0 indicates... Figure 2In the leaf2 switch, port number 0 has a similar meaning to other ports, so they will not be repeated here. Table 1 shows a first correspondence between the first input port leaf2-1 and the first output port leaf2-5. Based on Table 1, after receiving the first data stream at leaf2-1, the leaf2 switch can look up the corresponding output port in Table 1 as leaf2-5 and then send the first data stream to the leaf3 switch via leaf2-5. Subsequently, the spine1, spine2, and leaf3 switches, which also received the first data stream, can also look up the port correspondence based on the input port used to receive the first data stream and use the determined output port to send the first data stream downstream, thus transmitting the first data stream along the transmission link leaf2-5->spine1-5->spine1-9->spine2-1->spine2-5->leaf3-1. After receiving the first data stream, the leaf3 switch, based on the port correspondence between leaf3-1 and leaf3-5, sends the first data stream to server 2 through leaf3-5.

[0079] The above explanation uses the Leaf2 switch receiving and transmitting the first data stream as an example, and is not intended to limit the data streams transmitted by the Leaf2 switch. In some cases, the Leaf2 switch may also transmit other data streams different from the first data stream. These other data streams may have different source or destination devices than the first data stream, or they may have the same source and destination devices as the first data stream, but different source or destination ports. Optionally, the other data streams may also have the same source and destination devices as the first data stream, and the same source and destination ports. The Leaf2 switch will forward the other data streams and the first data stream based on the same port mapping. This can be understood as the Leaf2 switch, after receiving other data streams, also looking up the port mapping in Table 1 based on the input port of the received data stream to determine the corresponding output port, so as to use the corresponding output port to send the other data streams.

[0080] In step 603, fault information is obtained, which indicates at least one of a faulty link or a first data stream transmitted through the faulty link, wherein the faulty link is the link between the leaf2 switch and the leaf3 switch.

[0081] In one possible implementation, the link between leaf2 and leaf3 switches may fail. Leaf2 switch can obtain fault information based on this link failure. A link failure refers to the inability of the link to transmit data normally. This failure could be caused by factors such as a momentary disconnection of the optical module leading to a complete failure of the connected port, or by other reasons, including congestion. For example, if the rate of transmitting data is lower than the rate of receiving data, the received data cannot be transmitted in time, resulting in link congestion. This situation can also be considered a link failure scenario.

[0082] Furthermore, the faulty link can be the link connecting the spine2 switch and the leaf3 switch, for example... Figure 7 As shown, Figure 7 Four links connect the Spine2 and Leaf3 switches. The faulty link is the second link between Spine2 and Leaf3. Optionally, the faulty link could also be the link connecting Leaf2 and Spine1, or the link connecting Spine1 and Spine2. In some cases, there can be multiple faulty links, such as one link connecting Spine2 and Leaf3, and another link connecting Spine1 and Spine2.

[0083] Since the handling processes for different faulty links are similar, we will temporarily refer to them as follows: Figure 7 The following explanation uses a faulty link as an example. The leaf2 switch can receive fault information sent by the control device. The control device can be referred to as a centralized controller in some cases. Exemplarily, the control device detects a link fault and, if a faulty link exists, sends fault information to the first-hop switch of that faulty link. The control device can determine the link fault based on port bandwidth, which can refer to the actual bandwidth used. For example, the spine and leaf switches periodically report the bandwidth of each outgoing port to the control device. The control device determines whether a link connected to each outgoing port is faulty based on the fluctuations in port bandwidth. If the bandwidth reported by any outgoing port is lower than the previously reported bandwidth, and the difference between the bandwidths is lower than a first threshold, the control device determines that the link connected to that outgoing port is a faulty link. Alternatively, if the link fault is link congestion, and the port bandwidth is higher than a second threshold, the control device determines that the link connected to that outgoing port is congested, and the connected link is a faulty link. The first and second thresholds can be set based on experience. In some cases, the control device can also use other methods to detect link faults, which are not limited in this embodiment.

[0084] Optionally, when the fault information indicates a faulty link that has failed, the control device can generate fault information carrying the link identifier of the faulty link. The link identifier may be, for example, the port information of the ingress and egress ports connected to the faulty link. The port information may be the port number, the Internet Protocol (IP) address of the port, the IP prefix of the port's IP address, or other information that can identify the port.

[0085] When a fault message indicates that a data stream is being transmitted through a faulty link, the control device can acquire mutual access relationships and path information; based on these relationships and path information, it determines the data stream to be transmitted through the faulty link. The mutual access relationships are used to determine at least one of the communication requirements or data stream transmission requirements between server 1 connected to leaf2 switch and server 2 connected to leaf3 switch. Communication requirements refer to the data streams sent between servers, while data stream transmission requirements refer to the amount of data sent, the required latency, or bandwidth, etc. For network interface cards (NICs) configured in the servers, which are used to process data streams, the mutual access relationships can also be called NIC mutual access relationships. Path information can be information about the forwarding path of the data stream, indicating not only the switches located on the forwarding path but also the ports of each switch, describing the ports used by each switch on the forwarding path to receive or send data streams during transmission.

[0086] The control device determines the various data streams transmitted between DC1 and DC2 based on the mutual access relationship. Then, the control device searches the path information for the forwarding path of each data stream. If the forwarding path of any data stream passes through a faulty link, that data stream is determined to be a data stream affected by the faulty link. For example, if the forwarding path of the data stream is Server 1->leaf2-1->leaf2-5->spine1-5->spine1-9->spine2-1->spine2-5->leaf3-1->leaf3-5->Server 2 in the above embodiment, since the forwarding path includes the faulty link spine2-5->leaf3-1, this data stream is a data stream transmitted through the faulty link.

[0087] Since the processing procedures for different data streams transmitted via a faulty link are similar, the following example will be the first data stream transmitted in steps 601-602, using the data stream transmitted via a faulty link as an illustration of the subsequent operations. Optionally, after determining the first data stream transmitted via a faulty link, the control device can generate fault information carrying the identification information of the first data stream. The identification information indicates the first data stream and can be the stream identifier of the first data stream, or it can be used to identify the source and destination information of the first data stream, such as a 5-tuple of the first data stream. In some cases, in addition to including at least one of the identification information of the first data stream or the link identifier of the faulty link, the fault information may also include a fault flag indicating that a faulty link currently exists.

[0088] In some cases, after determining the fault information, the control device will also locate the first-hop switch corresponding to the faulty link. The first-hop switch refers to the leaf switch connected to the source device, and the data stream transmitted will pass through the faulty link. The source device is, for example, server 1 in the above embodiment. Since leaf switch 2 is connected to server 1, the data stream from server 1 will pass through the faulty link when sending data to leaf switch 3. In this case, the first-hop switch corresponding to the faulty link is leaf switch 2. When the control device determines that the first-hop switch corresponding to the faulty link is leaf switch 2, it sends the fault information to leaf switch 2, thereby allowing leaf switch 2 to obtain the fault information.

[0089] In one possible implementation, the leaf2 switch can also receive fault information sent by downstream devices, such as communication devices connected to the faulty link. If the fault information includes a first data stream transmitted through the faulty link, the downstream device can locate the path information of the data stream based on the faulty link and determine the first data stream transmitted through the faulty link based on the path information. The path information can be sent to the downstream device when the control device performs centralized load balancing, or it can be path information compiled by the downstream device based on historical forwarding statistics of the data stream during forwarding.

[0090] Regardless of how downstream devices obtain fault information, they can send fault information to the leaf2 switch to continue serving downstream devices. Figure 7Taking the Spine2 switch as an example, after detecting a faulty link, the Spine2 switch, since the outgoing port of the faulty link is Spine2-5 and the ingoing port corresponding to Spine2-5 is Spine2-1, sends the fault information to Spine1-9 connected to Spine2-1. The Spine1 switch, based on the fact that the ingoing port corresponding to Spine1-9 is Spine1-5, sends the fault information to Leaf2-5 connected to Spine1-5, so as to notify the Leaf2 switch that there is a faulty link on the forwarding path of the data flow sent through Leaf2-5.

[0091] In some cases, the Leaf2 switch can also detect fault information. For example, the Leaf2 switch periodically sends detection packets to the Spine1 switch through different outgoing ports. After receiving the detection packets based on the ingoing ports corresponding to the different outgoing ports, the Spine1 switch returns corresponding response packets for each detection packet. The Leaf2 switch can determine whether the link between the Leaf2 switch and the Spine1 switch is faulty based on whether it receives the detection packets returned by the Spine1 switch within the detection duration. The period for sending detection packets and the detection duration can be set empirically. The Leaf2 switch can also determine the first data stream passing through the faulty link based on the faulty link. The determination process is similar to that of downstream devices determining the first data stream; see the relevant description.

[0092] In step 604, based on the fault information, a second correspondence is determined for the first data stream. The second correspondence indicates that the first data stream received by the first input port is sent through the second output port.

[0093] Regardless of how the Leaf2 switch obtains fault information, it can determine the first data flow passing through the faulty link or the first data flow to be passed through the faulty link based on the fault information. Taking the fault information sent by the control device as an example, and the fault information includes the five-tuple of the first data flow, after parsing the five-tuple in the fault information, the Leaf2 switch determines the first data flow passing through the faulty link based on the five-tuple, and determines the first output port corresponding to the first data flow.

[0094] The first data stream will pass through the faulty link because its forwarding path is leaf2-1->leaf2-5->spine1-5->spine1-9->spine2-1->spine2-5->leaf3-1->leaf3-5. This can be understood as follows: after the leaf2 switch sends the first data stream according to leaf2-5, the spine1 and spine2 switches will forward the first data stream to the faulty link according to the port mapping. Therefore, the leaf2 switch will adjust the output port of the first data stream to avoid sending it using leaf2-5, thus preventing the first data stream from passing through the faulty link and causing packet loss. Furthermore, since the leaf2 switch also forwards the first data stream according to the port mapping, it can construct a second mapping for the first data stream, with the second mapping having higher priority than the first. Optionally, the leaf2 switch can also adjust the output port corresponding to leaf2-1 in the first port mapping to adjust the output port of the first data stream, thus obtaining the second mapping.

[0095] In some cases, the leaf2 switch can determine a second output port from multiple output ports. The determination process includes, but is not limited to: determining a first output port from multiple output ports of the leaf2 switch; determining at least one candidate port from multiple output ports of the leaf2 switch based on the first output port, wherein the candidate port and the first output port correspond to different output ports of the spine2 switch connecting to the leaf3 switch; and selecting a second output port from at least one candidate port.

[0096] Optionally, if the fault information includes the source port number of the first data stream, the leaf2 switch can determine the first input port connected to the source port based on the source port number, look up the port correspondence, and determine the first output port corresponding to the first input port. If the fault information is sent by a downstream device as shown in step 603, the leaf2 switch can use leaf2-5, which is used to receive the fault information, as the first output port.

[0097] Subsequently, the leaf2 switch can select a candidate port based on the first outgoing port. This candidate port must guarantee that it can send the first data stream to the server 2 corresponding to the destination identifier. Since server 2 is connected to the leaf3 switch, if the first data stream sent by the candidate port can be sent to the leaf3 switch via the spine1 and spine2 switches, then the first data stream can be sent to server 2 via the leaf3 switch. In one possible implementation, the leaf2 switch can determine at least one candidate port from multiple outgoing ports of the leaf2 switch based on at least one of the load balancing or routing strategies of the first data stream and the first outgoing port.

[0098] The load balancing strategy is used to evenly distribute data flows across multiple paths to avoid link congestion. The routing strategy is used to determine the specific path of the data flow from the source port to the destination port, such as the multiple paths of the data flow to be allocated in the above embodiment. The specific path can be selected based on network topology and network status. The load balancing strategy and routing strategy corresponding to the first data flow refer to the load balancing strategy and routing strategy referenced in the process of determining the forwarding path of the first data flow. Load balancing strategies include, but are not limited to, round robin (RR) strategy, weighted round robin (WRR) strategy, bandwidth-based load balancing strategy, equal-cost multi-path (ECMP) strategy, and latency-based load balancing strategy. Routing strategies include, but are not limited to, shortest path first (SPF) strategy and policy-based routing (PBR) strategy.

[0099] If different load balancing or routing strategies are used to distribute data flows between DC1 and DC2, the forwarding paths for different data flows will be different, and the path between leaf1 switch and leaf3 switch will also be different. Therefore, leaf2 switch can determine candidate ports among multiple outgoing ports that can connect to ingoing ports of leaf3 switch based on at least one of the load balancing or routing strategies. In some cases, the load balancing strategy may instruct leaf2 switch to use adjacent outgoing ports to forward multiple data flows sent by the same server.

[0100] In this scenario, where the first data stream is a data stream from multiple data streams sent from server 1 to leaf2 switch, the process by which leaf2 switch determines candidate ports based on the first output port includes, but is not limited to: determining multiple consecutive port numbers based on the port number of the first output port and the number of interfaces of server 1; any one of the multiple port numbers indicates an output port of leaf2 switch used to send any one of the multiple data streams; different port numbers indicate output ports corresponding to different output ports of spine2 switch connected to leaf3 switch; and the number of interfaces of server 1 indicates the number of interfaces of server 1 connected to leaf2 switch.

[0101] For example, server 1 sends multiple data streams to server 2. Both server 1 and server 2 include multiple network interface cards (NICs) with consecutive global logical numbers (ranks). The NICs in server 1 simultaneously send data streams to the NICs in server 2 to achieve communication. Therefore, the destination devices of the multiple data streams sent by server 1 are the same. In a single-track network scenario, one server is connected to only one leaf switch. Therefore, the multiple data streams sent by server 1 are all sent to the leaf switch (connected to server 2). Any output port on the leaf switch used to transmit the data streams sent by server 1 can send the data streams to the leaf switch (connected to server 2).

[0102] Based on this, the leaf2 switch can determine multiple outgoing ports for transmitting data streams from server 1, and then select candidate ports from these outgoing ports. Optionally, the multiple consecutive port numbers determined by the leaf2 switch can be represented as [ , [+N-1], where N indicates the number of interfaces of server 1, and X indicates the port number of the first output port. The instruction is to round down to the nearest integer. The first output port is used as the base. Figure 7 Taking leaf2-5 as an example, with port number 5, all four ingress ports of the leaf2 switch are connected to server 1. Substituting X=5 and N=4 into the above formula, we get [4× , 4× [+4-1]=[4, 7]. The Leaf2 switch determines multiple port numbers as 4, 5, 6, and 7. Among them, the output port corresponding to port number 5 is the first output port, and the Leaf2 switch can use leaf2-4, leaf2-6, and leaf2-7 as candidate ports.

[0103] Regardless of the method used by the leaf2 switch to determine candidate ports, a second output port can be selected from these candidate ports. The leaf2 switch can randomly select the second output port; for example, it can randomly select leaf2-7 as the second output port. Alternatively, the leaf2 switch can select an output port adjacent to the first output port as the second output port; for example, it can select leaf2-6, which is adjacent to leaf2-5, from leaf2-4, leaf2-6, and leaf2-7. This can be understood as meaning that in some cases, the port numbers of the first and second output ports are consecutive.

[0104] Regardless of the method used by the Leaf2 switch to determine the second output port, a second correspondence can be established for the first data stream after the second output port is determined. This allows the first data stream to be transmitted through the second output port if it is received through the first input port. In this case, the second correspondence can be a port correspondence for the first data stream, implementing stream-level transmission control. That is, the first data stream received through the first input port is transmitted through the second output port. Other data streams received through the first input port may be transmitted to other communication devices. If they do not pass through a faulty link, there is no need to switch to other output ports for transmission; other data streams can continue to be transmitted through the first output port. Furthermore, in this case, the Leaf2 switch can store the first correspondence. Since there are two corresponding output ports for the same first input port, the Leaf2 switch will also set a priority between the first and second correspondences, with the second correspondence having a higher priority than the first correspondence, so that the second correspondence can be used to transmit the first data stream.

[0105] In some cases, the second correspondence can also be a port-level port correspondence, meaning that the data stream received by the Leaf2 switch through the first ingress port, whether it is the first data stream or other data streams, will be forwarded to the second egress port indicated by the second correspondence. For example, the Leaf2 switch can adjust the egress port corresponding to the first egress port in the first correspondence from the first egress port to the second egress port. Table 2 shows an adjusted port correspondence provided in an embodiment of this application.

[0106] Table 2

[0107] Referring to Tables 2 and 1, the leaf2 switch modifies the output port corresponding to leaf2-1 from leaf2-5 to leaf2-6. Optionally, the leaf2 switch can also reconstruct the second correspondence between the first input port and the second output port. In this case, for the saved first correspondence, the leaf2 switch can delete the first correspondence, for example, overwrite the first correspondence with the second correspondence, or mark the first correspondence as unavailable and mark the second correspondence as available.

[0108] In step 605, subsequent messages of the first data stream are transmitted to the leaf3 switch through the second output port. The link between the leaf2 switch and the leaf3 switch for transmitting subsequent messages of the first data stream does not include the faulty link.

[0109] In this context, subsequent messages in the first data stream refer to messages that have not yet been transmitted at the current moment. See also... Figure 7 As shown in the diagram below, all four ingress ports of the leaf2 switch are connected to server 1. The leaf2 switch receives multiple data streams from server 1 through these four ingress ports. The data stream received by leaf2-1 is the first data stream. After establishing a second correspondence between the first data stream and the second correspondence, the leaf2 switch, upon receiving the data stream from leaf2-1 and confirming that it is the first data stream, uses leaf2-1 to look up the second correspondence and determines that the corresponding egress port is leaf2-6. Then, it uses leaf2-6 to send the first data stream to the spine1 switch.

[0110] When the second correspondence determined by the leaf2 switch is a port-level correspondence, after receiving the first data stream through leaf2-1, the leaf2 switch looks up the port correspondence shown in Table 2. Based on the second correspondence between leaf2-1 and leaf2-6, it sends the first data stream received by leaf2-1 to the corresponding leaf2-6, and uses leaf2-6 to send the first data stream to the spine1 switch.

[0111] Regardless of how the leaf2 switch sends the first data stream to the connected spine1-6 via leaf2-6, the spine1 switch, upon receiving the first data stream, can look up the locally stored port mapping relationship. This port mapping relationship indicates the correspondence between the eight inbound ports and four outbound ports on the spine1 switch. Based on the port mapping relationship indicating a correspondence between spine1-6 and spine1-10, the first data stream is sent to spine2-2 via spine1-10. The spine2 switch, based on the port mapping relationship between spine2-2 and spine2-6, sends the first data stream to leaf3-2 via spine2-6. After receiving the first data stream based on leaf3-2, the leaf3 switch, based on the port mapping relationship between leaf3-2 and leaf3-6, can send the first data stream to server 2 via leaf3-6. Figure 7 It can be seen that after the first data stream is sent using leaf2-6, the first data stream does not pass through the faulty link spine2-5->leaf3-1.

[0112] In one possible implementation, the leaf2 switch also maintains a third correspondence corresponding to the second input port. This third correspondence indicates that the data stream received by the first communication device through the second input port is sent through the second output port. Therefore, the leaf2 switch will also receive the second data stream based on the second input port and send it to the leaf3 switch through the second output port. At the second output port... Figure 7 In the case of leaf2-6, the second input port is Figure 7 If leaf2-2 is located in the diagram below, then the second data stream is the data stream received by leaf2-2. The leaf2 switch can look up the port correspondence shown in Table 1 to determine that the corresponding output port for leaf2-2 is leaf2-6, and then use leaf2-6 to send the second data stream downstream. The transmission process of the second data stream is similar to that of the first data stream; please refer to the relevant description, which will not be repeated here. See also Figure 7 In the diagram below, the link through which the second data stream is transmitted between the leaf2 and leaf3 switches is the same as the link through which the first data stream is transmitted between the leaf2 and leaf3 switches.

[0113] By adjusting the output port of the leaf2 switch when the first ingress port is transmitting the first data stream, congestion at the output port of the leaf2 switch can be reduced when the faulty link is located between the leaf2 and leaf3 switches. In some cases, because the distance between the leaf2 switch and the source device is less than the distance between the spine2 switch and the source device, the leaf2 switch can be referred to as the near end, and the spine2 switch as the far end; congestion at the spine2 switch can be called far-end congestion.

[0114] Figure 7 The diagram above illustrates remote congestion during a fault scenario. When a faulty link exists between the Spine2 and Leaf3 switches, if only the output ports on the Spine2 switch are adjusted—for example, changing the output port corresponding to Spine2-1 to Spine2-6, Spine2-2 to Spine2-7, and Spine2-3 to Spine2-4—then Spine2-4 will receive data streams from both input ports. Since these input streams have been transmitted through two links before the Spine2 switch, Spine2-4 may be unable to promptly forward the received data streams to Leaf3-0, resulting in remote congestion and packet loss. However, if the data stream transmission method provided in this embodiment is used, because the first and second data streams share the same transmission link, even if the first data stream is moved to the second output port, the near-end transmission rate matches the far-end transmission rate, and Spine2-6 will not experience congestion or packet loss due to its inability to promptly forward packets from the received data streams.

[0115] In one possible implementation, the faulty link between the spine1 switch and the leaf3 switch will also recover from the fault. In this case, the leaf2 switch can further determine a fourth correspondence corresponding to the first ingress port, which indicates that the data stream received by the first ingress port is sent through the first egress port; it receives the packets to be transmitted in the first data stream through the first ingress port and transmits the packets to be transmitted in the first data stream to the leaf3 switch through the first egress port. Optionally, the leaf2 switch can obtain recovery information, which indicates at least one of the faulty link that has been recovered or the first data stream transmitted through the recovered faulty link.

[0116] The process of obtaining recovery information is similar to that of obtaining fault information. Recovery information can be received from control devices, downstream devices, or determined by the Leaf2 switch. When fault information is sent by control devices or downstream devices, the recovery information may include a fault clearance flag to indicate the recovery of the faulty link, and may also include identification information for the first data stream.

[0117] Optionally, the fourth correspondence can be obtained by restoring the first correspondence. The way to determine the fourth correspondence based on the restoration information is, for example, to determine the first data stream based on the restoration information and set the second correspondence corresponding to the first data stream to invalid. In this case, since the second correspondence with higher priority is invalid, after receiving the first data stream using the first ingress port, the leaf2 switch will still look up the first correspondence in the port correspondence.

[0118] Alternatively, the fourth correspondence can also be a redefined correspondence. For example, if the second correspondence is obtained by adjusting the first correspondence, the leaf2 switch can also adjust the second correspondence to obtain the fourth correspondence. In this case, the leaf2 switch can determine the first output port based on recovery information. For example, if the recovery information includes port information of the first output port, the first output port can be determined based on the port information. Optionally, the leaf2 switch can also determine the first output port based on the faulty link indicated by the recovery information, or based on the third data stream indicated by the recovery information. Then, the output port corresponding to the first input port in the second correspondence is adjusted from the second output port to the first output port to obtain the fourth correspondence.

[0119] If the Leaf2 switch also retains the first correspondence during the process of determining the second correspondence, then after determining the first output port, the Leaf2 switch can mark the first correspondence corresponding to the first input port and the first output port as available, and mark the second correspondence as unavailable. Regardless of how the Leaf2 switch determines the fourth correspondence, after receiving the first data stream through leaf2-1, it can determine that leaf2-1 corresponds to leaf2-5 based on the fourth correspondence, and send the first data stream outward through leaf2-5.

[0120] The above is temporarily based on Figure 2 The example shown is a spine-leaf network illustrating the process of a leaf2 switch acting as the first communication device to transmit data streams, and is not intended to limit the spine-leaf network structure applicable to the embodiments of this application. Furthermore, the above example... Figure 7The example is intended to illustrate how to avoid remote congestion, not to limit the applicable scenarios for remote congestion. It can also alleviate remote congestion when the faulty link is located between spine switches. For example... Figure 8 , Figure 8 The faulty link is the link between switch Spine1 and switch Spine2. See [link / reference] Figure 8 In the diagram above, in the event of a link failure, if the output port corresponding to Spine1-1 is adjusted to Spine1-6, the output port corresponding to Spine1-2 to Spine1-7, and the output port corresponding to Spine1-3 to Spine1-4 at the Spine1 switch, then, because the correspondence between input and output ports in Spine2 is as follows: Spine2-0 corresponds to Spine2-4 and Spine2-6, Spine2-2 corresponds to Spine2-4 and Spine2-6, and Spine2-3 corresponds to Spine2-5 and Spine2-7, and multiple data streams received by Spine2-4 were previously transmitted using different links, remote congestion will also occur at Spine2-4. Furthermore, due to potential network convergence between Spine switches, the number of data streams affected by a link failure between Spine switches will be even greater. However, if the Leaf2 switch executes the data stream transmission method provided in this embodiment, the data stream transmission process can be found in [reference needed]. Figure 8 The diagram below shows how congestion at spine2-4 can be effectively avoided.

[0121] Furthermore, the link failure can occur either after or before the first data stream transmission. This can be understood as, in some cases, the first data stream being the predicted data stream to be transmitted through the failed link. Moreover, this embodiment uses the transmission of a data stream from DC1 to DC2 as an example to illustrate the data stream transmission process in the event of a failure. However, in practical applications, it could also be DC2 sending a data stream to DC1. If the failed link occurs between the Spine2 switch and the leaf switch in DC1, the leaf switch in DC2 can perform similar operations as the leaf2 switch. Furthermore, the terms "output port" and "input port" are intended to illustrate the transmission direction of the data stream in each port when a data stream is sent from DC1 to DC2. However, in some cases, the input port can also be used to send a data stream, and the output port can also be used to receive a data stream.

[0122] In summary, the data stream transmission method provided in this application, since the first data stream passes through a faulty link when sent from the first output port to the leaf3 switch, but does not pass through a faulty link when sent from the second output port to the leaf3 switch, determines the second correspondence corresponding to the first data stream. This allows the leaf2 switch to use the second output port to send the first data stream after receiving it using the first input port, thus avoiding passing through the faulty link during the transmission of subsequent packets of the first data stream. Furthermore, by adjusting the ports of the first data stream that passes through the faulty link, the number of data streams adjusted is small, and the switching range is small. Even if the second output port is also used to transmit other second data streams to the leaf3 switch, since the second data stream and the first data stream share the same path throughout, remote congestion is avoided. There is no need to modify the correspondence between the input and output ports on the spine1, spine2, and leaf3 switches, and the modification range is small.

[0123] This application provides a data stream transmission method, taking the method executed by a first communication device as an example. The flowchart of the method is as follows: Figure 9 As shown, it includes steps 901-905.

[0124] In step 901, the first data stream is received through the first input port.

[0125] Optionally, the process of the first communication device receiving the first data stream can be found in the description of the leaf2 switch receiving the first data stream in step 601, and will not be repeated here.

[0126] In step 902, according to the first correspondence relationship corresponding to the first input port, the first data stream is transmitted to the second communication device through the first output port. The first correspondence relationship indicates that the data stream received by the first input port is sent through the first output port.

[0127] For example, the process of the first communication device transmitting the first data stream is similar to the process of the leaf2 switch transmitting the first data stream in step 602, and can be found in the relevant description, which will not be repeated here.

[0128] In step 903, fault information is obtained, which indicates at least one of a faulty link that has failed or a first data stream transmitted through the faulty link. The faulty link is a link between the first communication device and the second communication device.

[0129] In one possible implementation, the first communication device can receive fault information sent by the control device. The process of obtaining fault information can be referred to in step 603, where the leaf2 switch obtains fault information, and will not be repeated here.

[0130] In step 904, based on the fault information, a second correspondence is determined for the first data stream. The second correspondence indicates that the first data stream received by the first input port is sent through the second output port.

[0131] Optionally, before adjusting the second output port, the first communication device may also determine the second output port. If the first data stream is one of multiple data streams sent from the first server to the first communication device, and the first communication device uses adjacent output ports to forward multiple data streams, then the port number of the second output port and the port number of the first output port can be consecutive port numbers. The process of determining the second output port can be found in step 604, where the leaf2 switch selects leaf2-6; it will not be repeated here.

[0132] After the first communication device determines the second output port, it can establish a second correspondence, which has a higher priority than the first correspondence. Optionally, the output port corresponding to the first input port in the first correspondence can be changed from the first output port to the second output port to obtain the second correspondence. The process of establishing the second correspondence can also refer to the process of the leaf2 switch adjusting the first correspondence in step 604, and will not be repeated here.

[0133] In step 905, subsequent messages of the first data stream are transmitted to the second communication device through the second output port. The link between the first and second communication devices for transmitting subsequent messages of the first data stream does not include the faulty link.

[0134] For example, the process of the first communication device sending subsequent messages of the first data stream is similar to the process of the leaf2 switch sending subsequent messages of the first data stream in step 605, and will not be described again here. In some cases, the first communication device also stores a third correspondence corresponding to the second input port. The third correspondence indicates that the data stream received by the second input port of the first communication device is sent through the second output port. In this case, the first communication device will also receive the second data stream based on the second input port and send the second data stream to the second communication device through the second output port. The link for the transmission of the second data stream between the first and second communication devices is the same as the link for the transmission of subsequent messages of the first data stream between the first and second communication devices. The process of sending the second data stream is similar to the process of the leaf2 switch sending the second data stream in step 605, and can be found in the relevant description.

[0135] In one possible implementation, upon recovery of a faulty link, the first communication device further determines a fourth correspondence corresponding to the first input port. This fourth correspondence indicates that the data stream received at the first input port is sent through the first output port. The device receives the message to be transmitted in the first data stream through the first input port and transmits the message to be transmitted in the first data stream to the second communication device through the first output port. Optionally, the first communication device can acquire recovery information indicating at least one of the recovered faulty link or the third data stream transmitted through the recovered faulty link. Then, it determines the fourth correspondence based on the recovery information. The process of acquiring recovery information is similar to that in step 605 of the leaf2 switch. The process of the first communication device determining the fourth correspondence is similar to that in step 605 of the leaf2 switch. The process of the first communication device sending the first data stream using the first output port is similar to that in step 605 of the leaf2 switch sending the first data stream using leaf2-5. See the relevant descriptions; they will not be repeated here.

[0136] This application embodiment also provides a transmission system, the system including a first communication device and a second communication device, the first communication device being connected to the second communication device through a first output port and a second output port; the first communication device is configured to receive a first data stream through a first input port; the first communication device is further configured to transmit the first data stream to the second communication device through a first output port according to a first correspondence relationship corresponding to the first input port, the first correspondence relationship indicating that the data stream received at the first input port is transmitted through the first output port; the first communication device is further configured to acquire fault information, the fault information indicating at least one of a faulty link or a first data stream transmitted through the faulty link, the faulty link being a link between the first communication device and the second communication device; the first communication device is further configured to determine a second correspondence relationship corresponding to the first data stream according to the fault information, the second correspondence relationship indicating that the first data stream received at the first input port is transmitted through the second output port; the first communication device is further configured to transmit subsequent messages of the first data stream to the second communication device through the second output port; the second communication device is configured to receive subsequent messages of the first data stream, the subsequent messages of the first data stream being transmitted through a link between the first communication device and the second communication device not including the faulty link.

[0137] In one possible implementation, the second correspondence has a higher priority than the first correspondence.

[0138] In one possible implementation, the first communication device is used to adjust the output port corresponding to the first input port in the first correspondence from the first output port to the second output port to obtain the second correspondence.

[0139] In one possible implementation, the port number of the second output port is consecutive to the port number of the first output port.

[0140] In one possible implementation, the first communication device stores a third correspondence corresponding to the second input port, the third correspondence indicating that the data stream received by the second input port of the first communication device is sent through the second output port; the first communication device is also used to receive the second data stream through the second input port and send the second data stream to the second communication device through the second output port; the second communication device is also used to receive the second data stream, the link through which the second data stream is transmitted between the first communication device and the second communication device is the same as the link through which subsequent messages of the first data stream are transmitted between the first communication device and the second communication device.

[0141] In one possible implementation, a first communication device is used to receive fault information sent by the control device.

[0142] In one possible implementation, the first communication device is further configured to, in the event of recovery of a faulty link, determine a fourth correspondence corresponding to the first input port, the fourth correspondence indicating that the data stream received by the first input port is sent through the first output port; receive a message to be transmitted in the first data stream through the first input port, and transmit the message to be transmitted in the first data stream to the second communication device through the first output port; the second communication device is further configured to receive the message to be transmitted in the first data stream.

[0143] In one possible implementation, the first communication device is further configured to acquire recovery information, which indicates at least one of a faulty link that has recovered from a fault or a third data stream transmitted through the faulty link that has recovered from a fault; and to determine a fourth correspondence based on the recovery information.

[0144] In one possible implementation, the system further includes a third communication device and a fourth communication device, with the first output port and the second output port connected to the second communication device via the third communication device and the fourth communication device.

[0145] In one possible implementation, a first communication device is used to transmit subsequent messages of the first data stream to a third communication device through a second output port; the third communication device is used to receive subsequent messages of the first data stream and transmit subsequent messages of the first data stream to a fourth communication device according to the port correspondence of the first data stream in the third communication device; the fourth communication device is used to receive subsequent messages of the first data stream and transmit subsequent messages of the first data stream to a second communication device according to the port correspondence of the first data stream in the fourth communication device.

[0146] In one possible implementation, the faulty link connects the first communication device and the third communication device, or the faulty link connects the third communication device and the fourth communication device, or the faulty link connects the fourth communication device and the second communication device.

[0147] In one possible implementation, the first communication device and the third communication device are located in the first data center, the third communication device is located at the exit of the first data center, the second communication device and the fourth communication device are located in the second data center, and the fourth communication device is located at the entrance of the second data center.

[0148] In one possible implementation, the first communication device and the second communication device are leaf switches.

[0149] Optionally, the first communication device corresponds to the above. Figure 6 The leaf2 switch in the illustrated embodiment corresponds to the second communication device described above. Figure 6 The leaf3 switch in the illustrated embodiment corresponds to the third communication device described above. Figure 6 The spine1 switch in the illustrated embodiment corresponds to the fourth communication device described above. Figure 6 The interaction process of the first, second, third, and fourth communication devices in the Spine2 switch shown in the embodiment can be found in [reference needed]. Figure 6 The embodiments shown will not be described again here.

[0150] The data stream transmission method of the present application embodiments has been described above. Corresponding to the above method, the present application embodiments also provide a data stream transmission device. Figure 10 This is a schematic diagram of the structure of a data stream transmission device provided in an embodiment of this application. Based on Figure 10 The following modules are shown. Figure 10 The data stream transmission device shown is capable of performing the above. Figure 9 The first communication device shown may operate in whole or in part. It should be understood that the device may include more additional modules than those shown, or may omit some of the modules shown; this application does not limit this. Figure 10 As shown, the device includes: Transceiver module 1001 is used to execute Figure 9 The data stream transmission method shown includes the receiving and / or sending operations of the first communication device. Processing module 1002 is used to execute Figure 9 Other operations of the data stream transmission method shown, besides the receiving and / or sending operations of the first communication device.

[0151] In one possible implementation, transceiver module 1001 is configured to receive a first data stream through a first input port; transceiver module 1001 is further configured to transmit the first data stream to a second communication device through a first output port according to a first correspondence relationship corresponding to the first input port, wherein the first correspondence relationship indicates that the data stream received at the first input port is transmitted through the first output port; transceiver module 1001 is further configured to acquire fault information, wherein the fault information indicates at least one of a faulty link or a first data stream transmitted through the faulty link, wherein the faulty link is a link between the first communication device and the second communication device; processing module 1002 is configured to determine a second correspondence relationship corresponding to the first data stream according to the fault information, wherein the second correspondence relationship indicates that the first data stream received at the first input port is transmitted through the second output port; transceiver module 1001 is further configured to transmit subsequent messages of the first data stream to the second communication device through the second output port, wherein the subsequent messages of the first data stream are transmitted through a link between the first communication device and the second communication device, wherein the link between the first communication device and the second communication device does not include the faulty link.

[0152] In one possible implementation, the second correspondence has a higher priority than the first correspondence.

[0153] In one possible implementation, the processing module 1002 is used to adjust the output port corresponding to the first input port in the first correspondence from the first output port to the second output port to obtain the second correspondence.

[0154] In one possible implementation, the port number of the second output port is consecutive to the port number of the first output port.

[0155] In one possible implementation, the first communication device stores a third correspondence corresponding to the second input port. The third correspondence indicates that the data stream received by the second input port of the first communication device is sent through the second output port. The transceiver module 1001 is also used to receive the second data stream through the second input port and send the second data stream to the second communication device through the second output port. The link through which the second data stream is transmitted between the first communication device and the second communication device is the same as the link through which subsequent messages of the first data stream are transmitted between the first communication device and the second communication device.

[0156] In one possible implementation, the transceiver module 1001 is used to receive fault information sent by the control device.

[0157] In one possible implementation, the processing module 1002 is further configured to determine a fourth correspondence corresponding to the first input port in the event of fault recovery of the faulty link, wherein the fourth correspondence indicates that the data stream received by the first input port is sent through the first output port; the transceiver module 1001 is further configured to receive the message to be transmitted in the first data stream through the first input port and transmit the message to be transmitted in the first data stream to the second communication device through the first output port.

[0158] In one possible implementation, the transceiver module 1001 is further configured to acquire recovery information, which indicates at least one of the faulty link that has recovered from the fault or the first data stream transmitted through the faulty link that has recovered from the fault; the processing module 1002 is further configured to determine a fourth correspondence based on the recovery information.

[0159] In one possible implementation, the first output port and the second output port are connected to the second communication device via a third communication device and a fourth communication device.

[0160] In one possible implementation, the faulty link connects the first communication device and the third communication device, or the faulty link connects the third communication device and the fourth communication device, or the faulty link connects the fourth communication device and the second communication device.

[0161] In one possible implementation, the first communication device and the third communication device are located in the first data center, the third communication device is located at the exit of the first data center, the second communication device and the fourth communication device are located in the second data center, and the fourth communication device is located at the entrance of the second data center.

[0162] In one possible implementation, the first communication device and the second communication device are leaf switches.

[0163] Since the first data stream passes through a faulty link when it is sent from the first output port to the second communication device, but does not pass through a faulty link when it is sent from the second output port to the second communication device, the faulty link is avoided during the transmission of subsequent messages of the first data stream by changing the output port of the first input port from the first output port to the second output port. Furthermore, port adjustment is only performed on the first data stream that passes through the faulty link, resulting in a small number of data streams being adjusted and a limited switching range.

[0164] It should be understood that the above Figure 10 The provided device, in implementing its functions, is only illustrated by the division of the aforementioned 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 process is detailed in the method embodiments, which will not be repeated here. Figure 10 The provided data stream transmission device can be a chip or a communication device; for example, the data stream transmission device can be the network device described below.

[0165] See Figure 11 , Figure 11A schematic diagram of the structure of a network device 1600 provided in an exemplary embodiment of this application is shown. Figure 11 The network device 1600 shown is used to perform the above. Figure 9 The data stream transmission method shown involves the operations described. The network device 1600 is, for example, a switch, a router, etc., and can be implemented using a general bus architecture.

[0166] like Figure 11 As shown, the network device 1600 includes at least one processor 1601, a memory 1603, and at least one communication interface 1604.

[0167] Processor 1601 may be, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solutions of this application. For example, processor 1601 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A PLD may be, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in connection with the embodiments of this application. A processor may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0168] Optionally, network device 1600 also includes a bus. The bus is used to transfer information between the components of network device 1600. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0169] Memory 1603 may be, for example, read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; electrically erasable programmable read-only memory (EEPROM); compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital universal 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 and accessible by a computer, but not limited thereto. Memory 1603 may exist independently and be connected to processor 1601 via a bus. Memory 1603 may also be integrated with processor 1601.

[0170] Communication interface 1604 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). Communication interface 1604 can include wired and wireless communication interfaces. Specifically, communication interface 1604 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a WLAN interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In this embodiment, communication interface 1604 can be used by network device 1600 to communicate with other devices.

[0171] In a specific implementation, as one example, the processor 1601 may include one or more CPUs, such as Figure 11 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 (such as computer program instructions).

[0172] In a specific implementation, as one example, the network device 1600 may include multiple processors, such as... Figure 11 The processors 1601 and 1605 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).

[0173] In a specific implementation, as one example, network device 1600 may further include output devices and input devices. The output device communicates with processor 1601 and can display information in various ways. For example, the output device may be a liquid crystal display (LCD), a light-emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device communicates with processor 1601 and can receive user input in various ways. For example, the input device may be a mouse, keyboard, touchscreen device, or sensor device, etc.

[0174] In some embodiments, memory 1603 stores program code 1610 for executing the solution of this application, and processor 1601 can execute the program code 1610 stored in memory 1603. That is, network device 1600 can implement the data stream transmission method provided in the method embodiment through processor 1601 and program code 1610 in memory 1603. Program code 1610 may include one or more software modules. Optionally, processor 1601 itself may also store program code or instructions for executing the solution of this application.

[0175] In specific embodiments, the network device 1600 of this application embodiment may correspond to the first communication device or the second communication device in the above method embodiments.

[0176] in, Figure 9 Each step of the data stream transmission method shown is completed through integrated logic circuits in the hardware or software instructions in the processor of the network device 1600. The steps of the method disclosed in the embodiments of this application can be directly implemented by the hardware processor, or 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 mature storage media in the art. Since the 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; to avoid repetition, these will not be described in detail here.

[0177] See Figure 12 , Figure 12 This invention provides a schematic diagram of the structure of a network device 1700 according to another exemplary embodiment of the present application. Figure 12 The network device 1700 shown is used to perform the above. Figure 9The data stream transmission method shown involves all or part of the operations. The network device 1700 is, for example, a switch, a router, etc., and can be implemented using a general bus architecture.

[0178] like Figure 12 As shown, network device 1700 includes: main control board 1710 and interface board 1730.

[0179] The main control board, also known as the main processing unit (MPU) or route processor card, is used to control and manage the various components in the network device 1700, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 1710 includes a central processing unit 1711 and a memory 1712.

[0180] Interface board 1730 is also known as a line processing unit (LPU), linecard, or service board. Interface board 1730 provides various service interfaces and implements packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, etc., with Ethernet interfaces such as Flexible Ethernet Clients (FlexE Clients). Interface board 1730 includes: a central processing unit 1731, a network processor 1732, a forwarding table entry memory 1734, and a physical interface card (PIC) 1733.

[0181] The central processing unit 1731 on the interface board 1730 is used to control and manage the interface board 1730 and communicate with the central processing unit 1711 on the main control board 1710.

[0182] Network processor 1732 is used to implement packet forwarding processing. Network processor 1732 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented using an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA). Specifically, network processor 1732 forwards received packets based on the forwarding table stored in forwarding table entry memory 1734. If the destination address of the packet is the address of network device 1700, the packet is sent to the CPU (such as central processing unit 1731) for processing; if the destination address of the packet is not the address of network device 1700, 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 may include: packet ingress interface processing, forwarding table lookup; downlink packet processing may include: forwarding table lookup, etc. In some embodiments, the central processing unit can also perform the functions of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for a forwarding chip on the interface board.

[0183] The physical interface card 1733 is used to implement physical layer interfacing functions. Raw traffic enters the interface board 1730 through this card, and processed packets are sent out from the physical interface card 1733. The physical interface card 1733, also called a daughter card, can be installed on the interface board 1730. It is responsible for converting photoelectric signals into packets, performing validity checks on the packets, and forwarding them to the network processor 1732 for processing. In some embodiments, the central processing unit 1731 can also perform the functions of the network processor 1732, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for the network processor 1732 in the physical interface card 1733.

[0184] Optionally, network device 1700 includes multiple interface boards. For example, network device 1700 also includes interface board 1740, which includes: a central processing unit 1741, a network processor 1742, a forwarding table entry memory 1744, and a physical interface card 1743. The functions and implementation methods of each component in interface board 1740 are the same as or similar to those in interface board 1730, and will not be described in detail here.

[0185] Optionally, network device 1700 also includes a switching fabric unit (SFU). The switching fabric unit 1720 can also be referred to as a switch fabric unit (SFU). When network device 1700 has multiple interface boards, the switching fabric unit 1720 is used to complete data exchange between the interface boards. For example, interface boards 1730 and 1740 can communicate via the switching fabric unit 1720.

[0186] The main control board 1710 and the interface boards are coupled. For example, the main control board 1710, interface boards 1730 and 1740, and the switching network board 1720 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 1710 and interface boards 1730 and 1740, and communication between the main control board 1710 and interface boards 1730 and 1740 is achieved through the IPC channel.

[0187] Logically, network device 1700 includes a control plane and a forwarding plane. The control plane includes a main control board 1710 and a central processing unit 1711, while the forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 1734, a physical interface card 1733, and a network processor 1732. The control plane performs functions such as router operation, generating forwarding tables, processing signaling and protocol messages, and configuring and maintaining the status of network devices. The control plane distributes the generated forwarding tables to the forwarding plane. In the forwarding plane, the network processor 1732 looks up and forwards messages received by the physical interface card 1733 based on the forwarding tables distributed by the control plane. The forwarding tables distributed by the control plane can be stored in the forwarding table entry memory 1734. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same network device.

[0188] It's worth noting that a network 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 powerful the network device's data processing capabilities, the more interface boards it provides. Each interface board may also have one or more physical interface cards. A switching board may or may not exist; multiple boards can share the load and provide redundancy. In a centralized forwarding architecture, the network device may not need a switching board, as the interface boards handle the entire system's business data processing. In a distributed forwarding architecture, the network device can have at least one switching board, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a distributed architecture network device are greater than those of a centralized architecture network device. Alternatively, the network device can also be a single board, without a switching 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 (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU to perform the combined functions. This type of network 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.

[0189] In a specific embodiment, network device 1700 corresponds to the above. Figure 10 The data stream transmission device shown. In some embodiments, Figure 10 The processing module 1002 in the data stream transmission device shown is equivalent to the central processing unit 1711 or network processor 1732 in the network device 1700.

[0190] This application embodiment also provides a communication device, which includes a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path. The memory stores instructions, and the processor executes the instructions stored in the memory to control the transceiver to receive and transmit signals. When the processor executes the instructions stored in the memory, it causes the processor to perform... Figure 9 The data stream transmission method shown.

[0191] It should be understood that the aforementioned processor can be a CPU, or other general-purpose processors, DSPs, ASICs, FPGAs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting the Advanced Reduced Instruction Set Computing (RISC) machine (ARM) architecture.

[0192] Furthermore, in an alternative embodiment, the memory described above may include read-only memory and random access memory, and provide instructions and data to the processor. The memory may also include non-volatile random access memory. For example, the memory may also store device type information.

[0193] The memory can be volatile or non-volatile, or may include both. Non-volatile memory can be ROM, programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), EEPROM, or flash memory. Volatile memory can be RAM, used as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include 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).

[0194] This application embodiment also provides a data stream transmission device, the device including a processor coupled to a memory, the memory for storing at least one instruction, and the processor for loading and executing the at least one instruction to enable the data stream transmission device to perform as follows: Figure 9 The data stream transmission method is illustrated. Optionally, the device may also include a memory.

[0195] This application also provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to enable the computer to perform the following: Figure 9 The data stream transmission method shown.

[0196] This application also provides a computer program (product) that, when executed by a computer, causes the processor or computer to perform the corresponding steps and / or processes in the above method embodiments.

[0197] In some cases, the aforementioned communication devices and data stream transmission devices can be chips.

[0198] 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., a solid-state drive).

[0199] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, fault information involved in this application was obtained with full authorization.

[0200] Those skilled in the art will recognize that the method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. To clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0201] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0202] When implemented using software, it can be implemented wholly or partially as a computer program product. This computer program product includes one or more computer program instructions. As an example, the methods of this application embodiment can be described in the context of machine-executable instructions, such as program modules that execute on a device on a real or virtual processor of the target. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functionality of program modules can be combined or divided among the described program modules. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside on both local and remote storage media.

[0203] Computer program code used to implement the methods of the embodiments of this application may be written in one or more programming languages. This computer program code may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data streaming device, such that when executed by the computer or other programmable data streaming device, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a computer, partially on a computer, as a standalone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.

[0204] In the context of the embodiments of this application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, etc.

[0205] Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.

[0206] A machine-readable medium can be any tangible medium that contains or stores programs for or relating to an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. More detailed examples of machine-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0207] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be found in the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0208] In the embodiments provided in this 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 merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or modules, or they may be electrical, mechanical, or other forms of connection.

[0209] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0210] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0211] If the integrated module is implemented as a software functional module 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0212] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have substantially the same function and purpose. 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. For example, without departing from the various examples described, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image. Both the first image and the second image can be images, and in some cases, they can be separate and distinct images.

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

[0214] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple second messages refer to two or more second messages. The terms "system" and "network" are often used interchangeably in this document.

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

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

[0217] It should also be understood that the term “comprising” (also referred to as “includes”, “including”, “comprises” and / or “comprising”) as used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0218] 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]”.

[0219] It should be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.

[0220] It should also be understood that the phrases "an embodiment," "an embodiment," and "a possible implementation" used throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment or implementation is included in at least one embodiment of this application. Therefore, the phrases "in an embodiment," "an embodiment," or "a possible implementation" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

Claims

1. A method of data stream transmission, characterized by, The method is applied to a first communication device, the first communication device being connected to a second communication device via a first output port and a second output port, the method comprising: Receive the first data stream through the first input port; According to the first correspondence relationship corresponding to the first input port, the first data stream is transmitted to the second communication device through the first output port. The first correspondence relationship indicates that the data stream received by the first input port is sent through the first output port. The first output port is connected to the second communication device through the third communication device. Obtain fault information, which indicates a fault has occurred between the third communication device and the second communication device; Based on the fault information, a second correspondence is determined for the first data stream, and the second correspondence indicates that the first data stream received by the first ingress port is sent through the second egress port. The subsequent messages of the first data stream are transmitted to the second communication device through the second output port. The link through which the subsequent messages of the first data stream are transmitted between the first communication device and the second communication device does not include the link between the third communication device and the second communication device that has failed.

2. The method of claim 1, wherein, The second correspondence has a higher priority than the first correspondence.

3. The method according to claim 1 or 2, characterized in that, The port number of the second output port is consecutive to the port number of the first output port.

4. The method according to any of claims 1 to 3, characterized in that, The first communication device stores a third correspondence relationship corresponding to the second input port, the third correspondence relationship indicating that the data stream received by the second input port of the first communication device is sent through the second output port, and the method further includes: The second data stream is received through the second inlet port and sent to the second communication device through the second outlet port. The link through which the second data stream is transmitted between the first communication device and the second communication device is the same as the link through which subsequent messages of the first data stream are transmitted between the first communication device and the second communication device.

5. The method according to any of claims 1 to 4, characterized in that, The acquisition of fault information includes: Receive fault information sent by the third communication device.

6. The method according to any one of claims 1 to 5, characterized in that, After transmitting subsequent messages of the first data stream to the second communication device through the second output port, the method further includes: In the event of recovery from the faulty link, a fourth correspondence is determined for the first ingress port, the fourth correspondence indicating that the data stream received by the first ingress port is sent through the first egress port. The system receives the message to be transmitted in the first data stream through the first input port and transmits the message to be transmitted in the first data stream to the second communication device through the first output port.

7. The method according to claim 6, characterized in that, Determining the fourth correspondence relationship corresponding to the first ingress port includes: Obtain recovery information, which indicates the recovery of the failed link; The fourth correspondence is determined based on the recovery information.

8. The method according to any one of claims 1-7, characterized in that, The first and second communication devices are leaf switches, and the third communication device is a spine switch.

9. A transmission system, characterized in that, The system includes a first communication device, a second communication device, and a third communication device, wherein the first communication device is connected to the second communication device through a first output port and a second output port; The first communication device is used to receive a first data stream through a first input port; The first communication device is further configured to transmit the first data stream to the second communication device through the first output port according to the first correspondence relationship corresponding to the first input port, wherein the first correspondence relationship indicates that the data stream received by the first input port is sent through the first output port, and the first output port is connected to the second communication device through the third communication device. The first communication device is further configured to acquire fault information, the fault information indicating a fault occurring between the third communication device and the second communication device; The first communication device is further configured to determine a second correspondence relationship corresponding to the first data stream based on the fault information, wherein the second correspondence relationship indicates that the first data stream received by the first ingress port is sent through the second egress port; The first communication device is further configured to transmit subsequent messages of the first data stream to the second communication device through the second output port; The second communication device is configured to receive subsequent messages of the first data stream, wherein the link through which the subsequent messages of the first data stream are transmitted between the first communication device and the second communication device does not include the link between the third communication device and the second communication device that has failed.

10. The system according to claim 9, characterized in that, The second correspondence has a higher priority than the first correspondence.

11. The system according to claim 9 or 10, characterized in that, The port number of the second output port is consecutive to the port number of the first output port.

12. The system according to any one of claims 9-11, characterized in that, The first communication device stores a third correspondence relationship corresponding to the second input port, the third correspondence relationship indicating that the data stream received by the second input port of the first communication device is sent through the second output port; The first communication device is further configured to receive a second data stream through the second input port and send the second data stream to the second communication device through the second output port; The second communication device is further configured to receive the second data stream, wherein the link through which the second data stream is transmitted between the first communication device and the second communication device is the same as the link through which subsequent messages of the first data stream are transmitted between the first communication device and the second communication device.

13. The system according to any one of claims 9-12, characterized in that, The first communication device is used to receive fault information sent by the third communication device.

14. The system according to any one of claims 9-13, characterized in that, The first communication device is further configured to, in the event of recovery of the faulty link, determine a fourth correspondence corresponding to the first ingress port, wherein the fourth correspondence indicates that the data stream received by the first ingress port is sent through the first egress port; receive a message to be transmitted in the first data stream through the first ingress port; and transmit the message to be transmitted in the first data stream to the second communication device through the first egress port. The second communication device is also used to receive messages to be transmitted in the first data stream.

15. The system according to claim 14, characterized in that, The first communication device is used to acquire recovery information, the recovery information indicating the recovery of a faulty link; and to determine the fourth correspondence based on the recovery information.

16. The system according to any one of claims 9-15, characterized in that, The first and second communication devices are leaf switches, and the third communication device is a spine switch.

17. A data stream transmission device, characterized in that, The device is applied to a first communication device, the first communication device being connected to a second communication device via a first output port and a second output port, the device comprising: The transceiver module is used to perform the receiving and / or sending related operations in the method according to any one of claims 1-8; The processing module is configured to perform operations other than the receiving and / or sending related operations in the method described in any one of claims 1-8.

18. A data stream transmission device, characterized in that, The device includes a processor coupled to a memory storing at least one instruction, the processor being configured to load and execute the at least one instruction to enable the device to implement the data stream transmission method as described in any one of claims 1-8.

19. 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 data stream transmission method as described in any one of claims 1-8.

20. A computer program product, characterized in that, The computer program product includes a computer program / instruction that is executed by a processor to cause a computer to perform the data stream transmission method as described in any one of claims 1-8.