Network loop protection method and device, equipment and storage medium

By constructing a local network topology at the switch level for link health monitoring and path selection, the problems of long fault convergence time and suboptimal redundant path selection in network loop protection are solved, enabling faster fault recovery and more intelligent path switching, thus improving network reliability and real-time performance.

CN121841990APending Publication Date: 2026-04-10SHENZHEN FENGRUNDA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN FENGRUNDA TECH CO LTD
Filing Date
2026-01-04
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing network loop protection methods suffer from long fault convergence times and suboptimal selection of redundant paths, which affect network reliability and real-time performance.

Method used

The local network topology is constructed based on the local link status information of the switch, the link health status is monitored, candidate redundant paths are determined, and the target redundant path is selected for traffic switching through a preset path selection strategy.

Benefits of technology

It improves fault convergence speed and the intelligence of path switching, thereby enhancing network reliability and real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121841990A_ABST
    Figure CN121841990A_ABST
Patent Text Reader

Abstract

Disclosed are a network loop protection method, apparatus and device, and a storage medium, the method being applied to a switch, the method comprising: constructing a local network topology based on local link state information of a link connected to the switch; monitoring the health state of the link based on the local network topology to obtain a link health assessment result; when the link health assessment result judges that the link is in an abnormal state, candidate redundant paths are determined based on local network topology; and selecting a target redundant path from the candidate redundant paths according to a preset path selection strategy, executing traffic switching according to the target redundant path, and notifying an adjacent switch to update path information. According to the method, the health state of the link is monitored based on the local network topology, the candidate redundant path is determined based on the local network topology, and the target redundant path is selected through the preset path selection strategy, so that the fault convergence speed and the path switching intelligence are improved, and the reliability and the real-time performance of the network are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Ethernet communication technology, and in particular to a network loop protection method, apparatus, device, and storage medium. Background Technology

[0002] In Ethernet switched networks, loop protection protocols are commonly used to prevent broadcast storms and improve reliability by utilizing redundant links. Besides the classic Spanning Tree Protocol (STP) and its rapid version (RSTP), Ethernet Ring Protection Protocol (ERPS), a standard protocol specifically designed for ring topologies, is widely used due to its fast loop blocking and recovery mechanisms. The ERPS protocol defines a complete set of control message exchange mechanisms and switch state machines to quickly unblock backup ports and switch traffic to redundant paths when a link failure is detected, thereby restoring network connectivity.

[0003] However, in actual deployment and operation, network loop protection schemes based on the traditional ERPS protocol still have significant drawbacks, affecting network reliability and real-time performance. Firstly, regarding fault convergence time, the state machine switching and path convergence process of the traditional ERPS protocol relies on hop-by-hop flooding of protocol messages and state synchronization of all ring network nodes. As the network size or topology complexity increases, this global synchronization mechanism introduces significant propagation and processing delays, resulting in a longer time required from the occurrence of a fault to the complete recovery of service flow. This makes it difficult to meet the high requirements of scenarios such as financial transactions, industrial control, and real-time video transmission, which are extremely sensitive to network interruption time.

[0004] Secondly, existing mechanisms for maintaining and selecting redundant paths suffer from insufficient intelligence. Traditional ERPS protocols typically employ predefined, static primary / backup link switching logic, or simply determine paths based on the spanning tree algorithm after convergence. This approach lacks the ability to perceive the real-time operational status of links, such as instantaneous load, transmission latency, and packet loss rate—key performance indicators. Therefore, during failover, traffic may be redirected to already congested or low-quality backup links, not only failing to guarantee service quality after the switch but also potentially triggering secondary congestion, causing network performance fluctuations and reliability degradation. Furthermore, static path selection strategies cannot achieve reasonable traffic distribution and load balancing in environments with dynamically changing network loads.

[0005] Therefore, there is an urgent need for a network loop protection method that can improve the speed of fault convergence and the intelligence of path switching, thereby enhancing the reliability and real-time performance of the network. Summary of the Invention

[0006] The main objective of this invention is to provide a network loop protection method, apparatus, device, and storage medium, aiming to solve the technical problems of long fault convergence time and suboptimal redundant path selection in existing network loop protection, which affect network reliability and real-time performance.

[0007] To achieve the above objectives, the present invention provides a network loop protection method, the method comprising the following steps: Based on the local link status information of the links connected to the switch, a local network topology is constructed; Based on the local network topology, the health status of the link is monitored to obtain the link health assessment result; When the link health assessment result determines that the link is in an abnormal state, a candidate redundant path is determined based on the local network topology. According to the preset path selection strategy, a target redundant path is selected from the candidate redundant paths, traffic switching is performed based on the target redundant path, and adjacent switches are notified to update the path information.

[0008] Optionally, the step of constructing a local network topology based on the local link state information of the links connected to the switch includes: Obtain the link status parameters of the links connected to each port of the switch, and use the link status parameters as local link status information; Receive link status information from adjacent switches through point-to-point communication; A local network topology is generated based on the local link status information and the link status information.

[0009] Optionally, the step of monitoring the health status of the link based on the local network topology and obtaining the link health assessment result includes: Based on the local network topology, determine the links to be monitored connected to the switch; The performance parameters of the link to be monitored are periodically collected, and the performance parameters are compared with preset parameter thresholds to obtain the comparison results; Based on the comparison results, a link health assessment result for the link to be monitored is generated.

[0010] Optionally, the step of determining candidate redundant paths based on the local network topology when the link health assessment result determines that the link is in an abnormal state includes: When the link health assessment result determines that the current primary link is in an abnormal state, the set of reachable nodes of the switch as the source node is identified from the local network topology. Based on the set of reachable nodes and the local network topology, candidate redundant paths connecting the source node and the target node are determined.

[0011] Optionally, the step of selecting a target redundant path from the candidate redundant paths according to a preset path selection strategy includes: Obtain the current link performance parameters for each candidate redundant path, including latency, packet loss rate, and bandwidth utilization. Based on the current link performance parameters and preset weight factors, a health assessment is performed on each of the candidate redundant paths to obtain a path health score for each of the candidate redundant paths. The candidate redundant paths are prioritized based on their path health scores to obtain a priority ranking result. Based on the priority ranking results, the candidate redundant path with the highest priority is selected as the target redundant path.

[0012] Optionally, the step of performing traffic switching based on the target redundant path and notifying adjacent switches to update path information includes: Based on the target redundant path, update the local forwarding table of the switch to obtain the updated local forwarding table; Based on the updated local forwarding table, traffic is switched to the target redundant path, and a path update message is generated; The path update message is sent to the adjacent switches on the target redundant path via point-to-point communication to notify the adjacent switches to update the path information.

[0013] Optionally, after the step of performing traffic switching based on the target redundant path and notifying adjacent switches to update path information, the method further includes: When the link is detected to have recovered from an abnormal state to a normal state, the performance parameters of the recovered link are compared with the performance parameters of the target redundant path to obtain the performance comparison result. If the performance comparison result indicates that the performance parameters of the restored link are better than the performance parameters of the target redundant path, then the traffic will be switched from the target redundant path back to the link.

[0014] Furthermore, to achieve the above objectives, the present invention also proposes a network loop protection device, the device comprising: The topology building module is used to build a local network topology based on the local link status information of the links connected to the switch; The status monitoring module is used to monitor the health status of the link based on the local network topology and obtain the link health assessment result; The path determination module is used to determine candidate redundant paths based on the local network topology when the link health assessment result determines that the link is in an abnormal state. The traffic switching module is used to select a target redundant path from the candidate redundant paths according to a preset path selection strategy, perform traffic switching based on the target redundant path, and notify adjacent switches to update path information.

[0015] Furthermore, to achieve the above objectives, the present invention also proposes a network loop protection device, the device comprising: a memory, a processor, and a network loop protection program stored in the memory and executable on the processor, the network loop protection program being configured to implement the steps of the network loop protection method described above.

[0016] Furthermore, to achieve the above objectives, the present invention also proposes a storage medium storing a network loop protection program, which, when executed by a processor, implements the steps of the network loop protection method described above.

[0017] This invention discloses a method for constructing a local network topology based on the local link status information of the links connected to the switch; monitoring the health status of the links based on the local network topology to obtain link health assessment results; when the link health assessment results determine that the link is in an abnormal state, determining candidate redundant paths based on the local network topology; selecting a target redundant path from the candidate redundant paths according to a preset path selection strategy; performing traffic switching based on the target redundant path; and notifying adjacent switches to update path information. Because this invention constructs a local network topology based on the local link status information of the links connected to the switch, monitors the health status of the links based on the local network topology, and then determines candidate redundant paths based on the local network topology when a link is in an abnormal state, and selects a target redundant path through a preset path selection strategy, compared with existing technologies, this invention improves the speed of fault convergence and the intelligence of path switching, thereby enhancing network reliability and real-time performance. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the first embodiment of the network loop protection method of the present invention; Figure 2 This is a flowchart illustrating the second embodiment of the network loop protection method of the present invention; Figure 3 This is a flowchart illustrating the third embodiment of the network loop protection method of the present invention; Figure 4 This is a structural block diagram of the first embodiment of the network loop protection device of the present invention; Figure 5 This is a schematic diagram of the network loop protection device for the hardware operating environment involved in the embodiments of the present invention.

[0019] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0021] This invention provides a network loop protection method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the network loop protection method of the present invention.

[0022] In this embodiment, the network loop protection method is applied to a switch, and the network loop protection method includes steps S10~S40: Step S10: Construct a local network topology based on the local link status information of the links connected to the switch.

[0023] It should be noted that the executing entity in this embodiment can be a computer server device with data processing, network communication, and program execution functions applied in network loop protection scenarios, such as a switch, or an electronic device capable of performing the above functions (such as a network loop protection device). The following uses a switch as an example to illustrate this embodiment and the subsequent embodiments.

[0024] It should be understood that the links connected by a switch can refer to communication channels directly associated with the switch's physical or logical ports for data forwarding. The links connected by a switch do not refer to a specific link, but rather encompass all physical or logical connections of the switch that may be used for ERPS ring network communication.

[0025] Understandably, local link status information can refer to status data about the links connected to it, which is monitored by the switch itself or obtained from its direct ports, including but not limited to link load, link latency, and link packet loss rate.

[0026] In a specific implementation, the link status parameters of the links connected to each port of the switch can be obtained and used as local link status information; link status information from neighboring switches can be received through point-to-point communication; and a local network topology can be generated based on the local link status information and the link status information.

[0027] It should be explained that adjacent switches can refer to other switches that have a direct physical link connection with the switch in the current network physical or logical topology.

[0028] Understandably, local network topology can refer to a logical view of the connectivity of a limited network area around a switch, which is built and maintained locally by the switch based on its local link-state information and the link-state information received from neighboring switches.

[0029] It should be noted that existing solutions (standard ERPS) typically rely on periodic network-wide broadcast control messages (such as R-APS) to allow all switches in the network to share and maintain a completely consistent global loop state and topology view. Fault switching decisions are based on this global view, a process involving network-wide synchronization and slow convergence. In contrast, this embodiment makes rapid judgments based on local network topology, achieving distributed and localized decision-making.

[0030] Step S20: Based on the local network topology, perform health status monitoring on the link to obtain the link health assessment result.

[0031] It should be noted that, based on the local network topology, the links to be monitored connected to the switch can be determined; the performance parameters of the links to be monitored can be collected periodically, and the performance parameters can be compared with preset parameter thresholds to obtain comparison results; based on the comparison results, the link health assessment results of the links to be monitored can be generated.

[0032] Assumptions: The local network topology is a ring topology with 5 switches (AE). The main link ABCDEA transmits traffic, and the backup links AC, BD, etc. are in standby mode.

[0033] It should be understood that the monitored link can refer to all communication links within the local network topology of the switch that need to have their health status checked periodically, including: the primary link currently transmitting data (such as the AB link) and the backup link (such as the AC link).

[0034] Understandably, performance parameters can refer to a series of measurable indicators used to quantitatively evaluate the communication quality and load status of the link, including link latency, packet loss rate, bandwidth utilization, and link load. Preset parameter thresholds can refer to critical values ​​set in advance for each performance parameter, used to convert continuous parameter measurements into discrete "normal / abnormal" state judgments. When a performance parameter exceeds its corresponding preset threshold, it indicates that the link health assessment result determines the link to be in an abnormal state.

[0035] It should be explained that the step of monitoring the health status of the links based on the local network topology and obtaining link health assessment results is executed through a distributed multi-layer state machine. This multi-layer state machine is configured to: independently assess the link health status and determine anomalies locally based on the local network topology and periodically collected link performance parameters; and trigger subsequent path selection procedures when an anomaly is determined. The distributed multi-layer state machine runs locally on the switch.

[0036] Step S30: When the link health assessment result determines that the link is in an abnormal state, a candidate redundant path is determined based on the local network topology.

[0037] In a specific implementation, when the link health assessment result determines that the current primary link is in an abnormal state, the set of reachable nodes of the switch as the source node is identified from the local network topology; based on the set of reachable nodes and the local network topology, a candidate redundant path connecting the source node and the target node is determined.

[0038] It should be understood that the current primary link may refer to the link that the switch used to forward data traffic to the target node before the link was determined to be in an abnormal state.

[0039] It should be noted that the reachable node set can refer to the set of all switches that can be reached from the switch (i.e., the source node) experiencing a link anomaly (i.e., a link failure), excluding the primary link determined to be abnormal, based on the current local network topology, through other normal links. The generation of this set signifies that the switches are searching for alternative paths to bypass the anomaly.

[0040] Understandably, the target node can refer to the peer switch that was originally reached via the primary link after the current primary link fails. For example, if the primary link between switches A and B fails, A represents the source node and B represents the target node.

[0041] It should be explained that the candidate redundant path can refer to one or more backup paths that can replace the current primary link that is faulty, based on the local network topology and the set of reachable nodes, between the source node and the target node. These paths may pass through one or more intermediate switches (i.e., nodes in the set of reachable nodes) and are the input set for subsequent selection of the target redundant path.

[0042] Step S40: According to the preset path selection strategy, select a target redundant path from the candidate redundant paths, perform traffic switching based on the target redundant path, and notify adjacent switches to update path information.

[0043] It's important to note that when the primary link fails due to physical interruption, performance degradation, or other reasons, all data flowing through that link will be lost without switching, resulting in network service interruption. Traffic switching is used to bypass the point of failure and ensure that data can reach its destination through other available paths.

[0044] In a specific implementation, the current link performance parameters of each candidate redundant path can be obtained. These current link performance parameters include latency (link delay), packet loss rate, and bandwidth utilization. Then, a multi-dimensional evaluation is performed based on the current link performance parameters of each candidate redundant path, and the candidate redundant path with the best performance is selected as the target redundant path based on the evaluation results.

[0045] Assumptions: The local network topology is a ring topology with 5 switches (AE). The main link ABCDEA transmits traffic, and backup links AC, BD, etc., are in standby mode. When the main link between switches A and B experiences a sudden failure, candidate redundancy paths include AEDB, ACB, and AEB. Finally, a multi-dimensional evaluation is performed based on the current link performance parameters of each candidate redundancy path. The candidate redundancy path with the best performance is selected as the target redundancy path (e.g., if ACB has the best performance, then ACB is the target redundancy path).

[0046] It should be noted that the step of performing traffic switching based on the target redundant path and notifying adjacent switches to update path information may include: updating the local forwarding table of the switch according to the target redundant path to obtain the updated local forwarding table; switching traffic to the target redundant path based on the updated local forwarding table and generating a path update message; and sending the path update message to adjacent switches on the target redundant path via point-to-point communication to notify the adjacent switches to update path information.

[0047] This embodiment discloses a method for constructing a local network topology based on the local link status information of the links connected to the switch; monitoring the health status of the links based on the local network topology to obtain link health assessment results; when the link health assessment results determine that the link is in an abnormal state, determining candidate redundant paths based on the local network topology; selecting a target redundant path from the candidate redundant paths according to a preset path selection strategy; performing traffic switching based on the target redundant path; and notifying adjacent switches to update path information. Because this embodiment constructs a local network topology based on the local link status information of the links connected to the switch, monitors the health status of the links based on the local network topology, and then determines candidate redundant paths based on the local network topology when a link is in an abnormal state, and selects a target redundant path through a preset path selection strategy, compared to existing technologies, this embodiment improves the speed of fault convergence and the intelligence of path switching, thereby enhancing network reliability and real-time performance.

[0048] refer to Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the network loop protection method of the present invention.

[0049] Based on the first embodiment described above, in this embodiment, step S40 includes steps S401 to S404: Step S401: Obtain the current link performance parameters of each candidate redundant path, including latency, packet loss rate and bandwidth utilization.

[0050] Step S402: Perform a health assessment on each of the candidate redundant paths based on the current link performance parameters and preset weight factors to obtain a path health score for each candidate redundant path.

[0051] Step S403: Prioritize each candidate redundant path according to its path health score to obtain the priority ranking result.

[0052] Step S404: Based on the priority ranking result, select the candidate redundant path with the highest priority as the target redundant path.

[0053] It should be noted that the above-mentioned current link performance parameters may include latency (link latency), packet loss rate, bandwidth utilization, and link load.

[0054] Understandably, the preset weighting factor can be a pre-defined coefficient used to quantify the importance of different performance parameters in the overall evaluation.

[0055] It should be understood that the priority ranking result can refer to the sequential list obtained by arranging all candidate redundant paths from best to worst.

[0056] This embodiment discloses obtaining the current link performance parameters of each candidate redundant path, including latency, packet loss rate, and bandwidth utilization; performing a health assessment on each candidate redundant path based on the current link performance parameters and a preset weighting factor to obtain a path health score for each candidate redundant path; prioritizing each candidate redundant path according to its path health score to obtain a priority ranking result; and selecting the candidate redundant path with the highest priority as the target redundant path based on the priority ranking result. Because this embodiment performs a health assessment on each candidate redundant path based on the current link performance parameters and a preset weighting factor, prioritizes each candidate redundant path according to its path health score, and selects the candidate redundant path with the highest priority as the target redundant path, compared to existing technologies, this embodiment achieves dynamic and precise path selection, improves the automation level and efficiency of fault switching decisions, and thus improves network performance and reliability.

[0057] refer to Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the network loop protection method of the present invention.

[0058] Based on the above embodiments, in this embodiment, after step S40, steps S50 to S60 are further included: Step S50: When the link is detected to have recovered from an abnormal state to a normal state, the performance parameters of the recovered link are compared with the performance parameters of the target redundant path to obtain the performance comparison result.

[0059] Step S60: If the performance comparison result indicates that the performance parameters of the restored link are better than the performance parameters of the target redundant path, then the traffic is switched from the target redundant path back to the link.

[0060] It should be understood that after switching traffic from the target redundant path back to the link, the process may further include: sending a path recovery message to the relevant adjacent switches on the target redundant path via point-to-point communication to notify them to update their forwarding table information and stop using the target redundant path to forward the corresponding traffic.

[0061] This embodiment discloses that when a link is detected to have recovered from an abnormal state to a normal state, the performance parameters of the recovered link are compared with the performance parameters of the target redundant path to obtain a performance comparison result. If the performance comparison result indicates that the performance parameters of the recovered link are better than those of the target redundant path, then traffic is switched back from the target redundant path to the recovered link. Because this embodiment switches traffic back to the recovered link when the performance parameters of the recovered link are better than those of the target redundant path, compared to existing technologies, this embodiment not only enhances network stability but also achieves continuous optimization of network status, ensuring that services always run on the optimal path.

[0062] Furthermore, this embodiment of the invention also proposes a storage medium storing a network loop protection program, which, when executed by a processor, implements the steps of the network loop protection method described above.

[0063] Reference Figure 4 , Figure 4 This is a structural block diagram of the first embodiment of the network loop protection device of the present invention.

[0064] like Figure 4 As shown, the network loop protection device proposed in this embodiment of the invention is applied to a switch. The network loop protection device includes: a topology construction module 501, a status monitoring module 502, a path determination module 503, and a traffic switching module 504.

[0065] The topology construction module 501 is used to construct a local network topology based on the local link status information of the links connected to the switch.

[0066] The status monitoring module 502 is used to monitor the health status of the link based on the local network topology and obtain the link health assessment result.

[0067] The path determination module 503 is used to determine candidate redundant paths based on the local network topology when the link health assessment result determines that the link is in an abnormal state.

[0068] The traffic switching module 504 is used to select a target redundant path from the candidate redundant paths according to a preset path selection strategy, perform traffic switching according to the target redundant path, and notify adjacent switches to update path information.

[0069] The topology construction module 501 is further configured to obtain the link status parameters of the links connected to each port of the switch, and use the link status parameters as local link status information; receive link status information from adjacent switches through point-to-point communication; and generate a local network topology based on the local link status information and the link status information.

[0070] The status monitoring module 502 is further configured to determine the link to be monitored connected to the switch according to the local network topology; periodically collect the performance parameters of the link to be monitored, and compare the performance parameters with preset parameter thresholds to obtain comparison results; and generate the link health assessment result of the link to be monitored based on the comparison results.

[0071] The path determination module 503 is further configured to, when the link health assessment result determines that the current primary link is in an abnormal state, identify a set of reachable nodes of the switch as the source node from the local network topology; and determine a candidate redundant path connecting the source node and the target node based on the set of reachable nodes and the local network topology.

[0072] The traffic switching module 504 is further configured to update the local forwarding table of the switch according to the target redundant path; obtain the updated local forwarding table; switch traffic to the target redundant path based on the updated local forwarding table and generate a path update message; and send the path update message to the adjacent switches on the target redundant path through point-to-point communication to notify the adjacent switches to update the path information.

[0073] This embodiment of the device discloses constructing a local network topology based on the local link status information of the links connected to the switch; monitoring the health status of the links based on the local network topology to obtain link health assessment results; when the link health assessment results determine that the link is in an abnormal state, determining candidate redundant paths based on the local network topology; selecting a target redundant path from the candidate redundant paths according to a preset path selection strategy; performing traffic switching based on the target redundant path; and notifying adjacent switches to update path information. Because this embodiment constructs a local network topology based on the local link status information of the links connected to the switch, monitors the health status of the links based on the local network topology, and then determines candidate redundant paths based on the local network topology when a link is in an abnormal state, and selects a target redundant path through a preset path selection strategy, compared with existing technologies, this embodiment improves the speed of fault convergence and the intelligence of path switching, thereby enhancing network reliability and real-time performance.

[0074] Based on the first embodiment of the network loop protection device of the present invention, a second embodiment of the network loop protection device of the present invention is proposed.

[0075] In this embodiment, the traffic switching module 504 is further configured to obtain the current link performance parameters of each candidate redundant path, including latency, packet loss rate, and bandwidth utilization; perform a health assessment on each candidate redundant path based on the current link performance parameters and a preset weighting factor to obtain a path health score for each candidate redundant path; prioritize each candidate redundant path according to its path health score to obtain a priority ranking result; and select the candidate redundant path with the highest priority as the target redundant path based on the priority ranking result.

[0076] Other embodiments or specific implementations of the network loop protection device of the present invention can be referred to the above-described method embodiments, and will not be repeated here.

[0077] This application provides a network loop protection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the network loop protection method in Embodiment 1 above.

[0078] The following is for reference. Figure 5 This document illustrates a structural diagram of a network loop protection device suitable for implementing embodiments of this application. The network loop protection device in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 5 The network loop protection device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0079] like Figure 5As shown, the network loop protection device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in the read-only memory 1002 or a program loaded from the storage device 1003 into the random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the network loop protection device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the network loop protection device to communicate wirelessly or wiredly with other devices to exchange data. Although network loop protection devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0080] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0081] The network loop protection device provided in this application, employing the network loop protection method described in the above embodiments, can solve the technical problems of long fault convergence time and suboptimal redundant path selection in existing network loop protection methods, thereby affecting network reliability and real-time performance. Compared with the prior art, the beneficial effects of the network loop protection device provided in this application are the same as those of the network loop protection method provided in the above embodiments, and other technical features of this network loop protection device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0082] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0083] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0084] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0085] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0086] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0087] The above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the protection scope of the present invention.

Claims

1. A method for protecting network loops, characterized in that, The method is applied to a switch, and the method includes: Based on the local link status information of the links connected to the switch, a local network topology is constructed; Based on the local network topology, the health status of the link is monitored to obtain the link health assessment result; When the link health assessment result determines that the link is in an abnormal state, a candidate redundant path is determined based on the local network topology. According to the preset path selection strategy, a target redundant path is selected from the candidate redundant paths, traffic switching is performed based on the target redundant path, and adjacent switches are notified to update the path information.

2. The network loop protection method as described in claim 1, characterized in that, The step of constructing a local network topology based on the local link status information of the links connected to the switch includes: Obtain the link status parameters of the links connected to each port of the switch, and use the link status parameters as local link status information; Receive link status information from adjacent switches through point-to-point communication; A local network topology is generated based on the local link status information and the link status information.

3. The network loop protection method as described in claim 1, characterized in that, The step of monitoring the health status of the link based on the local network topology and obtaining the link health assessment result includes: Based on the local network topology, determine the links to be monitored connected to the switch; The performance parameters of the link to be monitored are periodically collected, and the performance parameters are compared with preset parameter thresholds to obtain the comparison results; Based on the comparison results, a link health assessment result for the link to be monitored is generated.

4. The network loop protection method as described in claim 1, characterized in that, The step of determining candidate redundant paths based on the local network topology when the link health assessment result determines that the link is in an abnormal state includes: When the link health assessment result determines that the current primary link is in an abnormal state, the set of reachable nodes of the switch as the source node is identified from the local network topology. Based on the set of reachable nodes and the local network topology, candidate redundant paths connecting the source node and the target node are determined.

5. The network loop protection method as described in claim 1, characterized in that, The step of selecting a target redundant path from the candidate redundant paths according to a preset path selection strategy includes: Obtain the current link performance parameters for each candidate redundant path, including latency, packet loss rate, and bandwidth utilization. Based on the current link performance parameters and preset weight factors, a health assessment is performed on each of the candidate redundant paths to obtain a path health score for each of the candidate redundant paths. The candidate redundant paths are prioritized based on their path health scores to obtain a priority ranking result. Based on the priority ranking results, the candidate redundant path with the highest priority is selected as the target redundant path.

6. The network loop protection method as described in claim 1, characterized in that, The step of performing traffic switching based on the target redundant path and notifying adjacent switches to update path information includes: Based on the target redundant path, update the local forwarding table of the switch to obtain the updated local forwarding table; Based on the updated local forwarding table, traffic is switched to the target redundant path, and a path update message is generated; The path update message is sent to the adjacent switches on the target redundant path via point-to-point communication to notify the adjacent switches to update the path information.

7. The network loop protection method according to any one of claims 1-6, characterized in that, After the step of performing traffic switching based on the target redundant path and notifying adjacent switches to update path information, the method further includes: When the link is detected to have recovered from an abnormal state to a normal state, the performance parameters of the recovered link are compared with the performance parameters of the target redundant path to obtain the performance comparison result. If the performance comparison result indicates that the performance parameters of the restored link are better than the performance parameters of the target redundant path, then the traffic will be switched from the target redundant path back to the link.

8. A network loop protection device, characterized in that, The device is used in a switch, and the device includes: The topology building module is used to build a local network topology based on the local link status information of the links connected to the switch; The status monitoring module is used to monitor the health status of the link based on the local network topology and obtain the link health assessment result; The path determination module is used to determine candidate redundant paths based on the local network topology when the link health assessment result determines that the link is in an abnormal state. The traffic switching module is used to select a target redundant path from the candidate redundant paths according to a preset path selection strategy, perform traffic switching based on the target redundant path, and notify adjacent switches to update path information.

9. A network loop protection device, characterized in that, The device includes: a memory, a processor, and a network loop protection program stored in the memory and executable on the processor, the network loop protection program being configured to implement the steps of the network loop protection method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium stores a network loop protection program, which, when executed by a processor, implements the steps of the network loop protection method as described in any one of claims 1 to 7.