Method and apparatus for transmitting data

By using fault detection sequences and switching paths in ring networks, the packet loss problem in ring network switching technology is solved, and data transmission reliability is achieved during link failures.

WO2025256478A1PCT designated stage Publication Date: 2025-12-18HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2025/099684
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-11
Filing Date
2025-06-06
Publication Date
2025-12-18

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

In a ring network, the first node sends a fault detection sequence to the second node. Upon receiving the fault detection sequence, a fault is determined based on the information received within a preset window. A link failure occurs between the faulty node and the second node. The receiving node sends a fault detection sequence, and based on the number of fault detection messages received within the preset window, the link failure is determined. The node receives a fault notification message and sends buffered messages and user messages based on a failover path. The buffered messages are 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 that of the first user message.

Benefits of technology

During link failures, the buffered packets within a preset window are retransmitted by switching paths, which solves the packet loss problem in ring network switching technology and ensures the reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025099684_18122025_PF_FP_ABST
    Figure CN2025099684_18122025_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a method and apparatus for transmitting data, relating to the technical field of communications. The method comprises: a first node sends a fault detection sequence to a second node, the sequence comprising a plurality of spaced apart pieces of fault detection information. The first node receives fault notification information sent by the second node, the fault notification information being determined by the second node on the basis of the number of pieces of fault detection information received within a preset window. The first node sends a first buffered packet and a second user packet on the basis of a switching path, the first buffered packet being obtained by buffering a first user packet sent to the second node within the preset window, and the packet sequence number of the second user packet being greater than the packet sequence number of the first user packet. In this way, since the first node sends the buffered packet within the preset window to the second node on the basis of a switching path, the first user packet sent by the first node to the second node within a preset window in which a link fault has occurred can reach the second node, thereby resolving the problem of packet loss in ring network switching technology.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission method and apparatus

[0001] The present application claims priority from the Chinese patent application No. 202410749823.8 filed on June 11, 2024, and entitled "Data transmission method and apparatus", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the field of communication technology, in particular to a data transmission method and apparatus. BACKGROUND

[0003] 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 link failure, the ring network switching technology is usually used to switch the messages originally transmitted through the fault link to the switching path in the ring networking for transmission. However, the existing ring network switching technology still transmits the messages originally transmitted through the fault link during the fault detection and fault notification. The messages transmitted during the fault detection and fault notification cannot be transmitted to the destination address through the fault link, and therefore there is a packet loss problem. SUMMARY

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

[0005] In a first aspect, a data transmission method is provided, applied to a first node in a ring network, the ring network comprising a plurality of nodes connected based on a ring topology structure, the plurality of nodes comprising the first node and a second node. The method comprises: first, the first node sends a fault detection sequence to the second node, the fault detection sequence comprising a plurality of fault detection information sent at intervals. Then, the first node receives fault notification information sent by the second node, the fault notification information being determined by the second node according to the number of fault detection information received within a preset window, the fault 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.

[0006] 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 first user messages sent by the first node to the second node within the preset window when re-sending the messages on the switching path, and continues to send the subsequent messages of the first user messages based on the switching path. In this way, since the first node sends the first buffered messages within the preset window to the second node based on the switching path, the first user messages sent by the first node to the second node during the preset window in which the link fails can reach the second node, thereby solving the packet loss problem existing in the ring network switching technology.

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

[0008] As a possible implementation manner, 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 switching path, thereby avoiding packet loss due to link failure.

[0009] Optionally, the first node replaces the buffered first buffered messages with the user messages sent to the second node within the next preset window in the case that the link between the first node and the second node does not fail. In this way, the update of the buffered messages is realized, and the occupation of the buffered resources is reduced.

[0010] As a possible implementation manner, 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 switching path, and 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 the 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 the messages in the first user messages with the count value greater than the second count value. In this way, for the part of the buffered messages in which the first node has sent the messages to the second node within the preset window, the second node can identify them according to the first count value and the second count value, thereby avoiding sending the redundant messages after the switching path, and improving the bandwidth utilization rate of the message transmission.

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

[0012] As a possible implementation, the fault detection sequence is carried in an Ethernet interface reserved field. In this way, the occupation of bandwidth resources for packet transmission between nodes is reduced.

[0013] As a possible implementation, the fault detection sequence is carried in a packet.

[0014] In a second aspect, a data transmission method is provided, applied to a second node in a ring network, the ring network comprising a plurality of nodes connected based on a ring topology, the plurality of nodes comprising a first node and the second node. The method comprises: first, the second node receives a fault detection sequence sent by the first node, the fault detection sequence comprising a plurality of fault detection information sent at intervals. Then, the second node determines that a link between the first node and the second node is faulty according to the number of fault detection information received within a preset window. Next, the second node sends fault notification information to the first node, so that the first node sends first buffered packets and second user packets based on a switchover path, the first buffered packets being obtained by buffering first user packets sent by the first node to the second node within the preset window, and the packet sequence number of the second user packets being greater than that of the first user packets.

[0015] As a possible implementation, the second node determines that the link between the first node and the second node is faulty in a case that the number of fault detection information received by the second node within the preset window is less than a preset threshold. In this way, the second node can determine the period of link failure according to the preset window as the time granularity for detecting link failure, so that the first node can determine the buffered packets that need to be sent to the second node according to the preset window after the subsequent switchover path.

[0016] As a possible implementation, the second node also caches a second count value, which is counted from the failure detection information of the failure detection sequence received from the first node. The second node receives the first count value sent by the first node, which is counted by the first node for each of the first user messages sent to the second node. The second node removes redundant messages from the first cache messages according to the first count value and the second count value. The redundant messages are the messages in the first user messages whose message count values are greater than the second count value.

[0017] As a possible implementation, the second node can also send the second cache messages and fourth user messages based on the switchover path. The second cache messages are obtained by caching the third user messages sent to the first node within a preset window, and the message sequence number of the fourth user messages is greater than that of the third user messages. In this way, in the case of a bidirectional failure of the link between the first node and the second node, neither the first node nor the second node can receive the failure notification information, and the second node can also send the second cache messages and the fourth user messages based on the switchover path according to the failure detection information, thereby solving the packet loss problem in the bidirectional failure scenario of the link.

[0018] As a possible implementation, the data transmission method of the second aspect can include any of the embodiments of the data transmission method of the first aspect, which will not be repeated here.

[0019] For the technical principles and benefits of the second aspect, please refer to the above description of the first aspect, which will not be repeated here.

[0020] In a third aspect, a data transmission apparatus is provided, which includes a transceiver module and a processing module. The transceiver module is configured to send a failure detection sequence to a second node, wherein the failure detection sequence includes multiple failure detection information sent at intervals. The transceiver module is also configured to receive failure notification information sent by the second node, wherein the failure notification information is determined by the second node according to the number of failure detection information received within a preset window, and the failure notification information is used to indicate that a link between the first node and the second node has failed. The processing module is configured to send first cache messages and second user messages based on a switchover path, wherein the first cache messages are obtained by caching first user messages sent to the second node within a preset window, and the message sequence number of the second user messages is greater than that of the first user messages.

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

[0022] As a possible implementation, the preset window comprises n minimum detection windows, n being a positive integer, and the minimum detection window being a sum of a minimum interval of sending the fault detection information and a serialization duration of sending one maximum transmission unit based on the link bandwidth.

[0023] As a possible implementation, the processing module is further configured to cache the first user messages according to the preset window; and the first user messages comprise at least one message sent to the second node within the preset window.

[0024] As a possible implementation, the processing module is specifically configured to, in a case where the link between the first node and the second node is not faulty, replace the cached first cache messages with user messages sent to the second node within a next preset window.

[0025] As a possible implementation, each two adjacent messages in the first user messages comprise one fault detection information. The processing module is further configured to cache a first count value, the first count value being obtained by counting each message in the first user messages sent to the second node by the first node. The transceiver module is further configured to send the first count value to the second node, so that the second node removes redundant messages in the first cache messages according to the first count value and a second count value, the second count value being obtained by counting the fault detection information in the first user messages by the second node, and the redundant messages being messages in the first user messages with a message count value greater than the second count value.

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

[0027] As a possible implementation, the fault detection sequence is carried in an Ethernet interface reserved field.

[0028] As a possible implementation, the fault detection sequence is carried in a message.

[0029] As a possible implementation, the data transmission apparatus can further comprise other modules for performing the operation steps of the data transmission method of the first aspect.

[0030] The technical principles and advantages of the third aspect can be referred to the related description of the first aspect, which will not be repeated here.

[0031] In a fourth aspect, a data transmission apparatus is provided, which comprises a transceiver module. The transceiver module is configured to receive a failure detection sequence sent by a first node, wherein the failure detection sequence comprises a plurality of failure detection information sent at intervals. A processing module is configured to determine that a link between the first node and a second node is faulty according to a number of the failure detection information received within a preset window. The transceiver module is further configured to send failure notification information to the first node, so that the first node sends a first buffered packet and a second user packet based on a switchover path, wherein the first buffered packet is obtained by buffering a first user packet sent by the first node to the second node within the preset window, and a packet sequence number of the second user packet is greater than a packet sequence number of the first user packet.

[0032] As a possible implementation form, the processing module is specifically configured to determine that the link between the first node and the second node is faulty in a case where the number of the failure detection information received within the preset window is less than a preset threshold.

[0033] As a possible implementation form, the processing module is further configured to buffer a second count value, wherein the second count value is obtained by counting the failure detection information of the failure detection sequence. The transceiver module is further configured to receive a first count value sent by the first node, wherein the first count value is obtained by the first node counting each packet in the first user packet sent to the second node. The processing module is further configured to remove redundant packets in the first buffered packet according to the first count value and the second count value, wherein the redundant packets are packets in the first user packet with a packet count value greater than the second count value.

[0034] As a possible implementation form, the transceiver module is further configured to send a second buffered packet and a fourth user packet based on the switchover path, wherein the second buffered packet is obtained by buffering a third user packet sent to the first node within the preset window, and a packet sequence number of the fourth user packet is greater than a packet sequence number of the third user packet.

[0035] As a possible implementation form, the data transmission apparatus can further comprise other modules for performing the operation steps of the data transmission method of the first aspect.

[0036] The technical principles and beneficial effects of the fourth aspect can be referred to the related description of the first aspect, which will not be repeated here.

[0037] In a fifth aspect, a network device is provided, which comprises a memory and a processor, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the data transmission method of any possible implementation form of the first aspect or the second aspect.

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

[0039] In a seventh aspect, a chip is provided, which comprises a processor, configured to invoke and execute instructions stored in a memory, so that a communication device in which the chip is installed performs the data transmission method according to any possible implementation of the first aspect or the second aspect.

[0040] In an eighth aspect, another chip is provided, which comprises an input interface, an output interface, a processor and a memory, the input interface, the output interface, the processor and the memory are connected through internal connection paths, the processor is configured to execute code in the memory, and when the code is executed, the processor is configured to perform the data transmission method according to any possible implementation of the first aspect or the second aspect.

[0041] In a ninth aspect, a computer readable storage medium is provided, which stores at least one instruction, the instruction is loaded and executed by a processor to implement the data transmission method according to any possible implementation of the first aspect or the second aspect. BRIEF DESCRIPTION OF DRAWINGS

[0042] FIG. 1 is a schematic diagram of a switching path;

[0043] FIG. 2 is a schematic diagram of a network architecture provided by the present application;

[0044] FIG. 3 is a flowchart of a data transmission method provided by the present application;

[0045] FIG. 4 is a schematic diagram of a sending interval of node detection information provided by the present application;

[0046] FIG. 5 is a sending control timing diagram of a fault detection sequence provided by the present application;

[0047] FIG. 6 is a receiving control timing diagram of a fault detection sequence provided by the present application;

[0048] FIG. 7 is a flowchart of a message buffering step provided by the present application;

[0049] FIG. 8 is a schematic diagram of a switching path mechanism provided by the present application;

[0050] FIG. 9 is a flowchart of a message deduplication step provided by the present application;

[0051] FIG. 10 is a flowchart of another data transmission method provided by the present application;

[0052] FIG. 11 is a schematic diagram of a packet sending method provided by the present application;

[0053] FIG. 12 is a schematic diagram of another packet sending method provided by the present application;

[0054] FIG. 13 is a schematic diagram of clock synchronization provided by the present application;

[0055] FIG. 14 is a schematic diagram of a data transmission device provided by the present application;

[0056] FIG. 15 is a schematic diagram of another data transmission device provided by the present application;

[0057] FIG. 16 is a schematic diagram of an electronic device provided by the present application. DETAILED DESCRIPTION

[0058] The terms used in the embodiment part of the present application are only used for explaining the specific embodiments of the present application, and are not intended to limit the present application. For example, the data transmission method provided by the embodiments of the present application can be applied to the scenario in which the network is a ring network topology in the communication field, i.e., in a ring network scenario. The technologies that may be involved in the present application are briefly introduced as follows.

[0059] (1) Ring network

[0060] The ring network refers to a ring network, i.e., a network composed of multiple nodes connected based on a ring topology. For example, an Ethernet ring network is a ring topology composed of a group of IEEE 802.1 compatible Ethernet nodes, each node is connected to other two nodes through a media access control (MAC) based ring port, and the Ethernet MAC can be carried by other service layer technologies (such as synchronous digital hierarchy (SDH), multi-protocol label switching (MPLS) Ethernet pseudo-wire, etc.), and all nodes can communicate directly or indirectly.

[0061] (2) Switching path

[0062] The switching path refers to a path for transmitting a message between two nodes in a ring network when a link between the two nodes fails, and the path is switched to a path opposite to the direction of the failed link in the ring network, i.e., a path other than the failed link in the ring network. As shown in FIG. 1, the ring network includes a node 1, a node 2, a node 3, and a node 4, and a path for transmitting a message between the node 1 and the node 3 is the node 1-node 4-node 3. If a link between the node 3 and the node 4 fails, the nodes in the ring network execute a scheme of switching the path, and the path for transmitting a message between the node 1 and the node 3 is switched to the node 1-node 2-node 3. If the link between the node 3 and the node 4 is recovered, the path for transmitting a message between the node 1 and the node 3 is switched back, i.e., the node 1-node 4-node 3.

[0063] (3) Maximum Transmission Unit

[0064] The maximum transmission unit is used to inform a counterpart of a maximum size of a data service unit that can be accepted, and to indicate a size of a payload that can be accepted by a sender. For example, a maximum value of a length of an Ethernet data frame is 1500 bytes, and a maximum value of a length of an IEEE 802.3 data frame is 1492 bytes. The 1500 bytes or 1492 bytes can be referred to as a maximum transmission unit.

[0065] (4) Ethernet Interface

[0066] Ethernet is the most widely used local area network communication method, and is also a protocol. The Ethernet interface is a port for connecting network data. For example, a medium independent interface (MII) includes a data interface and a management interface between a MAC and a PHY (physical). The data interface includes two independent channels for a transmitter and a receiver, respectively, and each channel has its own data, clock, and control signals. Related types of the medium independent interface include a reduced medium independent interface (RMII), a serial medium independent interface (SMII), a serial gigabit medium independent interface (SGMII) GMII, a 10 gigabit medium independent interface (XGMII), and the like.

[0067] Information is communicated between the Ethernet interfaces through Ethernet frames, which generally include a preamble, a destination MAC address, a source MAC address, a length, a type, a frame trailer, and the like. In addition, the Ethernet frames also include a variable portion, such as a reserved field, and the like.

[0068] Currently, the ring network switching technology for the ring network, such as the ERPS protocol, mainly consists of steps such as fault detection, fault notification, table clearing, and table item reconstruction. Only after the table is cleared, the unicast in the transmission path is converted into broadcast to avoid subsequent packet loss. In the process before this, the sending side of the packet is still sending the packet based on the transmission path in which the link fault has occurred, and the receiving side of the packet cannot receive the packet, and packet loss is inevitable.

[0069] The embodiment of the present application provides a data transmission method, in particular, a data transmission method for retransmitting buffered packets in a preset window in which a link fault occurs after a switching path. The method is applied to a first node in a ring network, the ring network comprising a plurality of nodes connected based on a ring topology, the plurality of nodes comprising the first node and a second node. The data transmission method comprises: the first node receiving a fault detection sequence sent by the second node, the fault detection sequence comprising a plurality of fault detection information sent at intervals. The first node determines that a link between the first node and the second node has failed according to the number of fault detection information contained in the fault detection sequence received in the preset window. The first node sends buffered packets and second user packets in a switching path mode, the buffered packets being obtained by the first node buffering first user packets sent to the second node in the preset window, and the packet sequence number of the second user packets being greater than that of the first user packets. In this way, since the first node sends the buffered packets in the preset window to the second node based on the switching path, the first user packets sent by the first node to the second node during the preset window in which the link fails can reach the second node, thereby solving the packet loss problem existing in the ring network switching technology.

[0070] The implementation of the embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0071] FIG. 2 is a schematic diagram of a network architecture provided by the present application. The network architecture 200 can comprise a plurality of nodes connected based on a ring topology. The network architecture 200 comprises a node 201, a node 202, a node 203, and a node 204.

[0072] For example, the network architecture 200 can be a data transmission network of an industrial internet park. The industrial internet park is an industrial park in which industrial infrastructure such as control equipment and business terminals are connected and communicated through information communication technology.

[0073] Figure 2 shows a connection manner of various nodes in a network architecture 200. Node 201 is connected with node 202, node 202 is further connected with node 203, node 203 is further connected with node 204, and node 204 is further connected with node 201.

[0074] Node 201, node 202, node 203 and node 204 can be network devices.

[0075] The network device can be a switch, a router, a gateway, a base station, a mobile core network, an optical line terminal (OLT), a wireless access point (AP) or other types of devices for forwarding or processing packets of user terminals. The embodiments of the present application do not limit the deployment location of the network device.

[0076] Node 201 includes at least one access interface and two pairs of transceiving ports. The at least one access interface is used to connect with at least one terminal device. Each pair of transceiving ports includes one sending port and one receiving port, and one pair of transceiving ports is used to connect with node 202 to form a bidirectional link, and the other pair of transceiving ports is used to connect with node 204 to form a bidirectional link. Node 202, node 203 and node 204 are similar to node 201, and will not be described here.

[0077] Each of node 201, node 202, node 203 and node 204 is provided with a memory. Taking node 201 as an example, the memory is a buffer for storing packets sent by the sending port of node 201 within a preset window. For example, node 201 is provided with a buffer on the side of the sending port connected with node 202, for buffering packets sent by node 201 to node 202 within a preset window. For another example, node 202 is provided with a buffer on the side of the sending port connected with node 204, for buffering packets sent by node 201 to node 204 within a preset window. For still another example, node 201 is provided with a buffer, for buffering packets sent by node 201 to node 202 within a preset window and packets sent by node 201 to node 204 within a preset window.

[0078] As a possible implementation manner, node 201, node 202, node 203 and node 204 can be switches, and the network architecture 200 further includes terminal devices connected with each node respectively. For example, node 201 is connected with terminal device 205 through one access port, node 202 is connected with terminal device 206 through one access port, node 203 is connected with terminal device 207 through one access port, and node 204 is connected with terminal device 208 through one access port.

[0079] The terminal device can also be referred to as a terminal, a terminal node, user equipment (UE), a mobile station (MS), a mobile terminal (MT), and the like. The terminal device can be an access point (AP), a mobile phone, a pad, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a programmable logic controller (PLC) in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in ttransportation safety, a wireless terminal in smart city, a wireless terminal in smart home, and the like. Embodiments of the present application do not limit specific technologies and specific device forms adopted by the terminal device. The terminal device 101 is configured to communicate with other devices through the network device.

[0080] It should be understood that FIG. 2 is only a simplified schematic diagram for ease of understanding, and other network devices and / or other terminal devices can also be included in the network architecture 200, and the connection relationship between nodes can also be changed, which are not shown in FIG. 2.

[0081] It should be pointed out that the scheme in the embodiments of the present application can also be applied to other networks, such as other types of campus networks, data center networks, mobile bearing networks, and the like, and the corresponding names can also be replaced by the names of corresponding functions in other network architectures.

[0082] Next, the data transmission method provided by the embodiments of the present application will be described in detail. Here, the specific steps of the data transmission method are described by taking the nodes in the network architecture 200 in FIG. 2 as an example.

[0083] FIG. 3 is a flow diagram of a data transmission method provided by the present application. Please refer to FIG. 3, the data transmission method can include the following steps 301-307.

[0084] Step 301, the node 201 sends a fault detection sequence to the node 202.

[0085] The node 201 sends the fault detection sequence to the node 202 through the Ethernet interface. In this embodiment, the node 201 can also be referred to as a first node, and the node 202 can also be referred to as a second node.

[0086] As a possible implementation, the node 201 sends each fault detection information in the fault detection sequence to the node 202 through the Ethernet interface according to the interval.

[0087] After the node 201 performs the fault detection enabling, each fault detection information in the fault detection sequence is sent to the node 202 at intervals. The fault detection enabling can be triggered by manual configuration, or triggered by the node 201 according to a preset triggering condition.

[0088] Optionally, the interval of each fault detection information in the fault detection sequence is determined based on the link state between the node 201 and the node 202. Please refer to FIG. 4, which is a schematic diagram of the sending interval of node detection information provided by the present application. The circle represents the fault detection information, and the bar represents the interval (interval length) between the fault detection information.

[0089] For example, when the link between the node 201 and the node 202 is in an idle state, the sending interval of each two fault detection information in the fault detection sequence is the preset interval of sending the fault detection information.

[0090] The preset interval can be flexibly adjusted according to the link attribute or the real-time requirement of fault detection, such as preset interval T equal to 0.1 microseconds, 0.5 microseconds, 1 microseconds, 2.6 microseconds, etc. In this embodiment, T=0.5 microseconds is taken as an example for subsequent description.

[0091] For another example, when the link between the node 201 and the node 202 is in a non-line-speed state of message, at least one fault detection information exists in each adjacent two messages in the user messages sent by the node 201 to the node 202. The node 201 sends a fault detection information after sending a message to the node 202.

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

[0093] For example, when the link between node 201 and node 202 is in the message line speed state, node 201 sends a fault detection message to node 202 every interval of a message.

[0094] 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), for example, 12 microseconds.

[0095] Based on the above three link states, the overall determination manner of node 201 sending the fault detection sequence can refer to FIG. 5, which is a sending control timing diagram of a fault detection sequence provided by the present application. Node 201 first initializes T1, T2, t1 and t2, T1 is the duration corresponding to a preset window, T2 is a preset interval, t1 and t2 are timers, the initial values of t1 and t2 are equal to 0, the counting value of t1 constitutes a counting cycle from 0 to the duration corresponding to the preset window, and the counting value of t2 constitutes a counting cycle from 0 to the preset interval. The preset window is determined by the maximum interval of the fault detection message. Then, node 201 judges whether t1 is less than T1, if t1 is less than T1, the counting of t1 and t2 is continued, node 201 judges whether t1 is less than T1 and t2 is equal to T2, if t1 is greater than or equal to T1 or t2 is not equal to T2, the counting of t1 and t2 is continued, if t1 is less than T1 and t2 is equal to T2, node 201 judges whether it is sending a message to node 202, if node 201 is not sending a message to node 202, t2 is reset to the initial value, the fault detection sequence is sent, t1 is judged whether it is less than T1 and the subsequent steps are executed. If node 201 is sending a message to node 202, node 201 judges whether t1 is less than T1 and t2 is equal to T2, if yes, node 201 judges whether it is sending a message to node 202 and executes the subsequent steps, if no, t1 and t2 are reset to the initial value when t1 is equal to T1.

[0096] In this way, the interval of the fault detection message in the fault detection sequence is associated with the interface bandwidth, the maximum transmission unit and other configurations. In the case of the maximum transmission unit being 1500 bytes, the Ethernet interface rate being 1 Gbps and the preset interval being 0.5 microseconds, the maximum interval of node 201 sending the fault detection message to node 202 under various link states is the sum of the preset interval and the transmission duration of the maximum transmission unit, that is, 12.5 microseconds.

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

[0098] Optionally, according to the type of MAC and PHY interfaces of the Ethernet interface, the interfaces are classified into a GMII interface and an XGMII interface, and the fault detection sequence is carried by different reserved fields. For example, for the XGMII interface, the fault detection sequence is carried by the reserved field of sequence in sequence ordered sets defined by the interface protocol. For another example, for the GMII interface, the fault detection sequence is carried by the reserved fields in permissible encodings of TXD<7.0>, TX_EN, and TX_ER defined by the interface protocol.

[0099] As a possible implementation, the fault detection sequence can also be carried by a packet.

[0100] Step 302: The node 202 receives the fault detection sequence sent by the node 201.

[0101] The node 202 receives the fault detection sequence sent by the node 201 through the Ethernet interface.

[0102] Step 303: The node 202 determines that the link between the node 201 and the node 202 is faulty according to the number of the fault detection information received within a preset window.

[0103] The node 202 determines that the link between the node 201 and the node 202 is faulty according to the comparison result of the number of the fault detection information received within a preset window and a preset threshold.

[0104] As a possible implementation, the node 202 determines that the link between the node 201 and the node 202 is faulty when the number of the fault detection information received within a preset window is less than a preset threshold.

[0105] Optionally, the preset window is determined by the maximum interval of the fault detection information, i.e., determined based on the link bandwidth and the maximum transmission unit. For example, in the case that the maximum transmission unit is 1500 bytes, the Ethernet interface rate is 1 Gbps, the preset interval is 0.5 microseconds, and the maximum interval of the fault detection information is 12.5 microseconds, the minimum detection window is equal to the sum of the maximum interval of the fault detection information and the transceiving redundancy of 0.5 microseconds, i.e., 13 microseconds, considering that the node 202 receives the fault detection information. The preset window can be the product of the preset threshold and the minimum detection window. The preset threshold is obtained by adding n-1 minimum detection windows to the time length of one minimum detection window, considering the transceiving delay, etc., where n is equal to 2, 3, 4, 5, etc. In this way, the preset window is equal to the product of the preset threshold and the minimum detection window. For example, n is equal to 3, the minimum detection window is equal to 13 microseconds, and the preset window is equal to 3*13 microseconds=39 microseconds. In this embodiment, the preset window is equal to 39 microseconds+1 microsecond, i.e., 40 microseconds, considering the transceiving delay, etc., and adding twice the preset interval to 39 microseconds.

[0106] Next, the fault determination logic of the node 202 is described in combination with FIG. 6, which is a receiving control timing diagram of a fault detection sequence provided by the present application. The node 202 first initializes T1, T2, t1, and t2, T1 is the time length corresponding to the preset window, T2 is the preset interval, t1 and t2 are timers, the initial values of t1 and t2 are equal to 0, the counting value of t1 constitutes a counting cycle from 0 to the time length corresponding to the preset window, and the counting value of t2 constitutes a counting cycle from 0 to the preset interval. Then, the 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 the initial value 0. If t1 is less than T1, it is determined whether the fault detection information is received. If the fault detection information is not received, it is determined again whether t1 is less than T1. If the fault detection information is received, cnt is increased by 1, and it is determined again whether t1 is less than T1. If t1 is less than T1, it is determined again whether the fault detection information is received and subsequent steps are performed. If t1 is greater than or equal to T1, it is determined whether the value of cnt is less than the preset threshold (threshold value). If the value of cnt is less than the preset threshold, it is determined that a fault occurs between the node 201 and the node 202. If the value of cnt is greater than or equal to the preset threshold, t1, t2, and cnt are reset to the initial value and subsequent steps are performed again. If t1 is less than T1, it is determined again whether the fault detection information is received and subsequent steps are performed.

[0107] As a possible implementation manner, the node 202 performs fault detection with a minimum detection window in a preset window as granularity. The node 202 performs fault counting according to the received fault detection information, that is, a fault counting value is equal to 0 when the link is normal, a preset interval counting determines a minimum interval in which the fault detection information should be received in the case that no packet is received, and the preset interval counting value is equal to a preset interval. When the fault detection information is received, the node 202 sets the preset interval counting value to 0. The preset window counting is used to identify a window boundary, and the range is cyclic with the minimum detection window. It is assumed that the link between the node 201 and the node 202 fails at an A moment, A is located at a rear position of the minimum detection window, the node 202 does not identify the link failure in the minimum detection window, and the node 202 identifies a B moment as a failure in the next minimum detection window, that is, the fault counting value is equal to 1.

[0108] Step 304, the node 202 sends fault notification information to the node 201.

[0109] The fault notification information is used to indicate that the link between the node 201 and the node 202 fails.

[0110] As a possible implementation manner, the node 202 performs fault detection with a minimum detection window in a preset window as granularity. It is assumed that the link between the node 201 and the node 202 fails at an A moment, A is located at a rear position of the minimum detection window, the node 202 does not identify the link failure in the minimum detection window, and the node 202 identifies a B moment as a failure in the next minimum detection window, that is, the fault counting value is equal to 1 and the node 202 sends a local fault sequence (LFQ) to the opposite end, that is, the node 201. The local fault sequence (LFQ) can be referred to as fault notification information.

[0111] Step 305, the node 201 receives the fault notification information.

[0112] Step 306, the node 201 sends a first cache packet and a second user packet based on the switching path.

[0113] The node 201 sends a first cache packet and a second user packet based on the switching path. The first cache packet is obtained by the node 201 caching a first user packet sent to the node 202 in a preset window of the link failure. The second user packet is a subsequent packet of the first user packet, that is, a second user packet sent by the node 201 to the node 202 after the first user packet is sent and cached, and a packet sequence number of the second user packet is greater than a packet sequence number of the first user packet.

[0114] In the embodiment, the node 201 caches the first user message in the manner as described above. The caching manner of the node 201 to the first user message is shown in steps 701-705 of FIG. 7, which will not be repeated here. The specific switchover mechanism of the switchover path is shown in steps of FIG. 8, which will not be repeated here.

[0115] In the embodiment, when the node 201 transmits the first cached message based on the switchover path, it is considered that the message receiving side can not have message deduplication capability. The node 202 can perform message deduplication on the first cached message. The specific steps of message deduplication are shown in steps 901-908 of FIG. 9, which will not be repeated here.

[0116] Step 307, the node 202 receives the first cached message and the second user message based on the switchover path.

[0117] The node 202 receives the first cached message and the second user message based on the switchover path when the destination nodes of the first cached message and the second user message are the node 202. The node 202 receives and forwards the first cached message and the second user message based on the switchover path when the destination nodes of the first cached message and the second user message are other nodes.

[0118] Based on the above data transmission method, after the link between the node 201 and the node 202 fails within the preset window, the node 201 retransmits the message based on the switchover path, and retransmits the first user message from the node 201 to the node 202 within the preset window, and continues to transmit the subsequent message of the first user message based on the switchover path. In this way, since the node 201 transmits the first cached message within the preset window to the node 202 based on the switchover path, the first user message from the node 201 to the node 202 within the preset window during which the link fails can reach the node 202, thereby solving the packet loss problem existing in the ring network switchover technology.

[0119] The overall flow of the data transmission method is described above in combination with FIGS. 3-6. Next, the specific steps of message caching are described in detail in combination with FIG. 7.

[0120] Referring to FIG. 7, FIG. 7 is a flowchart of a message caching step provided by the present application. The message caching step can include the following steps 701-705.

[0121] Step 701, the node 201 transmits a first user message to the node 202 within a preset window.

[0122] The first user message can include at least one message.

[0123] Step 702, the node 201 caches the first user message according to the preset window.

[0124] The node 201 caches the first user message within a preset window.

[0125] In step 703, in the case that the link between the node 201 and the node 202 does not fail within the preset window, the node 201 replaces the cached first cached message with the user message sent by the node 201 to the node 202 within the next preset window.

[0126] In step 704, in the case that the link between the node 201 and the node 202 fails within the preset window, the node 201 sends the cached first cached message based on the switchover path.

[0127] The specific steps of the node 201 sending the cached first cached message based on the switchover path are described in the above step 306, which will not be repeated here.

[0128] In step 705, the node 201 replaces the cached first cached message with the user message sent by the node 201 to the node 202 within the next preset window.

[0129] Based on the above steps 701-705, the node 201 caches the sent message based on the preset window, so as to resend the cached message based on the switchover path when the link fails, thereby avoiding packet loss due to link failure.

[0130] The specific steps of message caching are described above in combination with FIG. 7. The node 201 involves resending the cached message and the second user message based on the switchover path. Next, the mechanism of the switchover path is described in detail in combination with FIG. 8.

[0131] Please refer to FIG. 8, which is a schematic diagram of a mechanism of a switchover path provided by the present application. Taking switches 1, 2 and 3 as an example, each switch includes ports A to F, wherein the port A and the port B are ring ports connected with other switches in a ring topology, and the ports C to F are non-ring ports connected with terminal devices.

[0132] The switch 1 receives a message. If the message enters from the non-ring port of the switch 1, the down ring table is queried. If no hit is found, the message is sent out from the port B by default. The down ring table only learns the MAC-port (port) table of the non-ring port of itself. If the message enters from the ring port of the switch 1, the down ring table is queried. If no hit is found, the ring table is queried, and the message is sent out from the opposite ring port of the entering ring port. After switchover, the message is forwarded to the switch 2, the down ring table is queried, and the message is sent out from the corresponding non-ring port.

[0133] In combination with the data transmission method shown in FIG. 3, the fault detection sequence is transmitted between the ring ports of the switches 1, 2 and 3, the link-level fault detection is performed, and the buffered packets in the preset window are retransmitted according to the above-mentioned mechanism of the switching path. Thus, assuming that the link between the switches 2 and 3 is faulty, the packet is looped back after reaching the faulty port, and the looped-back packet is entered from the faulty port or another ring port. The rule of the packet being sent out from the other ring port is determined by the above-mentioned mechanism of the switching path, and it is not necessary to reflush the table or change the forwarding rule.

[0134] The mechanism of the switching path is described above in combination with FIG. 8, and the first buffered packet in the preset window that needs to be sent by the node 201 to the node 202. Since the moment when the link between the node 201 and the node 202 is faulty can be any moment in the preset window, and the buffered packet of the node 201 is stored based on the preset window, the packet that has been sent by the node 201 to the node 202 in the preset window when the link is faulty can be regarded as redundant packet when the first buffered packet is sent by the node 201 based on the switching path. Therefore, the packet redundancy removing step is described in detail below in combination with FIG. 9.

[0135] Please refer to FIG. 9, which is a flowchart of a packet redundancy removing step provided by the present application. The packet redundancy removing step can include the following steps 901-908.

[0136] In step 901, the node 201 sends packet count zero information to the node 202 after the fault detection is enabled.

[0137] The node 201 and the node 202 are both configured with a packet counter. The packet counter of the node 201 is used to count the packet sent to the node 202 to obtain a first count value, and the packet counter of the node 202 is used to count the packet sent by the node 201 to obtain a second count value. The packet zero information is used to instruct the node 202 to zero the second count value.

[0138] As a possible implementation manner, the packet count zero information can be carried by the Ethernet interface reserved field.

[0139] In step 902, the node 202 zeros the packet counter according to the packet count zero information.

[0140] In step 903, the node 201 sends a packet and a fault detection sequence to the node 202.

[0141] After the node 201 sends one packet to the node 202, the node 201 sends one fault detection information to the node 202. The multiple fault detection information contained in the multiple packets constitutes the fault detection sequence. The multiple packets can be the packets contained in the first user packet.

[0142] Step 904, the node 201 counts the fault detection information by using the message counter to obtain and cache a first count value.

[0143] The node 201 adds one to the first count value of the message counter every time a fault detection information is sent, and caches the first count value together with the message.

[0144] Step 905, the node 202 counts the fault detection information by using the message counter to obtain and cache a second count value.

[0145] The node 202 adds one to the second count value of the message counter every time a fault detection information is received, and caches the second count value together with the message.

[0146] Step 906, when a link between the node 201 and the node 202 fails, the node 201 sends the first count value to the node 202.

[0147] Step 907, the node 202 receives the first count value.

[0148] Step 908, the node 202 removes redundant messages from the cached messages according to the first count value and the second count value.

[0149] The node 202 compares the second count value with the first count value in the cached messages, and the messages corresponding to the part of the first count value greater than the second count value are messages not received by the node 202, and the other messages are redundant messages, i.e., the messages corresponding to the second count value are redundant messages.

[0150] In this way, for the part of the cached messages that the node 201 has sent to the node 202 within the preset window, the node 202 can identify them according to the first count value and the second count value, so as to avoid sending redundant messages after switching the path, thereby improving the bandwidth utilization of message transmission.

[0151] The above embodiments are all described by taking the node 202 receiving the fault detection sequence of the node 201 as an example, and the node 202 judging the link failure according to the fault detection sequence, and instructing the node 201 to resend the cached messages based on the switching path according to the preset window, which is applicable to the scenario that the unidirectional link from the node 201 to the node 202 fails and the unidirectional link from the node 202 to the node 201 is normal. In the data transmission method provided by the application, in order to solve the packet loss problem of message retransmission in the scenario of bidirectional link failure, in addition to a node itself determining the link failure and notifying the opposite node to resend the cached messages based on the switching path, one node can also determine the link failure according to the received fault detection sequence and resend the cached messages based on the switching path according to the preset window.

[0152] Please refer to FIG. 10, which is a flow diagram of another data transmission method provided by the present application. The data transmission method can include the following steps 1001-1006.

[0153] In step 1001, the node 201 sends a fault detection sequence to the node 202.

[0154] In step 1002, the node 202 receives the fault detection sequence.

[0155] In step 1003, the node 202 determines that the link between the node 201 and the node 202 has failed according to the number of fault detection information received within a preset window.

[0156] In step 1004, the node 202 sends fault notification information to the node 201.

[0157] As a possible implementation, the above steps 1001-1004 refer to steps 301-304 shown in FIG. 3, which will not be described here.

[0158] Since the bidirectional link between the node 201 and the node 202 has failed, the node 201 cannot receive the fault notification information sent by the node 202.

[0159] In step 1005, the node 202 sends a second buffered packet and a fourth user packet based on the switching path.

[0160] The node 202 sends the second buffered packet and the fourth user packet buffered within the preset window based on the switching path. The second buffered packet is obtained by the node 202 buffering the third user packet sent to the node 201 within the preset window of the link failure. The fourth user packet is a subsequent packet of the third user packet, i.e., the fourth user packet sent by the node 202 to the node 201 after the third user packet is sent and buffered, and the packet sequence number of the fourth user packet is greater than that of the third user packet.

[0161] As a possible implementation, considering that the node 202 detects the moment when the fault count value is equal to 1, the node 201 may still have packets to send, and the node 202 needs to wait for the packet transmission of the maximum transmission unit to be completed before sending the second buffered packet and the fourth user packet based on the switching path.

[0162] In this embodiment, the above-mentioned buffering manner of the node 202 to the third user packet refers to steps 701-705 shown in FIG. 7, which will not be described here. The specific switching mechanism of the above-mentioned switching path refers to the steps shown in FIG. 8, which will not be described here.

[0163] In the embodiment, when the node 202 transmits the second buffered packet based on the switchover path, the node 201 can perform packet deduplication on the second buffered packet, considering that the packet receiving side can not have packet deduplication capability. For specific steps of packet deduplication, refer to steps 901-908 shown in FIG. 9, which will not be described here.

[0164] In step 1006, the node 201 receives the second buffered packet and the fourth user packet based on the switchover path.

[0165] When the destination node of the second buffered packet and the fourth user packet is the node 201, the node 201 receives the second buffered packet and the fourth user packet based on the switchover path. When the destination node of the second buffered packet and the fourth user packet is another node, the node 201 receives and forwards the second buffered packet and the fourth user packet based on the switchover path.

[0166] Based on the above data transmission method, after the bidirectional link between the node 201 and the node 202 fails within the preset window, when the node 202 detects that the link from the node 201 to the node 202 fails, the node 202 retransmits the third user packet buffered in the preset window and sent from the node 202 to the node 201, and continues to transmit subsequent packets of the third user packet based on the switchover path. In this way, since the node 201 and the node 202 exist bidirectional fault detection, when the node 201 or the node 202 detects that the link from the opposite end to the local end exists a fault, the node 201 or the node 202 sends fault notification information to the opposite end, and transmits the buffered packets in the preset window to the opposite end based on the switchover path at the local end. Even if the bidirectional link between the node 201 and the node 202 fails, the packet retransmission without loss of the ring network switchover can be realized.

[0167] Next, the sending method of the buffered packet will be described in combination with the accompanying drawings.

[0168] Please refer to FIG. 11, which is a schematic diagram of a buffered packet sending method provided by the present application.

[0169] As shown in FIG. 11, it is assumed that the link from switch 2 (for example, the node 202) to switch 1 (for example, the node 203) fails, while the link from switch 1 to switch 2 is normal, and the length of the link is not more than 200 meters (the transmission time is less than 1 microsecond). The switch 1 identifies the link failure within two minimum detection windows and sends an LFQ to the switch 2. The switch 2 receives the LFQ and records the corresponding buffered address and area (such as A1 / A2 / A3) at this time.

[0170] A3: records the write address (A3_1) corresponding to the time when the LFQ is received and stops sending packets, and reads the data sent in A1, A2, and A3 to A3_1 in sequence.

[0171] A2: record the write address corresponding to the LFQ receiving time (A2_1) and stop sending messages, and sequentially read A3, A1, A2 to A2_1 data sending.

[0172] A1: record the write address corresponding to the LFQ receiving time (A1_1) and stop sending messages, and sequentially read A2, A3, A1 to A1_1 data sending.

[0173] Please refer to FIG. 12, which is a schematic diagram of another cache message sending method provided by the present application.

[0174] As shown in FIG. 12, it is assumed that the link between switch 2 (for example, node 202) and switch 1 (for example, node 203) is bidirectional failure. Switch 1 or switch 2 identifies the link failure within two minimum detection windows and sends LFQ to the opposite interface. Due to the bidirectional failure of the link, although the LFQ is sent bidirectionally, switch 1 and switch 2 cannot receive it. Switch 1 and switch 2 record the time when the link failure is identified, that is, the time when the failure count value is equal to 1, and the corresponding address and region of the cache at that time. Because the maximum time for the LFQ to be sent to the opposite interface and received by the opposite interface will not exceed the minimum detection window, the minimum detection window is taken as the time threshold, that is, a total of 3 minimum detection windows are needed from the time when the link fails to trigger the switching path.

[0175] Switch 1 and switch 2 judge the link failure and the switching path based on the "clock" in units of minimum detection windows. Because the clocks on both sides of the link are asynchronous, the "clocks" of switch 1 and switch 2 are not synchronized, and the maximum difference is within one minimum detection window. That is, the maximum difference of the minimum detection window is caused by the asynchronous "clocks" on both ends of the link. Considering the maximum LFQ delay of the minimum detection window, one minimum detection window is used as the timeout compensation. A total of 4 minimum detection windows are needed from the time when the link fails to trigger the folding switching, that is, the sending side stores 4 minimum detection window message data.

[0176] A1 receives the failure information, reads A4, A1, A2, A3 respectively for folding switching (that is, switching path) sending.

[0177] A2 receives the failure information, reads A1, A2, A3, A4 respectively for folding switching sending.

[0178] A3 receives the failure information, reads A2, A3, A4, A1 respectively for folding switching sending.

[0179] A4 receives the failure information, reads A3, A4, A1, A2 respectively for folding switching sending.

[0180] As a possible implementation, the switch 1 and the switch 2 implement the "clock" synchronization on both sides of the link by sending the synchronization sequence, so that the Ethernet interfaces on both sides of the link are directly triggered to fold over by the receiving side of the fault detection sequence, and the specific steps of the clock synchronization can be as follows:

[0181] The master sends a Sync message at time t1 (and a follow_up message if configured as a two-step mode), and carries the t1 timestamp in the Sync message (or the follow_up message).

[0182] The slave receives the Sync message at time t2, generates a t2 timestamp locally, and extracts the t1 timestamp from the message.

[0183] Wherein, the master and the slave can be the switch 1 and the switch 2. For example, the master is the switch 1, and the slave is the switch 2. For another example, the master is the switch 2, and the slave is the switch 1.

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

[0185] The master receives the delay_req message at time t4, generates a t4 timestamp locally, and then carries the t4 timestamp in a delay_resp message, and returns it to the slave.

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

[0187] Suppose that the transmission link delay from the master to the slave is t-ms, the transmission link delay from the slave to the master is t-sm, and the time offset between the slave and the master is Offset, then:

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

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

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

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

[0192] If t-ms = t-sm, i.e. the delay of the transceiving link between Master and Slave is symmetrical, then:

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

[0194] In this way, the Slave can calculate the time offset Offset between the Slave and the Master according to the four time stamps t1, t2, t3 and t4, and then adjust the local time, thereby achieving time synchronization between the Slave and the Master.

[0195] As shown in FIG. 13, after the "clock" synchronization, for the bidirectional link failure of switch 1 and switch 2, the length of the link is not more than 200 meters. Switch 1 or switch 2 identifies the failure within 2 minimum detection windows and sends an LFQ to the opposite end. Due to the bidirectional link failure, the LFQ is sent bidirectionally, but neither side can receive it. Switch 1 or switch 2 records the time when the failure is identified (i.e. the failure count value is equal to 1) and the corresponding cache location. Since the maximum time for sending an LFQ to the opposite end to receiving the LFQ will not exceed the minimum detection window, the minimum detection window is taken as the time threshold, i.e. the total time from the time when the link fails (within a certain minimum detection window) to triggering the folding switching is 3 minimum detection windows, i.e. the preset window.

[0196] The judgment of the failure and the switching path of switch 1 and switch 2 on both sides of the link is based on the "clock" in units of minimum detection windows, and the "clock" on both sides of the link is synchronized, so the "clock" of switch 1 and switch 2 is synchronized, and the receiving side failure judgment result can be used to judge and process the sending side cache of the same interface:

[0197] A1 receives the failure information, reads A3, A1 and A2 respectively, and sends the folding switching.

[0198] A2 receives the failure information, reads A1, A2 and A3 respectively, and sends the folding switching.

[0199] A3 receives the failure information, reads A2, A3 and A1 respectively, and sends the folding switching.

[0200] In order to cooperate with the above-mentioned data transmission method provided by the embodiments of the present application, the embodiments of the present application also provide a data transmission device 1400, which is used to execute the above-mentioned data transmission method. As shown in FIG. 14, the device comprises:

[0201] The transceiving module 1410 is configured to send a failure detection sequence to a second node; the failure detection sequence comprises a plurality of failure detection information sent at intervals.

[0202] The transceiver module 1410 is further configured to receive fault notification information sent by the second node, wherein the fault notification information is determined by the second node according to a number of fault detection information received within a preset window, and the fault notification information is used to indicate that a link between the first node and the second node is faulty.

[0203] The processing module 1420 is configured to send the first buffered packet and the second user packet based on the switching path, wherein the first buffered packet is obtained by buffering the first user packet sent to the second node within the preset window, and the sequence number of the second user packet is greater than that of the first user packet.

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

[0205] As a possible implementation, the preset window includes n minimum detection windows, n is a positive integer, and the minimum detection window is a sum of a minimum interval of sending the fault detection information and a serialization duration of sending one maximum transmission unit based on the link bandwidth.

[0206] As a possible implementation, the processing module 1420 is further configured to buffer the first user packet according to the preset window, and the first user packet includes at least one packet sent to the second node within the preset window.

[0207] As a possible implementation, the processing module 1420 is specifically configured to replace the buffered first buffered packet with a user packet sent to the second node within a next preset window in a case where the link between the first node and the second node is not faulty.

[0208] As a possible implementation, each two adjacent packets in the first user packet include a fault detection information. The processing module 1420 is further configured to buffer a first count value, wherein the first count value is obtained by counting each packet in the first user packet sent to the second node by the first node. The transceiver module 1410 is further configured to send the first count value to the second node, so that the second node removes redundant packets in the first buffered packet according to the first count value and a second count value, wherein the second count value is obtained by counting the fault detection information in the first user packet by the second node, and the redundant packet is a packet in the first user packet with a packet count value greater than the second count value.

[0209] As a possible implementation, in a case that the link between the first node and the second node is in an idle state, a sending interval of each two fault detection information of the fault detection sequence is a preset interval of sending the fault detection information. In a case that the link between the first node and the second node is in a packet non-line-speed state, at least one fault detection information exists in each adjacent two packets of the user packets sent by the second node to the first node. In a case that the link between the first node and the second node is in a packet line-speed state, one fault detection information exists in each adjacent two packets of the user packets sent by the first node to the second node.

[0210] As a possible implementation, the fault detection sequence is carried in an Ethernet interface reserved field.

[0211] As a possible implementation, the fault detection sequence is carried in a packet.

[0212] It should be understood that the apparatus provided in the above Figure 14 is only exemplified by the above division of the functional modules in realizing its functions, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be described here.

[0213] To cooperate with the above data transmission method provided in the embodiments of the present application, the embodiments of the present application further provide a data transmission apparatus 1500, which is used to execute the above data transmission method. As shown in Figure 15, the apparatus includes:

[0214] The transceiver module 1510 is configured to receive the fault detection sequence sent by the first node, and the fault detection sequence includes multiple fault detection information sent at intervals.

[0215] The processing module 1520 is configured to determine that the link between the first node and the second node is faulty according to the number of the fault detection information received within the preset window.

[0216] The transceiver module 1510 is further configured to send fault notification information to the first node, so that the first node sends the first buffered packet and the second user packet based on the switching path, the first buffered packet is obtained by buffering the first user packet sent by the first node to the second node within the preset window, and the packet sequence number of the second user packet is greater than that of the first user packet.

[0217] As a possible implementation, the processing module 1520 is specifically configured to determine that the link between the first node and the second node is faulty in a case that the number of the fault detection information received within the preset window is less than a preset threshold.

[0218] As a possible implementation, the processing module 1520 is further configured to cache a second count value, the second count value being counted from the fault detection information of the fault detection sequence. The transceiver module 1510 is further configured to receive the first count value sent by the first node, the first count value being counted by the first node from each of the first user messages sent to the second node. The processing module 1520 is further configured to remove redundant messages from the first cached messages according to the first count value and the second count value, the redundant messages being the messages in the first user messages with a message count value greater than the second count value.

[0219] As a possible implementation, the transceiver module 1510 is further configured to send the second cached messages and the fourth user messages based on the switched path, the second cached messages being cached from the third user messages sent to the first node within a preset window, and the fourth user messages having a message sequence number greater than that of the third user messages.

[0220] It should be understood that the apparatus provided in FIG. 15 is only taken as an example to divide the above-mentioned functional modules, and in actual application, the above-mentioned functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above-mentioned functions. In addition, the apparatus and method embodiments provided in the above-mentioned embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be described here.

[0221] FIG. 16 is a structural schematic diagram of an electronic device according to an embodiment of the present application. As shown in FIG. 16, the electronic device 1600 includes a processor 1610, a bus 1620, a memory 1630, a communication interface 1640, and a memory unit 1650 (which can also be referred to as a main memory unit). The processor 1610, the memory 1630, the memory unit 1650, and the communication interface 1640 are connected through the bus 1620.

[0222] It should be understood that in the present embodiment, the processor 1610 can be a CPU, and the processor 1610 can also be other general-purpose processors, digital signal processors (DSP), ASICs, FPGAs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0223] The processor can 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 for controlling the execution of programs of the solutions of the present application.

[0224] The communication interface 1640 is configured to enable the electronic device 1600 to communicate with external devices or apparatuses. In the present embodiment, the communication interface 1640 is configured to serve as a physical port for transmitting and receiving data packets when the electronic device 1600 is configured to implement the functions of any node in FIG. 2.

[0225] The bus 1620 can include a path for transmitting information between the above-mentioned components (e.g., the processor 1610, the memory unit 1650, and the storage 1630). The bus 1620 can include, in addition to a data bus, a power supply bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, all the buses are denoted as the bus 1620 in the figure. The bus 1620 can be a Peripheral Component Interconnect Express (PCIe) bus, or an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. The bus 1620 can be divided into an address bus, a data bus, a control bus, etc.

[0226] As an example, the electronic device 1600 can include a plurality of processors. The processor can be a multi-CPU processor. The processor herein can refer to one or more devices, circuits, and / or computing units for processing data (e.g., computer program instructions).

[0227] It is worth noting that only one processor 1610 and one storage 1630 are taken as examples in FIG. 16, and here the processor 1610 and the storage 1630 are respectively used to indicate a type of device or apparatus. In specific embodiments, the number of each type of device or apparatus can be determined according to business needs.

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

[0229] The memory 1630 can correspond to the storage medium used for storing computer instructions and other information in the method embodiments described above, for example, a magnetic disk such as a mechanical hard disk or a solid-state hard disk.

[0230] The electronic device 1600 described above can be a general-purpose device or a special-purpose device. For example, the electronic device 1600 can be an edge device (e.g., a box carrying a chip with processing capability) and the like. Alternatively, the electronic device 1600 can also be a network device, a server, or other device with computing capability.

[0231] It should be understood that the electronic device 1600 according to the present embodiment can correspond to the data transmission apparatus 1400 or the data transmission apparatus 1500 in the present embodiment, and can correspond to performing the corresponding subject in the method in FIG. 3, and the above and other operations and / or functions of each module in the data transmission apparatus 1400 or the data transmission apparatus 1500 are respectively for realizing the corresponding flow of the method in FIG. 3, and for brevity, will not be repeated here.

[0232] The method steps in the embodiments can be implemented by hardware, or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, so that the processor can 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 the storage medium can be located in an ASIC. In addition, the ASIC can be located in an electronic device. Of course, the processor and the storage medium can also exist as discrete components in the electronic device.

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

Claims

1. A data transmission method, characterized by, A first node applied to a ring network, the ring network comprising a plurality of nodes connected based on a ring topology, the plurality of nodes comprising the first node and a second node, the method comprising: sending a failure detection sequence to the second node, the failure detection sequence comprising a plurality of failure detection information sent at intervals; receiving failure notification information sent by the second node, the failure notification information being determined by the second node according to a 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; sending a first buffered packet and a second user packet based on a switchover path, the first buffered packet being obtained by buffering a first user packet sent to the second node within the preset window, the second user packet having a packet sequence number greater than that of the first user packet.

2. The method of claim 1, wherein, The preset window is determined based on a link bandwidth and a maximum transmission unit.

3. The method of claim 2, wherein, The preset window comprises n minimum detection windows, n being a positive integer, the minimum detection window being a sum of a minimum interval for sending two failure detection information and a serialization time length for sending one maximum transmission unit based on the link bandwidth.

4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: buffering the first user packet according to the preset window, the first user packet comprising at least one packet sent to the second node within the preset window.

5. The method of claim 4, wherein, The method further comprises: in a case where the link between the first node and the second node has not failed, replacing the first buffered packet with a user packet sent to the second node within a next preset window.

6. The method according to any one of claims 1-5, characterized in that, Each two adjacent packets in the first user packet comprise a failure detection information, and before the first buffered packet and the second user packet are sent based on the switchover path, the method further comprises: buffering a first count value, the first count value being obtained by the first node counting each packet in the first user packet sent to the second node; sending the first count value to the second node, so that the second node removes redundant packets in the first buffered packet according to the first count value and a second count value, the second count value being obtained by the second node counting the failure detection information in the first user packet, the redundant packet being a packet in the first user packet having a packet count value greater than the second count value.

7. The method of any one of claims 1-6, wherein, in a case where the link between the first node and the second node is in an idle state, a sending interval of each two failure detection information of the failure detection sequence is a preset interval for sending failure detection information; in a case where the link between the first node and the second node is in a packet non-line speed state, there is at least one failure detection information in each two adjacent packets in the user packet sent by the first node to the second node. In a case that a link between the first node and the second node is in a packet line speed state, one fault detection information exists in every two adjacent user packets 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 an Ethernet interface reserved field, or the fault detection sequence is carried in a packet.

9. A data transmission method, characterized by, A second node applied to a ring network, the ring network comprising a plurality of nodes connected based on a ring topology, the plurality of nodes comprising 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 a plurality of fault detection information sent at intervals; Determining that a link between the first node and the second node is faulty according to a number of fault detection information received within a preset window; Sending fault notification information to the first node, so that the first node sends a first buffered packet and a second user packet based on a switching path, the first buffered packet being obtained by buffering a first user packet sent by the first node to the second node within the preset window, and a packet sequence number of the second user packet being greater than a packet sequence number of the first user packet.

10. The method of claim 9, wherein, The determining that the link between the first node and the second node is faulty according to the number of fault detection information received within the preset window comprises: In a case that the number of fault detection information received within the preset window is less than a preset threshold, determining that the link between the first node and the second node is faulty.

11. The method according to claim 9 or 10, characterized in that, The method further comprises: Buffering a second count value; the second count value being obtained by counting the fault detection information of the fault detection sequence; Receiving a first count value sent by the first node; the first count value being obtained by counting each packet in the first user packet sent by the first node to the second node; Removing redundant packets in the first buffered packet according to the first count value and the second count value; the redundant packets being packets in the first user packet with packet count values greater than the second count value.

12. The method according to any one of claims 9-11, characterized in that, The method further comprises: Sending a second buffered packet and a fourth user packet based on the switching path, the second buffered packet being obtained by buffering a third user packet sent to the first node within the preset window, and a packet sequence number of the fourth user packet being greater than a packet sequence number of the third user packet.

13. A data transmission apparatus, characterized by comprising: Comprise: A transceiving module configured to send a fault detection sequence to the second node; The fault detection sequence comprises a plurality of fault detection information sent at intervals; The transceiving module is further configured to receive fault notification information sent by the second node; The fault notification information is determined by the second node according to a number of fault detection information received within a preset window, and the fault notification information is used to indicate that a link between the first node and the second node is faulty; The processing module is configured to send the first buffered packet and the second user packet based on the switching path, the first buffered packet being obtained by buffering a first user packet sent to the second node within the preset window, and a packet sequence number of the second user packet being greater than a packet sequence number of the first user packet.

14. A data transmission apparatus, characterized by comprising: Comprise: The transceiving module is configured to receive a fault detection sequence sent by a first node; The fault detection sequence comprises a plurality of fault detection information sent at intervals; The processing module is configured to determine that a link between the first node and the second node is faulty according to a number of fault detection information received within a preset window; The transceiving module is further configured to send fault notification information to the first node, so that the first node sends the first buffered packet and the second user packet based on the switching path, the first buffered packet being obtained by buffering a first user packet sent by the first node to the second node within the preset window, and a packet sequence number of the second user packet being greater than a packet sequence number of the first user packet.

15. A network device, comprising: The network device comprises a processor and a memory, and the processor is configured to execute instructions stored in the memory, so that the network device performs the method according to any one of claims 1-12.

16. A computer program product comprising instructions, characterized in that, When the instructions are executed by the network device, the network device performs the method according to any one of claims 1-12.

17. A computer readable storage medium characterized by: The computer program instructions are executed by the network device, and the network device performs the method according to any one of claims 1-12.

Citation Information

Patent Citations

  • Ring control method and apparatus of Ethernet looped network system

    CN101340346A

  • Data processing method and device for link switching process

    CN102238069A

  • Service frame processing method and system during ring network fault

    CN105141493A

  • Internet of Things data transmission system based on annular network and first repeater

    CN107733980A

  • Message transmission method and device

    CN111130893A

Cited By

  • Bridge and tunnel structure health monitoring system and looped network fault self-healing communication method

    CN121418451A