Packet sending method and apparatus, device, and computer readable storage medium

By detecting congestion points in a ring network and sending messages at those points, the problem of resource waste and efficiency reduction caused by path interruption is solved, achieving efficient message transmission and fault detection.

WO2025213944A1PCT designated stage Publication Date: 2025-10-16HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/076617
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-08
Filing Date
2025-02-10
Publication Date
2025-10-16

AI Technical Summary

Technical Problem

In a ring network, when the path is interrupted, existing technologies struggle to effectively manage message transmission, leading to resource waste and reduced transmission efficiency.

Method used

By determining whether the second path in the ring network includes a blockage point, and sending a reference message through the second path in the event of a blockage point, loopback transmission is restricted. Link detection messages and loop detection messages are used to detect connection interruptions, ensuring that messages are sent on the normal path.

Benefits of technology

It improves the efficiency of message transmission and resource utilization in ring networks, reduces resource waste caused by loopback transmission, and improves the accuracy and speed of fault detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025076617_16102025_PF_FP_ABST
    Figure CN2025076617_16102025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications, and discloses a packet sending method and apparatus, a device, and a computer readable storage medium. The method comprises: when a first path in a ring network is interrupted, a first network device determines path information between the first network device and a second network device, wherein the ring network further comprises a connected second path, and the first network device and the second network device are a terminal-side device of the first path and a terminal-side device of the second path; and if the path information indicates that the second path comprises a congestion point, the first network device sends a reference packet via the second path, wherein the congestion point is used for limiting loopback transmission of the reference packet on the second path. A first network device first determines whether a second path comprises a congestion point, and the first network device sends a reference packet via the second path only when the second path comprises the congestion point, so that the loopback transmission of the reference packet is limited by means of the congestion point, thereby controlling transmission resources occupied by the reference packet, and ensuring the utilization rate of the second path.
Need to check novelty before this filing date? Find Prior Art

Description

Message sending method, device, equipment and computer readable storage medium

[0001] The present application claims priority to the Chinese patent application No. 202410417399.7, filed on April 8, 2024, and entitled "Message sending method, device, equipment and computer readable storage medium", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the field of communication technology, in particular to a message sending method, device, equipment and computer readable storage medium. BACKGROUND

[0003] In the field of communication technology, a ring network includes a plurality of network devices, the network devices are connected end to end to form a closed loop, and the closed loop is also the ring network. In some cases, the ring network can be referred to as a ring network.

[0004] Because the network devices on the ring network are connected end to end, any network device can communicate with other network devices, and other network devices can receive messages sent by any network device. Therefore, in the case of a connection interruption on one side of any network device, any network device can trigger a protection switchover, send a message using the other side that is normally connected, and use the feature that the ring network is connected end to end to send the message back on the ring network, so that the network device on the ring network that is the destination node of the message receives the message. SUMMARY

[0005] The present application provides a message sending method, device, equipment and computer readable storage medium to manage message sending in the case of a failure of a ring network, and the technical solution is as follows:

[0006] In a first aspect, a message sending method is provided, and the method includes: in the case of an interruption of a first path in a ring network, a first network device determines path information between the first network device and a second network device, the ring network further includes a connected second path, and the first network device and the second network device are end-side devices of the first path and the second path; in the case that the path information indicates that the second path includes a blocking point, the first network device sends a reference message through the second path, and the blocking point is used to limit the reference message to be looped back on the second path.

[0007] When the first path in the ring network has a fault, the end-side device of the first path determines whether the currently connected second path includes a blocking point, and only when the second path includes the blocking point, the reference message is sent through the second path. The blocking point can limit the loop transmission of the reference message on the second path in time, and the loop transmission refers to the repeated transmission of the reference message between the first network device and the second network device through the second path. By limiting the loop transmission, the reference message occupies a large amount of transmission resources of the second path, and the utilization rate of the second path is ensured.

[0008] In a possible implementation, the first path further includes a third network device adjacent to the first network device, the fault of the first path includes a fault of a connection between the first network device and the third network device, and before the determination of the path information between the first network device and the second network device, the method further includes: sending a link detection message to the third network device, the link detection message being used to trigger the third network device to return a link response message to the first network device; and determining, based on a return condition of the link response message, whether the connection between the first network device and the third network device is interrupted. By sending the link detection message, it can be determined whether the connection between the first network device and the third network device is interrupted, and the detection process is simple and efficient.

[0009] In a possible implementation, the determination, based on the return condition of the link response message, whether the connection between the first network device and the third network device is interrupted includes: in a case where the link response message returned by the third network device is received within a first period, determining that the connection between the first network device and the third network device is connected; or in a case where the link response message returned by the third network device is not received within the first period, determining that the connection between the first network device and the third network device is interrupted. By setting the first period, the influence of the transmission delay of the link response message is considered, and it is avoided that the link response message with a long transmission delay is judged as not received, and thus it is avoided that the third network device in normal connection is judged as interrupted, and the detection accuracy is ensured.

[0010] In a possible implementation, before the sending of the link detection message to the third network device, the method further includes: obtaining a loop detection message, the loop detection message being transmitted along the ring network, and a source node and a destination node of the loop detection message being a same network device on the ring network; and copying the loop detection message to obtain the link detection message. By copying the loop detection message, the link detection message can be obtained, and the obtaining process of the link detection message is simple and efficient. Moreover, the first network device obtains the link detection message after receiving the loop detection message, and the transmission time of the link detection message is also after the receiving of the loop detection message, and the receiving of the loop detection message can trigger the transmission of the link detection message, and the transmission time of the link detection message is more accurate.

[0011] In a possible implementation, the determining the path information between the first network device and the second network device comprises: in a case where the first network device comprises the blocking point, determining that the path information indicates that the second path comprises the blocking point; or in a case where the first network device does not comprise the blocking point, determining the path information according to reception of a loop detection message, the loop detection message being sent by a network device comprising the blocking point in the ring network. Regardless of whether the first network device comprises the blocking point, there is a corresponding manner to determine whether the second path comprises the blocking point, which is high in flexibility and wide in universality.

[0012] In a possible implementation, the determining the path information according to the reception of the loop detection message comprises: in a case where the loop detection message is not received in the second period, determining that the path information indicates that the second path does not comprise the blocking point; or in a case where the loop detection message is received in the second period, determining that the path information indicates that the second path comprises the blocking point. By judging whether the loop detection message is received in the second period, whether the second path comprises the blocking point can be determined, and the path information is obtained, and the determination process of the path information is simple and high in efficiency.

[0013] In a possible implementation, the loop detection message comprises a first detection message and a second detection message, and the first detection message and the second detection message are transmitted in different transmission directions through different ports of the network device comprising the blocking point. The two loop detection messages of the first detection message and the second detection message are sent in the two transmission directions, which can detect the opening and closing states of the ring network in the two directions, and the detection is more comprehensive.

[0014] In a possible implementation, the blocking point is configured to discard the reference message in a case where the reference message transmitted in a loop is received. The blocking point can timely detect and discard the reference message in a case where the reference message is repeatedly transmitted, so as to avoid the reference message transmitted in a loop on the second path, and the transmission resource occupied by the reference message is controlled.

[0015] In a second aspect, a message sending apparatus is provided, the apparatus being applied to a first network device, and the apparatus comprising: a determining module configured to determine path information between the first network device and a second network device in a case where a first path in a ring network is interrupted, the ring network further comprising a second path in communication, and the first network device and the second network device being end-side devices of the first path and the second path; and a sending module configured to send a reference message through the second path in a case where the path information indicates that the second path comprises a blocking point, the blocking point being configured to limit the reference message transmitted in a loop on the second path.

[0016] In a possible implementation, the first path further includes a third network device adjacent to the first network device, the interruption of the first path includes an interruption of a connection between the first network device and the third network device, the sending module is further configured to send a link detection packet to the third network device, the link detection packet is used to trigger the third network device to return a link response packet to the first network device, and the determining module is further configured to determine whether the connection between the first network device and the third network device is interrupted based on a return condition of the link response packet.

[0017] In a possible implementation, the determining module is configured to determine that the first network device and the third network device are connected in a case where the link response packet returned by the third network device is received within the first period, or determine that the connection between the first network device and the third network device is interrupted in a case where the link response packet returned by the third network device is not received within the first period.

[0018] In a possible implementation, the apparatus further includes an obtaining module configured to obtain a loop detection packet, the loop detection packet is transmitted along the ring network, and a source node and a destination node of the loop detection packet are a same network device on the ring network; and the loop detection packet is copied to obtain the link detection packet.

[0019] In a possible implementation, the determining module is configured to determine that the path information indicates that the second path includes the blocking point in a case where the first network device includes the blocking point, or determine the path information according to a reception condition of the loop detection packet in a case where the first network device does not include the blocking point, the loop detection packet being sent by a network device including the blocking point in the ring network.

[0020] In a possible implementation, the determining module is configured to determine that the path information indicates that the second path does not include the blocking point in a case where the loop detection packet is not received within the second period, or determine that the path information indicates that the second path includes the blocking point in a case where the loop detection packet is received within the second period.

[0021] In a possible implementation, the loop detection packet includes a first detection packet and a second detection packet, the first detection packet and the second detection packet are transmitted along different transmission directions through different ports of the network device including the blocking point.

[0022] In a possible implementation, the blocking point is configured to discard a reference packet in a case where the reference packet transmitted in a loopback manner is received.

[0023] In a third aspect, a packet sending device is provided, the device includes a processor configured to load and execute at least one instruction to enable the packet sending device to perform the method in the first aspect or any possible implementation of the first aspect.

[0024] In a possible implementation, the device includes a memory, the memory and the processor are coupled, and the memory stores at least one instruction.

[0025] In a fourth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores at least one instruction. The instruction is loaded and executed by a processor to implement the packet sending method in the first aspect or any possible implementation of the first aspect.

[0026] In a fifth aspect, a computer program (product) is provided, and the computer program (product) includes computer programs / instructions. The computer programs / instructions are executed by a processor to enable a computer to implement the packet sending method in the first aspect or any possible implementation of the first aspect.

[0027] In a sixth aspect, a communication apparatus is provided, and the apparatus includes a transceiver, a memory, and a processor. The transceiver, the memory, and the processor are in communication with each other through internal connection paths. The memory is configured to store instructions, and the processor is configured to execute the instructions stored in the memory to control the transceiver to receive a signal and control the transceiver to send a signal. When the processor executes the instructions stored in the memory, the processor is caused to execute the method in the first aspect or any possible implementation of the first aspect. Optionally, the communication apparatus can be a chip.

[0028] Optionally, the processor is one or more, and the memory is one or more.

[0029] Optionally, the memory can be integrated with the processor, or the memory and the processor are separately arranged.

[0030] In a specific implementation process, the memory can be a non-transitory memory, such as a read only memory (ROM), which can be integrated on the same chip with the processor, or arranged on different chips respectively. The type of the memory and the arrangement manner of the memory and the processor are not limited in the present application.

[0031] In a seventh aspect, a chip is provided, including a processor, configured to call and run running program instructions or codes stored in a memory, so that a communication device installed with the chip executes the method in the above aspects.

[0032] In an eighth aspect, another chip is provided, including 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 codes in the memory. When the codes are executed, the processor is configured to execute the method in the above aspects.

[0033] It should be understood that the message sending device mentioned in the second aspect can be the device mentioned in the third aspect, or the chip mentioned in the seventh aspect or the eighth aspect. The technical solutions of the second aspect to the eighth aspect and the corresponding possible implementation manners can achieve the technical effects as described above for the first aspect and the corresponding possible implementation manners, and thus will not be described here. BRIEF DESCRIPTION OF DRAWINGS

[0034] FIG. 1 is a topological structure diagram of a ring network according to an embodiment of the present application;

[0035] FIG. 2 is a schematic diagram of an implementation environment according to an embodiment of the present application;

[0036] FIG. 3 is a flowchart of a message sending method according to an embodiment of the present application;

[0037] FIG. 4 is a schematic diagram of a fault of a ring network according to an embodiment of the present application;

[0038] FIG. 5 is a schematic diagram of another fault of a ring network according to an embodiment of the present application;

[0039] FIG. 6 is a schematic diagram of transmission of a link detection message according to an embodiment of the present application;

[0040] FIG. 7 is a schematic diagram of another fault of a ring network according to an embodiment of the present application;

[0041] FIG. 8 is a schematic diagram of transmission of a loop detection message according to an embodiment of the present application;

[0042] FIG. 9 is a schematic diagram of transmission of another link detection message according to an embodiment of the present application;

[0043] FIG. 10 is a schematic diagram of transmission of still another link detection message according to an embodiment of the present application;

[0044] FIG. 11 is a schematic diagram of transmission of a message on a ring network according to an embodiment of the present application;

[0045] FIG. 12 is a schematic diagram of still another fault of a ring network according to an embodiment of the present application;

[0046] FIG. 13 is a schematic diagram of another fault of a ring network according to an embodiment of the present application;

[0047] FIG. 14 is a schematic diagram of transmission of a reference message according to an embodiment of the present application;

[0048] FIG. 15 is a schematic diagram of a structure of a message sending device according to an embodiment of the present application;

[0049] FIG. 16 is a schematic diagram of a structure of a network device according to an embodiment of the present application;

[0050] FIG. 17 is a structural schematic diagram of another network device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0051] The terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.

[0052] With the development of communication technology, there are more and more types of network topology structures, and the ring network is one of them. The ring network uses a continuous ring to connect each network device together, as shown in FIG. 1. The ring network shown in FIG. 1 includes five network devices, which are network device A, network device B, network device C, network device D and network device E. The five network devices in FIG. 1 are connected end to end, and the links between the network devices form a continuous ring.

[0053] Since the links in the ring network are closed loops, there are two paths between any two network devices in the ring network, and the path includes at least two network devices and the links between the network devices. Taking network device A and network device C as an example, the first path between network device A and network device C in FIG. 1 is network device A->network device B->network device C, and the second path is network device A->network device E->network device D->network device C. Therefore, in the case of a connection interruption on one side of any network device, the any network device can trigger a protection switching to send a message using the normally connected other side path. For example, if a connection interruption occurs between network device A and network device B in the first path, network device A can send a message back to network device C through network device E->network device D->network device C path.

[0054] Please refer to FIG. 2, which shows an implementation environment schematic diagram of a message sending method provided by an embodiment of the present application. The implementation environment includes a plurality of network devices, which are network device S1, network device S2, network device S3, network device S4 and network device S5. W and E in FIG. 2 are used to distinguish different ports of the same network device. In FIG. 2, network device S1, network device S2, network device S3, network device S4 and network device S5 can establish a communication connection through wired or wireless network method, and the established communication connection forms a closed ring network. Optionally, the network devices included in the ring network can be five as shown in FIG. 1 or FIG. 2, or other numbers, which are not limited by the embodiments of the present application. The links between the network devices can be of any shape, which can be a straight line as shown in FIG. 1, or a curve as shown in FIG. 2.

[0055] The network device for performing the packet sending method is not limited in the embodiments of the present application, and can be any end-side device of the first path in which the connection interruption occurs. For example, in FIG. 2, the link between the network device S2 and the network device S3 in the ring network is interrupted, the first path is the network device S2->network device S3, and in this case, the network device S2 and the network device S3 are both end-side devices of the first path. Therefore, the network device S2 and the network device S3 can both perform the packet sending method provided in the embodiments of the present application as the first network device. For example, it is determined whether the second path includes a blocking point, and in the case that the second path includes a blocking point, the reference packet to be transmitted is sent through the second path, wherein the second path includes the network device S2->network device S1->network device S5->network device S4->network device S3.

[0056] Exemplarily, the packet sending method provided in the embodiments of the present application can be applied to any network device group ring network scene, including but not limited to the access layer ring network, the aggregation layer ring network or the core layer ring network of a local area network; the access layer ring network, the aggregation layer ring network or the core layer ring network of a metropolitan area network; the access layer ring network, the aggregation layer ring network or the core layer ring network of a backbone network, and the like.

[0057] Optionally, the network device in the ring network can be a router (RT), or other device with packet forwarding capability, such as a switch, a gateway (GW), a server and a terminal, and the like. The server can be a central server, an edge server, or a local server in a local data center. The server can be a physical server, or a cloud server providing cloud computing services in a cloud scenario. The terminal can be a desktop computer, a notebook computer or a smart phone, and the like. The subject performing the packet sending method can be the whole network device, or a part of components on the network device, such as a single board, a line card on the network device, or a functional module on the network device, or a chip for implementing the method, and the embodiments of the present application do not make a specific limitation on the subject performing the method.

[0058] The embodiments of the present application provide a packet sending method, which can be applied to the implementation environment shown in FIG. 2, and the flowchart of the method is shown in FIG. 3, including S301-S302.

[0059] S301, in the case that the first path in the ring network is interrupted, the first network device determines the path information between the first network device and the second network device, and the ring network further includes a connected second network, and the first network device and the second network device are end-side devices of the first path and the second path.

[0060] In a possible case, the ring network has a fault point, and the fault point is located on the first path, causing the first path originally in communication to be interrupted. The fault point can be a link fault or a port fault. The link fault refers to a disconnection of a link between network devices, and the port fault refers to a fault of a port of a network device connected with the link. FIG. 4 is a fault diagram provided by an embodiment of the present application, and in FIG. 4, the network device S4->network device S5 is interrupted, and the disconnection between the network device S4 and the network device S5 can be a fault of a link connected between the network device S4 and the network device S5, or a fault of a port of the network device S4 connected with the link, or a fault of a port of the network device S5 connected with the link, or a fault of a port of the network device S4 and a port of the network device S5.

[0061] In a possible implementation, the first path includes all fault points in the ring network, and the end-side device of the first path is a network device adjacent to the fault points or is a fault point. In a case where the fault points in the ring network are one, the first path is a link where the fault point is located. For example, as shown in FIG. 4, the link between the network device S4 and the network device S5 in the ring network is interrupted, and the first path is the network device S4->network device S5.

[0062] In a case where the fault points in the ring network are multiple, the two end-side devices of the first path are adjacent to the fault points or are the fault points. FIG. 5 is another fault diagram provided by an embodiment of the present application, and in FIG. 5, two links in the ring network are interrupted, one link is between the network device S2 and the network device S3, and the other link is between the network device S4 and the network device S5. Then, the first path is the network device S2->network device S3->network device S4->network device S5, or the network device S3->network device S2->network device S1->network device S5->network device S4. That is, no matter what the first path is, the connection between the end-side device corresponding to the first path and the neighbor device is interrupted, and the neighbor device is a network device adjacent to the end-side device included in the first path.

[0063] The embodiment of the present application does not limit the device detecting that the first path is interrupted, which can be an upper-layer monitoring device for detecting the ring network. In this case, the monitoring device can determine that the end-side device of the first path is the first network device when detecting that the first path is interrupted, and send the interruption notification of the first path to the first network device. Alternatively, the device detecting that the first path is interrupted can also be a network device configured in the ring network.

[0064] In a possible implementation, a network device included in the ring network detects the connectivity of the connected link to avoid sending a packet through a link that is disconnected, thereby causing packet loss in the transmission process. The network device can transmit a packet according to a transmission period to detect the connectivity of the link connected to the port, and the transmission period of the packet can be set based on experience and implementation environment. Taking a first network device as an example, the process of detecting the connectivity includes but is not limited to: sending a link detection packet to a third network device, where the third network device is a network device adjacent to the first network device, and the link detection packet is used to trigger the third network device to return a link response packet to the first network device; and determining whether the connection between the first network device and the third network device is disconnected based on the return of the link response packet.

[0065] Optionally, the link detection packet can be a packet automatically generated by the first network device, or a packet obtained by the first network device based on a received packet. The packet received by the first network device can be a data packet used for service transmission, for example, the first network device sends a data packet to the third network device based on the routing information of the data packet after receiving the data packet, and generates a link detection packet after sending the data packet, and sends the link detection packet to the third network device through the same link as the data packet, so as to detect whether the connection between the first network device and the third network device is disconnected according to the transmission of the link response packet corresponding to the link detection packet, and further determine whether the data packet needs to be retransmitted.

[0066] Exemplarily, the packet received by the first network device can also be a loop detection packet. The loop detection packet is transmitted along the ring network, the source node and the destination node of the loop detection packet are the same network device on the ring network, and the loop detection packet is used to detect the open and close state of the ring network. Referring to the ring network shown in FIG. 4 and FIG. 5, the source node and the destination node of the loop detection packet are both network devices S1 configured with a blocking point, the network device S1 can periodically send the loop detection packet, and the transmission path of the loop detection packet is network device S1->network device S2->network device S3->network device S4->network device S5->network device S1. The transmission period of the loop detection packet can be set based on experience or implementation environment. Optionally, the network device S1 can also send the loop detection packet based on a sending instruction, and the sending instruction can be issued by a monitoring device or manually. In addition, the above transmission path is intended to illustrate the network devices passed through in the transmission process of the loop detection packet, rather than to limit the transmission direction of the loop detection packet. The loop detection packet can be transmitted along the clockwise direction, or along the counterclockwise direction, or along multiple directions, for example, the loop detection packet includes a first detection packet and a second detection packet, the first detection packet and the second detection packet are transmitted through different ports along different transmission directions.

[0067] Regardless of the transmission process of the loop detection message, the loop detection message will pass through each network device in the ring network, and the network device S1 can determine the connectivity between the network devices included in the ring network according to whether the sent loop detection message is received, to obtain the open-close state of the ring network. If the network device S1 receives the loop detection message, it is determined that the connectivity between the network devices in the ring network is normal, and the open-close state of the ring network is closed. If the network device S1 does not receive the loop detection message, it is determined that the connectivity between at least two network devices in the ring network is interrupted, and the open-close state of the ring network is disconnected.

[0068] Since each network device on the ring network will receive the loop detection message, the first network device can also receive the loop detection message. In this case, the first network device can obtain the link detection message based on the loop detection message after obtaining the loop detection message. For example, the first network device copies the loop detection message and uses the copied message as the link detection message. Alternatively, the first network device uses the loop detection message as the link detection message and sends the loop detection message to the third network device, which triggers the third network device to return the link response message.

[0069] Since the loop detection message is a message to be sent to the third network device, using the loop detection message as the link detection message eliminates the need to repeatedly send messages to the third network device, reducing the number of message transmissions in the ring network and saving transmission bandwidth. Moreover, since loop detection and link detection are performed synchronously, in the case where fault discovery in the ring network relies on loop detection and link detection, using the loop detection message as the link detection message also effectively shortens the fault discovery time. Referring to FIG. 6, the ring network in FIG. 6 includes eight network devices, and the master node is the network device S1 configured with a blocking point. In actual applications, the network device S5 can also be consistent with the network device S1, and there is a gateway structure. In FIG. 6, the fault discovery is the continuous loss of three loop detection messages and three link detection messages. The loop detection message corresponds to RC and the white rectangle in FIG. 6, and the link detection message corresponds to LC and the black rectangle in FIG. 6. Since the loop detection message and the link detection message are transmitted asynchronously, there is an interval between the transmission periods, so the fault discovery time includes the transmission period and the transmission interval of the link detection message and the loop detection message, which is longer than three transmission periods, for example, four transmission periods shown in the lower left box in FIG. 6. If the link detection and the loop detection are performed synchronously, there is no transmission interval between the link detection message and the loop detection message, and the fault discovery time is three transmission periods shown in the lower right box in FIG. 6, effectively shortening the fault discovery time. In FIG. 6, t represents the transmission period.

[0070] No matter what kind of link detection packet, the first network device can send the link detection packet to the third network device. For example, the link detection packet is transmitted in the control virtual local area network (VLAN), and the control VLAN contains a ring port. Among them, the third network device and the first network device are adjacent, and in the case of two sides of the first network device in the ring network being connected with network devices, any network device adjacent to the first network device can be the third network device and interact with the first network device. Taking the first network device as the network device S2 shown in FIG. 5 as an example, the third network device can be at least one of the network device S3 or the network device S1.

[0071] In the case that the first network device has multiple adjacent third network devices, the first network device can detect the communication connection between one of the third network devices. Continue to take the ring network shown in FIG. 5 as an example, the network devices in the ring network detect the connectivity of the connected link in the clockwise direction. For example, the network device S1 sends a loop detection packet to the network device S2 as a link detection packet to detect the connectivity between the network device S1 and the network device S2, and the network device S2 sends a loop detection packet to the network device S3 as a link detection packet to detect the connectivity between the network device S2 and the network device S3. By limiting the transmission direction of the link detection packet, for the network devices connected with links on both sides, the connectivity of the links on both sides can be determined by one transmission of the link detection packet, and the detection efficiency is high.

[0072] In addition, by limiting the direction of transmitting the link detection packet by each network device, repeated detection of the same link is avoided. The process of repeated detection of the same link is, for example, that the network device S2 sends a link detection packet to the network device S3 to detect the connectivity between the network device S2 and the network device S3, and the network device S3 also sends a link detection packet to the network device S2 to detect the connectivity between the network device S2 and the network device S3. In addition, by limiting the transmission direction of the link detection packet, the number of link detection packets transmitted in the ring network can also be controlled, and the transmission resources of the ring network are avoided from being wasted.

[0073] In a possible case, the first network device can also detect the connection status of each third network device in the plurality of third network devices. In this case, if the link through which the first network device sends the message to the third network device is different from the link through which the third network device sends the message to the first network device, the targeted detection of different links can be achieved through the detection of messages in different transmission directions, and even in the case of single-link failure, the connection status of different links between the two network devices can be detected through the detection of messages in different transmission directions. The single-link failure scenario is, for example, the link between the network device S4 and the network device S5 in the direction of the network device S4-> the network device S5 is connected, while the link between the network device S5 and the network device S4 in the direction of the network device S5-> the network device S4 is not connected.

[0074] For the case where the first network device sends the link detection message to the plurality of third network devices, the first network device can send the link detection message to the plurality of third network devices at the same time. Taking the case where the link detection message is copied from the received loop detection message as an example, after receiving the loop detection message, the first network device can copy the loop detection message into a plurality of link detection messages and send them to the plurality of third network devices, respectively.

[0075] Alternatively, the first network device can also send the link detection message to the third network device at different times. Taking the case where the link detection message is copied from the loop detection message as an example, in a possible case, the loop detection message used to detect the open / close state of the ring network includes a first detection message and a second detection message, wherein the transmission directions of the first detection message and the second detection message are different.

[0076] Referring to FIG. 8, the loop detection packet transmitted in the ring network is indicated by a dashed arrow, and different dashed lines are used to indicate loop detection packets in different transmission directions. Optionally, the clockwise direction indicates a first detection packet, and the counterclockwise direction indicates a second detection packet. In a possible implementation, the first network device receives the first detection packet at a first time and receives the second detection packet at a second time, and the time difference is caused by the same network device sending the first detection packet and the second detection packet at different times, or is caused by a difference in the transmission path length between the network device sending the first detection packet and the second detection packet and the first network device. In FIG. 8, the network device S1 sends the loop detection packet, and the first network device is taken as an example of the network device S2. The transmission path of the first detection packet to the network device S2 is network device S1->network device S2, and the transmission path of the second detection packet to the network device S2 is network device S1->network device S5->network device S4->network device S3->network device S2. The transmission path of the second detection packet is longer than that of the first detection packet, and therefore, even if the first detection packet and the second detection packet are sent from the network device S1 at the same time, the first detection packet and the second detection packet will arrive at the network device S2 in sequence. In this case, the first network device can send the copied link detection packet to a third network device corresponding to the loop detection packet according to the received loop detection packet.

[0077] Exemplarily, the third network device corresponding to the loop detection packet can be an upstream device of the loop detection packet. For example, the first detection packet is sent from the network device S1 to the network device S2, and the upstream device of the first detection packet is the network device S1. After receiving the first detection packet, the network device S2 sends the copied loop detection packet to the network device S1. The third network device corresponding to the loop detection packet can also be a downstream device of the loop detection packet. For example, the first detection packet is transmitted by the network device S2 to the network device S3 after arriving at the network device S2, and the downstream device of the first detection packet is the network device S3. After receiving the first detection packet, the network device S2 copies the first detection packet to obtain a link detection packet, and sends the first detection packet and the link detection packet to the network device S3. The first detection packet and the link detection packet can be transmitted in parallel or in sequence, and the embodiments of the present application do not limit this.

[0078] In a possible case, the third network device can return a link response message to the first network device after receiving the link detection message. Alternatively, the third network device can copy the received link detection message to obtain the link response message, and send the link response message to the first network device. Taking the first network device taking the loop detection message as the link detection message as an example, the first network device sends the loop detection message to the third network device based on the routing information of the loop detection message. After receiving the loop detection message, the third network device copies the loop detection message to obtain the link response message, and returns the link response message to the first network device. Alternatively, the third network device can generate the link response message, which is not limited in the embodiments of the present application. In a possible implementation, the third network device can also take the received link detection message as the link response message and send it to the first network device, that is, the first network device and the third network device use the Ethernet operation administration and maintenance (OAM) remote loopback function to transmit the link response message. For example, as shown in FIG. 9, in FIG. 9, LC indicates a link detection message, and RC indicates a loop detection message. Network device S6 sends the link detection message to network device S7, and network device S7 loops the received link detection message to network device S6. In the case of a failure between network device S6 and network device S7 as shown in FIG. 9, network device S6 cannot receive the link detection message returned by network device S7, and network device S6 can determine that the connection between network device S6 and network device S7 is faulty.

[0079] Regardless of the way in which the third network device returns the link response message to the first network device, the first network device can determine whether the link between the first network device and the third network device is interrupted based on the return of the link response message. For example, in the case that the link response message returned by the third network device is received within the first period, it is determined that the first network device and the third network device are connected; or in the case that the link response message returned by the third network device is not received within the first period, it is determined that the connection between the first network device and the third network device is interrupted.

[0080] The first period can be any length set based on experience and implementation environment. In the case that the first network device periodically sends the link detection message, the first period can be determined based on the sending period of the link detection message. For example, the first period is equal to n sending periods, and n is equal to 2.5, 3 or other positive numbers. By setting the first period, the transmission delay of the link response message between the third network device and the first network device is taken into account, and the link response message with long transmission delay is avoided from being judged as a packet loss, which leads to a link that is normally connected being judged as interrupted.

[0081] In the case that the first network device and the third network device are normally connected, the third network device successfully receives the link detection message, returns a link response message to the first network device according to the link detection message, and the first network device can receive the link response message within the first period, so that the first network device can directly determine that the connection between the first network device and the third network device is normal. Alternatively, the first network device can receive the link response message, parse the link response message, determine that the link detection message corresponding to the link response message is normally transmitted based on the message identifier carried in the link response message, and thus determine that the first network device and the third network device are normally connected. Optionally, the message identifier can be any information indicating the association between the link response message and the link detection message, such as a message sequence number or a message name.

[0082] In the case that the connection between the first network device and the third network device is interrupted, the link detection message sent by the first network device cannot be transmitted to the third network device, for example, the link detection message is lost during transmission. The third network device does not receive the link detection message, does not trigger the return of the link response message, and the first network device cannot receive the link response message. Alternatively, the connection between the first network device and the third network device is interrupted, but the transmission of the link detection message is not affected, for example, the first network device and the third network device are interrupted after the transmission of the link detection message is completed. Therefore, the third network device receives the link detection message and returns a link response message to the first network device based on the received link detection message, but the connection between the first network device and the third network device is interrupted, so that the first link response message cannot be transmitted to the first network device, for example, the link response message is lost on the link, and the first network device cannot receive the link response message. Therefore, the first network device cannot receive the link response message in the case that the connection between the first network device and the third network device is interrupted.

[0083] Since the third network device returns the link response message based on the received link detection message, even if there is a single fault scenario, the link fault can be detected. Taking a single fault as an example, the link fault of the first network device to the third network device, and the normal communication of the link of the third network device to the first network device, if the first network device and the third network device use the method of directly sending and receiving link response messages, for example, as shown in FIG. 10, the first network device is network device S6, the third network device is network device S7, LC indicates a link detection message, and RC indicates a link response message. Even if there is a fault between network device S6 and network device S7, network device S6 can normally receive the link response message sent by network device S7, and therefore, network device S6 will incorrectly determine that the link between network device S7 is normally connected. However, the application adopts the scheme of sending a link detection message first to trigger the third network device to return a link response message. Since the third network device cannot receive the link detection message, it cannot return the link response message based on the link detection message. Even if it is a single fault scenario, the first network device can detect that the link between the third network device is faulty.

[0084] In addition, the above-mentioned one of the network devices in the ring network, i.e., the first network device, is taken as an example to explain the process of detecting whether the connection between the first network device and the third network device is interrupted. In actual operation, each network device in the ring network can detect the connection between adjacent network devices by sending a link detection message. For example, as shown in FIG. 11, in FIG. 11, RC_test message indicates a loop detection message, and the network devices in the ring network take the loop detection message as a link detection message. LC_test message indicates a link response message. The two sides of any network device can be divided into east (E) and west (W) ports based on direction. Next, taking FIG. 11 as an example, the link detection process of each network device in the ring network is explained from the overall perspective.

[0085] In FIG. 11, network device S1 sends RC_test messages in both directions at a fixed period. RC_test_E message is sent from the east port in the clockwise direction, and RC_test_W message is sent from the west port in the counterclockwise direction. In the clockwise direction, network device S2 receives RC_test_E message, copies a copy of RC_test_E message, modifies the copied message to LC_test_E message, and then sends the received RC_test_E message to network device S3. The modified LC_test_E message is sent to network device S1 from the west port in the counterclockwise direction. Network device S1 receives LC_test_E message and detects whether the link between network device S2 and network device S1 is connected based on the reception of LC_test_E message, and does not continue to forward the message downstream.

[0086] Exemplarily, if the east-facing port of the network device S2 does not receive the LC_test_E message in the first period, the network device S2 determines that the LC_test_E detection fails, and is identified as LC_test_E fail. If the east-facing port of the network device S2 receives the LC_test_E message in the first period, the network device S2 determines that the LC_test_E detection succeeds, and is identified as LC_test_E success. The first period can also be referred to as a statistical time window in some cases.

[0087] After the network device S2 transmits the RC_test_E message downward, the network device S3, the network device S4 and the network device S5 receive the RC_test_E message through the west-facing port, and perform similar operations as the network device S2. After the network device S2, the network device S3 and the network device S4 receive the LC_test_E message through the east-facing port, they perform similar operations as the network device S1.

[0088] In a possible case, although the network device S1 is in a disconnected state in the case of a closed loop network, to avoid loop transmission of messages on the loop network through the network device S1, the west-facing port as a blocking point in the network device S1 does not block the transmission of the RC_test_E message. Therefore, in the case that there is no interrupted link in the loop network, i.e., the closed loop network, the west-facing port of the network device S1 can normally receive the RC_test_E message sent by the network device S5. After receiving the RC_test_E message, the network device S1 determines that the whole loop detection is completed, and terminates the transmission of the RC_test_E message, and no longer circulates the forwarding. The network device S1 determines the transmission delay of the RC_test_E message based on the sending time and the receiving time of the RC_test_E message. In the case that the transmission delay is not greater than a time window, it is determined that the RC_test_E detection succeeds, and is identified as RC_test_E success. In the case that the transmission delay is greater than the time window, it is determined that the RC_test_E detection fails, and is identified as RC_test_E fail. The time window can be set based on experience and implementation environment.

[0089] In addition, the network device S1 also performs similar operations as the network device S2. Based on receiving the RC_test_E message, the network device S1 copies the received RC_test_E message, modifies it into an LC_test_E message, and sends it from the west-facing port to the network device S5 in the counterclockwise direction. The network device S5 determines that the connection between the network device S1 and the network device S5 is normally connected based on the received LC_test_E message.

[0090] The operations performed by each network device receiving the RC_test_W message in the counterclockwise direction and the operations performed by each network device receiving the RC_test_E message in the clockwise direction are similar, and the judgment process is also similar. For any network device, if no RC_test_W is received by the east port within the statistical time window, it is determined that the RC_test_W detection fails, and is marked as RC_test_W Fail; if RC_test_W is received by the east port within the statistical time window, it is determined that the RC_test_W detection succeeds, and is marked as RC_test_W Success; and if no LC_test_W is received by the west port within the statistical time window, it is determined that the LC_test_W detection fails, and is marked as LC_test_W Fail; if LC_test_W is received by the west port within the statistical time window, it is determined that the LC_test_W detection succeeds, and is marked as LC_test_W Success. For details, refer to the above description of the clockwise direction, which will not be repeated here. In the case that each link in the ring network shown in FIG. 8 is normally connected, the statistical results of each network device can be seen in Table 1.

[0091] Table 1

[0092] In Table 1, the master node refers to the network device configured as the blocking point, that is, network device S1 in FIG. 11, and the transmission node refers to other network devices in the ring network except the master node, that is, network devices S2, S3, S4 and S5 in FIG. 11. Since there is no link interruption on the ring network, the detection results of each transmission node are the same, so in Table 1, network devices S2, S3, S4 and S5 are collectively referred to as transmission nodes.

[0093] FIG. 12 is a fault schematic diagram of a ring network provided by an embodiment of the application. The fault scenario is that the connection between a pair of network devices is interrupted, also known as a single point of failure. In the scenario shown in FIG. 12, the statistical results of each network device can be seen in Table 2.

[0094] Table 2

[0095] In FIG. 12, due to the disconnection between the network device S4 and the network device S5 in the ring network, the RC_test_E message transmitted in the clockwise direction cannot reach the port W of the network device S1, and thus the receiving result of the RC_test_E message is fail, and the RC_test_W message transmitted in the counterclockwise direction cannot reach the port E of the network device S1, and thus the receiving result of the RC_test_W message is also fail. In FIG. 12, the connection relationship between the network device S1 and the network device S2 and the network device S5 is normal, and thus the network device S2 and the network device S5 can receive the RC_test message sent by the network device S1, and can trigger the return of the LC_test message based on the receiving of the RC_test message. The east port and the west port of the network device S1 can receive the corresponding LC_test message, and the receiving result of the LC_test message is success. For the receiving conditions of the other network devices, refer to the arrows in FIG. 12, which will not be described herein.

[0096] In a possible case, the fault in the ring network is the single-path fault scenario shown in FIG. 7, the connection between the network device S4 and the network device S5 is disconnected, and the connection between the network device S5 and the network device S4 is connected. The statistical results of the network devices can be referred to Table 3.

[0097] Table 3

[0098] FIG. 13 is a fault schematic diagram of another ring network provided by the embodiment of the application. The fault scenario is that the connection between multiple pairs of network devices in the ring network is disconnected, which is also called multi-point fault. In the scenario shown in FIG. 13, the statistical results of the network devices can be referred to Table 4.

[0099] Table 4

[0100] In Table 4, the receiving conditions of the link response messages of the network devices except the network device S1 are all fail, because the RC_test message sent by the network device S1 can only be transmitted to the network device S2 and the network device S5, and the other network devices cannot receive the RC_test message, and thus cannot return the LC_test message based on the RC_test message. Based on Table 1 to Table 4, each network device can determine whether the connection is disconnected by the receiving condition of the link response message. When any network device detects that the connection is disconnected, for example, the LC_test message is not received, any network device can start to perform the operation of determining the path information of the second path as the first network device. For example, in Table 4, the network device S2, the network device S3, the network device S4 and the network device S5 can all be the first network device to determine the path information of the second path.

[0101] Optionally, the first network device can take the link connected with the failed end as the first path, and take the link connected with the non-failed end as the second path, and start to determine the path information of the second path. Since the process of determining the path information by different network devices is similar, the following takes one of the network devices, i.e. the first network device, as an example to illustrate the operation of determining the path information. The operation process of the network device on the other side of the ring network with the one-side connection interrupted and the other-side connection connected can refer to the operation process of the first network device, which will not be described here in detail.

[0102] In one possible case, the first network device determines the path information between the first network device and the second network device. The first network device and the second network device are the end-side devices of the first path. In the case that the failure point in the ring network is one, the second network device is the adjacent network device of the first network device, for example, as shown in FIG. 4, the first network device is the network device S4, the second network device is the network device S5, and the first path is the network device S4->network device S5. In the case that the failure point in the ring network is multiple, the second network device is the boundary device of the multiple failure points, and the first path connected between the second network device and the first network device includes all the failure points in the ring network. Continuing to take FIG. 5 as an example, in the case that the first network device is the network device S2, the second network device is the network device S5, and in the case that the first network device is the network device S3, the second network device is the network device S4.

[0103] In one possible case, the first network device and the second network device are the end-side devices of the first path and also belong to the end-side devices of the second path. That is, the ring network can be divided into the first path and the second path by the first network device and the second network device. In the case that the first path is the network device S4->network device S5 as shown in FIG. 4, the second path is the network device S4->network device S3->network device S2->network device S1->network device S5. In the case that the first path is the network device S2->network device S3->network device S4->network device S5 as shown in FIG. 5, the second path is the network device S2->network device S1->network device S5. Moreover, since the first path includes all the interrupted links in the ring network, the second path does not include the interrupted links, and the second path is normally connected.

[0104] Since the first path connection is interrupted, the second path is normally connected, therefore, the first network device cannot transmit the packet through the first path, and needs to transmit the packet through the second path. Taking the ring network shown in FIG. 4 as an example, the first network device is network device S4, network device S2 receives the packet to be transmitted, and based on the destination node of the packet being network device S5, it is expected to transmit the packet through network device S2->network device S3->network device S4->network device S5, but after receiving the packet, network device S4 finds that the first path network device S4->network device S5 is interrupted and cannot transmit the packet, and selects to transmit the packet to network device S5 through the second path network device S4->network device S3->network device S2->network device S1->network device S5. The above operation can be referred to as a ring network path switching technology in some cases, and the embodiments of the present application do not limit the ring network path switching technology, including but not limited to an ethernet ring protection switching (ERPS) technology, a media redundancy protocol (MRP), and a distributed redundancy protocol (DRP).

[0105] In a possible case, based on the transmission requirement of the second path, the first network device also needs to determine whether the second path meets the packet transmission condition before transmitting the packet through the second path, for example, judging whether the second path includes a blocking point. In a possible implementation, a blocking point is configured in the ring network, and the blocking point is used to block repeated transmission of the packet. For example, as shown in FIG. 2, the E port of network device S1 in FIG. 2 is a master port and is in a forwarding state, and the W port of network device S1 is a secondary port and is a blocking point, which is in a blocking state when the ring network is closed, and is switched to a forwarding state when the ring network is opened, to complete protection switching. The embodiments of the present application do not limit the setting process of the blocking point in the ring network, which can be manually set, and a fourth network device can be selected from a plurality of network devices included in the ring network, and a port of the fourth network device is set as the blocking point. Alternatively, the fourth network device can also be obtained through interaction and negotiation of each network device in the ring network. After determining the position of the blocking point in the ring network, the blocking point can be set by using an ERPS technology, an MRP, a DRP, or the like. Moreover, the number of blocking points set in one ring network can be one or multiple, and regardless of the number of blocking points included in the ring network, the process of obtaining path information by the first network device is similar, and the embodiments of the present application take the ring network including one blocking point as an example for illustration.

[0106] Exemplarily, the first network device can receive the path information sent by the monitoring device. For example, the monitoring device detects that a connection interruption occurs in the first path in the ring network, and sends a notification of the interruption of the first path to the first network device to prompt the first network device that the first path cannot transmit the packet, and the subsequently obtained to-be-transmitted packet is transmitted by using the second path. On this basis, the monitoring device can further determine whether the second path includes the blocking point, and send the determined path information to the first network device.

[0107] Optionally, the first network device can also determine whether the second path includes the blocking point by itself to obtain the path information. For example, in the case that the first network device includes the blocking point, the determined path information indicates that the second path includes the blocking point. In a possible case, the first network device and the fourth network device configured with the blocking point are the same network device. Since the port of the first network device is the blocking point, the second path including the first network device also includes the port of the first network device, and the second path includes the blocking point.

[0108] Alternatively, in the case that the first network device does not include the blocking point, the path information is determined according to the reception of the loop detection packet sent by the fourth network device including the blocking point in the ring network. The description of the loop detection packet can be referred to the related content of the loop detection packet in the above embodiment, which will not be repeated here.

[0109] In a possible implementation, the process in which the first network device determines the path information according to the loop detection packet includes: in the case that the loop detection packet is received in the second period, determining that the path information indicates that the second path includes the blocking point; or in the case that the loop detection packet is not received in the second period, determining that the path information indicates that the second path does not include the blocking point. The principle of the second period is similar to that of the first period, and can be set based on experience and implementation environment, for example, the sending period of the loop detection packet or the transmission delay on the ring network.

[0110] Since the first path of the connection between the first network device and the second network device includes a fault point of connection interruption, the first path is in a disconnected state, the first network device cannot receive the packet through the first path, and the received packet is transmitted through the second path. When the second path includes the fourth network device, the loop detection packet sent by the fourth network device can be normally received by the first network device, and the first network device determines that the second path includes the blocking point. Continue to take the ring network shown in FIG. 5 as an example, the fourth network device is network device S1, and the transmission path of the loop detection packet sent by the network device S1 is network device S1->network device S2->network device S5->network device S1. In the case that the first network device is network device S2 and the second path is network device S2->network device S1->network device S5, the second path includes network device S1, and the network device S2 can receive the loop detection packet sent by the network device S1.

[0111] If the second path does not include the fourth network device, the loop detection packet sent by the fourth network device cannot be received by the first network device. Continue to take the fourth network device shown in FIG. 5 as network device S1, and the transmission path of the loop detection packet sent by the network device S1 is network device S1->network device S2->network device S5->network device S1. In the case that the first network device is network device S3, the second network device is network device S4, and the second path is network device S3->network device S4, the transmission path of the loop detection packet sent by the network device S1 does not pass through the network device S3, and the network device S3 cannot receive the loop detection packet.

[0112] In some cases, the process of determining whether the second path includes a congestion point can be referred to as determining whether the first network device includes an edge port, which refers to a port connected to a second path that is connected and includes a congestion point. For the first network device without a configured congestion point, if RC_test_E success and LC_test_E fail for the west port, the east port is an edge port, such as the network device S2 port W in Table 4. Alternatively, if RC_test_W success and LC_test_W fail for the east port, the west port is an edge port, such as the network device S5 port E in Table 4. If the reception of the RC_test packet and the LC_test packet for either port is fail, the port is not an edge port, and the path connected by the port does not belong to the second path including a congestion point, such as the network device S5 port W, the two ports of the network device S3, and the two ports of the network device S4 in Table 4. For the first network device with a configured congestion point, if the main port without a configured congestion point is the west port, the main port LC_test_W fail, and the main port is an edge port. If the main port without a configured congestion point is the east port, the main port LC_test_E fail, and the main port is an edge port.

[0113] S302, in the case where the path information indicates that the second path includes a congestion point, the first network device transmits a reference packet through the second path, and the congestion point is used to limit the loopback transmission of the reference packet on the second path.

[0114] The embodiments of the present application do not limit the manner in which the first network device obtains the reference packet, which can be generated by the first network device or received from an upstream device. The upstream device can be a network device configured outside the ring network or a network device configured on the ring network, such as the network device S1 in FIG. 5 receiving a to-be-transmitted reference packet and transmitting the reference packet to the network device S2 as the first network device. Alternatively, the reference packet can be any packet with transmission requirements, including but not limited to a data packet generated by service running or a detection packet for detection.

[0115] After obtaining the reference packet with transmission requirements, the first network device can transmit the reference packet through the second path. By transmitting the packet through the second path including the congestion point, the loopback transmission of the packet on the second path can be effectively avoided. Next, the packet transmission process of the second path without a congestion point and the packet transmission process of the second path including a congestion point are introduced respectively.

[0116] Taking the ring network shown in FIG. 5 as an example, the reference message acquired by the network device S3 as the first network device is a broadcast message. The network device S3 sends the reference message to the network device S4 based on the disconnection between the network device S3 and the network device S2. The network device S4 sends the reference message to the network device S3 after detecting the disconnection between the network device S4 and the network device S5. The network device S3 continues to send the reference message to the network device S5 after receiving the reference message. The reference message is repeatedly transmitted between the network device S3 and the network device S4, and finally forms the loop transmission shown in FIG. 5.

[0117] Optionally, if the second path includes a blocking point, the blocking point can discard the reference message after receiving the reference message returned by the second network device, that is, in the case of loop transmission of the reference message. Taking FIG. 5 as an example, the first network device is the network device S2, the second network device is the network device S5, and the transmitted reference message is a broadcast message. Similar to the interaction principle between the network device S3 and the network device S4, the network device S2 sends the broadcast message to the network device S1 based on the disconnection between the network device S2 and the network device S3. The network device S1 sends the broadcast message to the network device S5. The network device S5 sends the broadcast message to the network device S1 based on the disconnection between the network device S5 and the network device S4. In this case, the network device S1 detects that the broadcast message is the same message sent to the network device S5 before, determines that the broadcast message has loop transmission, and discards the broadcast message because the network device S1 is configured with a blocking point.

[0118] The reference message of the loopback transmission is discarded by the blocking point. In some cases, the reference message of the loopback transmission can also be discarded by the second network device. Continuing to take the ring network shown in FIG. 5 as an example, the reference message sent by the network device S2 as the first network device is a unicast message, and the destination node of the unicast message is the network device S3. In this case, because the link between the network device S2 and the network device S3 is disconnected, the network device S2 performs loopback switching, and adds a tunnel header to the reference message to transmit the reference message through the protection path between the network device S2-> the network device S1-> the network device S5. After the reference message reaches the network device S5, because the transmission path from the network device S5 to the network device S4 is a service path, the network device S5 removes the tunnel header of the reference message to restore the reference message. When the network device S5 sends the reference message to the network device S4, it detects that the connection between the network device S5 and the network device S4 is interrupted. The network device S5 determines to perform loopback switching on the reference message. Because the tunnel header of the reference message has been removed before, the reference message is a downlink message. Based on the principle of limiting the re-looping of the downlink message, the network device S5 cannot add a tunnel header to the reference message to perform loopback switching. Because in the topology of the ring network, the network device S5 sends the reference message to the network device S3 through the network device S4, the network device S5 sends the reference message to the network device S4 to discard the reference message by using the fault link.

[0119] To address the above situation, the blocking point can also assist the second network device to discard the message. For example, when the reference message is sent by the network device S2 to the network device S1, the network device S1 marks the reference message to indicate that the reference message has passed through a blocking point. The network device S5 can determine that the reference message has passed through the loopback switching of the blocking point and is a downlink message according to the mark carried on the reference message, and selects to discard the reference message.

[0120] In a possible case, when the path information indicates that the second path does not include a blocking point, the first network device limits sending of the reference message to be transmitted. The limitation of sending can be discarding the reference message, or storing the reference message to be transmitted in a cache space, waiting for the fault on the ring network to be repaired, and then continuing to transmit the reference message. For example, as shown in FIG. 14, since the E port of the network device S2 and the W port of the network device S5 are edge ports, and the edge ports include a blocking point, that is, the second path between the network device S2 and the network device S5 includes a blocking point, the network device S2 and the network device S5 can both trigger a protection switching as the first network device, and the network device S2 transmits the acquired reference message through the second path network device S2->network device S1->network device S5. Although the W port of the network device S3 and the E port of the network device S4 are fault ports, the W port of the network device S3 and the E port of the network device S4 do not include a blocking point, and are not edge ports, so the network device S3 and the network device S5 cannot trigger a protection switching action, and the network device S3 and the network device S4 will not transmit the message.

[0121] In summary, the message sending method provided by the embodiments of the present application can determine whether the second path currently connected includes a blocking point when the first path in the ring network is interrupted, and only when the second path includes a blocking point, the reference message is sent through the second path. In this case, even if the reference message is repeatedly transmitted on the second path, the blocking point on the second path will be aware of the repeated transmission of the reference message in time and discarded, thereby avoiding a storm, and the reliability of message transmission is high. In the case where the second path includes a blocking point, the first network device is limited to send the reference message, so as to avoid the reference message from being looped back between the first network device and the second network device to form a storm. By sending link detection messages in different transmission directions, a single path fault scenario can be effectively identified, and the reliability of the bypass protection switching ring network scheme is further improved.

[0122] The message sending method of the embodiments of the present application is introduced above, and corresponding to the above method, the embodiments of the present application also provide a message sending device. FIG. 15 is a structural schematic diagram of a message sending device provided by an embodiment of the present application. Based on the following multiple modules shown in FIG. 15, the message sending device shown in FIG. 15 can perform all or part of the operations shown in FIG. 3. It should be understood that the device can include more additional modules than the shown modules or omit part of the shown modules, and the embodiments of the present application do not limit this. As shown in FIG. 15, the device is applied to a first network device, and the device includes:

[0123] The determining module 1201 is configured to determine the path information between the first network device and the second network device in a case where the first path in the ring network is interrupted, the ring network further includes a second path in communication, and the first network device and the second network device are end-side devices of the first path and the second path.

[0124] The sending module 1202 is configured to send the reference message through the second path in a case where the path information indicates that the second path includes a blocking point, and the blocking point is used to limit the reference message from being transmitted in a loop on the second path.

[0125] In a possible implementation, the first path further includes a third network device adjacent to the first network device, the interruption of the first path includes an interruption of a connection between the first network device and the third network device, and the sending module 1202 is further configured to send a link detection message to the third network device, the link detection message being used to trigger the third network device to return a link response message to the first network device; and the determining module 1201 is further configured to determine whether the connection between the first network device and the third network device is interrupted based on a return condition of the link response message.

[0126] In a possible implementation, the determining module 1201 is configured to determine that the connection between the first network device and the third network device is in communication in a case where the link response message returned by the third network device is received within a first period; or determine that the connection between the first network device and the third network device is interrupted in a case where the link response message returned by the third network device is not received within the first period.

[0127] In a possible implementation, the apparatus further includes an obtaining module configured to obtain a loop detection message, the loop detection message being transmitted along the ring network, and a source node and a destination node of the loop detection message being a same network device on the ring network; and the loop detection message is copied to obtain the link detection message.

[0128] In a possible implementation, the determining module 1201 is configured to determine that the path information indicates that the second path includes the blocking point in a case where the first network device includes the blocking point; or determine the path information according to a reception condition of a loop detection message in a case where the first network device does not include the blocking point, and the loop detection message is sent by a network device including the blocking point in the ring network.

[0129] In a possible implementation, the determining module 1201 is configured to determine that the path information indicates that the second path does not include the blocking point in a case where the loop detection message is not received within a second period; or determine that the path information indicates that the second path includes the blocking point in a case where the loop detection message is received within the second period.

[0130] In a possible implementation, the loop detection packet includes a first detection packet and a second detection packet, and the first detection packet and the second detection packet are transmitted in different transmission directions through different ports of the network device including the blocking point.

[0131] In a possible implementation, the blocking point is configured to discard the reference packet upon receiving the loop transmission of the reference packet.

[0132] When the first path in the ring network is interrupted, the apparatus determines whether the second path currently connected includes the blocking point, and sends the reference packet through the second path only when the second path includes the blocking point, so as to timely limit the loop transmission of the reference packet on the second path through the blocking point, where the loop transmission refers to repeated transmission of the reference packet between the first network device and the second network device through the second path. By limiting the loop transmission, the transmission resources of the second path are prevented from being occupied by the reference packet, and the transmission utilization of the second path is improved.

[0133] It should be understood that the apparatus provided in FIG. 15 is only used as an example to illustrate the division of the functional modules, and in actual application, the functions can be distributed to 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 functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process is described in the method embodiments, which will not be repeated here. In addition, the packet sending apparatus provided in FIG. 15 can be a chip or a communication device, for example, the packet sending apparatus can be the network device described below.

[0134] Referring to FIG. 16, FIG. 16 shows a structural schematic diagram of a network device 1300 provided in an example embodiment of the present application. The network device 1300 shown in FIG. 16 is configured to perform the operations involved in the packet sending method shown in FIG. 3. The network device 1300 is, for example, a switch, a router, etc., and can be implemented by a general bus architecture.

[0135] As shown in FIG. 16, the network device 1300 includes at least one processor 1301, a memory 1303, and at least one communication interface 1304.

[0136] The processor 1301 is, for example, a central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing units (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits used to implement a design described in the present application. For example, the processor 1301 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic device, transistor logic, a hardware component, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute various logical blocks, modules, and circuits described in combination with the disclosure of the embodiments of the present application. The processor can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0137] Optionally, the network device 1300 also includes a bus. The bus is used to transmit information between the components of the network device 1300. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is shown in FIG. 16, but it does not mean that there is only one bus or only one type of bus.

[0138] The memory 1303 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions; a random access memory (RAM), or other type of dynamic storage device that can store information and instructions; a flash memory or other optical disk storage, including a compact disc read-only memory (CD-ROM), a compact disc-rewritable (CD-RW), and the like, a magneto-optical disk, a floppy disk, a hard disk, or other magnetic storage device, or any other medium capable of storing instructions and data and that can be accessed by a computer, but is not limited thereto. The memory 1303 may, for example, exist independently of the processor 1301 and be connected to the processor 1301 via a bus. The memory 1303 may, for example, also be integrated with the processor 1301.

[0139] The communication interface 1304 uses any transceiver-like mechanism for communicating with other devices or communication networks, such as an Ethernet network, a radio access network (RAN), or a wireless local area networks (WLAN), etc. The communication interface 1304 can include a wired communication interface and / or a wireless communication interface. Specifically, the communication interface 1304 can be an Ethernet interface, a fast Ethernet (FE) interface, a gigabit Ethernet (GE) interface, an asynchronous transfer mode (ATM) interface, a wireless local area networks (WLAN) interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In embodiments of the present application, the communication interface 1304 can be used for the network device 1300 to communicate with other devices.

[0140] In specific implementations, as one example, the processor 1301 can include one or more CPUs, such as the CPU0 and the CPU1 shown in FIG. 16. Each of these processors can be a single-CPU processor or a multi-CPU processor. The processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0141] In a particular implementation, as one example, network device 1300 can include multiple processors, such as processor 1301 and processor 1305 as shown in FIG. 16. Each of these processors can be a single-CPU or a multi-CPU. A processor here can refer to one or more devices, circuits, and / or processing cores for processing data, such as computer program instructions.

[0142] In a particular implementation, as one example, network device 1300 can also include an output device and an input device. The output device is in communication with the processor 1301 and can display information in various ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device is in communication with the processor 1301 and can receive user input in various ways. For example, the input device can be a mouse, a keyboard, a touch screen device, a sensor device, etc.

[0143] In some embodiments, the memory 1303 is used to store program code 1310 for implementing the solutions of the present application, and the processor 1301 can execute the program code 1310 stored in the memory 1303. That is, the network device 1300 can implement the packet sending method provided by the method embodiments through the processor 1301 and the program code 1310 in the memory 1303. The program code 1310 can include one or more software modules. Alternatively, the processor 1301 itself can also store program codes or instructions for implementing the solutions of the present application.

[0144] In a particular implementation, the network device 1300 of the embodiments of the present application can correspond to the computing device in the above-mentioned various method embodiments.

[0145] The steps of the packet sending method shown in FIG. 3 are completed by the integrated logic circuits of hardware in the processor of the network device 1300 or instructions in the form of software. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, or other mature storage media in the field. The storage medium is located in the memory, and the processor reads information in the memory and combines the hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.

[0146] Referring to FIG. 17, FIG. 17 shows a structural diagram of a network device 1400 according to another example embodiment of the present application. The network device 1400 shown in FIG. 17 is configured to perform all or part of the operations involved in the packet sending method shown in FIG. 3. The network device 1400 can be a switch, a router, or the like, and can be implemented by a general bus architecture.

[0147] As shown in FIG. 17, the network device 1400 includes a master board 1410 and an interface board 1430.

[0148] The master board 1410, also referred to as a main processing unit (MPU) or a route processor card, is configured to control and manage various components in the network device 1400, including route calculation, device management, device maintenance, and protocol processing functions. The master board 1410 includes a central processor 1411 and a memory 1412.

[0149] The interface board 1430, also referred to as a line processing unit (LPU), a line card, or a service board, is configured to provide various service interfaces and implement packet forwarding. The service interfaces include, but are not limited to, Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, and the like. The Ethernet interface can be, for example, a Flexible Ethernet Client (FlexE Client) interface. The interface board 1430 includes a central processor 1431, a network processor 1432, a forwarding table item memory 1434, and a physical interface card (PIC) 1433.

[0150] The central processor 1431 on the interface board 1430 is configured to control and manage the interface board 1430 and communicate with the central processor 1411 on the master board 1410.

[0151] The network processor 1432 is configured to implement the forwarding processing of the packet. The network processor 1432 can be a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented by an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 1432 is configured to forward the received packet based on a forwarding table stored in the forwarding table entry memory 1434, and if the destination address of the packet is the address of the network device 1400, the packet is sent to the CPU (e.g., the central processor 1431) for processing; if the destination address of the packet is not the address of the network device 1400, the next hop and the out interface corresponding to the destination address are found from the forwarding table according to the destination address, and the packet is forwarded to the out interface corresponding to the destination address. The processing of the uplink packet can include the processing of the packet entry interface and the forwarding table lookup, and the processing of the downlink packet can include the forwarding table lookup, and the like. In some embodiments, the central processor can also perform the function of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, so that the interface board does not need a forwarding chip.

[0152] The physical interface card 1433 is configured to implement the interfacing function of the physical layer, and the original traffic enters the interface board 1430 through the physical interface card 1433, and the processed packet is sent out from the physical interface card 1433. The physical interface card 1433 is also called a daughter card, which can be installed on the interface board 1430 and is responsible for converting the optical and electrical signals into packets and forwarding the packets to the network processor 1432 for processing after performing the legality check. In some embodiments, the central processor 1431 can also perform the function of the network processor 1432, such as implementing software forwarding based on a general-purpose CPU, so that the physical interface card 1433 does not need a network processor 1432.

[0153] Optionally, the network device 1400 includes a plurality of interface boards, for example, the network device 1400 further includes an interface board 1440, the interface board 1440 includes a central processor 1441, a network processor 1442, a forwarding table entry memory 1444, and a physical interface card 1443. The functions and implementation manners of the components in the interface board 1440 are the same as or similar to those of the interface board 1430, and are not described herein again.

[0154] Optionally, the network device 1400 further includes a switch fabric 1420. The switch fabric 1420 can also be referred to as a switch fabric unit (SFU). In the case that the network device 1400 has multiple interface boards, the switch fabric 1420 is used to complete data exchange between the interface boards. For example, the interface board 1430 and the interface board 1440 can communicate through the switch fabric 1420.

[0155] The master board 1410 is coupled with the interface boards. For example, the master board 1410, the interface board 1430 and the interface board 1440, and the switch fabric 1420 are connected through a system bus and a system backplane to realize intercommunication. In a possible implementation, an inter-process communication (IPC) channel is established between the master board 1410 and the interface board 1430 and the interface board 1440, and the master board 1410 and the interface board 1430 and the interface board 1440 communicate through the IPC channel.

[0156] In logic, the network device 1400 includes a control plane and a forwarding plane. The control plane includes the master board 1410 and the central processor 1411, and the forwarding plane includes various components that perform forwarding, such as the forwarding table entry memory 1434, the physical interface card 1433 and the network processor 1432. The control plane performs functions such as generating a forwarding table, processing signaling and protocol packets, configuring and maintaining the state of the network device, and the like. The control plane distributes the generated forwarding table to the forwarding plane, and in the forwarding plane, the network processor 1432 performs table lookup and forwarding on the packets received by the physical interface card 1433 based on the forwarding table distributed by the control plane. The forwarding table distributed by the control plane can be stored in the forwarding table entry memory 1434. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same network device.

[0157] It is worth mentioning that the master board can be one or more, and when there are multiple master boards, the master boards can include a main master board and a backup master board. The interface board can be one or more, and the stronger the data processing capability of the network device, the more interface boards are provided. The physical interface card on the interface board can also be one or more. The switching network board can be none or one or more, and when there are multiple switching network boards, the switching network boards can collectively implement load sharing and redundancy. In the centralized forwarding architecture, the network device can not need the switching network board, and the interface board can bear the processing function of the entire system. In the distributed forwarding architecture, the network device can have at least one switching network board, and the switching network board can be used to realize data exchange between multiple interface boards and provide large-capacity data exchange and processing capability. Therefore, the data access and processing capability of the network device in the distributed architecture is greater than that of the network device in the centralized architecture. Alternatively, the network device can also be in the form of only one board, that is, the functions of the interface board and the master board are integrated on the one board, and at this time, the central processor on the interface board and the central processor on the master board can be combined into one central processor on the one board to perform the functions of the two superimposed boards. The data exchange and processing capability of the network device in this form is relatively low (for example, low-end switches or routers and the like). Which architecture is used depends on the specific network deployment scenario, and no limitation is made herein.

[0158] In specific embodiments, the network device 1400 corresponds to the packet sending apparatus shown in FIG. 15. In some embodiments, the determination module 1201 in the packet sending apparatus shown in FIG. 15 corresponds to the central processor 1411 or the network processor 1432 in the network device 1400.

[0159] The embodiments of the present application also provide a communication apparatus, which comprises a transceiver, a memory and a processor. The transceiver, the memory and the processor communicate with each other through internal connection paths. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive a signal and control the transceiver to send a signal. When the processor executes the instructions stored in the memory, the processor executes the packet sending method shown in FIG. 3.

[0160] It should be understood that the above processor can be a CPU, and can also be other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth mentioning that the processor can be a processor supporting an advanced RISC machine (ARM) architecture.

[0161] Further, in an alternative embodiment, the aforementioned memory can include read-only memory and random access memory, and provide the processor with instructions and data. The memory can also include non-volatile random access memory. For example, the memory can also store device type information.

[0162] The memory can be volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of illustration, and not limitation, nonvolatile memory can be ROM, programmable ROM (PROM), erasable PROM (EPROM), EEPROM, or flash memory. Volatile memory can be RAM, which acts as external cache memory. By way of illustration and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous dynamic RAM (SDRAM), double-data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0163] The embodiment of the present application further provides a packet sending device, which comprises a processor, and the processor is used for loading and running at least one instruction, so that the packet sending device implements the packet sending method shown in Fig. 3. Optionally, the device further comprises a memory, the memory is coupled with the processor, and the memory is used for storing at least one instruction.

[0164] The embodiment of the present application further provides a computer readable storage medium, and the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor, so that the computer implements the packet sending method shown in Fig. 3.

[0165] The embodiment of the present application further provides a computer program (product), when the computer program is executed by a computer, can make the processor or the computer execute the corresponding steps and / or processes in the above method embodiment.

[0166] The embodiment of the present application further provides a chip, which comprises a processor, and the processor is used for calling and running instructions stored in a memory, so that a communication device installed with the chip executes the packet sending method shown in Fig. 3.

[0167] The embodiment of the present application further provides another chip, comprising: an input interface, an output interface, a processor and a memory, which are connected through internal connection paths, the processor is configured to execute the code in the memory, and when the code is executed, the processor is configured to execute the packet sending method shown in Fig. 3.

[0168] In the above embodiment, all or part of the embodiment can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of the embodiment can be realized in the form of a computer program product. The computer program product comprises one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. 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. integrated with one or more available media. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), optical medium (for example, DVD) or semiconductor medium (for example, solid state disk) and the like.

[0169] It should be noted that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the present application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions. For example, the reference packet and the like involved in the present application are obtained under sufficient authorization.

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

[0171] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by programs instructing related hardware, which can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0172] When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. As an example, the method of the embodiments of the present application can be described in the context of machine-executable instructions, such as program modules that are executed by devices included in the target real or virtual processor. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functions of the program modules can be combined or divided among the described program modules. Machine-executable instructions for program modules can be executed within a local or distributed device. In a distributed device, program modules can be located in both local and remote storage media.

[0173] The computer program code for implementing the method of the embodiments of the present application can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable messaging device, so that the program codes cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented when the computer or other programmable messaging device executes the program codes. The program codes can be executed entirely on the computer, partially on the computer, as a separate software package, partially on the computer and partially on a remote computer, or entirely on a remote computer or server.

[0174] In the context of the embodiments of the present application, computer program codes or related data can be carried by any appropriate carrier to enable the device, apparatus or processor to perform the various processes and operations described above. Examples of the carrier include signals, computer readable media, etc.

[0175] Examples of a signal can include electrical, optical, radio frequency, sound, or other forms of propagated signals, such as carrier waves, infrared signals, etc.

[0176] A machine-readable medium can be any tangible medium that contains or stores the program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), and a digital versatile disc (DVD), or any suitable combination of the foregoing.

[0177] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and module can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0178] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of the module is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be indirect coupling or communication connection through some interfaces, devices or modules, and can also be electrical, mechanical or other form of connection.

[0179] The module described as a separate component can or can not be physically separated, and the component displayed as a module can or can not be a physical module, that is, it can be located in one place, or can be distributed to a plurality of network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0180] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically, or two or more modules can be integrated into one module. The above integrated module can be realized in the form of hardware or in the form of software functional module.

[0181] The integrated module, if implemented in the form of a software function module and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0182] The terms "first", "second", and the like in the present application are used to distinguish between items or similar items having substantially the same function and action. It should be understood that there is no logical or chronological dependency between "first", "second", and "nth", and the number and execution order are not limited. It should also be understood that although the following description uses the terms first, second, and the like to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various described examples, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image. The first image and the second image can both be images, and in some cases, can be separate and distinct images.

[0183] It should also be understood that in various embodiments of the present application, the size of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0184] The term "at least one" in the present application means one or more, and the term "a plurality of" in the present application means two or more, for example, a plurality of second messages means two or more second messages. The terms "system" and "network" are often used interchangeably in this document.

[0185] It should be understood that the terms used in the description of various described examples herein are only for the purpose of describing specific examples and are not intended to be limiting. As used in the description of various described examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0186] It should also be understood that, as used in this specification, the terms "comprises", "comprising", "includes", "including", "with" or "comprising", specifies the presence of stated features, integers, steps, operations, elements, and / or components but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0187] It should also be understood that the terms "comprises", "comprising", "includes", "including", "with" or "comprising", specifies the presence of stated features, integers, steps, operations, elements, and / or components but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0188] It should also be understood that the terms "if' and "when" can be construed to mean "upon" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [a stated condition or event] is detected" can be construed to mean "upon determining" or "in response to determining" or "upon detecting [the stated condition or event]" or "in response to detecting [the stated condition or event]", depending on the context.

[0189] It should be understood that determining B according to A does not mean that B is determined only according to A, but B can also be determined according to A and / or other information.

[0190] It should also be understood that the reference herein to "one embodiment", "an embodiment", "one possible implementation", means that a particular feature, structure, or characteristic described in connection with an embodiment or implementation is included in at least one embodiment of the application. Therefore, appearances of the phrases "in one embodiment" or "in an embodiment", "one possible implementation", throughout the specification are not necessarily all referring to the same embodiment. Furthermore, the various features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

Claims

1. A message sending method, characterized in that: The method comprises: In a case where a first path in a ring network is interrupted, a first network device determines path information between the first network device and a second network device, the ring network further comprising a connected second path, the first network device and the second network device being end-side devices of the first path and the second path; In a case where the path information indicates that the second path includes a blocking point, the first network device sends a reference message through the second path, and the blocking point is used to restrict loopback transmission of the reference message on the second path.

2. The method according to claim 1, characterized in that The first path further includes a third network device adjacent to the first network device, and the interruption of the first path includes an interruption of a connection between the first network device and the third network device. Before determining the path information between the first network device and the second network device, the method further includes: Sending a link detection message to the third network device, where the link detection message is used to trigger the third network device to return a link response message to the first network device; Based on the return status of the link response message, it is determined whether the connection between the first network device and the third network device is interrupted.

3. The method according to claim 2, characterized in that The determining, based on the return status of the link response message, whether the connection between the first network device and the third network device is interrupted includes: When a link response message returned by the third network device is received within the first period, determining that the first network device and the third network device are connected; Alternatively, when no link response message returned by the third network device is received within the first period, it is determined that the connection between the first network device and the third network device is interrupted.

4. The method according to claim 2 or 3, characterized in that Before sending the link detection message to the third network device, the method further includes: Acquire a loop detection message, where the loop detection message is transmitted along the ring network, and a source node and a destination node of the loop detection message are the same network device on the ring network; The loop detection message is copied to obtain the link detection message.

5. The method according to any one of claims 1 to 4, characterized in that: The determining of path information between the first network device and the second network device includes: In a case where the first network device includes the choke point, determining that the path information indicates that the second path includes the choke point; Alternatively, in a case where the first network device does not include the blocking point, the path information is determined according to a reception condition of a loop detection message sent by the network device including the blocking point in the ring network.

6. The method according to claim 5, characterized in that The determining of the path information according to the reception status of the loop detection message includes: If the loop detection message is not received within the second period, determining that the path information indicates that the second path does not include the blocking point; Alternatively, when the loop detection message is received within the second period, it is determined that the path information indicates that the second path includes the blocking point.

7. The method according to claim 5 or 6, characterized in that The loop detection message includes a first detection message and a second detection message, and the first detection message and the second detection message are transmitted along different transmission directions through different ports of the network device including the blocking point.

8. The method according to any one of claims 1 to 7, characterized in that: The blocking point is configured to discard the reference message when receiving the reference message transmitted in a loopback manner.

9. A message sending device, characterized in that: The apparatus is applied to a first network device, and includes: a determining module, configured to determine path information between the first network device and the second network device when a first path in a ring network is interrupted, the ring network further comprising a connected second path, the first network device and the second network device being end-side devices of the first path and the second path; The sending module is configured to send the reference message through the second path when the path information indicates that the second path includes the blocking point, and the blocking point is used to restrict loopback transmission of the reference message on the second path.

10. The device according to claim 9, characterized in that The first path further includes a third network device adjacent to the first network device, the interruption of the first path includes an interruption of the connection between the first network device and the third network device, and the sending module is further configured to send a link detection message to the third network device, wherein the link detection message is configured to trigger the third network device to return a link response message to the first network device; The determining module is further configured to determine whether the connection between the first network device and the third network device is interrupted based on the return status of the link response message.

11. The device according to claim 10, characterized in that The determination module is configured to determine that the first network device and the third network device are connected when a link response message returned by the third network device is received within the first cycle; or to determine that the connection between the first network device and the third network device is interrupted when no link response message returned by the third network device is received within the first cycle.

12. The device according to claim 10 or 11, characterized in that The device also includes: an acquisition module, used to acquire a loop detection message, the loop detection message is transmitted along the ring network, and the source node and destination node of the loop detection message are the same network device on the ring network; copy the loop detection message to obtain the link detection message.

13. The device according to any one of claims 9 to 12, characterized in that: The determining module is configured to, when the first network device includes the blocking point, determine that the path information indicates that the second path includes the blocking point; or, when the first network device does not include the blocking point, determine the path information based on a reception status of a loop detection message, wherein the loop detection message is sent by the network device including the blocking point in the ring network.

14. The device according to claim 13, characterized in that The determining module is configured to, if the loop detection message is not received within the second period, determine that the path information indicates that the second path does not include the blocking point; or, if the loop detection message is received within the second period, determine that the path information indicates that the second path includes the blocking point.

15. The device according to claim 13 or 14, characterized in that The loop detection message includes a first detection message and a second detection message, and the first detection message and the second detection message are transmitted along different transmission directions through different ports of the network device including the blocking point.

16. The device according to any one of claims 9 to 15, characterized in that: The blocking point is configured to discard the reference message when receiving the reference message transmitted in a loopback manner.

17. A message sending device, characterized in that: The device includes a processor, and the processor is used to load and execute at least one instruction, so that the message sending device implements the message sending method according to any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement the message sending method according to any one of claims 1 to 8.

19. A chip, characterized in that: The chip includes a processor, and the processor is used to run program instructions or codes, so that the device including the chip executes the message sending method according to any one of claims 1 to 8.

20. A computer program product, characterized in that The computer program product includes a computer program / instruction, and the computer program / instruction is executed by a processor to enable a computer to execute the message sending method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for fault detection and convergence of Ethernet and node apparatus

    CN101207521A

  • Failure detection method, system, and main node in Ethernet loop network

    CN101212366A

  • Network communication method and system

    CN103036782A

  • Method and device for loop discovery, space reuse and protection conversion in MAC bridge connecting network

    CN1645834A

  • Protection switching method and device for ring network

    WO2018171745A1