Communication network protection method, communication node, and communication system

WO2025214294A8PCT designated stage Publication Date: 2025-12-04HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/087518
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-12
Filing Date
2025-04-07
Publication Date
2025-12-04

AI Technical Summary

Technical Problem

Existing ring network protection protocols have a long switching time when a fault occurs and cannot effectively handle gray faults, resulting in reduced network availability.

Method used

A dual network fault detection mechanism is adopted, and two master nodes are configured to detect network faults respectively. When one master node fails, the other master node will take on the detection and notification work, reducing the switching time. At the same time, gray faults are judged by detecting the ratio of the number of frames to avoid unnecessary switching.

Benefits of technology

It significantly reduces failover time, improves network availability and reliability, and reduces equipment costs and implementation complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025087518_04122025_PF_FP_ABST
    Figure CN2025087518_04122025_PF_FP_ABST
Patent Text Reader

Abstract

A communication network protection method, a communication node, and a communication system. The method comprises: a first primary node receiving a first detection frame, wherein the first detection frame is from the first primary node or a second primary node, the first primary node and the second primary node are two primary nodes among a plurality of primary nodes in a communication network that are used for detecting a network fault, and the communication network is a ring network; the first primary node diagnosing a network fault of the communication network on the basis of the first detection frame; and when it is detected, by means of diagnosis, that a network fault has occurred on the communication network, the first primary node sending a fault notification, wherein the network fault comprises a fault occurring on the second primary node. By means of the solution, the switchover time caused by a fault can be shortened, thereby rapidly restoring network communication.
Need to check novelty before this filing date? Find Prior Art

Description

Communication network protection method, communication node and system

[0001] The present application claims priority to the Chinese patent application No. 202410444371.2, filed on April 12, 2024, with the State Intellectual Property Office of China, and entitled "Communication network protection method, communication node and system", 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 communication network protection method, a communication node and a system. BACKGROUND

[0003] With the rapid development of Internet information technology (IT), Ethernet technology gradually penetrates into the industrial control field with the advantages of flexible and rapid networking, realizing the rapid and reliable transmission of industrial data, and helping the rapid development of industrial operation technology (OT). The high reliability requirements of Ethernet communication scenarios and industrial scenarios require that the network can quickly and automatically recover communication after a fault occurs, without affecting production. Ring network switching is the most widely used network protection mechanism, which can recover communication after a network fault occurs. How to reduce the switching time caused by the fault is a technical problem that needs to be solved by personnel in the field. SUMMARY

[0004] The present application provides a communication network protection method, a communication node and a system, which can reduce the switching time caused by the fault and quickly recover network communication.

[0005] In a first aspect, the present application provides a communication network protection method, which comprises: a first master node receiving a first detection frame; diagnosing a network fault of the communication network based on the first detection frame; and in the case of diagnosing that the communication network has a network fault, the first master node sending a fault notification; the network fault includes a fault of a second master node. The aforementioned first detection frame is from the aforementioned first master node or the second master node, and the aforementioned first master node and the aforementioned second master node are two master nodes in a plurality of master nodes in the communication network for detecting network faults; the communication network is a ring network.

[0006] Exemplarily, the first master node and the second master node exist in the communication network at the same time.

[0007] Exemplarily, the aforementioned diagnosing a network fault of the communication network based on the first detection frame can comprise judging whether there is a network fault in the communication network based on the first detection frame.

[0008] Exemplarily, if the first detection frame is from the second master node, a source media access control (MAC) address in the first detection frame is a MAC address of the second master node.

[0009] In the scheme, two master nodes are configured in the communication network, and each of the two master nodes can detect whether a fault occurs in the communication network. In a case where one of the master nodes fails, the other master node can undertake the work of fault detection and notification, so that other nodes in the communication network can quickly switch to restore communication of the communication network. Thus, switching time caused by the fault is greatly reduced. In addition, for the scheme in which the first detection frame is from the second master node, a blocked port does not need to be configured to receive and process the detection frame, thereby saving configuration cost. Compared with the existing DRP scheme, each node does not need to have the capability of sending a ring network integrity detection frame as a master node, thereby reducing performance requirements and cost of the device, and a complex time synchronization algorithm does not need to be configured. The implementation complexity of the scheme is reduced.

[0010] In a possible implementation, the first master node and the second master node are two master nodes that are adjacently connected in the communication network, and the blocked port in the communication network is any one of ports through which the first master node and the second master node access the communication network.

[0011] Optionally, the blocked port of the first master node is connected to the second master node, and / or the blocked port of the second master node is connected to the first master node.

[0012] In the scheme, the two master nodes are adjacently connected. In the implementation in which the first detection frame is from the second master node, a detection frame sent by one master node is received and processed by the other master node, without being forwarded back to the master node that sends the detection frame. That is, the two blocked ports do not need to be additionally configured to receive and process the detection frame, thereby saving configuration cost and implementation complexity. In the implementation in which the first detection frame is from the first master node, a detection frame sent by each master node is received and processed by the master node itself. The same effect of undertaking the work of fault detection and notification by one of the master nodes in a case where the master node fails, so that other nodes in the communication network can quickly switch to restore communication of the communication network, thereby greatly reducing switching time caused by the fault, can be achieved.

[0013] In a possible implementation, the method further includes: sending, by the first master node, a second detection frame, where the second detection frame is used by the second master node to diagnose a network fault of the communication network.

[0014] Exemplarily, the source MAC address in the second detection frame is the MAC address of the first master node.

[0015] In the foregoing scheme, the double network fault detection mechanism is provided, and the single master control risk of the existing master-slave communication network is solved. That is, in the case where one of the master nodes fails, the other master node can undertake the work of fault detection, so that the network fault can be quickly found. In addition, the double network fault detection mechanism can also improve the detection reliability.

[0016] In a possible implementation, the communication network further comprises one or more slave nodes; the first master node and the second master node are further connected with the one or more slave nodes; and the first detection frame is from the first master node.

[0017] Exemplarily, the blocked port of the first master node is connected with one of the one or more slave nodes; or the blocked port of the second master node is connected with one of the one or more slave nodes.

[0018] In the foregoing scheme, the two master nodes in the communication network are not adjacent. In this scheme, the detection frame sent by each master node is received and processed by itself. Similarly, in the case where one of the master nodes fails, the other master node can undertake the work of fault detection and notification, so that the other nodes in the communication network can quickly switch to restore the communication of the communication network, thereby greatly reducing the switching time caused by the fault.

[0019] In a possible implementation, the first detection frame comprises one or more detection frames received by the first master node within a preset time interval; and the first master node diagnoses the network fault of the communication network based on the first detection frame, comprising: the first master node diagnoses the network fault of the communication network based on the number of detection frames in the first detection frame and a preset detection frame number; and the preset detection frame number is the number of detection frames expected to be received within the preset time interval.

[0020] In the foregoing scheme, whether a fault occurs is determined based on the actual number of detection frames received by the master node and the expected number of detection frames. Compared with the prior scheme in which a fault is determined to occur when no detection frame is received within a timeout, the present scheme can not only detect network faults, but also reduce the risk of false detection of faults and detect gray network faults. For example, when the link state in the ring network is poor and causes frequent packet loss, although a small number of detection frames are received within the first time interval. However, since the number of received detection frames does not meet the preset condition, it can be diagnosed that there is a gray network fault. Thus, the ring network switching can be triggered to avoid using the path with frequent packet loss to cause data loss. Conversely, if the link loses a small number of packets, some detection frames may be lost, but the link is quickly restored and does not affect normal data transmission. In this case, even if a small number of detection frames are lost, the number of detection frames received by the master node within the first time interval still meets the preset condition, and the network fault is not diagnosed. Thus, unnecessary ring network switching is avoided, and the availability of the network is improved.

[0021] In a possible implementation, the first master node diagnoses a network fault of the communication network based on the number of detection frames in the first detection frame and a preset number of detection frames, including: the first master node calculates a ratio of the number of detection frames in the first detection frame to the preset number of detection frames; and in a case where the ratio is less than a threshold value, the first master node diagnoses that the communication network has a network fault.

[0022] In the foregoing scheme, by comparing the ratio of the actual number of detection frames received by the master node to the expected number of detection frames with a threshold value, a gray network fault can be intuitively diagnosed, thereby avoiding unnecessary ring network switching and improving the availability of the network. In specific implementation, not limited to this implementation, for example, whether a network fault occurs can be determined by directly comparing the actual number of detection frames received with the expected number of detection frames.

[0023] In a possible implementation, the method further includes: in a case where it is diagnosed that the communication network has a network fault, the first master node clears the forwarding table item of the first master node, and opens a blocked port.

[0024] In the foregoing scheme, after the master node detects a network fault, the forwarding table item of the master node also needs to be cleared to relearn the route, and the blocked port is opened to smoothly complete the path switching.

[0025] In a second aspect, the present application provides a communication network protection method, which is applied to a slave node in a communication network, the communication network is a ring network, and the communication network comprises a first master node and a second master node for detecting network failure; the method comprises: in the case that network failure occurs in the communication network, the slave node receives a failure notification from the first master node; the network failure comprises failure of the second master node; and the slave node clears forwarding table entries of itself based on the failure notification.

[0026] In a possible implementation, the first master node and the second master node are two master nodes that are connected adjacently in the communication network; a blocked port of the first master node is connected to the second master node, and / or a blocked port of the second master node is connected to the first master node.

[0027] In a possible implementation, the communication network further comprises one or more slave nodes; and the one or more slave nodes are further connected between the first master node and the second master node.

[0028] In a possible implementation, a blocked port of the first master node is connected to a first node of the one or more slave nodes, or a blocked port of the second master node is connected to a second node of the one or more slave nodes.

[0029] In a possible implementation, the method further comprises: the slave node receives a first detection frame; the first detection frame comprises one or more detection frames from the first master node and / or the second master node; the slave node diagnoses network failure of the communication network based on the first detection frame; and the slave node clears forwarding table entries of itself in the case that the slave node diagnoses that network failure occurs in the communication network.

[0030] In the above scheme, the slave node can diagnose whether network failure occurs based on the received detection frame, and can directly clear forwarding table entries of itself in the case that network failure is diagnosed, without waiting for the master node to announce the failure, thereby further reducing ring network switching time.

[0031] In a possible implementation, the first detection frame comprises detection frames received by the slave node within a preset time interval; and the slave node diagnoses network failure of the communication network based on the first detection frame, which comprises: the slave node diagnoses network failure of the communication network based on a number of detection frames in the first detection frame and a preset number of detection frames; and the preset number of detection frames is a number of detection frames expected to be received within the preset time interval.

[0032] In a possible implementation, the slave node diagnoses the network fault of the communication network based on the number of detection frames in the first detection frame and a preset number of detection frames, including: the slave node calculates a ratio of the number of detection frames in the first detection frame to the preset number of detection frames; and in a case where the ratio is less than a threshold, the slave node diagnoses that the communication network has a network fault.

[0033] In a third aspect, the present application provides a communication network protection method, including: a second master node sends a first detection frame; the first detection frame is used by a first master node to diagnose a network fault of a communication network, and the network fault includes a fault of the second master node; the first master node and the second master node are two master nodes in the communication network for detecting the network fault; and the communication network is a ring network.

[0034] Optionally, the first master node and the second master node are two master nodes that are adjacently connected in the communication network; and the blocked port in the communication network is any one of ports through which the first master node and the second master node access the communication network.

[0035] Optionally, a blocked port of the first master node is connected to the second master node, and / or a blocked port of the second master node is connected to the first master node.

[0036] In the above scheme, two master nodes are configured in the communication network, and both of the master nodes can detect whether the communication network has a fault; in a case where one of the master nodes has a fault, the other master node can take over the work of fault detection and notification, so that other nodes in the communication network can quickly perform switching to restore communication of the communication network. Therefore, the switching time caused by the fault is greatly reduced. In addition, in the scheme, the detection frame sent by one master node is received and processed by the other master node, and there is no need to configure a blocked port to receive and process the detection frame, thereby saving the configuration cost. Moreover, compared with the existing DRP scheme, each node does not need to have the ability to send a ring network integrity detection frame as a master node, thereby reducing the performance requirement and cost of the device, and there is no need to configure a complex time synchronization algorithm. The implementation complexity of the scheme is reduced.

[0037] In a possible implementation, the method further includes: the second master node receives a second detection frame from the first master node or the second master node, and the second detection frame is used by the second master node to diagnose the network fault of the communication network.

[0038] In the scheme, the double network fault detection mechanism is provided, and the single master control risk of the existing master-slave communication network is solved. That is, in the case where one of the master nodes fails, the other master node can take on the work of fault detection, so that the network fault can be quickly found. In addition, the double network fault detection mechanism can also improve the detection reliability.

[0039] In a fourth aspect, the present application provides a communication node, comprising:

[0040] a receiving unit configured to receive a first detection frame; the first detection frame is from a first master node or a second master node, the first master node and the second master node are two master nodes in a plurality of master nodes in a communication network for detecting network faults; the communication network is a ring network;

[0041] a processing unit configured to diagnose a network fault of the communication network based on the first detection frame;

[0042] a sending unit configured to send a fault notification in the case where the network fault of the communication network is diagnosed; the network fault includes a fault of the second master node.

[0043] In a possible implementation, the first master node and the second master node are two master nodes connected adjacently in the communication network, a blocked port of the first master node is connected with the second master node, and / or a blocked port of the second master node is connected with the first master node.

[0044] In a possible implementation, the sending unit is further configured to send a second detection frame, the second detection frame is used for the second master node to diagnose the network fault of the communication network.

[0045] In a possible implementation, the communication network further comprises one or more slave nodes; the one or more slave nodes are further connected between the first master node and the second master node; the first detection frame is from the first master node.

[0046] In a possible implementation, a blocked port of the first master node is connected with one of the one or more slave nodes; or a blocked port of the second master node is connected with one of the one or more slave nodes.

[0047] In a possible implementation, the first detection frame comprises one or more detection frames received by the first master node within a preset time interval; the processing unit is specifically configured to diagnose the network fault of the communication network based on a number of detection frames in the first detection frame and a preset number of detection frames; the preset number of detection frames is a number of detection frames expected to be received within the preset time interval.

[0048] In a possible implementation, the processing unit is specifically configured to: calculate a ratio of a number of detection frames in the first detection frame to the preset number of detection frames; and diagnose that the communication network has a network fault in a case where the ratio is less than a threshold.

[0049] In a possible implementation, the processing unit is further configured to: in a case where it is diagnosed that the communication network has a network fault, empty the forwarding table item of the processing unit, and open the blocked port.

[0050] In a possible implementation, the source MAC address in the first detection frame is a MAC address of the second master node.

[0051] In a fifth aspect, the present application provides a communication node, which comprises:

[0052] a receiving unit configured to receive a fault notification from the first master node in a case where the communication network has a network fault; the network fault comprises a fault of the second master node;

[0053] a processing unit configured to empty a forwarding table item of the processing unit based on the fault notification.

[0054] In a possible implementation, the first master node and the second master node are two master nodes that are adjacently connected in the communication network, the blocked port of the first master node is connected with the second master node, and / or the blocked port of the second master node is connected with the first master node.

[0055] In a possible implementation, the communication network further comprises one or more slave nodes; the one or more slave nodes are further connected between the first master node and the second master node.

[0056] In a possible implementation, the blocked port of the first master node is connected with a first node of the one or more slave nodes, or the blocked port of the second master node is connected with a second node of the one or more slave nodes.

[0057] In a possible implementation, the receiving unit is further configured to receive a first detection frame; the first detection frame comprises one or more detection frames from the first master node and / or the second master node.

[0058] The processing unit is further configured to diagnose a network fault of the communication network based on the first detection frame; and in a case where it is diagnosed that the communication network has a network fault, empty the forwarding table item of the processing unit.

[0059] In a possible implementation, the first detection frame comprises detection frames received by the slave node within a preset time interval; the processing unit is specifically configured to:

[0060] diagnose a network fault of the communication network based on the number of detection frames in the first detection frame and a preset number of detection frames; the preset number of detection frames is a number of detection frames expected to be received in the preset time interval.

[0061] In a possible implementation, the processing unit is specifically configured to: calculate a ratio of the number of detection frames in the first detection frame to the preset number of detection frames; and diagnose that the communication network has a network fault in a case where the ratio is less than a threshold.

[0062] In a sixth aspect, the present application provides a communication node, comprising:

[0063] a sending unit configured to send a first detection frame; the first detection frame is used by a first master node to diagnose a network fault of a communication network, and the network fault includes a fault of a second master node; the first master node and the second master node are two master nodes in the communication network for detecting a network fault; and the communication network is a ring network.

[0064] Optionally, the first master node and the second master node are two master nodes adjacent to each other in the communication network; and a blocked port in the communication network is any one of ports through which the first master node and the second master node access the communication network.

[0065] Optionally, a blocked port of the first master node is connected to the second master node, and / or a blocked port of the second master node is connected to the first master node.

[0066] In a possible implementation, the communication node further comprises a receiving unit configured to receive a second detection frame from the first master node or the second master node, and the second detection frame is used by the second master node to diagnose a network fault of the communication network.

[0067] In a seventh aspect, the present application provides a communication node, comprising a processor configured to implement the method in any one of the first aspect.

[0068] In a possible implementation, the communication node can further comprise a memory and a communication interface. The memory is coupled to the processor, and the processor, when executing computer programs or computer instructions stored in the memory, can implement the method described in any one of the first aspect. The communication interface is used for the communication node to communicate with other devices (for example, other communication nodes in the same communication system). Exemplarily, the communication interface can be a transceiver, a circuit, a bus, a module or other types of communication interfaces.

[0069] In an eighth aspect, the present application provides a communication node, comprising a processor configured to implement the method in any one of the second aspect.

[0070] In a possible implementation, the communication node can further include a memory and a communication interface. The memory is coupled to the processor, and the processor, when executing the computer program or computer instructions stored in the memory, can implement the method described in any of the second aspect. The communication interface is configured to enable the communication node to communicate with other devices (e.g., other communication nodes in the same communication system), and the communication interface can be, for example, a transceiver, a circuit, a bus, a module, or another type of communication interface.

[0071] In a ninth aspect, the present application provides a communication node, which includes a processor configured to implement the method described in any of the third aspect.

[0072] In a possible implementation, the communication node can further include a memory and a communication interface. The memory is coupled to the processor, and the processor, when executing the computer program or computer instructions stored in the memory, can implement the method described in any of the third aspect. The communication interface is configured to enable the communication node to communicate with other devices (e.g., other communication nodes in the same communication system), and the communication interface can be, for example, a transceiver, a circuit, a bus, a module, or another type of communication interface.

[0073] In a tenth aspect, the present application provides a communication system, which includes a first master node, a second master node, and one or more slave nodes; the first master node is configured to implement the method described in any of the first aspect, the slave node is configured to implement the method described in any of the second aspect, and the second master node is the second master node in the method described in any of the first aspect to the third aspect.

[0074] In an eleventh aspect, the present application provides a computer-readable storage medium, which stores a computer program or computer instructions, and the computer program or computer instructions, when executed by a processor, implement the method described in any of the first aspect.

[0075] In a twelfth aspect, the present application provides a computer-readable storage medium, which stores a computer program or computer instructions, and the computer program or computer instructions, when executed by a processor, implement the method described in any of the second aspect.

[0076] In a thirteenth aspect, the present application provides a computer-readable storage medium, which stores a computer program or computer instructions, and the computer program or computer instructions, when executed by a processor, implement the method described in any of the third aspect.

[0077] In a fourteenth aspect, an embodiment of the present application provides a computer program product, which, when executed by a processor, causes the method of any one of the first aspect to be implemented.

[0078] In a fifteenth aspect, an embodiment of the present application provides a computer program product, which, when executed by a processor, causes the method of any one of the second aspect to be implemented.

[0079] In a sixteenth aspect, an embodiment of the present application provides a computer program product, which, when executed by a processor, causes the method of any one of the third aspect to be implemented.

[0080] In a seventeenth aspect, an embodiment of the present application provides a chip system, which includes a processor for supporting a communication node to implement the method of any one of the first aspect. In a possible design, the chip system can further include a memory, which is configured to store necessary program instructions and data for the communication node. The chip system can be composed of a chip, or can include the chip and other discrete devices.

[0081] In an eighteenth aspect, an embodiment of the present application provides a chip system, which includes a processor for supporting a communication node to implement the method of any one of the second aspect. In a possible design, the chip system can further include a memory, which is configured to store necessary program instructions and data for the communication node. The chip system can be composed of a chip, or can include the chip and other discrete devices.

[0082] In a nineteenth aspect, an embodiment of the present application provides a chip system, which includes a processor for supporting a communication node to implement the method of any one of the third aspect. In a possible design, the chip system can further include a memory, which is configured to store necessary program instructions and data for the communication node. The chip system can be composed of a chip, or can include the chip and other discrete devices.

[0083] The solutions provided by the fourth aspect to the nineteenth aspect are used for implementing or assisting in implementing the method provided in the first aspect, the second aspect or the third aspect, and thus can achieve the same or corresponding beneficial effects as the method provided in the first aspect, the second aspect or the third aspect. Here, no further elaboration is made. BRIEF DESCRIPTION OF DRAWINGS

[0084] FIG. 1 and FIG. 2 are schematic diagrams of a ring communication network.

[0085] FIG. 3 to FIG. 6 are schematic diagrams of structures of communication systems provided by embodiments of the present application.

[0086] FIG. 7 and FIG. 7A are schematic diagrams of method flows provided by embodiments of the present application.

[0087] FIG. 8 and FIG. 9 are schematic diagrams of frame detection paths according to an embodiment of the present application.

[0088] FIG. 9A, FIG. 9B, FIG. 9C and FIG. 9D are schematic diagrams of interaction processes according to an embodiment of the present application.

[0089] FIG. 10 to FIG. 12 are schematic diagrams of structures of communication nodes according to an embodiment of the present application. DETAILED DESCRIPTION

[0090] In the embodiments of the present application, "multiple" refers to two or more than two. In the embodiments of the present application, "and / or" is used to describe the association relationship of the associated objects, which means three independent relationships, for example, A and / or B, which means A exists alone, B exists alone, or A and B exist together. The description such as "at least one of a1, a2, … and an (or at least one)" adopted in the embodiments of the present application includes any one of a1, a2, … and an exists alone, and also includes any combination of a1, a2, … and an exists together, each case can exist alone; for example, the description of "at least one of a, b and c" includes the cases of a alone, b alone, c alone, a and b combination, a and c combination, b and c combination, or abc three combination.

[0091] In the present application, the terms "first", "second", and the like are used to distinguish between the same or similar items with substantially the same function and purpose, and it should be understood that there is no logical or time sequence relationship between "first", "second", "n", and the quantity 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.

[0092] In various embodiments of the present application, the terms and / or descriptions between various embodiments are consistent and can be mutually referred to if there is no special description and logical conflict. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationship.

[0093] First, introduce the technical terms related to the embodiments of the present application.

[0094] 1. Ring network (abbreviated as ring network).

[0095] A ring network is a network in which each communication node is connected together using a continuous ring. In a ring network, it is guaranteed that a signal sent from one communication node can be received by all other communication nodes in the ring. For the purpose of understanding, reference can be made to Fig. 1. Fig. 1 shows a schematic diagram of a ring network using four communication nodes as an example. It can be understood that Fig. 1 is merely an example and does not limit the embodiments of the present application.

[0096] By way of example, the communication node can be a network device such as a switch, a router or a network access device, and the embodiments of the present application do not limit the communication node.

[0097] 2. Ring network storm.

[0098] Since the communication nodes in a ring network are directly connected in a loop, if no control is applied (for example, no ring network protection protocol is deployed), the data packets broadcast by the communication nodes will be duplicated in the broadcast domain, which will cause a large amount of broadcast data in the network, large-scale consumption of link bandwidth, and failure of the normal data to be effectively transmitted, resulting in occupation of the resources of the communication nodes and causing the communication nodes to be dead. This is a ring network storm.

[0099] 3. Ring network protection protocol and concepts defined by the protocol.

[0100] The ring network protection protocol is a link layer protocol applied to a ring network. It can prevent a ring network storm caused by a data loop when the ring network is complete. When a link in the ring network is disconnected, the ring network protection protocol can quickly enable a backup link to ensure the maximum connectivity of the ring network, i.e., to implement ring network switching.

[0101] The ring network protection protocol defines a master node and a slave node of the ring network. The master node is the initiator of the active detection mechanism of the ring network, i.e., is used to detect faults in the network. In addition, the master node is also the decision maker for performing operations after a change in the network topology. For example, after a fault occurs in the network, the master node notifies other nodes to perform network switching. The communication nodes in the ring network other than the master node are slave nodes. The slave nodes can be used to forward data packets or ring network protection protocol packets.

[0102] The ring network protection protocol also defines a blocked port and a forwarding port. One port of the master node of the ring network is blocked and cannot be used to forward data packets. This blocked port is called a blocked port or an isolated ring port. The blocked port is a break point in the ring network and can avoid a ring network storm. The forwarding port is a port of the communication node of the ring network used to forward any traffic (for example, including data packets and / or ring network protection protocol packets).

[0103] Exemplarily, the blocking port can be configured to not forward any message or only forward detection frames in the case of no failure of the ring network. Or exemplarily, in the case of failure of the ring network, the blocking port can be configured to be opened so that the blocking port can forward failure notification.

[0104] 4. Ring network detection mechanism at path level and detection mechanism at link level.

[0105] The ring network detection mechanism at path level refers to that a detection frame is sent by a master node of the ring network. After being forwarded by communication nodes on the ring network, the detection frame is transmitted back to the master node, so as to realize failure detection of the ring network.

[0106] The detection mechanism at link level refers to that a detection frame is sent by two adjacent communication nodes on the ring network, and is not forwarded to other nodes, so as to realize failure detection of adjacent nodes.

[0107] 5. Gray failure.

[0108] The gray failure refers to an abnormal packet loss failure caused by a hardware problem, without complete failure of a link or a communication node.

[0109] Before introducing the scheme provided in the present application, exemplary introduction is made to the technical problem to be solved by the present application.

[0110] The most mainstream ring network protection protocol at present is media redundancy protocol (MRP). In the scheme for ring network protection based on MRP, one communication node in the ring network is configured as a master node, and other communication nodes in the ring network are slave nodes. The master node blocks an access port of the ring network (forms a blocking port) to avoid ring network storm, and periodically sends a ring network integrity detection frame MRP_Test to two ports of the ring network. The detection frame can be a protocol message defined in MRP, and is used to detect whether a failure occurs in the ring network. This detection can be referred to as ring network detection at path level. For ease of understanding, exemplary reference can be made to FIG. 2. In FIG. 2, three slave nodes are exemplarily shown. It is assumed that ports of the master node accessing the ring network are port 1 and port 2. Optionally, in a specific implementation, the master node can include more ports, and the embodiments of the present application do not limit this. Among them, the port 1 is a blocking port of the master node, and the port 2 is a forwarding port of the master node. After configuration, the port 1 can be used to receive and send detection frames. Based on this, the master node can periodically send detection frames to the port 1 and the port 2.

[0111] If the master node does not receive its own detection frame within a certain time, it considers that a network failure occurs on the ring network. Then, the master node can open its blocked port and send a failure notification to other communication nodes on the ring network, so that other communication nodes clear the forwarding table entries and complete ring network switching. Exemplarily, the failure notification can be, for example, an MRP topology change message.

[0112] In addition, in the scheme of ring network protection based on MRP, the slave nodes also periodically send link-level detection messages to each other to detect failures, such as sending continuity check messages (CCM). If a slave node detects that the CCM message of a neighbor is lost, it considers that the neighbor fails and sends an MRP link change message to notify the master node. The master node receiving the MRP link change message can choose to trust and directly send an MRP topology change message to notify other nodes to clear the forwarding table entries and complete ring network switching. Alternatively, after receiving the MRP link change message, the master node can also choose to quickly send three detection frames to detect the ring network. If the detection frames are lost, it is confirmed that a failure occurs, and other nodes are notified to perform failure switching.

[0113] In the above-mentioned scheme of ring network protection based on MRP, on the one hand, after a network failure occurs, the master node mainly sends a failure notification. If the master node fails, a new master node needs to be re-elected, and the new master node needs to re-detect the failure before sending a failure notification to clear the table entries. The recovery time of the master node re-election and re-detection is greatly increased. On the other hand, the failure detection mechanism of MRP cannot handle gray failures such as abnormal packet loss. Specifically, the master node is provided with a timeout timer for ring network detection frames. If the timer times out without receiving the ring network detection frame, it is considered that a failure occurs. However, when the link state in the ring network is poor and causes frequent packet loss, the ring network detection frame is normally received within the Timeout time. Ring network switching is not triggered, and the path with frequent packet loss is continued to be used, resulting in data loss. Conversely, if the link loses a small amount of packets, the ring network detection frame is lost, and the link is quickly recovered, unnecessary switching is triggered, and the availability is reduced.

[0114] Another ring network protection protocol is distributed redundancy protocol (DRP). The ring network detection mechanism of DRP is similar to MRP, both of which adopt path-level ring network detection mechanism and link-level detection mechanism. Only DRP does not have a fixed master node, but all communication nodes take turns as master node. If the master node does not receive the detection frame sent by itself within a certain time, it is considered to be faulty. At the same time, each slave node sends a link check message to the adjacent node within a fixed time. After each slave node receives the link check message from the adjacent node, it stops forwarding the message and feeds back the working status, port and health status of itself to the adjacent node. If the slave node does not receive the link check message from the adjacent node within a specified time, it considers that the adjacent node is faulty.

[0115] In the ring network protection scheme of DRP, each node requires the ability to send ring network integrity detection frames as a master node, so the device requires high and the cost is also high. In addition, the algorithm of taking turns as a master node to send detection frames depends on IEEE 1588 time synchronization, and the implementation is relatively complex. In addition, if the master node fails, it needs to wait for the next master node to detect the failure again, which greatly increases the recovery time.

[0116] Based on the above introduction, in order to reduce the switching time caused by failure, the embodiments of the present application provide a communication network protection method, a communication node and a communication system.

[0117] First, the communication system provided by the embodiments of the present application is introduced. The communication system can be a ring communication network. The communication system can include two master nodes and one or more slave nodes. That is, the communication system is configured with two master nodes. The two master nodes can be used to detect network failure in the ring network. The two master nodes can be adjacent or non-adjacent. In order to facilitate understanding, the following examples are introduced in combination with FIG. 3 to FIG. 6.

[0118] Exemplarily, in one possible implementation, referring to FIG. 3, a schematic diagram of a communication system in which two master nodes are adjacently connected is shown. As can be seen in FIG. 3, the communication system is a ring network, which includes master node 301 and master node 302 and includes one or more slave nodes. In FIG. 3, four slave nodes (slave node 303, slave node 304, slave node 305 and slave node 306) are shown as an example. The master node 301 and the master node 302 are adjacently connected. The blocked port of the master node 301 and the blocked port of the master node 302 are connected. Specifically, as shown in FIG. 3, the ports of the master node 301 connected to the ring network are port 1 and port 2. The ports of the master node 302 connected to the ring network are port 3 and port 4. The port 1 and the port 3 are connected. The port 1 and the port 3 can be configured as blocked ports. The port 2 and the port 4 are forwarding ports.

[0119] Exemplarily, in another possible implementation, referring to FIG. 3, only one of the two ports connected by the master node 301 and the master node 302 can be blocked. That is, only the port 1 of the master node 301 can be configured as a blocked port, or only the port 3 of the master node 302 can be configured as a blocked port. For example, referring to FIG. 4, only the port 1 of the master node 301 is configured as a blocked port is shown as an example.

[0120] Exemplarily, referring to FIG. 5, a schematic diagram of a communication system in which two master nodes are non-adjacently connected is shown. As can be seen in FIG. 5, the communication system is a ring network, which includes two master nodes (master node 501 and master node 502) and includes one or more slave nodes. In FIG. 5, five slave nodes (slave node 503, slave node 504, slave node 504 and slave node 506) are shown as an example. The difference is that the master node 501 and the master node 502 are non-adjacently connected. There are one or more slave nodes connected between the master node 501 and the master node 502. For example, in FIG. 5, the slave node 503 and the slave node 504 are connected between the master node 501 and the master node 502; in addition, the slave node 505 and the slave node 506 are also connected between the master node 501 and the master node 502.

[0121] One of the master node 501 or the master node 502 can be configured as a blocked port. It is assumed that the ports of the master node 501 connected to the ring network are port 1 and port 2; the ports of the master node 502 connected to the ring network are port 3 and port 4. The port 1 and the port 2 are connected to the slave node 503 and the slave node 506 respectively. The port 3 and the port 4 are connected to the slave node 504 and the slave node 505 respectively. One of the port 1, the port 2, the port 3 and the port 4 can be selected and configured as a blocked port. For example, in FIG. 5, the port 1 of the master node 501 is configured as a blocked port is shown as an example. Alternatively, referring to FIG. 6, the port 3 of the master node 501 is configured as a blocked port is shown as an example.

[0122] It can be understood that the blocked port in the ring communication network described above can be any one of the ports of the two master nodes accessing the communication network. The communication system shown in FIGS. 3 to 6 and the location of the blocked port are only examples and do not constitute a limitation on the embodiments of the present application. In addition, the ring network communication system provided by the embodiments of the present application is exemplarily not limited to two master nodes, but can also be more than two. The embodiments of the present application mainly take two master nodes as an example for introduction.

[0123] Exemplarily, the master node can be used to detect network faults in the ring network. The slave node can be used to forward messages or detect network faults.

[0124] Exemplarily, the master node and the slave node in the embodiments can include but are not limited to switches, routers, terminal devices, servers, computer cards with switching capabilities, office equipment, industrial equipment, vehicles, communication nodes in vehicles, robots or smart home devices, etc. The computer card with switching capabilities can include a central processing unit (CPU), a graphics processing unit (GPU), a neural network processing unit (NPU) and the like extensible processing unit (XPU). The office equipment may, for example, include a desktop computer, a fax machine, a printer, a copier, a projector, a paper shredder, a scanner, an attendance machine, a binding machine, etc. The industrial equipment may, for example, include production and processing equipment, assembly line equipment or quality inspection equipment, etc. The communication node in the vehicle may, for example, include air conditioning, audio, display screen, microphone or camera in the vehicle, etc. The smart home device may, for example, include air conditioning, refrigerator, washing machine, audio, television, camera, smoke alarm, lighting device and home robot, etc. It can be understood that the introduction of the master node and the slave node here is only an example and does not constitute a limitation on the embodiments of the present application.

[0125] Exemplarily, the scheme of the present application can be applied not only to the Ethernet communication scenario, but also to various industrial scenarios. For example, see Table 1 for exemplarily listing some industrial scenarios to which the embodiments of the present application can be applied.

[0126] Table 1

[0127] For ease of understanding, for example, the enterprise resource planning scenario in Table 1 is taken as an example. In this scenario, the master node and the slave node can be office equipment of an enterprise. The form of the office equipment can be seen in the foregoing description, which is not described herein. In a specific implementation, multiple office equipment of the enterprise can be built into a ring network topology to realize interactive communication. Then, the master node and the slave node can be configured in the ring network to detect network faults in the ring network.

[0128] For another example, the manufacturing planning scenario in Table 1 is taken as an example. In this scenario, the master node and the slave node can be industrial equipment such as production and processing equipment, assembly line equipment, or quality inspection equipment. In a specific implementation, multiple industrial equipment can be built into a ring network topology to realize interactive communication. Then, the master node and the slave node can be configured in the ring network to detect network faults in the ring network.

[0129] For another example, the automobile line control scenario in Table 1 is taken as an example. In this scenario, the master node and the slave node can be communication nodes in a vehicle. The form of the communication nodes in the vehicle can be seen in the foregoing description, which is not described herein. In a specific implementation, multiple communication nodes in the vehicle can be built into a ring network topology to realize interactive communication. Then, the master node and the slave node can be configured in the ring network to detect network faults in the ring network.

[0130] It can be understood that the scenarios shown in Table 1 are only examples and do not constitute a limitation on the embodiments of the present application.

[0131] In combination with the communication system provided by the embodiments of the present application, the embodiments of the present application provide a communication network protection method. For example, referring to FIG. 7, the method provided by the embodiments of the present application includes but is not limited to the following steps.

[0132] S701, the first master node receives a first detection frame, and the first detection frame is from the first master node or the second master node.

[0133] In a specific implementation, the first master node and the second master node are two master nodes of multiple master nodes in a communication network for detecting network faults. That is, the first master node and the second master node can both be used to send detection frames and can send a fault notification to other communication nodes in the communication network after detecting a network fault. For example, the detection frames (including the first detection frame) sent by the first master node and the second master node can be any type of packet, and the embodiments of the present application do not limit this.

[0134] The communication network is a network formed by the communication system provided by the embodiment of the application, i.e., the communication network is a ring network. For example, the communication network is a communication network formed by the communication system described in any one of FIG. 3 to FIG. 6. For example, the first master node and the second master node can be the master node 301 and the master node 302 in FIG. 3 or FIG. 4. Alternatively, the first master node and the second master node can be the master node 501 and the master node 502 in FIG. 5 or FIG. 6.

[0135] Therefore, for example, in an implementation, the first master node and the second master node are two master nodes connected adjacently in the communication network. For example, the first master node can be the master node 301 or the master node 302 in FIG. 3 or FIG. 4. If the first master node is the master node 301, the second master node is the master node 302. If the first master node is the master node 302, the second master node is the master node 301. In this implementation, the first detection frame can come from the second master node or the first master node. The following describes the two cases.

[0136] In the first case, the first detection frame can come from the second master node. For ease of understanding, with reference to FIG. 3 or FIG. 4, the first master node is taken as the master node 301, and the second master node is taken as the master node 302. As shown in FIG. 3 or FIG. 4, the port 1 and / or the port 3 are blocked ports. The blocked ports can be configured to not forward any packet in the case that the communication network is not faulty. Then, the second master node (the master node 302) sends the first detection frame through the port 4. The first detection frame is transmitted to the first master node (the master node 301) after being forwarded by the slave node 303, the slave node 304, the slave node 305, and the slave node 306. The first master node (the master node 301) does not continue to forward after receiving the first detection frame through the port 2. Since the first detection frame is sent by the second master node (the master node 302) at the beginning, the source media access control (MAC) address in the first detection frame is the MAC address of the second master node (the master node 302). In this scheme, the two master nodes are adjacently connected, and the detection frame sent by one master node is received and processed by the other master node without being forwarded back to the master node sending the detection frame, i.e., the two blocked ports do not need to be additionally configured to receive and process the detection frame, thereby saving the configuration cost and implementation complexity.

[0137] In another possible implementation, in the above Fig. 3 or Fig. 4, the first master node (master node 301) can also send a detection frame (referred to as a second detection frame) through port 2. The second detection frame is transmitted to the second master node (master node 302) after being forwarded by slave node 306, slave node 305, slave node 304 and slave node 303. After receiving the second detection frame, the second master node (master node 302) will not continue to forward it. Since the second detection frame is initially sent by the first master node (master node 301), the source MAC address in the second detection frame is the MAC address of the first master node (master node 301). In this scheme, a double network fault detection mechanism is set up, which solves the single master control risk existing in the existing master-slave communication network. That is, in the case of failure of one of the master nodes, the other master node can take on the work of fault detection, so that the network failure can be quickly discovered. In addition, the double network fault detection mechanism can also improve the detection reliability.

[0138] In the second case, the above-mentioned first detection frame can come from the first master node. For the sake of understanding, the first master node is taken as master node 301 and the second master node is taken as master node 302, which are introduced by way of example in combination with Fig. 3 or Fig. 4. As can be seen in Fig. 3 or Fig. 4, port 1 and / or port 3 are blocked ports. The blocked ports can be configured to allow forwarding of ring network protection protocol messages, i.e. to allow forwarding of detection frames sent by the master node. Then, the first master node (master node 301) sends the above-mentioned first detection frame through port 2. The first detection frame is transmitted to the second master node (master node 302) after being forwarded by slave node 306, slave node 305, slave node 304 and slave node 303. After receiving the first detection frame, the second master node (master node 302) can forward the first detection frame to the first master node (master node 301) through port 3. The first master node (master node 301) can receive the first detection frame through port 1. Since the first detection frame is initially sent by the first master node (master node 301), the source MAC address in the first detection frame is the MAC address of the first master node (master node 301). In this scheme, the detection frames sent by each master node are received and processed by itself. Similarly, in the case of failure of one of the master nodes, the other master node can take on the work of fault detection and notification, so that the other nodes in the communication network can quickly switch to restore the communication of the communication network, thereby greatly reducing the switching time caused by the failure.

[0139] Exemplarily, the above-mentioned second master node (master node 302) can determine whether the received message belongs to a detection frame by the message type included in the message header of the received message. For example, if the received message is a detection frame, the message type included in the message header of the message is a preset detection frame message type. The same applies hereinafter and will not be described again.

[0140] In another possible implementation, in the above-mentioned Fig. 3 or Fig. 4, the second master node (master node 302) can also send a detection frame (referred to as a third detection frame for short) through port 4. The third detection frame is transmitted to the first master node (master node 301) after being forwarded by the slave node 303, the slave node 304, the slave node 305, and the slave node 306. After receiving the third detection frame, the first master node (master node 301) can forward the third detection frame to the second master node (master node 302) through port 1. The second master node (master node 302) can receive the third detection frame through port 3. Since the third detection frame is initially sent by the second master node (master node 302), the source media access control (MAC) address in the third detection frame is the MAC address of the second master node (master node 302). In this scheme, a double network fault detection mechanism is set up, solving the single master control risk existing in the existing master-slave communication network. That is, in the case where one of the master nodes fails, the other master node can take on the work of fault detection, so that the network fault can be quickly discovered. In addition, the double network fault detection mechanism can also improve the detection reliability.

[0141] Exemplarily, in another implementation, the above-mentioned first master node and the above-mentioned second master node are two master nodes that are not connected adjacent in the communication network. That is, the first master node and the second master node are not directly connected, but the communication between the two is realized through one or more slave nodes. For example, the above-mentioned first master node can be the master node 501 or the master node 502 shown in the above-mentioned Fig. 5 or Fig. 6. If the first master node is the master node 501, the above-mentioned second master node is the master node 502. If the first master node is the master node 502, the above-mentioned second master node is the master node 501. In this implementation, the above-mentioned first detection frame comes from the first master node. For ease of understanding, in combination with Fig. 5 or Fig. 6, the first master node is taken as the master node 501 and the second master node is taken as the master node 502 as an example for introduction.

[0142] In FIG. 5 or FIG. 6, any one of port 1 and port 2 of the first master node (master node 501) and port 3 and port 4 of the second master node (master node 502) can be configured as a blocking port. FIG. 5 takes port 1 as an example of the blocking port, and FIG. 5 takes port 3 as an example of the blocking port. The blocking port can be configured to allow forwarding of the ring network protection protocol message, that is, to allow forwarding of the detection frame sent by the master node. Then, the first master node (master node 501) sends the above-mentioned first detection frame through port 2. The first detection frame is transmitted to the first master node (master node 501) after being forwarded by the slave node 506, the slave node 505, the second master node (master node 502), the slave node 504 and the slave node 503. The first master node (master node 501) can receive the first detection frame through port 1. Since the first detection frame is first sent by the first master node (master node 501), the source MAC address in the first detection frame is the MAC address of the first master node (master node 501). In this scheme, the detection frame sent by each master node is received and processed by itself. Similarly, in the case where one of the master nodes fails, the other master node can take on the work of fault detection and notification, so that other nodes in the communication network can quickly switch to restore communication of the communication network, thereby greatly reducing the switching time caused by the fault.

[0143] In another possible implementation, in the above-mentioned FIG. 5 or FIG. 6, the second master node (master node 502) can also send a detection frame (referred to as a fourth detection frame) through port 4. The fourth detection frame is transmitted to the second master node (master node 502) after being forwarded by the slave node 505, the slave node 506, the first master node (master node 501), the slave node 503 and the slave node 504. The second master node (master node 502) can receive the fourth detection frame through port 3. Since the fourth detection frame is first sent by the second master node (master node 502), the source MAC address in the fourth detection frame is the MAC address of the second master node (master node 502). In this scheme, a double network fault detection mechanism is set up, which solves the single master control risk existing in the existing master-slave communication network. That is, in the case where one of the master nodes fails, the other master node can take on the work of fault detection, so that the network fault can be quickly discovered. In addition, the double network fault detection mechanism can also improve the detection reliability.

[0144] S702, the first master node diagnoses the network fault of the communication network based on the above-mentioned first detection frame.

[0145] In a specific implementation, the first master node or the second master node can periodically send the detection frame. Exemplarily, the sending period of the detection frame (i.e., the sending time between every two detection frames) can be any length of time, which can be set according to the actual application needs, and the embodiments of the present application do not limit this. Specifically, the first master node can determine whether a network fault occurs in the communication network based on the number of received detection frames. Exemplary introduction is as follows.

[0146] In a possible implementation, similar to the existing MRP ring network protection scheme, if the first master node does not receive the detection frame within a certain time (which can be pre-configured, and the embodiments of the present application do not limit the length of the time), i.e., the number of received detection frames is zero, it is determined that a network fault occurs on the ring network. However, this fault diagnosis scheme cannot handle abnormal packet loss and other gray faults. For specific analysis, reference can be made to the foregoing description related to the MRP ring network protection scheme, which is not described herein.

[0147] In order to handle abnormal packet loss and other gray faults, in another possible implementation, the first detection frame includes one or more detection frames received by the first master node within a preset first time interval. Exemplarily, the first time interval can be n times of the sending period of the detection frame. The n is an integer greater than 1. Then, the first master node can diagnose the network fault of the communication network based on the number of detection frames in the first detection frame and the first preset detection frame number. The first preset detection frame number is the number of detection frames expected to be received within the first time interval.

[0148] Exemplarily, in an implementation, the number of detection frames expected to be received within the first time interval can be n, for example. That is, the first preset detection frame number is the total number of detection frames sent by the first master node or the second master node within the first time interval. Based on this, the first master node can count the number of received detection frames within the first time interval. Then, the ratio of the number of detection frames to the first preset detection frame number is calculated. If the ratio is less than a first threshold, it indicates that the first master node or the second master node sends n detection frames within the first time interval, and the first master node only receives a part of them. And the proportion of the number of received detection frames is less than the first threshold, so the detection frame is lost more within the preset time interval. It indicates that the path transmission state of the communication network is poor and cannot meet the transmission demand. Therefore, it can be diagnosed that the communication network has a fault. Conversely, if the calculated ratio is greater than or equal to the first threshold, it indicates that the path transmission state of the communication network is good, and it is considered that no network fault occurs. The first threshold can be any value greater than 0 and less than or equal to 1, for example.

[0149] Exemplarily, the first threshold value can be preconfigured, for example. Alternatively, the first threshold value can be a first threshold value updated dynamically according to a preset rule on the basis of presetting the first threshold value. For example, in the process of working of the ring network, the first master node can record the ratio of the number of detection frames calculated each time when a network fault is diagnosed. It is found through statistical analysis that the ratio when a network fault occurs multiple times is near a certain value. Then, the value of the preset first threshold value can be updated to the value. The updated first threshold value is used for subsequent fault diagnosis. It can be understood that the description herein is only an example and does not constitute a reasonable limitation on the present application.

[0150] Alternatively, exemplarily, in another implementation, the expected detection frames received in the first time interval can be d*n, for example. The value of d can be any value greater than 0 and less than or equal to 1, for example. That is, the first preset detection frame number is d times of the total detection frames sent by the first master node or the second master node in the first time interval. Based on this, the first master node can count the number of received detection frames in the first time interval. Then, the number of detection frames is compared with the first preset detection frame number. If the number of detection frames is less than the first preset detection frame number, it indicates that the first master node receives only a small part of the n detection frames sent by the first master node or the second master node in the first time interval. Then, there are more detection frame packet losses in the preset time interval. It indicates that the path transmission state of the communication network is poor and cannot meet the transmission demand. Therefore, it can be diagnosed that the communication network has a fault. Conversely, if the number of detection frames is greater than or equal to the first preset detection frame number, it indicates that the path transmission state of the communication network is good and no network fault occurs.

[0151] Exemplarily, in a possible implementation, the first preset detection frame number d*n can be an initial setting number. The first preset detection frame number can be updated dynamically according to a preset rule on the basis of the initial setting number. For example, in the process of working of the ring network, the first master node can record the number of detection frames received by the first master node in the first time interval each time when a network fault is diagnosed. It is found through statistical analysis that the received detection frame number when a network fault occurs multiple times is near a certain value. Then, the value of the first preset detection frame number can be updated to the value. The updated detection frame number is used for subsequent fault diagnosis. It can be understood that the description herein is only an example and does not constitute a reasonable limitation on the present application.

[0152] In another possible implementation, if the first master node does not receive any detection frame in the first time interval, that is, the actual number of received detection frames is zero. It can also be diagnosed that a network fault occurs.

[0153] In the above implementation, whether a failure occurs is determined based on the actual number of detection frames received by the master node and the expected number of detection frames, compared to the prior art scheme in which a failure is determined to occur when a detection frame is not received within a timeout. In the present scheme, in addition to detecting network failures, the risk of false detection of a failure is reduced, and gray network failures can also be detected. For example, when the link state in the ring network is poor and causes frequent packet loss, although a small number of detection frames are received within the first time interval. However, since the number of received detection frames does not meet the preset condition, it can be diagnosed that there is a gray network failure. Thus, the ring network can be switched to avoid continued use of the path with frequent packet loss, thereby preventing data loss. Conversely, if the link loses a small number of packets, some detection frames may be lost, but the link is quickly restored and does not affect normal data transmission. In this case, even if a small number of detection frames are lost, the number of detection frames received by the master node within the first time interval still meets the preset condition, and the network failure is not diagnosed. Thus, unnecessary ring network switching is avoided, and the availability of the network is improved.

[0154] S703, in the case of diagnosing that the communication network has a network failure, the first master node sends a failure notification; the network failure includes a failure of the second master node.

[0155] In a specific implementation, after the first master node diagnoses that the communication network has a network failure, the first master node can send a failure notification to other communication nodes in the communication network. The other communication nodes can include the second master node and slave nodes in the communication network. For example, the failure notification can be an MRP topology change packet or any other type of packet. The present application does not limit this.

[0156] For example, if the network failure is a failure of the second master node, the first master node can send a failure notification to other communication nodes in the communication network. The other communication nodes can include slave nodes in the communication network. For example, referring to FIG. 3 or FIG. 4, the master node 302 has a failure, and the master node 301 can diagnose the failure. Then, the master node 301 sends a failure notification to the slave node 303 to the slave node 306. Or for example, referring to FIG. 5 or FIG. 6, the master node 502 has a failure, and the master node 501 can diagnose the failure. Then, the master node 501 sends a failure notification to the slave node 503 to the slave node 506. As can be seen, in the present scheme, in the case of a failure of one of the master nodes, the other master node can take on the task of failure detection and notification, so that other nodes in the communication network can quickly switch to restore communication of the communication network. Thus, the switching time caused by the failure is greatly reduced.

[0157] Exemplarily, the network failure of the communication network can include any link failure, slave node failure, master node failure (e.g. the failure of the second master node), or the gray network failure of the communication network, which is not limited in the embodiments of the present application.

[0158] Exemplarily, in the specific implementation, after the first master node diagnoses that the network failure occurs in the communication network, the first master node can clear the forwarding table item of the first master node, and re-learn the new routing forwarding table item. In addition, since the network failure of the ring network causes a broken point in the ring network, if the blocked port is configured on the first master node, the first master node can also open the blocked port to become a forwarding port, so as to implement the ring network switching.

[0159] Exemplarily, after the first master node opens the blocked port, the first master node can send the failure notification through the two ports connected to the ring network, so that the failure notification can be forwarded to all the communication nodes in the ring network. Thus, the failure switching is successfully completed.

[0160] In summary, in the embodiments of the present application, two master nodes can be configured in the ring communication network, and the two master nodes can detect whether the network failure occurs. In the case that one of the master nodes fails, the other master node can undertake the work of failure detection and notification, so that the other nodes in the communication network can quickly switch to restore the communication of the communication network. Thus, the switching time caused by the failure is greatly reduced.

[0161] Exemplarily, in the specific implementation, after the first master node sends the failure notification, the slave node can receive the failure notification. Exemplarily, referring to FIG. 7A, the steps performed by the slave node can include but are not limited to the steps shown in FIG. 7A.

[0162] S7A01, the first slave node receives the failure notification.

[0163] The first slave node can be any slave node in the ring communication network. For example, it can be any one of the slave nodes 303 to 306 in FIG. 3 or FIG. 4. Or, for example, it can be any one of the slave nodes 503 to 506 in FIG. 5 or FIG. 6.

[0164] In a particular implementation, after the first master node sends the failure notification, the first slave node can receive the failure notification. For example, if the first slave node is adjacently connected to the first master node, the first master node can send the failure notification to the first slave node directly. Alternatively, if the first slave node is not adjacently connected to the first master node, the failure notification sent by the first master node can be forwarded to the first slave node through other nodes. For example, referring to FIG. 3, if the first master node is the master node 301 and the first slave node is the slave node 305. The failure notification sent by the master node 301 can be forwarded to the slave node 305 through the slave node 306.

[0165] S7A02, the first slave node clears the forwarding table item of the first slave node based on the failure notification.

[0166] In a particular implementation, after the first slave node receives the failure notification, the first slave node can clear the table item of the first slave node in response to the failure notification and re-learn a new routing forwarding table item, so as to implement ring network switching.

[0167] Similarly, after the first master node sends the failure notification, the second master node can receive the failure notification and clear the table item of the second master node in response to the failure notification and re-learn a new routing forwarding table item, so as to implement ring network switching.

[0168] In a possible implementation, the second master node can also detect whether the communication network has a failure and send a failure notification to notify other nodes to perform failure switching after detecting the failure. For example, referring to FIG. 8 or FIG. 9, the first master node and the second master node periodically send detection frames. FIG. 8 is an example in combination with FIG. 3. FIG. 9 is an example in combination with FIG. 5.

[0169] As shown in FIG. 8, the detection frame sent by the first master node (the master node 301) is transmitted to the second master node (the master node 302) through the path 1. The second master node (the master node 302) can detect whether the communication network has a failure based on the received detection frame. For details, refer to the related description of the first master node, which is not repeated here. The detection frame sent by the second master node (the master node 302) is transmitted to the first master node (the master node 301) through the path 2. The first master node (the master node 301) can detect whether the communication network has a failure based on the received detection frame.

[0170] As can be seen in FIG. 9, the detection frame sent by the first master node (master node 501) is transmitted back to the first master node (master node 501) through path 1. The first master node (master node 501) can detect whether the communication network has a fault based on the received detection frame. The detection frame sent by the second master node (master node 502) is transmitted back to the second master node (master node 502) through path 2. The second master node (master node 502) can detect whether the communication network has a fault based on the received detection frame. The specific implementation can refer to the related description of the first master node above, which will not be repeated here.

[0171] It can be understood that the above-mentioned FIG. 8 and FIG. 9 are only examples and do not constitute a limitation on the embodiments of the present application.

[0172] In a possible implementation, the first slave node can also diagnose the network fault of the communication network based on the received detection frame. For example, if the first master node and the second master node both periodically send detection frames, the first slave node can receive the detection frames from the first master node and the second master node.

[0173] For example, in a specific implementation, the first slave node can count the detection frames received in a preset second time interval. For example, the detection frame can be identified by the message type of the message header. For example, the second time interval can be m times of the detection frame sending period. The m is an integer greater than 1. Then, the first slave node can diagnose the network fault of the communication network based on the number of received detection frames and the second preset number of detection frames. The second preset number of detection frames is the number of detection frames expected to be received in the second time interval.

[0174] For example, in an implementation, the number of detection frames expected to be received in the second time interval can be 2*m, for example. That is, the second preset number of detection frames is the total number of detection frames sent by the first slave node and the second master node in the second time interval. Based on this, the first slave node can count the number of received detection frames in the second time interval. Then, the ratio of the number of detection frames to the second preset number of detection frames is calculated. If the ratio is less than the second threshold, it means that in the second time interval, the first slave node and the second master node send 2*m detection frames, and the first slave node only receives a part of them. And the proportion of the number of received detection frames is less than the second threshold, so there are many packet losses of detection frames in the preset time interval. It indicates that the path transmission state of the communication network is poor and cannot meet the transmission demand. Therefore, it can be diagnosed that the communication network has a fault. Conversely, if the calculated ratio is greater than or equal to the second threshold, it means that the path transmission state of the communication network is good and no network fault occurs. The first threshold can be any value greater than 0 and less than or equal to 1, for example.

[0175] Exemplarily, the second threshold value can be preconfigured, for example. Alternatively, the second threshold value can be a second threshold value dynamically updated according to a preset rule on the basis of presetting the second threshold value. For details, reference can be made to the foregoing introduction about the first threshold value, which is not repeated here.

[0176] Alternatively, exemplarily, in another implementation, the expected detection frames received in the second time interval can be c*2*m, for example. The value of c can be any value greater than or equal to 0 and less than or equal to 1, for example. That is, the second preset detection frame quantity is c times the total detection frames sent by the first slave node and the second master node in the second time interval. Based on this, the first slave node can count the number of received detection frames in the second time interval. Then, the number of detection frames is compared with the second preset detection frame quantity. If the number of detection frames is less than the second preset detection frame quantity, it indicates that the first slave node or the second master node sends 2*m detection frames in the second time interval, and the first slave node only receives a small part. Then, there are more detection frame packet losses in the preset time interval. It indicates that the path transmission state of the communication network is poor and cannot meet the transmission demand. Therefore, it can be diagnosed that the communication network has a fault. Conversely, if the number of detection frames is greater than or equal to the second preset detection frame quantity, it indicates that the path transmission state of the communication network is good, and it is considered that no network fault occurs.

[0177] Exemplarily, in a possible implementation, the second preset detection frame quantity c*2*m can be an initially set quantity. The second preset detection frame quantity can be dynamically updated according to a preset rule on the basis of the initially set quantity. For details, reference can be made to the foregoing introduction about the first preset detection frame quantity, which is not repeated here.

[0178] In another possible implementation, if the first slave node does not receive any detection frame in the second time interval, that is, the actual number of received detection frames is zero. It can also be diagnosed that a fault occurs in the network.

[0179] Exemplarily, if the first master node or the second master node fails, the first slave node can only receive the detection frames of the master node that does not fail. Based on this, the number of detection frames received by the first slave node in the second time interval does not necessarily satisfy the condition. Therefore, it can be diagnosed that a network fault occurs.

[0180] After the first slave node diagnoses a network fault, the first slave node clears its own forwarding table entries and relearns new routing forwarding table entries to implement a ring network.

[0181] In the above scheme, the slave node can diagnose whether the network is faulty based on the received detection frame, and if a fault is diagnosed, the slave node can directly clear its forwarding table entries, without waiting for the master node to announce the fault, thereby further reducing the ring network switching time.

[0182] To better understand the interaction between nodes in the communication system provided by the embodiments of the present application, in one possible implementation, reference can be made to FIG. 9A, FIG. 9B, FIG. 9C or FIG. 9D. In FIG. 9A, FIG. 9B, FIG. 9C or FIG. 9D, steps with the same step numbers indicate that the execution order of these steps is not limited. The first master node and the second master node are two master nodes in the communication system. For example, the first master node and the second master node can be the master node 301 and the master node 302 in FIG. 3 or FIG. 4 described above. Alternatively, the first master node and the second master node can be the master node 501 and the master node 502 in FIG. 5 or FIG. 6 described above. The first slave node can be any slave node in the communication system. For example, the first slave node can be any one of the slave node 303 to the slave node 306 in FIG. 3 or FIG. 4 described above. Alternatively, the first slave node can be any one of the slave node 503 to the slave node 506 in FIG. 5 or FIG. 6 described above.

[0183] FIG. 9A or FIG. 9B described above is a flow diagram of a detection frame sent by one master node, received by another master node, and based on the received detection frame to perform fault detection. FIG. 9C or FIG. 9D described above is a flow diagram of a detection frame sent by a master node, received by the master node itself, and based on the received detection frame to perform fault detection.

[0184] First, referring to FIG. 9A, the interaction between the first master node, the second master node and the first slave node can include but is not limited to the following steps.

[0185] S9A01, the second master node sends a first detection frame.

[0186] S9A02, the first slave node and the first master node receive the first detection frame.

[0187] The first detection frame can be forwarded through the first slave node and finally transmitted to the first master node.

[0188] S9A03, the first master node diagnoses the network fault of the communication network based on the first detection frame. Optionally, the first slave node can also diagnose the network fault of the communication network based on the first detection frame.

[0189] S9A04, in the case where it is diagnosed that the communication network has a network fault, the first master node sends a fault notification.

[0190] S9A05, the first slave node clears its forwarding table entries.

[0191] Specifically, in an implementation, the first slave node can receive the fault notification and clear its forwarding table entries based on the fault notification. Alternatively, if the first slave node can diagnose the network fault of the communication network based on the first detection frame, the first slave node can clear its table entries without waiting for the fault notification in the case that the network fault of the communication network is diagnosed.

[0192] The specific implementation of each step shown in FIG. 9A can be referred to the foregoing description, which will not be repeated here.

[0193] Referring to FIG. 9B, the interaction between the first master node, the second master node and the first slave node can include but is not limited to the following steps.

[0194] S9B01, the second master node sends the first detection frame. The first master node sends the second detection frame.

[0195] S9B02, the first master node receives the first detection frame. The second master node receives the second detection frame. The first slave node receives the first detection frame and the second detection frame.

[0196] The first detection frame can be forwarded through the first slave node and finally transmitted to the first master node. The second detection frame can be forwarded through the first slave node and finally transmitted to the second master node.

[0197] S9B03, the first master node diagnoses the network fault of the communication network based on the first detection frame. The second master node diagnoses the network fault of the communication network based on the second detection frame. Alternatively, the first slave node can also diagnose the network fault of the communication network based on the first detection frame and the second detection frame.

[0198] S9B04, in the case that the network fault of the communication network is diagnosed, the first master node and the second master node send the fault notification.

[0199] Alternatively, if one of the master nodes fails, the failed master node does not send the fault notification.

[0200] S9B05, the first slave node clears its forwarding table entries.

[0201] Specifically, in an implementation, the first slave node can receive the fault notification and clear its forwarding table entries based on the fault notification. Alternatively, if the first slave node can diagnose the network fault of the communication network based on the first detection frame and the second detection frame, the first slave node can clear its table entries without waiting for the fault notification in the case that the network fault of the communication network is diagnosed.

[0202] The specific implementation of each step shown in FIG. 9B can be referred to the foregoing description, which will not be repeated here.

[0203] Referring to FIG. 9C, the interaction between the first master node, the second master node and the first slave node can include but is not limited to the following steps.

[0204] S9C01, the first master node sends a first detection frame.

[0205] S9C02, the first slave node and the first master node receive the first detection frame.

[0206] The first detection frame can be forwarded through the first slave node and finally transmitted back to the first master node.

[0207] S9C03, the first master node diagnoses the network fault of the communication network based on the above-mentioned first detection frame. Optionally, the first slave node can also diagnose the network fault of the communication network based on the above-mentioned first detection frame.

[0208] S9C04, the first master node sends a fault notification in the case of diagnosing that the communication network has a network fault.

[0209] Exemplarily, in a specific implementation, since it is a ring network, after the first detection frame is sent from the first master node, it is forwarded through one or more slave nodes in the ring network and the second master node and then returns to the first master node, therefore, if the second master node has a fault, the network fault of the ring network can be detected based on the first detection frame.

[0210] S9C05, the first slave node clears the forwarding table entry of itself.

[0211] Specifically, in an implementation, the first slave node can receive the above-mentioned fault notification and clear the forwarding table entry of itself based on the fault notification. Alternatively, if the first slave node can diagnose the network fault of the communication network based on the above-mentioned first detection frame, in the case of diagnosing that the communication network has a network fault, the forwarding table entry of itself can be cleared without waiting to receive the fault notification.

[0212] The specific implementation of each step shown in FIG. 9C can be referred to the foregoing description, which will not be repeated here.

[0213] Referring to FIG. 9D, the interaction between the first master node, the second master node and the first slave node can include but is not limited to the following steps.

[0214] S9D01, the first master node sends a first detection frame. The second master node sends a second detection frame.

[0215] S9D02, the first master node receives the first detection frame. The second master node receives the second detection frame. The first slave node receives the first detection frame and the second detection frame.

[0216] The first detection frame can be forwarded through the first slave node and finally transmitted back to the first master node. The second detection frame can be forwarded through the first slave node and finally transmitted back to the second master node.

[0217] S9D03, the first master node diagnoses the network fault of the communication network based on the first detection frame. The second master node diagnoses the network fault of the communication network based on the second detection frame. Optionally, the first slave node can also diagnose the network fault of the communication network based on the first detection frame and the second detection frame.

[0218] S9D04, in the case of diagnosing that the communication network has a network fault, the first master node and the second master node send a fault notification.

[0219] Optionally, if one of the master nodes has a fault, the faulty master node does not send a fault notification. Exemplarily, in a specific implementation, since it is a ring network, after the first detection frame is sent out from the first master node, it is forwarded through one or more slave nodes in the ring network and the second master node and then returns to the first master node, therefore, if the second master node has a fault, it can be detected that the ring network has a network fault based on the first detection frame. Similarly, after the second detection frame is sent out from the second master node, it is forwarded through one or more slave nodes in the ring network and the first master node and then returns to the second master node, therefore, if the first master node has a fault, it can be detected that the ring network has a network fault based on the second detection frame.

[0220] S9D05, the first slave node clears the forwarding table entries of itself.

[0221] Specifically, in an implementation, the first slave node can receive the fault notification and clear the forwarding table entries of itself based on the fault notification. Alternatively, if the first slave node can diagnose the network fault of the communication network based on the first detection frame and the second detection frame, in the case of diagnosing that the communication network has a network fault, the first slave node can clear the forwarding table entries of itself without waiting to receive the fault notification.

[0222] The specific implementation of each step shown in the above FIG. 9D can refer to the foregoing introduction, which will not be repeated here.

[0223] In another possible implementation, in the case that both the first master node and the second master node send the detection frame, the first master node can receive the detection frame sent by itself and the detection frame sent by the second master node, and then diagnose the network fault based on the received detection frames. For details, reference can be made to the specific implementation of diagnosing the network fault by the first slave node based on the detection frames received from the two master nodes, which will not be described herein. Similarly, the second master node can receive the detection frame sent by itself and the detection frame sent by the first master node, and then diagnose the network fault based on the received detection frames. For details, reference can be made to the specific implementation of diagnosing the network fault by the first slave node based on the detection frames received from the two master nodes, which will not be described herein.

[0224] Exemplarily, the above embodiments mainly take the case that the ring network communication system includes two master nodes as an example. In another possible implementation, the communication system provided by the embodiments of the present application can also include more than two master nodes. Each of the more than two master nodes can be used to detect the network fault. In one implementation, the detection frame sent by each master node is finally transmitted back to the master node via the other master nodes in the communication system, and the master node diagnoses whether the network fault occurs based on the number of received detection frames. In another implementation, the detection frame sent by each master node can be finally received by one or more master nodes other than the master node, and then whether the network fault occurs is diagnosed based on the number of received detection frames. The specific implementation processes of the two implementations can both refer to the foregoing introduction of the first master node and / or the second master node sending and receiving the detection frame and diagnosing whether the network fault occurs based on the detection frame, which will not be described herein.

[0225] In summary, compared with the existing MRP scheme in which the master node is re-elected to detect the fault and then the fault notification is performed for switching, or compared with the existing DRP scheme in which the next on-duty master node needs to re-detect the fault, in the scheme provided by the present application, two master nodes are configured in the communication network, and both of the master nodes can detect whether the communication network has a fault. In the case that one of the master nodes has a fault, the other master node can undertake the work of fault notification, so that the other nodes in the communication network can quickly perform switching to restore the communication of the communication network. Therefore, the switching time caused by the fault is greatly reduced. In addition, for the scheme in which the first detection frame comes from the second master node, there is no need to configure the blocking port to receive and process the ring network protection protocol packet, thereby saving the configuration cost. Moreover, compared with the existing DRP scheme, each node does not need to have the capability of sending the ring network integrity detection frame as a master node, thereby reducing the performance requirement and cost of the device, and there is no need to configure a complex time synchronization algorithm. The implementation complexity of the scheme is reduced.

[0226] The above mainly introduces the communication network protection method provided by the embodiments of the present application. It can be understood that each communication node contains the hardware structure and / or software module corresponding to each function in order to realize the above corresponding functions. The units and steps of each example described in combination with the embodiments disclosed herein can be implemented in hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application of the technical solution and the design constraints. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of the present application.

[0227] The embodiments of the present application can divide the function modules of the communication node according to the above method examples. For example, each function module can be divided according to each function, or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or software function module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical function division. Actual implementation can have another division method.

[0228] In the case of dividing each function module according to each function, the embodiments of the present application also provide a communication node for implementing any of the above methods, for example, a communication node includes units (or means) for implementing each step in any of the above methods.

[0229] For example, please refer to FIG. 10, which is a structural schematic diagram of a communication node 1000 provided by the embodiments of the present application. The communication node 1000 can be a master node (for example, the first master node or the second master node) for implementing any of the above communication network protection methods. Or the communication node 1000 can be a chip in the master node. For example, the master node can be the master node 301 or the master node 302 in FIG. 3 or FIG. 4. Or, for example, the master node can be the master node 501 or the master node 502 in FIG. 5 or FIG. 6.

[0230] The communication node 1000 can include a receiving unit 1001, a processing unit 1002, and a sending unit 1003. The receiving unit 1001, the processing unit 1002, and the sending unit 1003 are the above function modules, which are hardware structures and / or software modules. Wherein:

[0231] The receiving unit 1001 is configured to receive a first detection frame. The first detection frame is from a first master node or a second master node, and the first master node and the second master node are two master nodes in a plurality of master nodes for detecting network faults in a communication network. The communication network is a ring network.

[0232] a processing unit 1002, configured to diagnose a network fault of the communication network based on the first detection frame;

[0233] a sending unit 1003, configured to send a fault notification in a case where it is diagnosed that the communication network has a network fault; the network fault includes a fault of the second master node.

[0234] In a possible implementation, the first master node and the second master node are two master nodes connected adjacently in the communication network, a blocked port of the first master node is connected with the second master node, and / or a blocked port of the second master node is connected with the first master node.

[0235] In a possible implementation, the sending unit 1003 is further configured to send a second detection frame, where the second detection frame is used by the second master node to diagnose a network fault of the communication network.

[0236] In a possible implementation, the communication network further includes one or more slave nodes; the one or more slave nodes are further connected between the first master node and the second master node; and the first detection frame is from the first master node.

[0237] In a possible implementation, a blocked port of the first master node is connected with one of the one or more slave nodes; or a blocked port of the second master node is connected with one of the one or more slave nodes.

[0238] In a possible implementation, the first detection frame includes one or more detection frames received by the first master node within a preset time interval; and the processing unit is specifically configured to diagnose a network fault of the communication network based on a number of detection frames in the first detection frame and a preset number of detection frames; and the preset number of detection frames is a number of detection frames expected to be received within the preset time interval.

[0239] In a possible implementation, the processing unit is specifically configured to calculate a ratio of the number of detection frames in the first detection frame to the preset number of detection frames; and diagnose that the communication network has a network fault in a case where the ratio is less than a threshold.

[0240] In a possible implementation, the processing unit 1002 is further configured to, in a case where it is diagnosed that the communication network has a network fault, clear a forwarding table item of the processing unit 1002, and open a blocked port.

[0241] In a possible implementation, a source MAC address in the first detection frame is a MAC address of the second master node.

[0242] The specific operations and advantages of the various units in the communication node 1000 shown in FIG. 10 can be found in the above description of FIG. 7 and its possible embodiments, and will not be repeated here.

[0243] For example, refer to FIG. 11, which is a structural schematic diagram of a communication node 1100 according to an embodiment of the present application. The communication node 1100 can be a slave node (for example, the first slave node described above) used to implement any of the embodiments of the communication network protection method described above. Alternatively, the communication node 1100 can be a chip in the slave node. For example, the slave node can be any one of the slave nodes 303 to 306 in FIG. 3 or FIG. 4 described above. Alternatively, for example, the slave node can be any one of the slave nodes 503 to 506 in FIG. 5 or FIG. 6 described above. The communication network is a ring network, and the communication network includes a first master node and a second master node for detecting network faults. For example, the first master node and the second master node can be the master nodes 301 and 302 in FIG. 3 or FIG. 4 described above. Alternatively, for example, the first master node and the second master node can be the master nodes 501 and 502 in FIG. 5 or FIG. 6 described above.

[0244] The communication node 1100 can include a receiving unit 1101 and a processing unit 1102. The receiving unit 1101 and the processing unit 1102 are functional modules described above, which are hardware structures and / or software modules. Wherein:

[0245] The receiving unit 1101 is configured to receive a fault notification from the first master node in the case that a network fault occurs in the communication network; the network fault includes a fault of the second master node;

[0246] The processing unit 1102 is configured to clear forwarding table entries of the communication node based on the fault notification.

[0247] In a possible implementation, the first master node and the second master node are two master nodes connected adjacently in the communication network, a blocked port of the first master node is connected with the second master node, and / or a blocked port of the second master node is connected with the first master node.

[0248] In a possible implementation, the communication network further includes one or more slave nodes; the one or more slave nodes are further connected between the first master node and the second master node.

[0249] In a possible implementation, a blocked port of the first master node is connected with a first node of the one or more slave nodes, or a blocked port of the second master node is connected with a second node of the one or more slave nodes.

[0250] In a possible implementation, the receiving unit 1101 is further configured to receive a first detection frame; the first detection frame comprises one or more detection frames from the first master node and / or the second master node.

[0251] The processing unit 1102 is further configured to diagnose a network fault of the communication network based on the first detection frame; and clear a forwarding table of the processing unit 1102 in a case where it is diagnosed that the communication network has the network fault.

[0252] In a possible implementation, the first detection frame comprises detection frames received by the slave node within a preset time interval; and the processing unit 1102 is specifically configured to:

[0253] diagnose the network fault of the communication network based on a number of detection frames in the first detection frame and a preset number of detection frames; the preset number of detection frames is a number of detection frames expected to be received within the preset time interval.

[0254] In a possible implementation, the processing unit 1102 is specifically configured to: calculate a ratio of the number of detection frames in the first detection frame to the preset number of detection frames; and diagnose that the communication network has the network fault in a case where the ratio is less than a threshold.

[0255] The specific operations and beneficial effects of each unit in the communication node 1100 shown in FIG. 11 can be refer to the corresponding description in the above-mentioned FIG. 7 and possible embodiments thereof, which will not be described here again.

[0256] Exemplarily, refer to FIG. 12, which is a structural schematic diagram of a possible physical entity of a communication node provided in the present application. The communication node 1200 shown in FIG. 12 can be a first master node, a second master node or a first slave node used to implement any embodiment of the above-mentioned communication network protection method. Or the communication node 1200 can be a chip of the first master node, the second master node or the first slave node. Exemplarily, the first master node and the second master node can be the master node 301 and the master node 302 in the above-mentioned FIG. 3 or FIG. 4. Or exemplarily, the first master node and the second master node can be the master node 501 and the master node 502 in the above-mentioned FIG. 5 or FIG. 6. Exemplarily, the first slave node can be any one of the slave node 303 to the slave node 306 in the above-mentioned FIG. 3 or FIG. 4. Or exemplarily, the first slave node can be any one of the slave node 503 to the slave node 506 in the above-mentioned FIG. 5 or FIG. 6.

[0257] The communication node 1200 comprises a processor 1201, a memory 1202 and a communication interface 1203. The processor 1201, the communication interface 1203 and the memory 1202 can be connected with each other or connected with each other through a bus 1204.

[0258] The memory 1202 is configured to store computer programs and data of the communication node 1200. The memory 1202 can include, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a compact disc read-only memory (CD-ROM), or the like.

[0259] The software or program codes required by the communication node in the method embodiments described above for all or part of the functions can be stored in the memory 1202.

[0260] In a possible implementation, if the software or program codes required by part of the functions are stored in the memory 1202, the processor 1201 can cooperate with other components (such as the communication interface 1203) to complete other functions (such as the functions of receiving or sending data or messages) described in the method embodiments in addition to calling the program codes in the memory 1202 to implement part of the functions.

[0261] The communication interface 1203 can be multiple in number, configured to support the communication of the communication node 1200, for example, receiving or sending data or messages, and the like.

[0262] The processor 1201 can be a circuit having a data processing capability. In one implementation, the processor can be a circuit having an instruction reading and running capability, such as a central processing unit (CPU), a microprocessor, a graphics processing unit (GPU) (which can be understood as a microprocessor), a digital signal processor (DSP), or the like. In another implementation, the processor can be a circuit having a fixed or reconfigurable logical relationship to implement certain functions, such as an application-specific integrated circuit (ASIC) or a programmable logic device (PLD) implemented hardware circuit, e.g., a field programmable gate array (FPGA). In the reconfigurable hardware circuit, the processor loads a configuration document to implement the hardware circuit configuration, which can be understood as the processor loading instructions to implement the functions of some or all of the units described above. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as a neural network processing unit (NPU), a tensor processing unit (TPU), a deep learning processing unit (DPU), or the like. Alternatively, the processor 1201 can be a combination of at least two of these processor forms, and the like.

[0263] The processor 1201 can be configured to read the program stored in the memory 1202 and perform the operations of the master node (e.g., the first master node or the second master node) described above with reference to FIG. 7 and possible implementations thereof. Alternatively, the processor 1201 can be configured to read the program stored in the memory 1202 and perform the operations of the slave node (e.g., the first slave node) described above with reference to FIG. 7 and possible implementations thereof.

[0264] The specific operations and benefits of the various units of the communication node 1200 shown in FIG. 12 can be found in the corresponding descriptions of FIG. 7 and possible implementations thereof described above, which will not be repeated here.

[0265] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program or computer instruction, and the computer program or computer instruction is executed by a processor to implement the method implemented by the first master node or the second master node in any of the possible implementation manners of the method shown in Fig. 7. Exemplarily, the computer readable storage medium can include but is not limited to various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. The same applies hereinafter, and details are not repeated.

[0266] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program or computer instruction, and the computer program or computer instruction is executed by a processor to implement the method implemented by the first slave node in any of the possible implementation manners of the method shown in Fig. 7.

[0267] The embodiment of the present application further provides a computer program product, and when the computer program product is read and executed by a computer, the method implemented by the first master node or the second master node in any of the possible implementation manners of the method shown in Fig. 7 will be executed. Exemplarily, the computer program product includes but is not limited to a computer program, a code or an electronic (digital) signal for transmitting computer program instruction code, which can implement the method when the computer runs.

[0268] The embodiment of the present application further provides a computer program product, and when the computer program product is read and executed by a computer, the method implemented by the first slave node in any of the possible implementation manners of the method shown in Fig. 7 will be executed.

[0269] The chip system can also include a memory for storing necessary program instructions and data of the communication device. The chip system can be composed of a chip, or can include a chip and other discrete devices. Illustratively, the communication device can be a first master node, a second master node, or a first slave node for implementing any of the embodiments of the communication network protection method. Illustratively, the first master node and the second master node can be the master node 301 and the master node 302 in FIG. 3 or FIG. 4. Alternatively, illustratively, the first master node and the second master node can be the master node 501 and the master node 502 in FIG. 5 or FIG. 6. Illustratively, the first slave node can be any one of the slave nodes 303 to 306 in FIG. 3 or FIG. 4. Alternatively, illustratively, the first slave node can be any one of the slave nodes 503 to 506 in FIG. 5 or FIG. 6.

[0270] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the device embodiment described above is merely illustrative. For example, the division of the units is only a logical function division. There can be another division manner for actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different units, or the among different units, can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0271] The units described as separated components can or can not be physical separate, and the components displayed as units can or can not be physical units. That is, they can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.

[0272] In addition, each functional unit in the embodiments of the present application can be integrated in a processing unit, or each unit can exist physically as a separate unit, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware, or in the form of a software functional unit.

[0273] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the part essentially contributing to the technical solutions of the present application 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 number of instructions for causing a communication node (such as the first master node, the second master node, or the first slave node) to execute all or part of the steps of the method described in various embodiments of the present application.

[0274] It should 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 according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

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

[0276] It should also be understood that the "one embodiment", "an embodiment", "one possible implementation" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" or "one possible implementation" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.

[0277] Finally, it should be pointed out that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A communication network protection method, characterized in that: The method comprises: The first master node receives a first detection frame; the first detection frame comes from the first master node or the second master node, the first master node and the second master node are two master nodes among multiple master nodes used to detect network faults in a communication network; the communication network is a ring network; The first master node diagnoses a network fault of the communication network based on the first detection frame; In the case where a network fault is diagnosed in the communication network, the first master node sends a fault notification; the network fault includes a fault occurring in the second master node.

2. The method according to claim 1, characterized in that The first master node and the second master node are two adjacently connected master nodes in the communication network; the blocked port in the communication network is any one of the ports through which the first master node and the second master node access the communication network.

3. The method according to claim 2, characterized in that The method further comprises: The first master node sends a second detection frame, where the second detection frame is used by the second master node to diagnose a network failure of the communication network.

4. The method according to claim 1, wherein The communication network further includes one or more slave nodes; the one or more slave nodes are further connected between the first master node and the second master node; and the first detection frame comes from the first master node.

5. The method according to claim 4, characterized in that The blocked port of the first master node is connected to one of the one or more slave nodes; or the blocked port of the second master node is connected to one of the one or more slave nodes.

6. The method according to any one of claims 1 to 5, characterized in that The first detection frame includes one or more detection frames received by the first master node within a preset time interval; The first master node diagnosing a network fault of the communication network based on the first detection frame includes: The first master node diagnoses a network fault of the communication network based on the number of detection frames in the first detection frame and a preset number of detection frames; The preset number of detection frames is the number of detection frames expected to be received within the preset time interval.

7. The method according to claim 6, characterized in that The first master node diagnoses a network fault of the communication network based on the number of detection frames in the first detection frame and a preset number of detection frames, including: The first master node calculates a ratio of the number of detection frames in the first detection frame to the preset number of detection frames; When the ratio is smaller than a threshold, the first master node diagnoses that a network failure occurs in the communication network.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: When it is diagnosed that a network failure occurs in the communication network, the first master node clears its own forwarding table entries and opens blocked ports.

9. The method according to any one of claims 1 to 8, characterized in that The source MAC address in the first detection frame is the MAC address of the second master node.

10. A communication network protection method, characterized in that: The method is applied to a slave node in a communication network, wherein the communication network is a ring network and includes a first master node and a second master node for detecting network failures; the method includes: In the event that a network failure occurs in the communication network, the slave node receives a failure notification from the first master node; the network failure includes a failure occurring in the second master node; The slave node clears its own forwarding table entries based on the fault notification.

11. The method according to claim 10, characterized in that The first master node and the second master node are two adjacently connected master nodes in the communication network; the blocked port in the communication network is any one of the ports through which the first master node and the second master node access the communication network.

12. The method according to claim 10, characterized in that The communication network further includes one or more slave nodes; the one or more slave nodes are further connected between the first master node and the second master node.

13. The method according to claim 12, characterized in that The blocking port of the first master node is connected to a first node among the one or more slave nodes, or the blocking port of the second master node is connected to a second node among the one or more slave nodes.

14. The method according to any one of claims 10 to 13, characterized in that: The method further comprises: The slave node receives a first detection frame; the first detection frame includes one or more detection frames from the first master node and / or the second master node; The slave node diagnoses a network fault of the communication network based on the first detection frame; When the slave node diagnoses that a network failure occurs in the communication network, the slave node clears its own forwarding table entries.

15. The method according to claim 14, characterized in that The first detection frame includes a detection frame received by the slave node within a preset time interval; The slave node diagnosing a network fault of the communication network based on the first detection frame includes: The slave node diagnoses a network fault of the communication network based on the number of detection frames in the first detection frame and a preset number of detection frames; The preset number of detection frames is the number of detection frames expected to be received within the preset time interval.

16. The method according to claim 15, characterized in that The slave node diagnoses a network fault of the communication network based on the number of detection frames in the first detection frame and a preset number of detection frames, including: The slave node calculates a ratio of the number of detection frames in the first detection frame to the preset number of detection frames; When the ratio is smaller than a threshold, the slave node diagnoses that a network failure occurs in the communication network.

17. A communication network protection method, characterized in that: The method comprises: The second master node sends a first detection frame; the first detection frame is used by the first master node to diagnose a network fault of the communication network, the network fault including a fault occurring in the second master node; The first master node and the second master node are two master nodes in the communication network for detecting network failures; the communication network is a ring network.

18. The method according to claim 17, characterized in that The first master node and the second master node are two adjacently connected master nodes in the communication network; the blocked port in the communication network is any one of the ports through which the first master node and the second master node access the communication network.

19. The method according to claim 18, characterized in that The method further comprises: The second master node receives a second detection frame from the first master node or the second master node, where the second detection frame is used by the second master node to diagnose a network fault in the communication network.

20. A communication node, characterized in that: The communication node comprises a processor, and the processor is configured to execute the method according to any one of claims 1 to 19.

21. A communication system, characterized in that: The communication system includes a first master node, a second master node and one or more slave nodes; the first master node is used to execute the method described in any one of claims 1-9, the slave node is used to execute the method described in any one of claims 10-16, and the second master node is the second master node in the method described in any one of claims 1-19.

22. A computer-readable storage medium, characterized in that The storage medium stores instructions, and when the instructions are executed on the computer, the computer executes the steps of the method according to any one of claims 1 to 19.