Data transmission method, device, equipment, system and storage medium

By rerouting unsuccessfully transmitted data packets when a port failure is detected, using reference sequence numbers and updating routing tables, the problem of data packet loss caused by point-to-point link failures is resolved, the transmission reliability of the link layer is improved, and the device processing overhead and latency are reduced.

CN120658671APending Publication Date: 2025-09-16HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410291566.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-13
Publication Date
2025-09-16

Smart Images

  • Figure CN120658671A_ABST
    Figure CN120658671A_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission method, device, equipment and system and a storage medium, and relates to the technical field of communication. When it is detected that a first port for sending the data stream is completely faulty, data packets which are not successfully transmitted in the data stream are determined in data packets cached in the first port, the data packets cached in the first port comprise data packets which do not receive an acknowledgement packet in the data stream, and the complete fault refers to a fault which is not recovered within a time threshold; the data packet which is not successfully transmitted is rerouted, a second port to the destination address of the data stream is determined according to a rerouting result, and the second port is not completely faulty; and sending the unsuccessfully transmitted data packet through the second port. According to the method, the loss of the unsuccessfully transmitted data packet cached by the first port caused by the complete failure of the first port is avoided, and the transmission reliability of the link layer is improved. Therefore, no end-to-end packet loss can be ensured without a transmission layer of the end-side device for transmitting the data stream.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to data transmission methods, devices, equipment, systems and storage media. Background Art

[0002] In the field of communications technology, data communications utilize a layered architecture, encompassing, for example, the transaction layer, transport layer, network layer, data link layer, and physical layer. Each layer handles corresponding functions. For example, the transport layer handles end-to-end transmission, while the data link layer handles point-to-point transmission. End-to-end refers to data communication from the source to the destination, while point-to-point refers to data communication from any hop between the source and destination to the next hop.

[0003] In the related art, in the event of a complete failure of a point-to-point link, since the point-to-point link cannot recover from the failure, it will cause point-to-point packet loss at the data link layer, and then the transport layer of the end-side devices at both ends of the data communication will need to retransmit the lost packets to ensure end-to-end packet loss.

[0004] Because transport layer functions are implemented by the central processing unit (CPU) through software or hardware chips, hardware implementations increase data processing latency. Therefore, in the event of a complete point-to-point link failure, ensuring end-to-end packet loss protection at the transport layer increases processing overhead on the end-side devices and increases data transmission latency. Summary of the Invention

[0005] The present application provides a data transmission method, apparatus, device, system and storage medium for improving the transmission reliability of the link layer.

[0006] In a first aspect, a data transmission method is provided, comprising: upon detecting a complete failure of a first port for sending a data stream, determining data packets in the data stream that have not been successfully transmitted from data packets cached by the first port, the data packets cached by the first port including data packets in the data stream for which no confirmation packets have been received, a complete failure being a failure that has not been recovered within a time threshold; rerouting the data packets that have not been successfully transmitted, determining a second port to a destination address of the data stream based on the rerouting result, the second port not having a complete failure; and sending the data packets that have not been successfully transmitted through the second port.

[0007] The sender of this method uses rerouting to ensure that, in the event of a complete failure of the first port, the data packets that have not been successfully transmitted and are cached by the first port can continue to be transmitted through the second port that has not completely failed. The data packets that have not been successfully transmitted include data packets that have been sent by the first port but have not been confirmed and data packets to be sent by the first port. In this way, the loss of data packets that have not been successfully transmitted and are cached by the first port due to the complete failure of the first port is avoided, and point-to-point packet loss-free transmission at the link layer can be achieved, thereby improving the transmission reliability of the link layer. In addition, on the basis of ensuring point-to-point packet loss-free transmission, end-to-end packet loss-free transmission can also be guaranteed, and there is no need to ensure end-to-end packet loss-free transmission through the transmission layer of the end-side device that transmits the data stream, thereby reducing the processing overhead of the transmission layer of the end-side device and shortening the data transmission delay.

[0008] In one possible embodiment, a method for determining, among the data packets cached by the first port, data packets that have not been successfully transmitted in a data stream may include receiving a reference sequence number of a data stream sent by a first communication device connected to the first port, the reference sequence number indicating the last data packet that has been successfully transmitted in the data stream; and determining, among the data packets cached by the first port, data packets that have not been successfully transmitted in the data stream based on the reference sequence number.

[0009] In this method, since the received reference sequence number can indicate the last data packet successfully transmitted in the data stream, the data packet that was not successfully transmitted is determined more accurately by the reference sequence number, avoiding the data packet that is rerouted to be included in the data packet that has been successfully transmitted, thus achieving point-to-point packet avoidance at the link layer.

[0010] In one possible implementation, when the data stream transmission granularity is packet, each packet corresponds to a sequence number. The reference sequence number is the sequence number of the last packet in the data stream received by the first communication device. Unsuccessfully transmitted packets are packets buffered by the first port whose sequence numbers follow the reference sequence number. In scenarios where the transmission granularity is packet, unsuccessfully transmitted packets can be accurately identified based directly on the sorting position of the reference sequence number.

[0011] In one possible implementation, when the transmission granularity of the data stream is a data block, a data packet is divided into multiple data blocks for transmission, one data block corresponds to one sequence number, and the data packet that is not successfully transmitted is the data packet to which the data block whose sequence number is after the reference sequence number belongs in the data packet cached by the first port.

[0012] In scenarios where the transmission granularity is smaller than a data packet, the data block that failed to be transmitted is determined based on the sorting position of the reference sequence number, and the data packet that failed to be transmitted is accurately determined based on the relationship between the unsuccessfully transmitted data block and the data packet. In this manner, if any data block within any data packet failed to be transmitted, then the data packet is determined to have failed to be transmitted. In other words, this method reroutes at the data packet granularity, ensuring the transmission integrity of the data packet and avoiding data packet errors caused by the communication device connected to the second port after rerouting being different from the first communication device connected to the first port.

[0013] In one possible implementation, the reference sequence number is carried in a link control message for transmission. The source address of the link control message is a third port connected to the first port of the first communication device, and the destination address of the link control message is the first port. Carrying the reference sequence number in the link control message provides an implementation for transmitting the reference sequence number.

[0014] In one possible implementation, before rerouting the unsuccessfully transmitted data packet, when a complete failure of the first port is detected, the state of the first port in the stored routing table is also set to offline to obtain a modified routing table, which includes multiple ports to the destination address of the data flow and the state of each port; and then the method of rerouting the unsuccessfully transmitted data packet may include rerouting the unsuccessfully transmitted data packet based on the modified routing table.

[0015] In this manner, by timely updating the port status, the accuracy of the port status in the routing table is ensured, thereby ensuring the accuracy of rerouting based on the routing table.

[0016] In a possible implementation, after rerouting the data packets that were not successfully transmitted, the data packets buffered by the first port may be released, thereby releasing the buffer space in a timely manner and saving the buffer space.

[0017] In a second aspect, a data transmission method is provided, which includes: in the event that a complete failure of a third port for receiving a data stream is detected, sending a reference sequence number of the data stream to a second communication device connected to the third port, the reference sequence number indicating the last data packet successfully transmitted in the data stream, the reference sequence number being used by the second communication device to reroute data packets that were not successfully transmitted in the data stream, and a complete failure being a failure that is not recovered within a time threshold.

[0018] In the event of a complete failure of the third port, the receiver of this method can proactively notify the sender of the reference sequence number, so that the sender can accurately determine the data packet that was not successfully transmitted based on the reference sequence number, and then achieve re-routing transmission of the data packet that was not successfully transmitted. In this way, it is possible to avoid the loss of unsuccessfully transmitted data packets caused by a complete failure of the port, ensuring that there is no point-to-point packet loss at the link layer, and it is also possible to avoid the re-routed data packets from including data packets that have been successfully transmitted, ensuring that there is no point-to-point packet loss at the link layer. In addition, on the basis of ensuring point-to-point packet loss, it is also possible to ensure end-to-end packet loss, and there is no need to ensure end-to-end packet loss through the transport layer of the end-side device that transmits the data stream, thereby reducing the processing overhead of the transport layer of the end-side device and reducing the data transmission delay.

[0019] In one possible embodiment, the transmission granularity of the data stream is a data packet, and one data packet corresponds to one serial number; before sending the reference serial number of the data stream to the second communication device connected to the third port, when any data packet of the data stream is received through the third port, the reference serial number is determined to be the serial number of any data packet.

[0020] In one possible embodiment, the transmission granularity of the data stream is a data block, a data packet is divided into multiple data blocks for transmission, and one data block corresponds to one serial number; before sending the reference serial number of the data stream to the second communication device connected to the third port, when any data block of the data stream is received through the third port, the reference serial number is determined to be the serial number of any data block.

[0021] By determining the reference sequence number in the above two methods at different transmission granularities, the accuracy of the reference sequence number can be guaranteed.

[0022] In a possible implementation, the reference sequence number is carried in a link control message for transmission, the source address of the link control message is the third port, and the destination address of the link control message is the first port of the second communication device connected to the third port.

[0023] In a third aspect, a data transmission device is provided, comprising a transceiver module and a processing module. In one possible embodiment, the transceiver module comprises a receiving module and / or a sending module. The receiving module is configured to perform reception-related operations, and the sending module is configured to perform transmission-related operations.

[0024] In one possible implementation, the transceiver module is configured to perform operations related to receiving and / or sending in the first aspect or any possible implementation of the first aspect; and the processing module is configured to perform operations other than the operations related to receiving and / or sending in the first aspect or any possible implementation of the first aspect. Alternatively, the transceiver module is configured to perform operations related to receiving and / or sending in the second aspect or any possible implementation of the second aspect; and the processing module is configured to perform operations other than the operations related to receiving and / or sending in the second aspect or any possible implementation of the second aspect.

[0025] In a transceiver module, used to perform operations related to reception and / or transmission in the first aspect or any possible implementation of the first aspect; a processing module, used to perform other operations other than the operations related to reception and / or transmission in the first aspect or any possible implementation of the first aspect; the processing module, used to determine the data packets that were not successfully transmitted in the data stream from the data packets cached by the first port when a complete failure is detected in the first port for sending the data stream, the data packets cached by the first port include data packets in the data stream for which no confirmation packets have been received, and a complete failure refers to a failure that is not recovered within a time threshold; and rerouting the data packets that were not successfully transmitted, and determining a second port to the destination address of the data stream based on the rerouting result, wherein the second port is not completely faulty; the transceiver module, used to send the data packets that were not successfully transmitted through the second port.

[0026] In one possible embodiment, the transceiver module is used to receive a reference sequence number of a data stream sent by a first communication device connected to the first port, where the reference sequence number indicates the last data packet successfully transmitted in the data stream; and the processing module is used to determine, among the data packets cached by the first port, data packets that were not successfully transmitted in the data stream based on the reference sequence number.

[0027] In one possible embodiment, when the transmission granularity of the data stream is a data packet, one data packet corresponds to a serial number, the reference serial number is the serial number of the last data packet belonging to the data stream received by the first communication device, and the data packet that is not successfully transmitted is the data packet in the data packet cache of the first port whose serial number is after the reference serial number.

[0028] In one possible embodiment, when the transmission granularity of the data stream is a data block, a data packet is divided into multiple data blocks for transmission, one data block corresponds to a sequence number, the reference sequence number is the sequence number of the last data block belonging to the data stream received by the first communication device, and the data packet that is not successfully transmitted is the data packet to which the data block with a sequence number after the reference sequence number belongs in the data packet cached by the first port belongs.

[0029] In a possible implementation, the reference sequence number is carried in a link control message for transmission, the source address of the link control message is the third port of the first communication device connected to the first port, and the destination address of the link control message is the first port.

[0030] In one possible embodiment, the processing module is further configured to, upon detecting a complete failure of the first port, set the status of the first port in the stored routing table to offline, thereby obtaining a modified routing table, wherein the modified routing table includes multiple ports to the destination address of the data flow and the status of each port; and the processing module is configured to reroute data packets that were not successfully transmitted based on the modified routing table.

[0031] In a possible implementation, the processing module is further configured to release the data packet buffered by the first port.

[0032] In the case where the transceiver module is used to perform operations related to reception and / or transmission in the second aspect or any possible implementation of the second aspect; the processing module is used to perform operations other than the operations related to reception and / or transmission in the second aspect or any possible implementation of the second aspect; the transceiver module is used to send a reference sequence number of the data stream to the second communication device connected to the third port when a complete failure of the third port for receiving the data stream is detected, the reference sequence number indicates the last data packet successfully transmitted in the data stream, and the reference sequence number is used by the second communication device to reroute data packets that are not successfully transmitted in the transmission data stream, and a complete failure refers to a failure that is not recovered within a time threshold.

[0033] In a possible implementation, the transmission granularity of the data stream is a data packet, and one data packet corresponds to one serial number; the processing module is used to determine that the reference serial number is the serial number of any data packet when any data packet of the data stream is received through the third port.

[0034] In one possible implementation, the transmission granularity of the data stream is a data block, a data packet is divided into multiple data blocks for transmission, and one data block corresponds to one serial number; the processing module is used to determine that the reference serial number is the serial number of any data block when any data block of the data stream is received through the third port.

[0035] In a possible implementation, the reference sequence number is carried in a link control message for transmission, the source address of the link control message is the third port, and the destination address of the link control message is the first port of the second communication device connected to the third port.

[0036] In a fourth aspect, a network device is provided, comprising: a processor, the processor being coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor, so that the network device implements the data transmission method as described in any one of the first or second aspects above.

[0037] Optionally, there are one or more processors and one or more memories.

[0038] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

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

[0040] In a fifth aspect, a data transmission system is provided, which includes a first communication device and a second communication device; the first communication device is used to execute the method described in the first aspect or any possible implementation of the first aspect, and the second communication device is used to execute the method described in the second aspect or any possible implementation of the second aspect.

[0041] In the sixth aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to enable the computer to implement the method in the above-mentioned first aspect or any possible implementation of the first aspect, or to implement the method in the above-mentioned second aspect or any possible implementation of the second aspect.

[0042] In a seventh aspect, a computer program (product) is provided, which includes: computer program code, which, when executed by a computer, enables the computer to execute the methods in the above aspects.

[0043] In an eighth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes the methods in the above aspects.

[0044] In the ninth aspect, 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, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the methods in the above aspects.

[0045] It should be understood that the beneficial effects achieved by the technical solutions of the third to ninth aspects of this application and the corresponding possible implementation methods can be referred to the technical effects of the first to second aspects and their corresponding possible implementation methods mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A schematic diagram of a data link layer retransmission process provided in the related art;

[0047] Figure 2 A schematic diagram of a network for data transmission provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of the system architecture of a communication device provided in an embodiment of the present application;

[0049] Figure 4 A flowchart of a data transmission method provided in an embodiment of the present application;

[0050] Figure 5 A flowchart of another data transmission method provided in an embodiment of the present application;

[0051] Figure 6 A schematic diagram of a data transmission scenario provided in an embodiment of the present application;

[0052] Figure 7 A schematic diagram of another data transmission scenario provided in an embodiment of the present application;

[0053] Figure 8 A schematic diagram of a data packet transmission provided in an embodiment of the present application;

[0054] Figure 9 A schematic diagram of another data transmission scenario provided in an embodiment of the present application;

[0055] Figure 10 A schematic diagram of a loopback channel of a communication device provided in an embodiment of the present application;

[0056] Figure 11 A schematic diagram of another data transmission scenario provided in an embodiment of the present application;

[0057] Figure 12 A schematic diagram of a data block transmission provided in an embodiment of the present application;

[0058] Figure 13 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;

[0059] Figure 14 A schematic diagram of the structure of a network device provided in an embodiment of the present application;

[0060] Figure 15 A schematic diagram of the structure of another network device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0062] With the development of communication technology, the peripheral component interconnect express (PCIE) protocol can support link layer retransmission to improve the reliability of the link layer. PCIE is a high-speed serial computer expansion bus standard that uses data packets (PKT) for data transmission. Data packets need to pass through the transaction layer (Transaction Layer), data link layer (Data Link Layer) and physical layer (Physical Layer) during the sending and receiving process. The transaction layer is responsible for generating transaction layer packets (TLP) at the sending end and decoding TLP at the receiving end. The transaction layer is also responsible for quality of service, flow control and transmission order; the data link layer is responsible for packaging TLP or generating data link layer packets (DLLP) at the sending end and decoding DLLP at the receiving end; the physical layer is responsible for generating ordered data packets at the sending end and decoding ordered data packets at the receiving end. Among them, the data link layer can be referred to as the link layer.

[0063] After the application layer at the sending end initiates a transaction, the data payload to be transmitted is submitted to the transaction layer. The transaction layer adds information such as the destination address and encapsulates it into a TLP, which is then passed to a buffer stack. When the TLP is submitted to the data link layer, the data link layer adds a sequence number (SEQ) to the TLP header and a link cyclical redundancy check (LCRC) to the TLP tail to generate a DLLP. The DLLP is also backed up in the buffer to prevent transmission failures and the need for retransmission. Finally, the DLLP is submitted to the physical layer, which adds header and tail identification tags to the DLLP and encodes it before sending it via differential signals. The physical layer at the receiving end receives the differential signals, decodes them, and recovers the DLLP, which is then submitted to the data link layer. The data link layer checks the LCRC at the end of the DLLP. If the LCRC is correct, the truncated TLP is submitted to the transport layer's buffer stack. The transport layer then extracts the data payload and submits it to the receiving application layer.

[0064] For example, the data link layer retransmission process in the related art is as follows: Figure 1 As shown in the figure. Data link layer retransmission is used for point-to-point retransmission on a directly connected interface between two devices. The sender of the point-to-point transmission is R1, and the receiver is R2. For example, R1's data link layer transmits a data stream to R2's port 2 via port 1. The data stream includes pkt1, pkt2, and pkt3. R1 sequentially sends three pkts, pkt1, pkt2, and pkt3. pkt1, pkt2, and pkt3 are all cached in the retry buffer (retry buffer). R2 correctly receives pkt1 and sends acknowledgment (ack) 1 to R1, notifying R1 that pkt1 has been correctly received. After receiving ack1, R1 deletes pkt1 from the retry buffer.

[0065] Correctly receiving any pkt means that the received pkt has no errors, for example, the frame sequence number of the pkt is continuous with the frame sequence number of the last correctly received pkt, and the pkt includes a cyclic redundancy check (CRC), and the CRC check is correct. Correspondingly, if there is an error in the received pkt, for example, the frame sequence number of the pkt is not continuous with the frame sequence number of the last correctly received pkt, or the CRC check included in the pkt is incorrect, it is determined that the pkt has not been correctly received. Optionally, any pkt that is not correctly received can be directly discarded, and it can be considered that the pkt has not been received.

[0066] If pkt2 is incorrect due to a point-to-point link failure between port1 and port2, for example, R2 discovers an error in pkt2 by checking the CRC in pkt2, or if R2 finds that pkt2 is discontinuous with the previously received pkt1, the receiver sends a request (req) 1 requesting R1 to retransmit from pkt2. Although R2 receives pkt3, it is discarded because pkt2 is already incorrect. After receiving req1, R1 retransmits pkt2 and pkt3 in sequence. The point-to-point link failure between port1 and port2 is restored. After R2 correctly receives pkt2 and pkt3, it returns the corresponding ack2 and ack3 to R1, which then deletes pkt2 and pkt3 from the retry buffer. Thus, reliable point-to-point transmission from R1 to R2 is completed, provided that the point-to-point link between port1 and port2 does not completely fail.

[0067] From this, we can see that if the point-to-point link is not completely faulty but intermittent, then through the data link layer retransmission in the relevant technology, the point-to-point link after the fault recovery can be used to achieve data link layer packet retransmission to ensure that there is no packet loss between points. If each point-to-point segment between the end-to-end can ensure no packet loss, it is equivalent to ensuring no packet loss from end to end. However, if the point-to-point link is completely disconnected, it is still Figure 1 For example, before port 1 completely fails and disconnects, only pkt1 is successfully transmitted, resulting in point-to-point packet loss of pkt2 and pkt3 between R1 and R2.

[0068] exist Figure 2 In the network shown, there are two paths for the end-side device S1 to transmit data to another end-side device D1. Path 1 is S1, R1, R2, R4 and D1, and path 2 is S1, R1, R3, R4 and D1. The communication devices R in the network all enable data link layer retransmission. Figure 1 The data link layer retransmission between R1 and R2 is shown as Figure 2 For example, if the point-to-point link between R1 and R2 fails completely after pkt1 is correctly received, then ack1 sent by R2 will not reach R1, and pkt2 and pkt3 sent by R1 will not reach D1. Ultimately, the transport layer on S1 on the end side must switch the transmission path for retransmission to ensure end-to-end packet loss prevention. For example, the retransmitted pkt will be transmitted over path 2.

[0069] However, with the growing demand for business and the increase in bandwidth, it is becoming a trend for the hardware chips of end-side devices to implement transport layer functions. Implementing transport layer functions in hardware chips will increase chip power consumption and area, and will also increase processing latency. Therefore, the embodiments of the present application provide a data transmission method that can ensure that there is no packet loss between points in the data link layer, and thus ensure that there is no packet loss in the intermediate network. This method can eliminate the transport layer processing of the end-side device, reduce the processing overhead of the end-side device, and shorten the data transmission latency.

[0070] See also Figure 3 , Figure 3 This is a schematic diagram of the system architecture of a communication device provided in an embodiment of the present application. The communication device may include multiple ports, any of which is used to connect to other communication devices, for example, to receive data sent by other communication devices, or to send data to other communication devices. Figure 3 In the figure, a communication device including port 0 and port 1 is used as an example, wherein any port includes an ingress medium access control (iMAC) module, an egress medium access control (eMAC) module, an ingress packet processing (iPP) module, and an egress packet processing (ePP) module.

[0071] The iMAC module is used to complete the reception processing of the pkt from the physical port, and the eMAC module is used to complete the transmission processing of the pkt from the physical port. The eMAC module includes a retry buf. When the pkt is sent from the physical port, a copy is also cached in the retry buf. If a successful response is received from the other end, the pkt is deleted from the retry buf. Otherwise, the pkt is resent from the retry buf to ensure that when an occasional port failure occurs, the pkt can be correctly received again after the failure is recovered. The iPP module is used to query the routing table based on the pkt content and select the corresponding output port for the pkt. The ePP module is used to perform operations such as encapsulation on the pkt. Different ports communicate with each other through the message buffer management unit (memory management unit, MMU). The MMU is used to allocate a sending queue according to the output port, add the pkt to the sending queue of the corresponding output port, and then perform scheduling processing. After scheduling, it is sent to the EPP module.

[0072] For example, take a pkt received from port 0 and sent by port 1 as an example. ① The iMAC module of port 0 receives the pkt and sends it to the iPP module of port 0. ② The iPP module of port 0 finds out that the port is port 1 in the routing table based on the destination address of the pkt, and sends the pkt carrying the information of port 1 to the MMU. ③ The MMU adds the pkt to the sending queue of port 1 according to port 1. After the sending queue is scheduled to the pkt, it sends the pkt to the ePP module of port 1. ④ The ePP module performs encapsulation processing and sends it to the eMAC module of port 1. ⑤ The eMAC module of port 1 sends the pkt out and caches it in the retry buf of the eMAC module. ⑥ If the iMAC module of port 1 receives the ack corresponding to the pkt, it notifies the eMAC module to delete the pkt from the retry buf.

[0073] The communication device mentioned in the embodiments of the present application can be a network device such as a switch or a router, or a component of a network device, such as a single board or line card on the network device, or a functional module on the network device, or a chip for implementing the method of the present application, which is not specifically limited in the embodiments of the present application. When the communication device is a chip, the transceiver module for implementing the method can be, for example, an interface circuit of the chip, and the processing module can be a processing circuit with processing functions in the chip. The connection method between the communication devices includes but is not limited to direct connection via Ethernet cable or optical cable.

[0074] See also Figure 4 , the method is described by taking the second communication device as an example, Figure 4 A flowchart of a data transmission method provided in an embodiment of the present application. In which the second communication device is the sender of data point-to-point transmission, and the method can be applied to Figure 2 In the networking shown, for example, the second communication device may be Figure 2 The S1 device or any R device shown, or the second communication device can be Figure 3 The communication device shown. Figure 4 As shown, the data transmission method includes but is not limited to the following steps 401 to 403.

[0075] Step 401, when a complete failure is detected on a first port sending a data stream, data packets in the data stream that are not successfully transmitted are determined from data packets cached by the first port, where the data packets cached by the first port include data packets in the data stream for which no acknowledgment packets have been received, and a complete failure refers to a failure that is not recovered within a time threshold.

[0076] In an embodiment of the present application, the second communication device is directly connected to the first communication device, that is, there is no other forwarding node between the second communication device and the first communication device. For example, the first port of the second communication device is directly connected to the third port of the first communication device. The embodiment of the present application is illustrated by taking the second communication device sending a data stream to the third port of the first communication device through the first port as an example. The data stream includes multiple data packets, and each data packet in the same data stream has the same source address and the same destination address. The second communication device and the first communication device can be any two-hop adjacent nodes on the forwarding path between the source address and the destination address.

[0077] A complete port failure means that the port has not recovered within a time threshold, that is, the failure occurring on the port cannot be automatically recovered within the time threshold. The time threshold can be flexibly adjusted according to the application scenario, for example, the time threshold is 1 second. The embodiment of the present application does not limit the method for detecting a complete failure. Optionally, a complete port failure can be determined if the optical signal of the port is lost, or if the reconnection initiated through the port after the port failure is unsuccessful.

[0078] In a possible embodiment, when a complete failure of the first port for sending a data stream is detected, the state of the first port is also set from up to down, and the port with a state of down is an unavailable port. In an embodiment of the present application, a routing table is stored and maintained in the second communication device, and the routing table includes multiple ports to different destination addresses and the state of each port. The routing table is used to route the forwarded data packet to determine the port for sending the data packet. In this case, setting the state of the first port to down can refer to setting the state of the first port in the stored routing table to down, thereby obtaining a modified routing table.

[0079] In an embodiment of the present application, when sending data packets of a data stream through a first port, data packets in the data stream for which no confirmation packets have been received are cached at the first port. For example, the sender caches all data packets that have been sent or are to be sent through the first port at the first port to facilitate subsequent retransmission of lost packets; when any data packet is correctly received by the receiver, the data packet is successfully transmitted from the sender to the receiver, and the receiver returns a confirmation packet corresponding to the data packet to the sender to notify the sender that the data packet has been received; each time the sender receives a confirmation packet corresponding to any data packet, it determines that the data packet has been successfully transmitted, i.e., there is no need to retransmit the data packet, and the cached data packet is deleted.

[0080] That is to say, a data packet that is not successfully transmitted refers to a data packet that is not received by the recipient, i.e., the first communication device, and a data packet that is successfully transmitted refers to a data packet that is received by the recipient, i.e., the first communication device. Therefore, the data packets cached by the first port include data packets that are not successfully transmitted, and may also include data packets that are successfully transmitted but for which no confirmation packet is received. For example, the confirmation packet fed back by the first communication device is lost due to a port failure. The data packets received by any communication device mentioned in the embodiments of the present application refer to data packets correctly received by any communication device. For an introduction to correct reception, please refer to the above description, i.e., the first communication device only receives data packets with continuous sequence numbers and correct CRC checks, and the recipient does not receive data packets with discontinuous sequence numbers and incorrect CRC checks.

[0081] In one possible implementation, the data packets buffered by the first port are directly determined as unsuccessfully transmitted data packets in the data stream. This method of determining unsuccessfully transmitted data packets is simple, direct, and easy to implement, ensuring that no packet is lost at the link layer. However, it can easily lead to the retransmission of successfully transmitted data packets.

[0082] Therefore, an embodiment of the present application provides another method for determining the data packets that have not been successfully transmitted in the data stream from the data packets cached by the first port. Optionally, a reference sequence number of the data stream sent by the first communication device is received, and the reference sequence number indicates the last data packet successfully transmitted in the data stream; in the data packets cached by the first port, the data packets that have not been successfully transmitted in the data stream are determined based on the reference sequence number. In this method, since the received reference sequence number can indicate the last data packet successfully transmitted in the data stream, the data packets that have not been successfully transmitted determined by the reference sequence number are more accurate, avoiding the data packets that have been successfully transmitted being included in the data packets that are rerouted, and thus achieving point-to-point packet avoidance at the link layer.

[0083] Considering the different transmission granularities of data stream transmission, the methods of determining the data packets that have not been successfully transmitted in the data stream based on the reference sequence number include but are not limited to the following two methods.

[0084] In the first approach, when the transmission granularity of the data stream is a data packet, one data packet corresponds to one sequence number, and the data packet that is not successfully transmitted is the data packet whose sequence number is after the reference sequence number in the data packets buffered by the first port.

[0085] In this manner, the reference sequence number is the sequence number of the last data packet belonging to the data stream received by the first communication device, and the last data packet belonging to the data stream received by the first communication device is the last data packet successfully transmitted. That is, the data packets with sequence numbers before the reference sequence number are all successfully transmitted data packets, and the data packets with sequence numbers after the reference sequence number are all unsuccessfully transmitted data packets. Furthermore, since the data packets cached by the first port are data packets to be successfully transmitted through the first port, that is, if the data packets cached by the first port fail to be successfully transmitted, it will cause the data packets cached by the first port to be lost, and thus cause data packet loss in the data stream. Therefore, after determining the reference sequence number of the last data packet successfully transmitted, it can be determined that all data packets with sequence numbers after the reference sequence number in the data packets cached by the first port are data packets that were unsuccessfully transmitted.

[0086] For example, if the first port buffers packets 2, 3, 4, and 5, and the reference sequence number is 3, then packet 3 is the last successfully transmitted packet in the data stream. That is, packets 2 and 3 are successfully transmitted, while packets 4 and 5 are unsuccessfully transmitted. Therefore, in scenarios where the transmission granularity is equal to the packet, unsuccessfully transmitted packets can be accurately identified directly based on the sorting position of the reference sequence number.

[0087] Method 2: When the transmission granularity of the data stream is data blocks, a data packet is divided into multiple data blocks for transmission, and a data block corresponds to a sequence number. The data packet that is not successfully transmitted is the data packet to which the data block whose sequence number is after the reference sequence number belongs in the data packet cached by the first port.

[0088] In the scenario where a data packet is divided into multiple data blocks for transmission, the sender will cache the data blocks that have been sent or to be sent through the first port at the first port, and the relationship between the cached data blocks and the data packets will be used to facilitate subsequent packet loss and retransmission; when any data block is correctly received by the receiver, the any data block is successfully transmitted from the sender to the receiver, and the receiver will return a confirmation packet corresponding to the any data block to the sender to inform the sender that the any data block has been received; each time the sender receives the confirmation packet corresponding to any data block, it determines whether each data block in the data packet to which the any data block belongs has received the corresponding confirmation packet. If each data block in the data packet to which the any data block belongs has received the corresponding confirmation packet, it is confirmed that the data packet to which the any data block belongs has been successfully transmitted, that is, there is no need to retransmit the data packet to which the any data block belongs, and the cached data packet to which the any data block belongs is deleted.

[0089] In the second mode, the reference sequence number is the sequence number of the last data block belonging to the data stream received by the first communication device. If the reference sequence number is the sequence number of the last data block in a data packet, then the data packet to which the last data block belonging to the data stream received by the first communication device belongs is the last data packet successfully transmitted; if the reference sequence number is not the sequence number of the last data block in a data packet, then the data packet before the data packet to which the last data block belonging to the data stream received by the first communication device belongs is the last data packet successfully transmitted. After the last data packet successfully transmitted is determined based on the reference sequence number, the data packet after the last data packet successfully transmitted in the data packets cached by the first port is the data packet that was not successfully transmitted. Therefore, the data packet that was not successfully transmitted is the data packet to which all data blocks with sequence numbers after the reference sequence number belong in the data packets cached by the first port belong.

[0090] For example, if the data packets cached by the first port are data packets 3, 4, and 5, and one data packet is divided into four data blocks for transmission, data packet 3 includes data blocks 1, 2, 3, and 4, data packet 4 includes data blocks 5, 6, 7, and 8, and data packet 5 includes data blocks 9, 10, 11, and 12. Taking the reference sequence number as 4 as an example, the data blocks with sequence numbers after the reference sequence number are data blocks 5-12, and the data packets to which data blocks 5-12 belong are data packets 4 and 5. Therefore, the data packets that were not successfully transmitted are data packets 4 and 5. Taking the reference sequence number as 6 as an example, the data blocks with sequence numbers after the reference sequence number are data blocks 7-12, and the data packets to which data blocks 7-12 belong are still data packets 4 and 5. Therefore, the data packets that were not successfully transmitted are still data packets 4 and 5.

[0091] Therefore, in scenarios where the transmission granularity is smaller than a data packet, the data block that was not successfully transmitted is determined based on the sorting position of the reference sequence number, and the data packet that was not successfully transmitted is accurately determined based on the relationship between the unsuccessfully transmitted data block and the data packet. Under this second method, if any data block within any data packet is not successfully transmitted, then the data packet is determined to be unsuccessfully transmitted. In other words, this method reroutes at the data packet granularity, ensuring the transmission integrity of the data packet and avoiding data packet errors caused by the communication device connected to the second port after rerouting being different from the first communication device connected to the first port.

[0092] In one possible implementation, the reference sequence number is carried in a link control message for transmission. The source address of the link control message is the third port of the first communication device, and the destination address of the link control message is the first port of the second communication device. In this case, the second communication device receives the link control message sent by the first communication device, which carries the reference sequence number. The second communication device can then obtain the reference sequence number by parsing the link control message.

[0093] Step 402: reroute the data packet that has not been successfully transmitted, and determine a second port to the destination address of the data flow according to the rerouting result, where the second port is not completely faulty.

[0094] In the case where a complete failure of the first port is detected in step 401, the state of the first port in the stored routing table is also set to offline to obtain a modified routing table. Then, the method for rerouting the unsuccessfully transmitted data packet may include rerouting the unsuccessfully transmitted data packet based on the modified routing table. The modified routing table includes multiple ports for the destination address of the data stream and the state of each port. Optionally, any port that is online among the multiple ports for the destination address of the data stream is determined to be the second port. Thus, by timely updating the port state, the accuracy of the port state in the routing table is guaranteed, thereby ensuring the accuracy of rerouting based on the routing table.

[0095] In the embodiment of the present application, the data packets buffered by the first port can be buffered in the egress buffer of the first port, for example, the egress buffer is Figure 3 Optionally, the process of rerouting the unsuccessfully transmitted data packet may include looping back the unsuccessfully transmitted data packet from the egress buffer to the ingress packet processing module of the first port. For example, the ingress packet processing module is Figure 3 The ipp module shown; reroutes the data packets that are not successfully transmitted based on the modified routing table through the ingress packet processing module.

[0096] In one possible implementation, after rerouting the unsuccessfully transmitted data packets, the data packets cached by the first port may be released. For example, all data in the egress buffer may be deleted. This allows for timely release of buffer space, saving buffer space.

[0097] Step 403: Send the data packet that was not successfully transmitted through the second port.

[0098] After determining that the second port is obtained, since the second port is in an online state, the data packet that was not successfully transmitted can be successfully transmitted through the second port. Optionally, the communication device connected to the second port can be the first communication device, or other communication devices that can reach the destination address of the data flow.

[0099] The method provided in the embodiment of the present application, for the sender, enables, through rerouting, in the event of a complete failure of the first port, the data packets that have not been successfully transmitted in the cache of the first port to continue to be transmitted through the second port that has not completely failed. The data packets that have not been successfully transmitted include data packets that have been sent but not confirmed by the first port and data packets to be sent by the first port. In this way, the loss of data packets that have not been successfully transmitted in the cache of the first port due to the complete failure of the first port is avoided, and point-to-point packet loss-free transmission of the link layer can be achieved, thereby improving the transmission reliability of the link layer. In addition, on the basis of ensuring point-to-point packet loss-free transmission, end-to-end packet loss-free transmission can also be guaranteed, and there is no need to ensure end-to-end packet loss-free transmission through the transmission layer of the end-side device that transmits the data stream, thereby reducing the processing overhead of the transmission layer of the end-side device and reducing the data transmission delay.

[0100] See also Figure 5 , the method is described by taking the first communication device as an example, Figure 5 A flowchart of another data transmission method provided in an embodiment of the present application. In which the first communication device is the receiver of the data point-to-point transmission, and the method can be applied to Figure 2 In the networking shown, for example, the first communication device may be Figure 2 Any R device or D1 device shown, or the first communication device can be Figure 3 The communication device shown. Figure 5 As shown, the data transmission method includes but is not limited to the following step 501.

[0101] Step 501: When a complete failure is detected in the third port for receiving the data stream, a reference sequence number of the data stream is sent to the second communication device connected to the third port. The reference sequence number indicates the last data packet successfully transmitted in the data stream. The reference sequence number is used by the second communication device to reroute the data packets that were not successfully transmitted in the data stream. A complete failure refers to a failure that is not recovered within a time threshold.

[0102] In an embodiment of the present application, the first communication device is directly connected to the second communication device, that is, there is no other forwarding node between the first communication device and the second communication device. For example, the first port of the second communication device is directly connected to the third port of the first communication device. The embodiment of the present application is illustrated by taking the data stream sent by the first port of the first communication device received by the first communication device through the third port as an example. The data stream includes multiple data packets, and the source address and destination address of each data packet in the same data stream are the same. The second communication device and the first communication device can be any two-hop adjacent nodes on the forwarding path between the source address and the destination address. Among them, for the introduction of complete failure and the method of detecting complete failure, please refer to the relevant instructions in step 401, which will not be repeated here.

[0103] Optionally, the forwarding path for sending the reference sequence number from the first communication device to the second communication device is not limited in this embodiment of the present application and can be any reachable path from the first communication device to the second communication device, where the reachable path can be either a direct path or an indirect path. For example, the shortest path from the first communication device to the second communication device is selected to send the reference sequence number.

[0104] In one possible implementation, the reference sequence number is carried in a link control message for transmission. The source address of the link control message is the third port of the first communication device, and the destination address of the link control message is the first port of the second communication device. In this case, the first communication device sends a link control message to the second communication device, and the link control message carries the reference sequence number.

[0105] Before sending the reference sequence number of the data stream to the second communication device connected to the third port, it is necessary to determine the reference sequence number of the data stream. Optionally, if the transmission granularity of the data stream is data packets, and one data packet corresponds to one sequence number, then when any data packet of the data stream is received through the third port, the reference sequence number of the data stream is determined to be the sequence number of any data packet. In other words, when any data packet of the data stream is correctly received through the third port, the reference sequence number of the data stream is determined to be the sequence number of any data packet. If the transmission granularity of the data stream is data blocks, and one data packet is divided into multiple data blocks for transmission, and one data block corresponds to one sequence number, then when any data block of the data stream is received through the third port, the reference sequence number of the data stream is determined to be the sequence number of any data block. In other words, when any data block of the data stream is correctly received through the third port, the reference sequence number of the data stream is determined to be the sequence number of any data block. By determining the reference sequence number under the above two different transmission granularities, the accuracy of the reference sequence number can be guaranteed.

[0106] In one possible implementation, the third port of the second communication device includes a register whose value is used to record a reference sequence number of the data stream. For example, if any data packet of the data stream is successfully received via the third port, the value of the corresponding register for that data stream is updated to the sequence number of that data packet. Furthermore, if a complete failure of the third port receiving the data stream is detected, the value of the corresponding register for that data stream is read as the reference sequence number of the data stream.

[0107] The method provided in the embodiment of the present application can, for the receiver, proactively notify the sender of the reference sequence number in the event of a complete failure of the third port, so that the sender can accurately determine the data packet that was not successfully transmitted based on the reference sequence number, and then achieve re-routing transmission of the data packet that was not successfully transmitted. In this way, it is possible to avoid the loss of unsuccessfully transmitted data packets caused by a complete failure of the port, ensuring that the link layer does not lose packets from point to point, and it is also possible to avoid the re-routed data packets from including data packets that have been successfully transmitted, ensuring that the link layer does not have too many packets from point to point. In addition, on the basis of ensuring point-to-point packet loss, it is also possible to ensure end-to-end packet loss, and there is no need to ensure end-to-end packet loss through the transport layer of the end-side device that transmits the data stream, thereby reducing the processing overhead of the transport layer of the end-side device and reducing the data transmission delay.

[0108] Next, combine Figure 6-11 The data transmission method provided in the embodiment of the present application is described with examples. Figure 2 Taking the network shown in the figure as an example, the data sent from S1 to D1 is divided into flow granularity. For example, S1 sends flow1 and flow2 to D1, and both flow1 and flow2 include multiple data packets. Figure 6 In a normal forwarding state with no link failures, both path 1 and path 2 are reachable. In R1's routing table, the egress ports for D1 include port 1 and port 3, and both port 1 and port 3 are up. For example, after flow 1 reaches R1, load balancing routing is performed based on the routing table. For example, a hash is performed based on the destination address of flow 1's packets to select one of the two egress ports. If port 1 is selected, the packets belonging to flow 1 are sent via path 1 to R4.

[0109] Among them, hash routing can be based on the quintuple information of flow1 and other features, and a hash value is calculated through a hash function. Then, the hash value is modulo the number of equivalent-cost paths. Taking the number of equivalent-cost routes as 2 as an example, if the modulus is 0, port1 is selected, and if the modulus is 1, port3 is selected. The quintuple information includes the source internet protocol (SIP), the destination internet protocol (DIP), the source port (SPort), the destination port (DPort), and the protocol number (protocol). Optionally, if the status of port1 is offline, after flow1 reaches R1, the output port is directly determined to be port3 based on the routing table, that is, the output port in the offline state is not selected.

[0110] See also Figure 7 After port 1 of R1 fails completely, the status of port 1 changes to down. Because the outbound port selected by flow 1 before port 1 fails is port 1, some packets of flow 1 will be buffered in the retrybuf of port 1 and will not reach R2 correctly. For example, Figure 8 As shown in the figure, before port 1 completely failed, pkt1, pkt2, and pkt3 were correctly received by R2, and ack1 correctly reached R1. However, ack2 and ack3 did not reach R1 due to the link failure. pkt4 and pkt5 also did not reach R2 due to the link failure. Since R1 received ack1, it deleted pkt1 from the retry buffer. Since acks for pkt2, pkt3, pkt4, and pkt5 were not received, pkt2, pkt3, pkt4, and pkt5 remained in R1's retry buffer.

[0111] For pkt2, pkt3, pkt4, and pkt5, pkt2 and pkt3 have been correctly received by R2, but pkt4 and pkt5 have not been correctly received by R2. The goal of the embodiment of the present application is to selectively reroute pkt4 and pkt5 to the final destination D1, but pkt2 and pkt3 cannot be resent to avoid multiple packets. Therefore, based on the data link layer retransmission mechanism, the embodiment of the present application adds a register last_rcv_pkt_seq at the receiving end. last_rcv_pkt_seq is used to record the packet sequence number of the last correctly received data packet at the receiving end. Figure 8As shown in the figure, each time the receiver correctly receives a data packet, it updates the sequence number of the data packet to last_rcv_pkt_seq. Before port-1 completely fails, pkt3 is the last correctly received data packet, so the value of last_rcv_pkt_seq is 3.

[0112] Because port 1 on R1 is connected to port 2 on R2, if port 1 on R1 fails completely, port 2 on R2 also fails completely. For example, if the link between port 1 and port 2 fails completely, R1 can detect the complete failure of port 1 and set the port 1 status to down. R2 can also detect the complete failure of port 2 and set the port 2 status to down.

[0113] See also Figure 9 After R2's port2 fails completely, R2 sends the value of last_rcv_pkt_seq to R1 through the failsafe path (failsafe-link). For example, R2 sends a failsafe-link control message to R1, the source address of which is R2's port2, the destination address is R1's port1, and the data payload is the value of last_rcv_pkt_seq of R2's port2. Optionally, failsafe-link is a logical concept and can be any path from R2 to R1. For example, the shortest path among all paths from R2 to R1 is selected as the failsafe-link. If there are other directly connected ports between R1 and R2, such as R1's port4 and R21's port5, then the link between port4 and port5 is the failsafe-link.

[0114] After port 1 of R1 fails completely, R1 opens a loopback channel from the eMAC module of port 1 to the iMAC module. For example, the loopback channel is as follows: Figure 10 The dotted path from the eMAC module to the iMAC module is shown. As a result, the data packets in the retrybuf of the eMAC module can reach the iPP module again through the loopback channel through the iMAC module, and the iPP module will re-check the routing table for rerouting.

[0115] Optionally, after R1 receives the failsafe-link control message sent by R2, it determines that the last data packet correctly received by R3 is pkt3 based on the value of last_rcv_pkt_seq carried in the failsafe-link control message being 3. Figure 8As shown in the figure, pkt2, pkt3, pkt4, and pkt5 are cached in the retry buffer of port 1 of R1. R1 deletes pkt2 and pkt3 and sends pkt4 and pkt5 to the iPP module of port 1 of R1 through the loopback channel. Since port 1 has completely failed, the route destined for D1 in R1's routing table has been modified to the following: Figure 11 The content shown is that the status of port 1 is down and the status of port 3 is up.

[0116] Continue to see Figure 11 When packets pkt4 and pkt5 loop back and reach the iPP module, the module checks the routing table to determine that port 1 is down and selects port 3 as the egress port for pkt4 and pkt5. Eventually, pkt4 and pkt5 reach R4 and then D1 via path 2. When subsequent packets from pkt5 reach the iPP module on port 0 of R1, the module also checks the routing table to determine that port 1 is down and selects port 3 as the egress port for subsequent packets.

[0117] above Figure 6-11 All are transmitted in units of data packets. For the case where data packets are not transmitted, for example, compute express link (CXL) technology. CXL is a new type of high-speed interconnect technology that aims to provide higher data throughput and lower latency to meet the needs of modern computing and storage systems. In CXL technology, the sending end cuts the data packet into fixed-size blocks for transmission, and the fixed-size blocks can be called flow control units (flits). The size of flit is not limited in the embodiments of the present application. For example, the size of flit can be 64 bytes. If the valid data of the last flit of the data packet is less than 64 bytes, it is padded to 64 bytes.

[0118] For example, Figure 12 As shown in the figure, both pkt1 and pkt2 are divided into four flits, one for each data block. That is, pkt1 includes flit1, flit2, flit3, and flit4, while pkt2 includes flit5, flit6, flit7, and flit8. Each flit has its own sequence number and CRC. Both the sender and receiver transmit in units of flits, and ACKs are also sent in units of flits. The sender can only remove a packet from the retry buffer after receiving ACKs for all of its flits. Therefore, the receiver's register is updated to contain the sequence number of the last correctly received flit, namely, last_rcv_flit_seq.

[0119] After a complete port failure, the sender receives the value of last_rcv_flit_seq sent by the receiver and determines whether all the flits of the data packet to which the flit belongs are correctly received by the receiver. If any flit of the data packet to which the flit belongs is not correctly received by the receiver, the data packet to which the flit belongs is looped back and rerouted. Figure 12 As shown in the figure, if the value of last_rcv_flit_seq is 5, pkt2 performs loopback rerouting. If the value of last_rcv_flit_seq is 8, pkt2 does not need to perform loopback rerouting.

[0120] The above describes the data transmission method of the embodiment of the present application. Corresponding to the above method, the embodiment of the present application also provides a data transmission device. Figure 13 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of the present application, which is applied to a first communication device or a second communication device, wherein the first communication device is the above-mentioned Figure 4 The first communication device shown, the second communication device is the above Figure 5 The second communication device shown. Figure 13 As shown in the following multiple modules, the Figure 13 The data transmission device shown is capable of performing Figure 4 or Figure 5 All or part of the operations performed by the provided method. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown, and the embodiments of the present application are not limited to this. Figure 13 As shown, the device includes:

[0121] Transceiver module 1301, used to execute Figure 4 The receiving and / or sending related operations performed by the first communication device in the method shown, the processing module 1302 is used to perform Figure 4 Other operations other than the receiving and / or sending related operations performed by the first communication device in the method shown. Alternatively, the transceiver module 1301 is configured to perform Figure 5 The receiving and / or sending related operations performed by the second communication device in the method shown, the processing module 1302 is used to perform Figure 5 Other operations other than the receiving and / or sending related operations performed by the second communication device in the method shown. In one possible implementation, the transceiver module includes a receiving module and / or a sending module. The receiving module is used to perform receiving related operations, and the sending module is used to perform sending related operations.

[0122] In the transceiver module 1301, for executing Figure 4The receiving and / or sending related operations performed by the first communication device in the method shown, the processing module 1302 is used to perform Figure 4 In the case of other operations other than the receiving and / or sending related operations performed by the first communication device in the method shown; the processing module 1302 is used to determine the data packets that were not successfully transmitted in the data stream from the data packets cached by the first port when a complete failure is detected in the first port for sending the data stream, the data packets cached by the first port include data packets in the data stream for which no confirmation packets have been received, and a complete failure refers to a failure that is not recovered within a time threshold; and rerouting the data packets that were not successfully transmitted, and determining a second port to the destination address of the data stream based on the rerouting result, wherein the second port is not completely faulty; the transceiver module 1302 is used to send the data packets that were not successfully transmitted through the second port.

[0123] In one possible embodiment, the transceiver module 1302 is used to receive a reference sequence number of a data stream sent by a first communication device connected to the first port, where the reference sequence number indicates the last data packet successfully transmitted in the data stream; the processing module 1302 is used to determine, among the data packets cached by the first port, data packets that were not successfully transmitted in the data stream based on the reference sequence number.

[0124] In one possible embodiment, when the transmission granularity of the data stream is a data packet, one data packet corresponds to a serial number, the reference serial number is the serial number of the last data packet belonging to the data stream received by the first communication device, and the data packet that is not successfully transmitted is the data packet in the data packet cache of the first port whose serial number is after the reference serial number.

[0125] In one possible embodiment, when the transmission granularity of the data stream is a data block, a data packet is divided into multiple data blocks for transmission, one data block corresponds to a sequence number, the reference sequence number is the sequence number of the last data block belonging to the data stream received by the first communication device, and the data packet that is not successfully transmitted is the data packet to which the data block with a sequence number after the reference sequence number belongs in the data packet cached by the first port belongs.

[0126] In a possible implementation, the reference sequence number is carried in a link control message for transmission, the source address of the link control message is the third port of the first communication device connected to the first port, and the destination address of the link control message is the first port.

[0127] In one possible implementation, the processing module 1302 is further configured to, upon detecting a complete failure of the first port, set the status of the first port in the stored routing table to offline, thereby obtaining a modified routing table, the modified routing table including multiple ports to the destination address of the data flow and the status of each port; the processing module 1302 is configured to reroute data packets that were not successfully transmitted based on the modified routing table.

[0128] In a possible implementation, the processing module 1302 is further configured to release the data packet buffered by the first port.

[0129] In the transceiver module 1301, for executing Figure 5 The receiving and / or sending related operations performed by the second communication device in the method shown, the processing module 1302 is used to perform Figure 5 In the case of other operations other than the reception and / or transmission related operations performed by the second communication device in the method shown; the transceiver module 1302 is used to send the reference sequence number of the data stream to the second communication device connected to the third port when a complete failure is detected in the third port for receiving the data stream, the reference sequence number indicates the last data packet successfully transmitted in the data stream, and the reference sequence number is used by the second communication device to reroute the data packets that were not successfully transmitted in the transmission data stream, and a complete failure refers to a failure that is not recovered within a time threshold.

[0130] In one possible implementation, the transmission granularity of the data stream is a data packet, and one data packet corresponds to one serial number; the processing module 1302 is used to determine that the reference serial number is the serial number of any data packet when any data packet of the data stream is received through the third port.

[0131] In one possible implementation, the transmission granularity of the data stream is a data block, a data packet is divided into multiple data blocks for transmission, and one data block corresponds to one serial number; the processing module 1302 is used to determine that the reference serial number is the serial number of any data block when any data block of the data stream is received through the third port.

[0132] In a possible implementation, the reference sequence number is carried in a link control message for transmission, the source address of the link control message is the third port, and the destination address of the link control message is the first port of the second communication device connected to the third port.

[0133] It should be understood that the above Figure 13When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed 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. In addition, the device provided in the above embodiment belongs to the same concept as the method embodiment. Its specific implementation process is detailed in the method embodiment, which will not be repeated here. The beneficial effects of the device provided in the above embodiment can be referred to the corresponding beneficial effects of the method embodiment, which will not be repeated here.

[0134] See also Figure 14 , Figure 14 A schematic structural diagram of a network device 2000 provided by an exemplary embodiment of the present application is shown. Figure 14 The network device 2000 shown is used to perform the above Figure 4 or Figure 5 The network device 2000 is, for example, a switch, a router, etc. The network device 2000 can be implemented by a general bus architecture.

[0135] like Figure 14 As shown, the network device 2000 includes at least one processor 2001 , a memory 2003 and at least one communication interface 2004 .

[0136] The processor 2001 is, 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 units (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 2001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic devices, a transistor logic device, a hardware component, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present invention. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0137] Optionally, the network device 2000 further includes a bus. The bus is used to transmit information between the components of the network device 2000. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 14 The fact that only one line is used does not mean that there is only one bus or one type of bus.

[0138] The memory 2003 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2003 is, for example, independent and connected to the processor 2001 via a bus. The memory 2003 can also be integrated with the processor 2001.

[0139] The communication interface 2004 uses any transceiver-like device to communicate with other devices or communication networks. The communication network can be Ethernet, a radio access network (RAN), or a wireless local area network (WLAN). The communication interface 2004 can include a wired communication interface or a wireless communication interface. Specifically, the communication interface 2004 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a wireless local area network (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 the embodiment of the present application, the communication interface 2004 can be used for the network device 2000 to communicate with other devices.

[0140] In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as Figure 140 and CPU1 are shown in FIG. Each of these processors can be a single-core CPU processor or a multi-core CPU processor. A processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0141] In a specific implementation, as an embodiment, the network device 2000 may include multiple processors, such as Figure 14 1 and 2005. Each of these processors can be a single-core CPU or a multi-core CPU. A processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0142] In a specific implementation, as an embodiment, the network device 2000 may further include an output device and an input device. The output device communicates with the processor 2001 and can display information in a variety of ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor 2001 and can receive user input in a variety of ways. For example, the input device can be a mouse, a keyboard, a touch screen device, or a sensor device.

[0143] In some embodiments, the memory 2003 is used to store program code 2010 for executing the solution of the present application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. In other words, the network device 2000 can implement the data transmission method provided by the method embodiment through the processor 2001 and the program code 2010 in the memory 2003. The program code 2010 may include one or more software modules. Optionally, the processor 2001 itself may also store program code or instructions for executing the solution of the present application.

[0144] In a specific embodiment, the network device 2000 of the embodiment of the present application may correspond to the first communication device in each of the above method embodiments, and the processor 2001 in the network device 2000 reads the instruction in the memory 2003, so that Figure 14 The illustrated network device 2000 is capable of performing all or part of the operations performed by the first communication apparatus.

[0145] Specifically, the processor 2001 is used to determine the data packets that have not been successfully transmitted in the data stream from the data packets cached by the first port when it is detected that the first port sending the data stream has completely failed. The data packets cached by the first port include data packets in the data stream for which no confirmation packets have been received. A complete failure refers to a failure that has not been recovered within a time threshold; reroute the data packets that have not been successfully transmitted, determine a second port to the destination address of the data stream based on the rerouting result, and the second port has not completely failed; and send the data packets that have not been successfully transmitted through the second port.

[0146] For the sake of brevity, other optional implementations are not described here in detail.

[0147] For another example, the network device 2000 of the embodiment of the present application may correspond to the second communication device in each of the above method embodiments, and the processor 2001 in the network device 2000 reads the instruction in the memory 2003, so that Figure 14 The illustrated network device 2000 is capable of performing all or part of the operations performed by the second communication apparatus.

[0148] Specifically, processor 2001 is used to send a reference sequence number of the data stream to a second communication device connected to the third port when it detects that the third port for receiving the data stream has completely failed. The reference sequence number indicates the last data packet successfully transmitted in the data stream. The reference sequence number is used by the second communication device to reroute data packets that have not been successfully transmitted in the data stream. A complete failure refers to a failure that is not recovered within a time threshold.

[0149] For the sake of brevity, other optional implementations are not described here in detail.

[0150] The network device 2000 may also correspond to the above Figure 13 In the data transmission device shown, each functional module in the data transmission device is implemented using software of the network device 2000. In other words, the functional modules included in the data transmission device are generated after the processor 2001 of the network device 2000 reads the program code 2010 stored in the memory 2003.

[0151] in, Figure 4 or Figure 5Each step of the data transmission method shown is completed by an integrated logic circuit of hardware or software instructions in the processor of the network device 2000. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0152] See also Figure 15 , Figure 15 FIG2 shows a schematic structural diagram of a network device 2100 provided by another exemplary embodiment of the present application. Figure 15 The network device 2100 shown is used to perform the above Figure 4 or Figure 5 All or part of the operations involved in the data transmission method shown. The network device 2100 is, for example, a switch, a router, etc. The network device 2100 can be implemented by a general bus architecture.

[0153] like Figure 15 As shown, the network device 2100 includes: a main control board 2110 and an interface board 2130 .

[0154] The main control board (2110), also known as the main processing unit (MPU) or route processor card, is used to control and manage various components in network device 2100, including routing calculations, device management, device maintenance, and protocol processing. It includes a central processing unit (CPU) 2111 and memory 2112.

[0155] Interface board 2130 is also known as a line processing unit (LPU), line card, or service board. It provides various service interfaces and implements data packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces and POS (Packet over SONET / SDH) interfaces. Ethernet interfaces, for example, are Flexible Ethernet Clients (FlexE Clients). Interface board 2130 includes a central processing unit (CPU) 2131, a network processor (NPU) 2132, a forwarding table memory 2134, and a physical interface card (PIC) 2133.

[0156] The central processing unit 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processing unit 2111 on the main control board 2110 .

[0157] The network processor 2132 is used to implement message forwarding processing. The network processor 2132 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, the network processor 2132 is used to forward received messages based on the forwarding table stored in the forwarding entry memory 2134. If the destination address of the message is the address of the network device 2100, the message is sent to the CPU (such as the central processing unit 2131) for processing. If the destination address of the message is not the address of the network device 2100, the next hop and outgoing interface corresponding to the destination address are searched in the forwarding table based on the destination address, and the message is forwarded to the outgoing interface corresponding to the destination address. The processing of uplink messages may include processing the message inbound interface and forwarding table lookup; the processing of downlink messages may include forwarding table lookup, etc. In some embodiments, the central processing unit may also perform the functions of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, thereby eliminating the need for a forwarding chip in the interface board.

[0158] Physical interface card 2133 implements physical layer interconnection. Raw traffic enters interface board 2130 through this card, and processed packets are sent out from this physical interface card 2133. Physical interface card 2133, also known as a daughter card, can be installed on interface board 2130. It converts optical and electrical signals into packets, performs a validity check on these packets, and then forwards them to network processor 2132 for processing. In some embodiments, central processing unit 2131 can also perform the functions of network processor 2132, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for network processor 2132 in physical interface card 2133.

[0159] Optionally, the network device 2100 includes multiple interface boards. For example, the network device 2100 further includes an interface board 2140. The interface board 2140 includes a central processing unit 2141, a network processor 2142, a forwarding table entry memory 2144, and a physical interface card 2143. The functions and implementation of each component in the interface board 2140 are the same as or similar to those of the interface board 2130 and are not described in detail here.

[0160] Optionally, network device 2100 further includes a switching fabric board 2120. Switching fabric board 2120 may also be referred to as a switch fabric unit (SFU). If network device 2100 includes multiple interface boards, switching fabric board 2120 is used to exchange data between the interface boards. For example, interface board 2130 and interface board 2140 can communicate via switching fabric board 2120.

[0161] The main control board 2110 is coupled to the interface board. For example, the main control board 2110, the interface board 2130, the interface board 2140, and the switching network board 2120 are connected to the system backplane via a system bus to achieve intercommunication. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 2110 and the interface boards 2130 and 2140, and communication is performed between the main control board 2110 and the interface boards 2130 and 2140 via the IPC channel.

[0162] Logically, network device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processing unit (CPU) 2111. The forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 2134, physical interface cards 2133, and a network processor 2132. The control plane performs routing functions, generates forwarding tables, processes signaling and protocol messages, and configures and maintains the network device's status. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 2132 forwards messages received by the physical interface card 2133 based on the forwarding tables sent by the control plane. The forwarding tables sent by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and forwarding plane can be completely separate and not located on the same network device.

[0163] It's worth noting that there may be one or more main control boards (SPUs), which can include both active and standby SPUs. There may also be one or more interface boards. The higher the network device's data processing capabilities, the more interface boards it provides. Interface boards can also have one or more physical interface cards. There may be no SPUs, one or more SPUs, and multiple SPUs can provide load balancing and redundancy. In a centralized forwarding architecture, network devices may not require SPUs; the interface boards handle service data processing for the entire system. In a distributed forwarding architecture, network devices may have at least one SPU, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, network devices with distributed architectures have greater data access and processing capabilities than those with centralized architectures. Alternatively, a network device can consist of a single card, without a switching fabric board (SFB), integrating the functions of the interface board and the main control 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 on this card, performing the combined functions of the two. This type of network device has lower data exchange and processing capabilities (for example, low-end network devices such as switches or routers). The specific architecture used depends on the specific network deployment scenario and is not specified here.

[0164] In a specific embodiment, the network device 2100 corresponds to the above Figure 13 In some embodiments, Figure 13 The transceiver module 1301 in the data transmission device shown is equivalent to the physical interface card 2133 in the network device 2100 , and the processing module 1302 is equivalent to the central processing unit 2111 or the network processor 2132 in the network device 2100 .

[0165] The embodiment of the present application also provides a data transmission system, which includes: a first communication device and a second communication device. For example, the first communication device is Figure 14 The network device 2000 or Figure 15 The network device 2100 shown in FIG. 2 includes a second communication device. Figure 14 The network device 2000 or Figure 15 The network device 2100 shown in FIG. The data transmission method performed by the first communication device and the second communication device can be referred to in the above Figure 4 or Figure 5 The relevant description of the illustrated embodiment will not be repeated here.

[0166] An embodiment of the present application further 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 connection path. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. When the processor executes the instructions stored in the memory, the processor executes the method required to be executed by the first communication device or the second communication device.

[0167] It should be understood that the processor described above may be a CPU, or other general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced Reduced Instruction Set Machine (ARM) architecture.

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

[0169] The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM).

[0170] An embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to enable a computer to implement any of the above data transmission methods.

[0171] The embodiments of the present application further provide a computer program (product), which, when executed by a computer, can enable a processor or computer to execute the corresponding steps and / or processes in the above method embodiments.

[0172] An embodiment of the present application also provides a chip, including a processor, for calling and executing instructions stored in a memory, so that a communication device equipped with the chip executes any of the above data transmission methods.

[0173] An embodiment of the present application also provides another chip, including: 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 through an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute any of the above data transmission methods.

[0174] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the present 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 computer-readable storage medium. 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 a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive).

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

[0176] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0177] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. As an example, the method of the embodiment of the present application can be described in the context of a machine executable instruction, and the machine executable instruction is such as included in the program module executed in the device on the real or virtual processor of the target. Generally speaking, a program module includes a routine, a program, a library, an object, a class, a component, a data structure, etc., which performs a specific task or realizes a specific abstract data structure. In various embodiments, the function of the program module can be merged or split between the described program modules. The machine executable instruction for the program module can be executed in a local or distributed device. In a distributed device, the program module can be located in both a local and a remote storage medium.

[0178] The computer program code for realizing the method for the embodiment of the application can be written in one or more programming languages.These computer program codes can be provided to the processor of general-purpose computer, special-purpose computer or other programmable data processing device, so that program code, when being executed by computer or other programmable data processing device, causes the function / operation specified in flow chart and / or block diagram to be implemented.Program code can be executed completely on computer, partly on computer, as independent software package, partly on computer and partly on remote computer or completely on remote computer or server.

[0179] In the context of the embodiments of the present 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, and the like.

[0180] Examples of signals may include electrical, optical, radio, acoustic or other forms of propagated signals, such as carrier waves, infrared signals, etc.

[0181] A machine-readable medium may be any tangible medium that contains or stores a program for or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of machine-readable storage media include an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0182] Those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the above-described systems, devices, and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0183] In the several 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 schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or can be electrical, mechanical or other forms of connection.

[0184] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0185] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.

[0186] If the integrated module is implemented in the form of 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 the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0187] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items that have substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity or execution order. 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 only used to distinguish one element from another. For example, without departing from the scope of the various examples, a first image may be referred to as a second image, and similarly, a second image may be referred to as a first image. The first image and the second image may both be images, and in some cases, may be separate and different images.

[0188] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean 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 the present application.

[0189] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, "plurality of second messages" means two or more second messages. The terms "system" and "network" are often used interchangeably herein.

[0190] 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," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0191] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the listed items. The term "and / or" describes an association between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this application generally indicates that the associated objects are in an "or" relationship.

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

[0193] It should also be understood that the terms “if” and “if” may be interpreted to mean “when” or “upon” or “in response to determining” or “in response to detecting.” Similarly, the phrases “if it is determined that ” or “if [stated condition or event] is detected” may be interpreted to mean “upon determining ” or “in response to determining ” or “upon detecting [stated condition or event]” or “in response to detecting [stated condition or event],” depending on the context.

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

[0195] It should also be understood that references throughout this specification to "one embodiment," "an embodiment," or "one possible implementation" mean that specific features, structures, or characteristics associated with that embodiment or implementation are included in at least one embodiment of the present application. Therefore, the appearance of "in one embodiment," "in an embodiment," or "one possible implementation" throughout this specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0196] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application should be included in the scope of protection of the present application.

Claims

1. A data transmission method, characterized in that: The method comprises: In a case where a complete failure is detected on a first port sending a data stream, determining data packets in the data stream that were not successfully transmitted from data packets buffered by the first port, the data packets buffered by the first port including data packets in the data stream for which no acknowledgment packets have been received, wherein the complete failure refers to a failure that is not recovered within a time threshold; rerouting the unsuccessfully transmitted data packet, and determining a second port to the destination address of the data flow according to the rerouting result, where the second port is not completely faulty; The unsuccessfully transmitted data packet is sent through the second port.

2. The method according to claim 1, characterized in that Determining, from among the data packets cached by the first port, data packets that are not successfully transmitted in the data stream includes: receiving a reference sequence number of the data stream sent by a first communication device connected to the first port, wherein the reference sequence number indicates a last successfully transmitted data packet in the data stream; Among the data packets buffered by the first port, data packets that are not successfully transmitted in the data flow are determined based on the reference sequence number.

3. The method according to claim 2, characterized in that When the transmission granularity of the data stream is a data packet, one data packet corresponds to one serial number, the reference serial number is the serial number of the last data packet belonging to the data stream received by the first communication device, and the data packet that was not successfully transmitted is the data packet in the data packet cached by the first port whose serial number is after the reference serial number.

4. The method according to claim 2, characterized in that When the transmission granularity of the data stream is a data block, a data packet is divided into multiple data blocks for transmission, one data block corresponds to a sequence number, the reference sequence number is the sequence number of the last data block belonging to the data stream received by the first communication device, and the data packet that is not successfully transmitted is the data packet to which the data block with the sequence number after the reference sequence number belongs in the data packet cached by the first port belongs.

5. The method according to any one of claims 2 to 4, characterized in that: The reference sequence number is carried in a link control message for transmission, a source address of the link control message is a third port of the first communication device connected to the first port, and a destination address of the link control message is the first port.

6. The method according to any one of claims 1 to 5, characterized in that: Before rerouting the unsuccessfully transmitted data packet, the method further includes: When a complete failure of the first port is detected, setting the state of the first port in the stored routing table to offline to obtain a modified routing table, wherein the modified routing table includes multiple ports to the destination address of the data flow and the state of each port; The rerouting of the unsuccessfully transmitted data packet includes: The unsuccessfully transmitted data packet is rerouted based on the modified routing table.

7. The method according to any one of claims 1 to 6, characterized in that: After rerouting the unsuccessfully transmitted data packet, the method further includes: Release the data packets buffered by the first port.

8. A data transmission method, characterized in that: The method comprises: In the event that a complete failure is detected in the third port for receiving the data stream, a reference sequence number of the data stream is sent to a second communication device connected to the third port, wherein the reference sequence number indicates the last data packet successfully transmitted in the data stream, and the reference sequence number is used by the second communication device to reroute and transmit data packets that were not successfully transmitted in the data stream. The complete failure refers to a failure that is not recovered within a time threshold.

9. The method according to claim 8, characterized in that The transmission granularity of the data stream is a data packet, and one data packet corresponds to one sequence number; before sending the reference sequence number of the data stream to the second communication device connected to the third port, the method further includes: In case any data packet of the data stream is received through the third port, the reference sequence number is determined to be the sequence number of the any data packet.

10. The method according to claim 8, characterized in that The transmission granularity of the data stream is a data block, a data packet is divided into multiple data blocks for transmission, and each data block corresponds to a sequence number; before sending the reference sequence number of the data stream to the second communication device connected to the third port, the method further includes: In a case where any data block of the data stream is received through the third port, the reference sequence number is determined to be the sequence number of the any data block.

11. The method according to any one of claims 8 to 10, characterized in that: The reference sequence number is carried in a link control message for transmission, the source address of the link control message is the third port, and the destination address of the link control message is the first port of the second communication device connected to the third port.

12. A data transmission device, characterized in that: The device comprises: A transceiver module, configured to perform operations related to receiving and / or sending in the method according to any one of claims 1 to 7, and a processing module, configured to perform operations other than the operations related to receiving and / or sending in the method according to any one of claims 8 to 11; Alternatively, the transceiver module is used to perform the operations related to receiving and / or sending in the method described in any one of claims 1-7, and the processing module is used to perform other operations besides the operations related to receiving and / or sending in the method described in any one of claims 8-11.

13. A network device, characterized in that: The network device includes: a processor, the processor is coupled to a memory, the memory stores at least one program instruction or code, and the at least one program instruction or code is loaded and executed by the processor so that the network device implements the data transmission method described in any one of claims 1-11.

14. A data transmission system, characterized in that: The data transmission system includes a first communication device and a second communication device; The first communication device is used to execute the data transmission method described in any one of claims 1-7, and the second communication device is used to execute the data transmission method described in any one of claims 8-11.

15. A computer-readable storage medium, characterized in that The computer storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor, so that the computer implements the data transmission method according to any one of claims 1 to 11.

16. A computer program product, characterized in that The computer program product includes: computer program code, which is loaded and executed by a computer to enable the computer to implement the data transmission method according to any one of claims 1 to 11.