Data transmission method and device

By sending fault detection sequences between nodes in a ring network and caching and retransmitting messages on the switching path, the packet loss problem in ring network switching technology is solved, thereby improving data transmission reliability and bandwidth utilization during link failures.

CN121125394APending Publication Date: 2025-12-12HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410749823.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing ring network switching technology continues to transmit messages through the faulty link during fault detection and fault notification, resulting in the failure to effectively solve the packet loss problem.

Method used

By sending fault detection sequences between nodes in a ring network, link faults are determined based on the number of fault detection messages within a preset window. Messages are then buffered and retransmitted on the switching path to ensure the continuity of message sequence numbers and avoid packet loss.

Benefits of technology

It effectively solves the packet loss problem in ring network switching technology, ensuring that messages can be transmitted smoothly during link failures, and improving the reliability of data transmission and bandwidth utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125394A_ABST
    Figure CN121125394A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method and device, and relates to the technical field of communication. The method comprises the following steps: a first node sends a fault detection sequence to a second node, wherein the sequence comprises a plurality of pieces of fault detection information at intervals; and the first node receives fault notification information sent by the second node, wherein the fault notification information is determined by the second node according to the number of the fault detection information received in the preset window. The first node sends a first cache message and a second user message based on the switching path, the first cache message is obtained by caching the first user message sent to the second node in the preset window, and the message sequence number of the second user message is larger than that of the first user message. Thus, since the first node sends the cache message in the preset window to the second node based on the switching path, the first user message sent by the first node to the second node in the preset window period when the link fails can reach the second node, thereby solving the problem of packet loss in the looped network switching technology.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, in particular to a data transmission method and device. BACKGROUND

[0002] In order to maintain the reliability of the industrial Ethernet network, the existing industrial Ethernet network topology adopts a large number of ring networking. Considering that the industrial Ethernet network of the ring networking may have a link failure, the ring network switching technology is usually used to switch the messages originally transmitted through the failure link to the switching path in the ring networking for transmission. However, during the failure detection and failure notification period, the messages originally transmitted through the failure link are still sent, and the messages sent during the failure detection and failure notification period cannot be transmitted to the destination address through the failure link, thus there is a packet loss problem. SUMMARY

[0003] Embodiments of the present application provide a data transmission method and device to solve the packet loss problem of the ring network switching technology in the industrial ring network, and the technical solutions are as follows:

[0004] In a first aspect, a data transmission method is provided, applied to a first node in a ring network, the ring network including a plurality of nodes connected based on a ring topology structure, the plurality of nodes including the first node and a second node. The method includes: first, the first node sends a failure detection sequence to the second node, the failure detection sequence including a plurality of failure detection information sent at intervals. Then, the first node receives failure notification information sent by the second node, the failure notification information being determined by the second node according to the number of failure detection information received within a preset window, the failure notification information being used to indicate that a link between the first node and the second node has failed. Next, the first node sends a first cache message and a second user message based on a switching path, the first cache message being obtained by caching a first user message sent to the second node within a preset window, and the message sequence number of the second user message being greater than that of the first user message.

[0005] Based on the above data transmission method, after the link between the first node and the second node fails within the preset window, the first node re-sends the messages on the switching path, re-sends the first user message sent by the first node to the second node within the preset window, and continues to send the subsequent messages of the first user message based on the switching path. In this way, since the first node sends the first cache message within the preset window to the second node based on the switching path, the first user message sent by the first node to the second node within the preset window when the link fails can reach the second node, thereby solving the packet loss problem of the ring network switching technology.

[0006] As a possible implementation, the preset window is determined based on a link bandwidth and a maximum transmission unit (MTU). The preset window includes n minimum detection windows, where n is a positive integer. The minimum detection window is a sum of a minimum interval for sending the failure detection information and a serialization duration for sending one maximum transmission unit based on the link bandwidth. For example, n = 2, 3, 4, etc.

[0007] As a possible implementation, the first node buffers the first user messages according to the preset window while sending the messages to the second node. The first user messages include at least one message sent to the second node within the preset window. In this way, the first node guarantees that the first buffered messages can be re-sent after the switchover path, avoiding packet loss due to link failure.

[0008] Optionally, the first node replaces the first buffered messages with user messages sent to the second node within the next preset window in a case where the link between the first node and the second node does not fail. In this way, the buffered messages are updated, reducing the occupation of the buffer resources.

[0009] As a possible implementation, each two adjacent messages in the first user messages include a failure detection information. The first node buffers a first count value before sending the messages to the second node based on the switchover path, where the first count value is obtained by counting each message in the first user messages sent to the second node by the first node. Then, the first node sends the first count value to the second node, so that the second node removes redundant messages in the first buffered messages according to the first count value and a second count value. The second count value is obtained by counting the failure detection information in the first user messages received by the second node. The redundant messages are messages in the first user messages with a count value greater than the second count value. In this way, for the part of the buffered messages that have been sent to the second node by the first node within the preset window, the second node can identify them according to the first count value and the second count value, so as to avoid sending redundant messages after the switchover path, improving the bandwidth utilization of message transmission.

[0010] As a possible implementation, in a case where the link between the first node and the second node is in an idle state, the sending interval of each two failure detection information of the failure detection sequence is the preset interval for sending the failure detection information. In a case where the link between the first node and the second node is in a non-line-speed state of messages, there is at least one failure detection information in each two adjacent messages in the user messages sent by the first node to the second node. In a case where the link between the first node and the second node is in a line-speed state of messages, there is one failure detection information between each two adjacent messages in the user messages sent by the first node to the second node.

[0011] As one possible implementation, the fault detection sequence is carried in a reserved field of the Ethernet interface. This reduces the bandwidth resources consumed in message transmission between nodes.

[0012] As one possible implementation, the fault detection sequence is carried in the message.

[0013] Secondly, a data transmission method is provided, applied to a second node in a ring network. The ring network includes multiple nodes connected based on a ring topology, including a first node and a second node. The method includes: First, the second node receives a fault detection sequence sent by the first node, the fault detection sequence including multiple fault detection messages sent at intervals. Then, the second node determines that a link failure has occurred between the first node and the second node based on the number of fault detection messages received within a preset window. Next, the second node sends a fault notification message to the first node, causing the first node to send a first buffered message and a second user message based on a failover path. The first buffered message is obtained by buffering the first user message sent by the first node to the second node within the preset window, and the sequence number of the second user message is greater than the sequence number of the first user message.

[0014] As one possible implementation, if the number of fault detection messages received by the second node within a preset window is less than a preset threshold, it determines that a link failure has occurred between the first and second nodes. Thus, the second node, using the preset window as the time granularity for detecting link failures, can determine the period in which the link failure occurred, enabling the first node to determine the cached packets that need to be sent to the second node after subsequent path switching, based on the preset window.

[0015] As one possible implementation, the second node also caches a second count value, which is obtained by counting the fault detection information in the fault detection sequence received from the first node. The second node receives a first count value sent by the first node, which is obtained by the first node counting each message in the first user message sent to the second node. The second node removes redundant messages from the first cached messages based on the first and second count values. Redundant messages are those in the first user message whose count value is greater than the second count value.

[0016] As one possible implementation, the second node can also send a second buffered message and a fourth user message based on the failover path. The second buffered message is obtained by buffering the third user message sent to the first node within a preset window, and the sequence number of the fourth user message is greater than that of the third user message. Thus, in the event of a bidirectional failure in the link between the first and second nodes, neither the first nor the second node can receive the failure notification information. The second node can still send the second buffered message and the fourth user message based on the failover path according to the failure detection information, thereby solving the packet loss problem in the bidirectional link failure scenario.

[0017] As one possible implementation, the data transmission method of the second aspect may include any implementation of the data transmission method of the first aspect, which will not be elaborated here.

[0018] Regarding the technical principles and beneficial effects of the second aspect, please refer to the relevant description of the first aspect mentioned above, which will not be repeated here.

[0019] Thirdly, a data transmission device is provided, including a transceiver module and a processing module. The transceiver module is used to send a fault detection sequence to a second node; the fault detection sequence includes multiple fault detection messages sent at intervals. The transceiver module is also used to receive fault notification information sent by the second node; the fault notification information is determined by the second node based on the number of fault detection messages received within a preset window, and the fault notification information is used to indicate a link failure between the first node and the second node. The processing module is used to send a first buffered message and a second user message based on a failover path; the first buffered message is obtained by buffering the first user message sent to the second node within the preset window, and the sequence number of the second user message is greater than the sequence number of the first user message.

[0020] As one possible implementation, the preset window is determined based on the link bandwidth and the maximum transmission unit.

[0021] As one possible implementation, the preset window includes n minimum detection windows, where n is a positive integer. The minimum detection window is the sum of the minimum interval between two transmission fault detection messages and the serialization time for transmitting a maximum transmission unit based on the link bandwidth.

[0022] As one possible implementation, the processing module is also used to: cache a first user message according to a preset window; the first user message includes at least one message sent to the second node within the preset window.

[0023] As one possible implementation, the processing module is specifically used to replace the cached first cached message with a user message sent to the second node in the next preset window, provided that the link between the first node and the second node is not faulty.

[0024] As one possible implementation, each pair of adjacent packets in the first user message includes fault detection information. The processing module is further configured to: cache a first count value; the first count value is obtained by the first node counting each packet in the first user message sent to the second node. The transceiver module is further configured to: send the first count value to the second node, so that the second node removes redundant packets from the cached first message based on the first and second count values; the second count value is obtained by the second node counting the fault detection information in the first user message, and redundant packets are packets in the first user message whose count value is greater than the second count value.

[0025] As one possible implementation, when the link between the first and second nodes is idle, the transmission interval between every two fault detection messages in the fault detection sequence is a preset interval for transmitting fault detection messages. When the link between the first and second nodes is in a non-line-rate message transmission state, at least one fault detection message exists in every two adjacent messages in the user messages sent from the second node to the first node. When the link between the first and second nodes is in a line-rate message transmission state, one fault detection message exists in every two adjacent messages in the user messages sent from the first node to the second node.

[0026] As one possible implementation, the fault detection sequence is carried in a reserved field of the Ethernet interface.

[0027] As one possible implementation, the fault detection sequence is carried in the message.

[0028] As one possible implementation, the aforementioned data transmission apparatus may further include other modules that perform the operational steps of the data transmission method described in the first aspect.

[0029] Regarding the technical principles and beneficial effects of the third aspect, please refer to the relevant description of the first aspect mentioned above, which will not be repeated here.

[0030] Fourthly, a data transmission apparatus is provided, including a transceiver module. The transceiver module is used to receive a fault detection sequence sent by a first node; the fault detection sequence includes multiple fault detection messages sent at intervals. A processing module is used to determine that a link failure has occurred between the first node and a second node based on the number of fault detection messages received within a preset window. The transceiver module is also used to send a fault notification message to the first node, so that the first node sends a first buffered message and a second user message based on a failover path. The first buffered message is obtained by buffering the first user message sent by the first node to the second node within the preset window, and the sequence number of the second user message is greater than the sequence number of the first user message.

[0031] As one possible implementation, the processing module is specifically used to: determine that the link between the first node and the second node has failed if the number of fault detection messages received within a preset window is less than a preset threshold.

[0032] As one possible implementation, the processing module is further configured to: cache a second count value; the second count value is obtained by counting the fault detection information in the fault detection sequence. The transceiver module is further configured to: receive a first count value sent by the first node; the first count value is obtained by the first node counting each packet in the first user message sent to the second node. The processing module is further configured to: remove redundant packets from the first cached packets based on the first and second count values; redundant packets are packets in the first user message whose count value is greater than the second count value.

[0033] As one possible implementation, the transceiver module is also used to: send a second buffered message and a fourth user message based on the switching path. The second buffered message is obtained by buffering the third user message sent to the first node within a preset window. The sequence number of the fourth user message is greater than the sequence number of the third user message.

[0034] As one possible implementation, the aforementioned data transmission apparatus may further include other modules that perform the operational steps of the data transmission method described in the first aspect.

[0035] Regarding the technical principles and beneficial effects of the fourth aspect, please refer to the relevant description of the first aspect mentioned above, which will not be repeated here.

[0036] Fifthly, a network device is provided, including a memory and a processor, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the data transmission method described in any possible implementation of the first or second aspect.

[0037] In a sixth aspect, a computer program (product) is provided, the computer program (product) comprising: computer program code, which, when executed by a computer, causes the computer to perform the data transmission method described in any possible implementation of the first or second aspect.

[0038] In a seventh aspect, a chip is provided, including a processor for retrieving and executing instructions stored in a memory, causing a communication device on which the chip is mounted to perform the data transmission method described in any possible implementation of the first or second aspect above.

[0039] Eighthly, another chip is provided, comprising: an input interface, an output interface, a processor, and a memory, wherein the input interface, the output interface, the processor, and the memory are connected via an internal connection path, and the processor is configured to execute code in the memory, wherein when the code is executed, the processor is configured to execute the data transmission method described in any possible implementation of the first or second aspect above.

[0040] A ninth aspect provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement the data transmission method described in any possible implementation of the first or second aspect above. Attached Figure Description

[0041] Figure 1 This is a schematic diagram of a reverse path;

[0042] Figure 2 A schematic diagram of a network architecture provided for this application;

[0043] Figure 3 A flowchart illustrating a data transmission method provided in this application;

[0044] Figure 4 This application provides a schematic diagram of the transmission interval for node detection information.

[0045] Figure 5 A timing diagram for transmitting a fault detection sequence is provided in this application;

[0046] Figure 6 A timing diagram for receiving control of a fault detection sequence provided in this application;

[0047] Figure 7 A flowchart illustrating a message caching step provided in this application;

[0048] Figure 8 A schematic diagram illustrating a path switching mechanism provided in this application;

[0049] Figure 9 A flowchart illustrating a message deduplication step provided for this application;

[0050] Figure 10 A flowchart illustrating another data transmission method provided in this application;

[0051] Figure 11 A schematic diagram illustrating a buffered message sending method provided in this application;

[0052] Figure 12 A schematic diagram illustrating another method for sending buffered messages provided in this application;

[0053] Figure 13 A schematic diagram of clock synchronization provided for this application;

[0054] Figure 14 A schematic diagram of a data transmission device provided in this application;

[0055] Figure 15 A schematic diagram of another data transmission apparatus provided in this application;

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

[0057] The terminology used in the implementation section of this application is only for explaining specific embodiments of this application and is not intended to limit this application. For example, the data transmission method provided in the embodiments of this application can be applied to scenarios in the communication field where the network has a ring network topology, i.e., a ring network scenario. The following is a brief introduction to the technologies that may be involved in this application.

[0058] (1) Ring network

[0059] A ring network is a network consisting of multiple nodes connected in a ring topology. For example, an Ethernet ring network is a ring topology composed of a group of IEEE 802.1 compliant Ethernet nodes. Each node is connected to the other two nodes through a ring port based on media access control (MAC). The Ethernet MAC can be carried by other service layer technologies (such as Synchronous Digital Hierarchy (SDH), multi-protocol label switching (MPLS) Ethernet pseudowires, etc.), and all nodes can communicate directly or indirectly.

[0060] (2) Reverse path

[0061] A switching path refers to the process where, when a link between two nodes in a ring network fails, the message transmission path between the two nodes changes to the opposite direction of the failed link within the ring network; that is, the transmission path within the ring network excluding the failed link. For example... Figure 1As shown, the ring network includes node 1, node 2, node 3, and node 4. The message transmission path between node 1 and node 3 is node 1-node 4-node 3. If the link between node 3 and node 4 fails, the nodes in the ring network execute a path switching scheme, tangenting the message transmission path between node 1 and node 3 to node 1-node 2-node 3. If the link between node 3 and node 4 is restored, the message transmission path between node 1 and node 3 is switched back, i.e., node 1-node 4-node 3.

[0062] (3) Maximum Transmission Unit

[0063] The Maximum Transmission Unit (MTU) is used to inform the other party of the maximum size of the data service unit that can be accepted, indicating the payload size that the sender can accept. For example, the maximum length limit for a data frame in Ethernet is 1500 bytes, and the maximum length limit for a data frame in IEEE 802.3 is 1492 bytes. These 1500 bytes or 1492 bytes can be referred to as the Maximum Transmission Unit.

[0064] (4) Ethernet interface

[0065] Ethernet is the most widely used local area network (LAN) communication method and also a protocol. An Ethernet interface is the port for network data connection. For example, a Medium Independent Interface (MII) includes a data interface and a management interface between the MAC and PHY (physical) circuits. The data interface includes two independent channels for the transmitter and receiver, each with its own data, clock, and control signals. Related types of MII include Reduced Media Independent Interface (RMII), Serial Media Independent Interface (SMII), Serial Gigabit Media Independent Interface (SGMII), and 10Gigabit Media Independent Interface (XGMII), etc.

[0066] Ethernet interfaces exchange information via Ethernet frames. Ethernet frames typically include fields such as a preamble, destination MAC address, source MAC address, length, type, and trailer. In addition, Ethernet frames also include variable parts, such as reserved fields.

[0067] Current ring network switching technologies for ring networks, such as protocols like ERPS, mainly consist of steps including fault detection, fault notification, table clearing, and table reconstruction. Only after table clearing can the transmission path of packets be changed from unicast to broadcast to avoid subsequent packet loss. In the process before this, the sending side of the packet is still sending packets based on the transmission path where the link failure has occurred, and the receiving side of the packet cannot receive the packet, inevitably resulting in packet loss.

[0068] This application provides a data transmission method, particularly a method for retransmitting cached packets within a preset window of link failure after path switching. This method is applied to a first node in a ring network, which includes multiple nodes connected based on a ring topology, including a first node and a second node. The data transmission method includes: the first node receiving a fault detection sequence sent by the second node, the fault detection sequence including multiple fault detection messages sent at intervals. The first node determines that a link failure has occurred between the first node and the second node based on the number of fault detection messages contained in the received fault detection sequence within the preset window. The first node sends cached packets and second user packets using a path switching approach. The cached packets are obtained by the first node caching first user packets sent to the second node within the preset window, and the sequence number of the second user packets is greater than that of the first user packets. Thus, because the first node sends cached packets within the preset window to the second node based on the path switching, the first user packets sent by the first node to the second node during the preset window of link failure can reach the second node, thereby solving the packet loss problem inherent in ring network switching technology.

[0069] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0070] Figure 2 This is a schematic diagram of a network architecture provided in this application. Network architecture 200 may include multiple nodes connected in a ring topology. Network architecture 200 includes node 201, node 202, node 203, and node 204.

[0071] For example, network architecture 200 could be a data transmission network for an industrial internet park. An industrial internet park is an industrial park that uses information and communication technologies to enable network communication between industrial infrastructure within the park, such as control equipment and business terminals.

[0072] Figure 2 This illustrates one connection method for the nodes in network architecture 200. Node 201 is connected to node 202, node 202 is also connected to node 203, node 203 is also connected to node 204, and node 204 is also connected to node 201.

[0073] Nodes 201, 202, 203, and 204 can be network devices.

[0074] Network devices can be switches, routers, gateways, base stations, mobile core networks, optical line terminals (OLTs), wireless access points (APs), or other types of devices, used to forward or process packets from user terminals. This application does not limit the deployment location of the network devices.

[0075] Node 201 includes at least one access interface and two pairs of transceiver ports. The at least one access interface is used to connect to at least one terminal device. Each pair of transceiver ports includes one transmit port and one receive port. One pair of transceiver ports is used to connect to Node 202 to form a bidirectional link, and the other pair of transceiver ports is used to connect to Node 204 to form a bidirectional link. Nodes 202, 203, and 204 are similar to Node 201 and will not be described further.

[0076] Each of nodes 201, 202, 203, and 204 is equipped with a memory. Taking node 201 as an example, the memory is a buffer used to store messages sent by node 201's sending port within a preset window. For instance, node 201 has a buffer on the sending port side connected to node 202 to buffer messages sent by node 201 to node 202 within the preset window. Similarly, node 202 has a buffer on the sending port side connected to node 204 to buffer messages sent by node 201 to node 204 within the preset window. Furthermore, node 201 itself has a buffer to buffer messages sent by node 201 to node 202 and to node 204 within the preset window.

[0077] As one possible implementation, nodes 201, 202, 203, and 204 can be switches, and the network architecture 200 also includes terminal devices to which each node is connected. For example, node 201 is connected to terminal device 205 through an access port, node 202 is connected to terminal device 206 through an access port, node 203 is connected to terminal device 207 through an access port, and node 204 is connected to terminal device 208 through an access port.

[0078] Terminal equipment can also be referred to as a terminal, terminal node, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. Terminal equipment can be an access point (AP), mobile phone, tablet computer, computer with wireless transceiver capabilities, virtual reality (VR) terminal device, augmented reality (AR) terminal device, programmable logic controller (PLC) in industrial control, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, etc. The embodiments of this application do not limit the specific technology or device form used in the terminal equipment. Terminal equipment 101 is used to communicate with other devices through network devices.

[0079] It should be understood that Figure 2 This is a simplified diagram for ease of understanding only. The network architecture 200 may also include other network devices and / or other terminal devices, and the connection relationships between nodes may also vary. Figure 2 It was not drawn in the middle.

[0080] It should be noted that the solutions in the embodiments of this application can also be applied to other networks, such as other types of campus networks, data center networks, mobile bearer networks, etc., and the corresponding names can also be replaced by the names of the corresponding functions in other network architectures.

[0081] Next, the data transmission method provided in the embodiments of this application will be described in detail with reference to the accompanying drawings. Here, we will refer to... Figure 2 Taking the data transmission method executed by each node in the network architecture 200 as an example, the specific steps of the data transmission method are explained.

[0082] Figure 3 This is a flowchart illustrating a data transmission method provided in this application. Please refer to it. Figure 3 The data transmission method may include the following steps 301-307.

[0083] Step 301: Node 201 sends a fault detection sequence to Node 202.

[0084] Node 201 sends a fault detection sequence to Node 202 via an Ethernet interface. In this embodiment, Node 201 can also be referred to as the first node, and Node 202 can also be referred to as the second node.

[0085] As one possible implementation, node 201 sends each fault detection message in the fault detection sequence to node 202 via the Ethernet interface at intervals.

[0086] After enabling fault detection at node 201, it sends fault detection information from the fault detection sequence to node 202 at intervals. Fault detection enabling can be triggered manually or by node 201 based on preset triggering conditions.

[0087] Optionally, the interval between each fault detection message in the fault detection sequence is determined based on the link state between node 201 and node 202. Please refer to... Figure 4 , Figure 4 This is a schematic diagram of the transmission interval of node detection information provided in this application. Circles are used to represent fault detection information, and bars are used to represent the interval (interval duration) between fault detection information.

[0088] For example, when the link between node 201 and node 202 is in an idle state, the interval between every two fault detection messages in the fault detection sequence is a preset interval for sending fault detection messages.

[0089] The preset interval can be flexibly adjusted according to the link attributes or the immediacy requirements of fault detection. For example, the preset interval T can be 0.1 microseconds, 0.5 microseconds, 1 microsecond, 2.6 microseconds, etc. In this embodiment, T = 0.5 microseconds will be used as an example for subsequent explanation.

[0090] For example, when the link between nodes 201 and 202 is in a non-line-rate state, at least one fault detection message exists in every two adjacent user messages sent from node 201 to node 202. Node 201 sends a fault detection message after each message it sends to node 202.

[0091] The interval between two fault detection messages is related to the message length between the fault detection messages and the message transmission rate. Taking the maximum transmission unit of the link between node 201 and node 202 as 1500 bytes and the message transmission rate as equal to the Ethernet interface rate of 1Gbps as an example, the maximum interval between the fault detection messages corresponding to the above non-line speed state is the sum of the preset interval and the transmission time of the maximum transmission unit, which is 12.5 microseconds.

[0092] For example, when the link between node 201 and node 202 is in the line-rate state, node 201 sends a fault detection message to node 202 every other message.

[0093] The transmission duration of the maximum transmission unit is equal to the quotient of the maximum transmission unit and the message transmission rate (Ethernet interface rate), such as 12 microseconds.

[0094] Based on the three link states mentioned above, the overall determination method for node 201 to send fault detection sequences can be referred to as follows: Figure 5 , Figure 5 This application provides a timing diagram for the transmission control of a fault detection sequence. Node 201 first initializes T1, T2, t1, and t2. T1 is the duration corresponding to a preset window, T2 is a preset interval, and t1 and t2 are timers. The initial values ​​of t1 and t2 are equal to 0. The timer value of t1 forms a timing cycle from 0 to the duration corresponding to the preset window, and the timer value of t2 forms a timing cycle from 0 to the preset interval. The preset window is determined by the maximum interval of the fault detection information. Then, node 201 checks if t1 is less than T1. If t1 is less than T1, it continues timing t1 and t2. Node 201 then checks if t1 is less than T1 and if t2 is equal to T2. If t1 is greater than or equal to T1 or t2 is not equal to T2, it continues timing t1 and t2. If t1 is less than T1 and t2 is equal to T2, it checks if node 201 is sending a message to node 202. If node 201 is not sending a message to node 202, it resets t2 to its initial value and sends a fault detection sequence. It then checks if t1 is less than T1 again and executes subsequent steps. If node 201 is sending a message to node 202, it checks if t1 is less than T1 and if t2 is equal to T2. If yes, it checks if node 201 is sending a message to node 202 again and executes subsequent steps. If no, it resets t1 and t2 to their initial values ​​when t1 equals T1.

[0095] Thus, the interval of fault detection information in the fault detection sequence is related to the interface bandwidth, maximum transmission unit and other configurations. With a maximum transmission unit of 1500 bytes, an Ethernet interface rate of 1Gbps and a preset interval of 0.5 microseconds, the maximum interval at which node 201 sends fault detection information to node 202 under various link states is the sum of the preset interval and the transmission time of the maximum transmission unit, which is 12.5 microseconds.

[0096] As one possible implementation, since the fault detection sequence is transmitted via the Ethernet interface, the fault detection sequence can be carried by a reserved sequence of the Ethernet interface (or Ethernet interface), which is compatible with existing Ethernet interfaces and physical layer (PHY).

[0097] Optionally, based on the type of the Ethernet interface's MAC and PHY interfaces, it is divided into Class GMII interfaces and Class XGMII interfaces, using different reserved fields to carry fault detection sequences. For example, for Class XGMII interfaces, the fault detection sequence is carried by the reserved fields of the sequence in the sequence ordered sets specified by the interface protocol. Similarly, for Class GMII interfaces, the fault detection sequence is carried by the reserved fields of the permissible encodings of TXD<7.0>, TX_EN, and TX_ER specified by the interface protocol.

[0098] As one possible implementation, the fault detection sequence can also be carried by a message.

[0099] Step 302: Node 202 receives the fault detection sequence sent by Node 201.

[0100] Node 202 receives the fault detection sequence sent by Node 201 via the Ethernet interface.

[0101] Step 303: Node 202 determines that the link between Node 201 and Node 202 has failed based on the number of fault detection messages received within the preset window.

[0102] Node 202 determines that the link between Node 201 and Node 202 has failed based on the comparison between the number of fault detection messages received within the preset window and the preset threshold.

[0103] As one possible implementation, if the number of fault detection messages received by node 202 within a preset window is less than a preset threshold, it determines that the link between node 201 and node 202 has failed.

[0104] Optionally, the preset window is determined by the maximum interval of fault detection information, i.e., based on the link bandwidth and the maximum transmission unit. For example, with a maximum transmission unit of 1500 bytes, an Ethernet interface rate of 1Gbps, a preset interval of 0.5 microseconds, and a maximum interval of 12.5 microseconds for fault detection information, considering the 0.5 microsecond redundancy for receiving fault detection information at node 202, the minimum detection window equals the sum of the maximum interval of fault detection information and the redundancy, i.e., 13 microseconds. The preset window can be the product of a preset threshold and the minimum detection window. The preset threshold is obtained by adding n-1 minimum detection windows to the duration of a single minimum detection window, taking into account transmission and reception delays, for example, n = 2, 3, 4, 5, etc. Thus, the preset window equals the product of the preset threshold and the minimum detection window; for example, if n = 3 and the minimum detection window is 13µs, then the preset window equals 3 * 13 microseconds = 39 microseconds. In this embodiment, considering transmission and reception delays, a preset interval of twice the value is added to the base of 39 microseconds, so the preset window is equal to 39 microseconds + 1 microsecond, which is 40 microseconds.

[0105] Next, combine Figure 6 The fault determination logic for node 202 is explained. Figure 6 This application provides a timing diagram for receiving and controlling a fault detection sequence. Node 202 first initializes T1, T2, t1, and t2. T1 is the duration corresponding to a preset window, T2 is a preset interval, and t1 and t2 are timers. The initial values ​​of t1 and t2 are equal to 0. The timing value of t1 forms a timing cycle from 0 to the duration corresponding to the preset window, and the timing value of t2 forms a timing cycle from 0 to the preset interval. Then, node 202 determines whether t1 is less than T1. If t1 is greater than or equal to T1, t1, t2, and cnt are reset to their initial values ​​of 0. If t1 is less than T1, it determines whether fault detection information has been received. If no fault detection information has been received, it re-determines whether t1 is less than T1. If fault detection information has been received, cnt is incremented by 1, and t1 is checked again. If t1 is less than T1, it checks again whether fault detection information has been received and executes subsequent steps. If t1 is greater than or equal to T1, it determines whether the value of cnt is less than a preset threshold. If the value of cnt is less than the preset threshold, a fault is determined to have occurred between node 201 and node 202. If the value of cnt is greater than or equal to the preset threshold, t1, t2, and cnt are reset to their initial values ​​and subsequent steps are executed again. If t1 is less than T1, it re-determines whether fault detection information has been received and executes subsequent steps.

[0106] As one possible implementation, node 202 performs fault detection at the smallest detection window within a preset window. Node 202 counts faults based on the received fault detection information; that is, the fault count is 0 when the link is normal. The preset interval count determines the minimum interval at which fault detection information is received. When the preset interval count equals the preset interval, fault detection information should be received even if no packets are received. Therefore, node 202 sets the preset interval count to zero when it receives fault detection information. The preset window count is used to identify the window boundaries, and the range cycles through the smallest detection window. Assume that the link between node 201 and node 202 fails at time A, which is later in the minimum detection window. Node 202 does not detect the link fault in this minimum detection window. Node 202 detects the fault at time B in the next minimum detection window, meaning the fault count is 1.

[0107] Step 304: Node 202 sends a fault notification message to Node 201.

[0108] The fault notification information is used to indicate that a link failure has occurred between node 201 and node 202.

[0109] As one possible implementation, node 202 performs fault detection at the smallest detection window within a preset window. Assume that the link between node 201 and node 202 fails at time A, which is later in the smallest detection window. Node 202 does not detect the link fault in this window. In the next smallest detection window, node 202 detects the fault at time B, i.e., the fault count value equals 1, and simultaneously sends a local fault sequence (LFQ) to the peer node 201. The local fault sequence (LFQ) can be referred to as fault notification information.

[0110] Step 305: Node 201 receives fault notification information.

[0111] Step 306: Node 201 sends the first buffered message and the second user message based on the inversion path.

[0112] Node 201 sends a first cached message and a second user message within a preset window based on the failover path. The first cached message is obtained by Node 201 caching the first user message sent to Node 202 within the preset window of the link failure. The second user message is a subsequent message to the first user message; that is, after Node 201 sends and caches the first user message, it sends the second user message to Node 202, and the sequence number of the second user message is greater than that of the first user message.

[0113] In this embodiment, please refer to the caching method of the first user message by the above-mentioned node 201. Figure 7 Steps 701-705 shown are not repeated here. Please refer to [link to relevant documentation] for the specific switching mechanism of the above switching path. Figure 8 The steps shown will not be repeated here.

[0114] In this embodiment, when node 201 sends the first buffered message based on the switching path, considering that the message receiving side may not have message deduplication capability, node 202 can perform message deduplication on the first buffered message. For the specific steps of message deduplication, please refer to [link to documentation]. Figure 9 Steps 901-908 shown will not be repeated here.

[0115] Step 307: Node 202 receives the first buffered message and the second user message based on the switching path.

[0116] When node 202 is the destination node of the first cached message and the second user message, it receives the first cached message and the second user message based on the switching path. When the destination node of the first cached message and the second user message is another node, node 202 receives and forwards the first cached message and the second user message based on the switching path.

[0117] Based on the aforementioned data transmission method, after a link failure occurs between nodes 201 and 202 within a preset window, when node 201 retransmits packets via a switchover path, it retransmits the first user packet cached within the preset window that was sent from node 201 to node 202, and continues to send subsequent packets of the first user packet based on the switchover path. Thus, because node 201 sends the first cached packet within the preset window to node 202 based on the switchover path, the first user packet sent from node 201 to node 202 during the preset window period of the link failure can reach node 202, thereby solving the packet loss problem inherent in ring network switching technology.

[0118] The above text combined Figures 3-6 The overall process of the data transmission method has been explained. Next, we will combine... Figure 7 The specific steps for message caching are explained in detail.

[0119] Please refer to Figure 7 , Figure 7 This is a flowchart illustrating a message caching step provided in this application. The message caching step may include the following steps 701-705.

[0120] Step 701: Node 201 sends the first user message to node 202 within a preset window.

[0121] The first user message may include at least one message.

[0122] Step 702: Node 201 caches the first user message according to the preset window.

[0123] Node 201 caches the first user message within a preset window.

[0124] Step 703: If the link between node 201 and node 202 does not fail within the preset window, node 201 replaces the cached first cached message with the user message sent by node 201 to node 202 within the next preset window.

[0125] Step 704: If the link between node 201 and node 202 fails within the preset window, node 201 sends the cached first cached message based on the switch path.

[0126] For the specific steps of node 201 sending the cached first cached message based on the switching path, please refer to step 306 above, which will not be repeated here.

[0127] Step 705: In the next preset window, node 201 replaces the cached first cached message with the user message sent by node 201 to node 202 in the next preset window.

[0128] Based on steps 701-705 above, node 201 caches the sent packets based on a preset window, so that when a link failure occurs, the cached packets are resent based on a switching path to avoid packet loss due to link failure.

[0129] The above text combined Figure 7 The specific steps for message caching are explained. Node 201 involves retransmitting cached messages and second-user messages based on the failover path. The following will combine... Figure 8 The mechanism of path switching is explained in detail.

[0130] Please refer to Figure 8 , Figure 8 This is a schematic diagram illustrating a path switching mechanism provided in this application. Taking switches 1, 2, and 3 as examples, each switch includes ports A to F, where ports A and B are ring ports connected to other switches in the ring topology, and ports C to F are non-ring ports connected to terminal devices.

[0131] When switch 1 receives a packet, if the packet entered from a non-loop port of switch 1, it queries the lower loop table. If no match is found, it defaults to sending the packet from port B. The lower loop table only learns the MAC-port table of its own non-loop ports. If the packet entered from a loop port of switch 1, it queries the lower loop table. If no match is found, it queries the ring network table and sends the packet from the loop port opposite to the entry port. After the switchover, the packet is forwarded to switch 2, where a lower loop table match is found, and the packet is sent from the corresponding non-loop port.

[0132] Combination Figure 3 The data transmission method shown involves sending fault detection sequences between the ring ports of switches 1, 2, and 3 to perform link-level fault detection. Based on the aforementioned path switching mechanism, buffered packets within a preset window are retransmitted. Thus, assuming a link failure occurs between switches 2 and 3, packets reaching the faulty port will loop back. The loopback packets will either enter from the faulty port or another ring port. The rules for sending packets from the other ring port are determined by the aforementioned path switching mechanism, eliminating the need to re-flush tables or change forwarding rules.

[0133] The above text combined Figure 8 The mechanism of path switching was explained. After path switching, node 201 needs to send the first buffered message within the preset window to node 202. Since the link failure between node 201 and node 202 can occur at any time within the preset window, and node 201's buffered messages are stored based on the preset window, messages already sent by node 201 to node 202 within the preset window when the link failure occurred can be considered as message redundancy when node 201 sends the first buffered message based on the path switching. Therefore, the following will combine... Figure 9 The message deduplication steps are explained in detail.

[0134] Please refer to Figure 9 , Figure 9 This application provides a flowchart illustrating a message deduplication step. The message deduplication step may include the following steps 901-908.

[0135] Step 901: After enabling fault detection, node 201 sends a message count reset message to node 202.

[0136] Both node 201 and node 202 are configured with message counters. The message counter of node 201 is used to count the messages sent to node 202 to obtain a first count value. The message counter of node 202 is used to count the messages sent to node 201 to obtain a second count value. The message zeroing information is used to instruct the message counter of node 202 to set the second count value to zero.

[0137] As one possible implementation, the message count zeroing information can be carried by the Ethernet interface reserved field.

[0138] Step 902: Node 202 sets the message counter to zero according to the message count zeroing information.

[0139] Step 903: Node 201 sends a message and fault detection sequence to Node 202.

[0140] After each message is sent from node 201 to node 202, node 201 sends a fault detection message to node 202. Multiple fault detection messages contained in multiple messages form a fault detection sequence. These multiple messages can be messages included in the first user message.

[0141] Step 904: Node 201 uses a message counter to count the fault detection information, and obtains and caches the first count value.

[0142] Each time node 201 sends a fault detection message, the first count value of the message counter is incremented by one, and the first count value and the message are cached together.

[0143] Step 905: Node 202 uses a message counter to count the fault detection information, and obtains and caches the second count value.

[0144] Each time node 202 receives a fault detection message, it increments the second count value of the message counter by one and caches the second count value together with the message.

[0145] Step 906: When a link failure occurs between node 201 and node 202, node 201 sends a first count value to node 202.

[0146] Step 907: Node 202 receives the first count value.

[0147] Step 908: Node 202 removes redundant packets from the cached packets based on the first count value and the second count value.

[0148] Node 202 compares the second count value with the first count value in the cached message. The messages corresponding to the portion where the first count value is greater than the second count value are messages that Node 202 has not received, and the other messages are redundant messages. That is, the messages corresponding to the second count value are redundant messages.

[0149] In this way, for the part of the message that node 201 has sent to node 202 within the preset window in the cached message, node 202 can identify it according to the first count value and the second count value, thereby avoiding sending redundant messages after switching paths and improving the bandwidth utilization of message transmission.

[0150] In the embodiments described above, each example illustrates the data transmission method of this application by showing that node 202 receives a fault detection sequence from node 201, and then, based on the fault detection sequence, instructs node 201 to retransmit cached packets according to a preset window and a switching path. This method is applicable to scenarios where a one-way link from node 201 to node 202 fails, while a one-way link from node 202 to node 201 remains normal. In the data transmission method provided by this application, to address the packet loss problem during packet retransmission in scenarios with bidirectional link failures, besides a node determining the link failure itself and notifying the peer node to retransmit cached packets according to a switching path, another approach is for a node to determine the link failure based on a received fault detection sequence and retransmit cached packets according to a preset window and a switching path.

[0151] Please refer to Figure 10 , Figure 10 A flowchart illustrating another data transmission method provided in this application. This data transmission method may include the following steps 1001-1006.

[0152] Step 1001: Node 201 sends a fault detection sequence to Node 202.

[0153] Step 1002: Node 202 receives the fault detection sequence.

[0154] Step 1003: Node 202 determines that the link between Node 201 and Node 202 has failed based on the number of fault detection messages received within the preset window.

[0155] Step 1004: Node 202 sends a fault notification message to Node 201.

[0156] As one possible implementation, please refer to steps 1001-1004 above. Figure 3 Steps 301-304 shown will not be repeated here.

[0157] Because the bidirectional link between node 201 and node 202 has failed, node 201 is unable to receive the fault notification information sent by node 202.

[0158] Step 1005: Node 202 sends the second buffered message and the fourth user message based on the switching path.

[0159] Node 202 sends a second cached message and a fourth user message within a preset window based on the failover path. The second cached message is obtained by Node 202 caching the third user message sent to Node 201 within the preset window of the link failure. The fourth user message is a subsequent message to the third user message; that is, after Node 202 sends and caches the third user message, it sends the fourth user message to Node 201, and the sequence number of the fourth user message is greater than that of the third user message.

[0160] As one possible implementation, considering that node 201 may still be sending messages when node 202 detects that the fault count value is equal to 1, node 202 needs to wait for the maximum transmission unit to finish sending messages before sending the second buffered message and the fourth user message based on the switching path.

[0161] In this embodiment, please refer to the caching method of the third user message by the above-mentioned node 202. Figure 7 Steps 701-705 shown are not repeated here. Please refer to [link to relevant documentation] for the specific switching mechanism of the above switching path. Figure 8 The steps shown will not be repeated here.

[0162] In this embodiment, when node 202 sends the second buffered message based on the switching path, considering that the message receiving side may not have message deduplication capability, node 201 can perform message deduplication on the second buffered message. For the specific steps of message deduplication, please refer to [link to documentation]. Figure 9 Steps 901-908 shown will not be repeated here.

[0163] Step 1006: Node 201 receives the second buffered message and the fourth user message based on the switching path.

[0164] When node 201 is the destination node of the second buffered message and the fourth user message, it receives the second buffered message and the fourth user message based on the switching path. When the destination node of the second buffered message and the fourth user message is another node, node 201 receives and forwards the second buffered message and the fourth user message based on the switching path.

[0165] Based on the aforementioned data transmission method, after both bidirectional links between nodes 201 and 202 fail within a preset window, when node 202 detects a failure in the link between node 201 and node 202, it retransmits the third user message cached within the preset window to node 201 during the path switching and retransmission of messages. It also continues to transmit subsequent messages of the third user message based on the switched path. Thus, because nodes 201 and 202 have bidirectional fault detection, when either node 201 or 202 detects a failure in the link from the other end to its own end, it sends a fault notification to the other end and sends the cached message within the preset window to the other end based on the switched path. Even if a bidirectional link failure occurs between nodes 201 and 202, packet loss-free message retransmission during ring network switching can still be achieved.

[0166] The following section, with reference to the accompanying diagram, explains how the cached messages are sent.

[0167] Please refer to Figure 11 , Figure 11 This is a schematic diagram illustrating a buffered message sending method provided in this application.

[0168] like Figure 11 As shown, assume that the link from switch 2 (e.g., node 202) to switch 1 (e.g., node 203) fails, while the link from switch 1 to switch 2 is normal, and the link length does not exceed 200 meters (transmission time is less than 1 microsecond). Switch 1 identifies the link failure within two minimum detection windows and sends an LFQ to switch 2. Switch 2 receives the LFQ and records the corresponding address and region (e.g., A1 / A2 / A3) in its cache at this time.

[0169] A3: Record the write address (A3_1) corresponding to the time of receiving LFQ and stop sending messages. Read the data from A1, A2, and A3 to A3_1 in sequence and send it.

[0170] A2: Record the write address (A2_1) corresponding to the time of receiving LFQ and stop sending messages. Read data from A3, A1, and A2 in sequence to send data to A2_1.

[0171] A1: Record the write address (A1_1) corresponding to the time of receiving LFQ and stop sending messages. Read data from A2, A3, and A1 to A1_1 in sequence and send the data.

[0172] Please refer to Figure 12 , Figure 12 This is a schematic diagram illustrating another method for sending cached messages provided in this application.

[0173] like Figure 12As shown, assume a bidirectional link failure between switch 2 (e.g., node 202) and switch 1 (e.g., node 203). Switch 1 or switch 2 identifies the link failure within two minimum detection windows and sends an LFQ to the peer interface. Due to the bidirectional link failure, although the LFQ is sent bidirectionally, neither switch 1 nor switch 2 receives it. Switch 1 and switch 2 record the moment the link failure is identified (i.e., the moment the failure count equals 1) and the corresponding address and region of the cache at that time. Because the maximum time from when the LFQ is sent to the peer interface to when the peer interface receives the LFQ will not exceed the minimum detection window, the minimum detection window is used as the duration threshold; that is, a total of three minimum detection windows are required from the moment the link failure occurs to triggering the switchover path.

[0174] Switch 1 and Switch 2 determine link faults and switching paths based on the "clock" in units of the minimum detection window. Because the clocks on both sides of the link are asynchronous, the "clocks" of Switch 1 and Switch 2 are not synchronized. The maximum difference is within one minimum detection window. That is, the difference in the minimum detection window is caused by the asynchronous "clocks" at both ends of the link. Considering the minimum detection window of the maximum delay of LFQ, one minimum detection window is used as timeout compensation. A total of 4 minimum detection windows are needed from the moment the link fault occurs (within a certain minimum detection window) to the triggering of folding switching. That is, the sending side stores the packet data of 4 minimum detection windows.

[0175] When A1 receives the fault information, it reads A4, A1, A2, and A3 respectively and performs folding and switching (i.e., switching paths) and sends them.

[0176] A2 receives the fault information and reads A1, A2, A3, and A4 respectively, then folds and retransmits them.

[0177] A3 receives the fault information and reads A2, A3, A4, and A1 respectively, then folds and retransmits them.

[0178] A4 receives the fault information and reads A3, A4, A1, and A2 respectively, then folds and retransmits them.

[0179] As one possible implementation, switch 1 and switch 2 synchronize the "clock" on both sides of the link by sending synchronization sequences, so that the Ethernet interfaces on both sides of the link are directly triggered by the receiving side of the fault detection sequence for folding and switching. The specific steps of clock synchronization can be as follows:

[0180] At time t1, the Master sends a Sync (synchronization) message (and a follow_up message if configured for two-step mode), and includes the t1 timestamp in the Sync message (or follow_up message).

[0181] The Slave receives the Sync message at time t2, generates the t2 timestamp locally, and extracts the t1 timestamp from the message.

[0182] In this context, Master and Slave can be switch 1 and switch 2, respectively. For example, Master can be switch 1 and Slave can be switch 2. Or, Master can be switch 2 and Slave can be switch 1.

[0183] The slave sends a delay_req message at time t3 and generates a t3 timestamp locally.

[0184] The Master receives the delay_req message at time t4, generates a t4 timestamp locally, and then carries the t4 timestamp in the delay_resp message and sends it back to the Slave.

[0185] The slave node receives the delay_resp message and extracts the t4 timestamp from it. Finally, the slave node obtains a set of timestamps (t1, t2, t3, t4).

[0186] Assuming the transmission link delay from Master to Slave is t-ms, the transmission link delay from Slave to Master is t-sm, and the time deviation between Slave and Master is Offset, then:

[0187] t2-t1=t-ms+Offset

[0188] t4-t3=t-sm-Offset

[0189] (t2-t1)-(t4-t3)=(t-ms+Offset)-(t-sm-Offset)

[0190] Therefore, Offset = [(t2-t1)-(t4-t3)-(t-ms-t-sm)] / 2

[0191] If t-ms = t-sm, meaning the transmit / receive link delays between the Master and Slave are symmetrical, then:

[0192] Offset = [(t2-t1)-(t4-t3)] / 2

[0193] In this way, the Slave can calculate the time offset between itself and the Master based on the four timestamps t1, t2, t3, and t4, and then adjust the local time accordingly, thus achieving time synchronization between the Slave and the Master.

[0194] like Figure 13As shown, after clock synchronization, for a bidirectional fault in the link between switch 1 and switch 2, with a link length not exceeding 200 meters, switch 1 or switch 2 identifies the fault and sends an LFQ to the other end within two minimum detection windows. Due to the bidirectional link fault, although the LFQ is sent bidirectionally, neither side receives it. Switch 1 or switch 2 records the time of fault identification (i.e., the fault count value equals 1) and the corresponding buffer position. Since the maximum time from sending the LFQ to receiving the LFQ will not exceed the minimum detection window, the minimum detection window is used as the duration threshold. That is, from the moment the link fault occurs (within a certain minimum detection window) to triggering the folding switch, a total of three minimum detection windows, i.e., the preset window, are required.

[0195] The fault detection and failover determination of switches 1 and 2 on both sides of the link are based on the "clock" in units of the minimum detection window. The "clocks" on both sides of the link are synchronized, so the "clocks" of switches 1 and 2 are synchronized. The fault detection result on the receiving side can be used to judge and process the sending side buffer of the same interface.

[0196] A1 receives the fault information and reads A3, A1, and A2 respectively, then folds and retransmits them.

[0197] A2 receives the fault information and reads A1, A2, and A3 respectively, then folds and retransmits them.

[0198] A3 receives the fault information and reads A2, A3, and A1 respectively, then folds and retransmits them.

[0199] To complement the data transmission method provided in the embodiments of this application, the embodiments of this application also provide a data transmission device 1400, which is used to execute the above data transmission method. Figure 14 As shown, the device includes:

[0200] The transceiver module 1410 is used to send a fault detection sequence to the second node; the fault detection sequence includes multiple fault detection messages sent at intervals.

[0201] The transceiver module 1410 is also used to receive fault notification information sent by the second node; the fault notification information is determined by the second node based on the number of fault detection messages received within a preset window, and the fault notification information is used to indicate that a link failure has occurred between the first node and the second node.

[0202] The processing module 1420 is used to send a first cached message and a second user message based on the switching path. The first cached message is obtained by caching the first user message sent to the second node within a preset window. The sequence number of the second user message is greater than the sequence number of the first user message.

[0203] As one possible implementation, the preset window is determined based on the link bandwidth and the maximum transmission unit.

[0204] As one possible implementation, the preset window includes n minimum detection windows, where n is a positive integer. The minimum detection window is the sum of the minimum interval between two transmission fault detection messages and the serialization time for transmitting a maximum transmission unit based on the link bandwidth.

[0205] As one possible implementation, the processing module 1420 is also configured to: cache a first user message according to a preset window; the first user message includes at least one message sent to the second node within the preset window.

[0206] As one possible implementation, the processing module 1420 is specifically used to: replace the cached first cached message with a user message sent to the second node in the next preset window, provided that the link between the first node and the second node is not faulty.

[0207] As one possible implementation, each pair of adjacent packets in the first user message includes fault detection information. Processing module 1420 is further configured to: cache a first count value; the first count value is obtained by the first node counting each packet in the first user message sent to the second node. Transceiver module 1410 is further configured to: send the first count value to the second node, so that the second node removes redundant packets from the cached first message based on the first count value and the second count value; the second count value is obtained by the second node counting the fault detection information in the first user message, and redundant packets are packets in the first user message whose count value is greater than the second count value.

[0208] As one possible implementation, when the link between the first and second nodes is idle, the transmission interval between every two fault detection messages in the fault detection sequence is a preset interval for transmitting fault detection messages. When the link between the first and second nodes is in a non-line-rate message transmission state, at least one fault detection message exists in every two adjacent messages in the user messages sent from the second node to the first node. When the link between the first and second nodes is in a line-rate message transmission state, one fault detection message exists in every two adjacent messages in the user messages sent from the first node to the second node.

[0209] As one possible implementation, the fault detection sequence is carried in a reserved field of the Ethernet interface.

[0210] As one possible implementation, the fault detection sequence is carried in the message.

[0211] It should be understood that the above Figure 14The provided device, in implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.

[0212] To complement the data transmission method provided in the embodiments of this application, the embodiments of this application also provide a data transmission device 1500, which is used to execute the above data transmission method. Figure 15 As shown, the device includes:

[0213] The transceiver module 1510 is used to receive the fault detection sequence sent by the first node; the fault detection sequence includes multiple fault detection messages sent at intervals.

[0214] The processing module 1520 is used to determine that a link failure has occurred between the first node and the second node based on the number of fault detection messages received within a preset window.

[0215] The transceiver module 1510 is also used to send fault notification information to the first node, so that the first node can send a first cached message and a second user message based on the switching path. The first cached message is obtained by caching the first user message sent by the first node to the second node within a preset window. The sequence number of the second user message is greater than the sequence number of the first user message.

[0216] As one possible implementation, the processing module 1520 is specifically used to: determine that the link between the first node and the second node has failed when the number of fault detection messages received within a preset window is less than a preset threshold.

[0217] As one possible implementation, processing module 1520 is further configured to: cache a second count value; the second count value is obtained by counting the fault detection information in the fault detection sequence. Transceiver module 1510 is further configured to: receive a first count value sent by the first node; the first count value is obtained by the first node counting each message in the first user message sent to the second node. Processing module 1520 is further configured to: remove redundant messages from the first cached messages based on the first count value and the second count value; redundant messages are messages in the first user message whose message count value is greater than the second count value.

[0218] As one possible implementation, the transceiver module 1510 is also used to: send a second buffered message and a fourth user message based on the switching path. The second buffered message is obtained by buffering the third user message sent to the first node within a preset window, and the sequence number of the fourth user message is greater than the sequence number of the third user message.

[0219] It should be understood that the above Figure 15 The provided device, in implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.

[0220] Figure 16 This is a schematic diagram of the structure of an electronic device provided in this embodiment. Figure 16 As shown, the electronic device 1600 includes a processor 1610, a bus 1620, a memory 1630, a communication interface 1640, and a memory unit 1650 (also referred to as a main memory unit). The processor 1610, memory 1630, memory unit 1650, and communication interface 1640 are connected via the bus 1620.

[0221] It should be understood that in this embodiment, the processor 1610 may be a CPU, but it may also be other general-purpose processors, digital signal processors (DSPs), ASICs, FPGAs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0222] The processor may also be a graphics processing unit (GPU), a neural network processing unit (NPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.

[0223] The communication interface 1640 is used to enable communication between the electronic device 1600 and external devices or components. In this embodiment, the electronic device 1600 is used to implement... Figure 2 When any node is in use, the communication interface 1640 is used as the physical port for sending and receiving data packets.

[0224] Bus 1620 may include a pathway for transferring information between the aforementioned components (such as processor 1610, memory unit 1650, and memory 1630). In addition to a data bus, bus 1620 may also include a power bus, control bus, and status signal bus. However, for clarity, all buses are labeled as bus 1620 in the figure. Bus 1620 may be a Peripheral Component Interconnect Express (PCIe) bus, or an Extended Industry Standard Architecture (EISA) bus, Unified Bus (Ubus or UB), Compute Express Link (CXL), Cache Coherent Interconnect for Accelerators (CCIX), etc. Bus 1620 can be divided into address bus, data bus, control bus, etc.

[0225] As an example, electronic device 1600 may include multiple processors. A processor may be a multi-core (multi-CPU) processor. Here, a processor may refer to one or more devices, circuits, and / or computing units used to process data (e.g., computer program instructions).

[0226] It is worth noting that, Figure 16 Taking the electronic device 1600 as an example, which includes a processor 1610 and a memory 1630, the processor 1610 and the memory 1630 are used to indicate a type of device or equipment. In specific embodiments, the number of each type of device or equipment can be determined according to business needs.

[0227] Memory unit 1650 can correspond to the storage medium used for storing cached messages in the above method embodiments. Memory unit 1650 can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0228] The memory 1630 can correspond to the storage medium used to store computer instructions and other information in the above method embodiments, such as a disk, like a mechanical hard disk or a solid-state hard disk.

[0229] The aforementioned electronic device 1600 can be a general-purpose device or a special-purpose device. For example, electronic device 1600 can be an edge device (e.g., a box carrying a chip with processing capabilities). Alternatively, electronic device 1600 can also be a network device, a server, or other device with computing capabilities.

[0230] It should be understood that the electronic device 1600 according to this embodiment may correspond to the data transmission device 1400 or the data transmission device 1500 in this embodiment, and may correspond to the device executing the data transmission device 1600 according to this embodiment. Figure 3 The corresponding entities in the method, and the above and other operations and / or functions of each module in the data transmission device 1400 or data transmission device 1500 are respectively for the purpose of implementing Figure 3 For the sake of brevity, the corresponding process of the Chinese method will not be elaborated here.

[0231] The method steps in this embodiment can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory, flash memory, read-only memory, programmable read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. Alternatively, the ASIC can reside in an electronic device. Of course, the processor and storage medium can also exist as discrete components in an electronic device.

[0232] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are performed entirely or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); or it can be a semiconductor medium, such as a solid-state drive (SSD). The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data transmission method, characterized in that, The method, applied to a first node in a ring network, wherein the ring network comprises multiple nodes connected based on a ring topology, the multiple nodes including the first node and a second node, includes: Send a fault detection sequence to the second node; the fault detection sequence includes multiple fault detection messages sent at intervals; The first node receives a fault notification message sent by the second node. The fault notification message is determined by the second node based on the number of fault detection messages received within a preset window. The fault notification message is used to indicate that a link failure has occurred between the first node and the second node. Based on the inversion path, a first cached message and a second user message are sent. The first cached message is obtained by caching the first user message sent to the second node within the preset window. The sequence number of the second user message is greater than the sequence number of the first user message.

2. The method according to claim 1, characterized in that, The preset window is determined based on the link bandwidth and the maximum transmission unit.

3. The method according to claim 2, characterized in that, The preset window includes n minimum detection windows, where n is a positive integer. The minimum detection window is the sum of the minimum interval between two transmission fault detection information transmissions and the serialization time for transmitting a maximum transmission unit based on the link bandwidth.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: The first user message is cached according to the preset window; the first user message includes at least one message sent to the second node within the preset window.

5. The method according to claim 4, characterized in that, The method further includes: If the link between the first node and the second node is not faulty, the cached first cached message is replaced by a user message sent to the second node in the next preset window.

6. The method according to any one of claims 1-5, characterized in that, Each pair of adjacent packets in the first user packet includes fault detection information, and before sending the first buffered packet and the second user packet based on the switchover path, it also includes: The first count value is cached; the first count value is obtained by the first node counting each message in the first user message sent to the second node. The first count value is sent to the second node so that the second node removes redundant packets from the first cached packet based on the first count value and the second count value; the second count value is obtained by the second node counting the fault detection information in the first user packet, and the redundant packet is a packet in the first user packet whose packet count value is greater than the second count value.

7. The method according to any one of claims 1-6, characterized in that, When the link between the first node and the second node is idle, the interval between every two fault detection messages in the fault detection sequence is a preset interval for sending fault detection messages. When the link between the first node and the second node is in a non-linear rate state, at least one fault detection message exists in every two adjacent user messages sent by the first node to the second node. When the link between the first node and the second node is in the line-rate state, there is a fault detection message in every two adjacent user messages sent by the first node to the second node.

8. The method according to any one of claims 1-7, characterized in that, The fault detection sequence is carried in a reserved field of the Ethernet interface, or the fault detection sequence is carried in a message.

9. A data transmission method, characterized in that, An application to a second node in a ring network, the ring network comprising multiple nodes connected based on a ring topology, the multiple nodes including the first node and the second node, the method comprising: receiving a fault detection sequence sent by the first node; the fault detection sequence comprising multiple fault detection messages sent at intervals; Based on the number of fault detection messages received within a preset window, it is determined that a link failure has occurred between the first node and the second node; A fault notification message is sent to the first node so that the first node sends a first cached message and a second user message based on the switching path. The first cached message is obtained by caching the first user message sent by the first node to the second node within the preset window. The sequence number of the second user message is greater than the sequence number of the first user message.

10. The method according to claim 9, characterized in that, The step of determining that the link between the first node and the second node has failed based on the number of fault detection messages received within a preset window includes: If the number of fault detection messages received within the preset window is less than a preset threshold, it is determined that a link failure has occurred between the first node and the second node.

11. The method according to claim 9 or 10, characterized in that, The method further includes: A second count value is cached; the second count value is obtained by counting the fault detection information of the fault detection sequence. The first count value is received by the first node; the first count value is obtained by the first node counting each message in the first user message sent to the second node. Redundant packets in the first cached packets are removed based on the first count value and the second count value; the redundant packets are packets in the first user packets whose packet count value is greater than the second count value.

12. The method according to any one of claims 9-11, characterized in that, The method further includes: The second cached message and the fourth user message are sent based on the reverse path. The second cached message is obtained by caching the third user message sent to the first node within the preset window. The sequence number of the fourth user message is greater than the sequence number of the third user message.

13. A data transmission device, characterized in that, include: The transceiver module is used to send fault detection sequences to the second node; The fault detection sequence includes multiple fault detection messages sent at intervals; The transceiver module is also used to receive fault notification information sent by the second node; The fault notification information is determined by the second node based on the number of fault detection messages received within a preset window, and the fault notification information is used to indicate that a link failure has occurred between the first node and the second node; The processing module is used to send a first cached message and a second user message based on the switching path. The first cached message is obtained by caching the first user message sent to the second node within the preset window. The sequence number of the second user message is greater than the sequence number of the first user message.

14. A data transmission device, characterized in that, include: The transceiver module is used to receive the fault detection sequence sent by the first node; The fault detection sequence includes multiple fault detection messages sent at intervals; The processing module is used to determine that a link failure has occurred between the first node and the second node based on the number of fault detection messages received within a preset window. The transceiver module is further configured to send fault notification information to the first node, so that the first node sends a first cached message and a second user message based on the switching path. The first cached message is obtained by caching the first user message sent by the first node to the second node within the preset window, and the sequence number of the second user message is greater than the sequence number of the first user message.

15. A network device, characterized in that, It includes a processor and a memory, the processor being configured to execute instructions stored in the memory, causing the network device to perform the method as described in any one of claims 1-12.

16. A computer program product containing instructions, characterized in that, When the instruction is executed by the network device, the network device performs the method as described in any one of claims 1-12.

17. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a network device, cause the network device to perform the method as described in any one of claims 1-12.