A method for intelligent maintenance of a network topology loop

CN122601415APending Publication Date: 2026-08-18THE 34TH RES INST OF CHINA ELECTRONICS TECH CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610956852.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-30
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0007]本发明所要解决的是现有破环方案分别存在收敛慢、配置复杂或强依赖CFM等辅助协议的问题,提供一种网络拓扑智能维护环路的方法

Benefits of technology

[0020]1、自包含的链路检测机制:通过自定义CC报文实现链路通断判断,无需依赖CFM等外部协议;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601415A_ABST
    Figure CN122601415A_ABST
Patent Text Reader

Abstract

The application discloses a method for intelligently maintaining a loop of network topology, which specifies a key node router and its blocked port according to the position of the router in a ring communication network; all loop ports of each router send a continuity detection message at the same time interval, and periodically broadcast a self-state message to all loop ports after determining the device state based on the continuity detection message, and start a corresponding period counter; the routers on the loop make port adjustment according to the role: when there is a fault router in the loop, first change the fault loop port of the fault router to a blocked state, and then change the blocked port of the key node router to an open state; when the fault is recovered, first change the blocked port of the key node router to a blocked state, and then change the recovered fault loop port of the recovered fault router to an open state. The application has the characteristics of simple configuration, fast convergence speed, and no need to rely on other protocols and special hardware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data link layer control technology, and more specifically to a method for intelligently maintaining loops in network topology. Background Technology

[0002] In early switched Ethernet networks, network administrators would deploy multiple physical links between critical nodes to improve network reliability and redundancy. This would cause Layer 2 data frames to be endlessly forwarded between switches, creating a broadcast storm. When a broadcast frame is copied and forwarded by every switch in the loop, it will exponentially consume all bandwidth and turbulent CPU resources, and can paralyze the entire network within seconds.

[0003] To address the aforementioned issues, existing loop-breaking protocols mainly include STP (Spanning Tree Protocol), MSTP (Multiple Instance Spanning Tree Protocol), and G.8032 (Ethernet Ring Protection Switching Protocol, or ERP for short). Each of these three protocols has its own shortcomings:

[0004] STP technology is an early development, suitable for scenarios with small network size, simple topology, and no requirements for convergence speed and link utilization, and it has low technical requirements for maintenance personnel. However, its convergence time is as long as 30-50 seconds, which is unacceptable in most business scenarios today; at the same time, it blocks all redundant links, causing backup links to be idle for a long time, resulting in extremely low bandwidth utilization; and its mechanism means that only one path in the network is active at any given time, making it impossible to achieve traffic load balancing. Currently, this protocol has been largely phased out by the industry, and it is rarely deployed independently in actual production networks.

[0005] MSTP represents a significant improvement over STP / RSTP, suitable for medium to large enterprise networks with numerous VLANs and trunk links. It aims to distribute traffic from different VLANs across multiple links using different instances to achieve load balancing and improve bandwidth utilization. However, its convergence time is in the second range (typically 1-3 seconds), failing to reach sub-second (millisecond) levels, making it difficult to meet the stringent interruption time requirements of real-time services such as voice and video. Furthermore, configuration complexity is significantly increased, involving parameters such as domain configuration, instance-VLAN mapping, and revision levels. Strict consistency across switches is required; otherwise, the protocol will degrade to RSTP, immediately rendering load balancing ineffective, and troubleshooting will be far more difficult than with STP. Additionally, for a specific VLAN instance, only one link is still in forwarding mode, resulting in port congestion and preventing multi-link bandwidth aggregation.

[0006] G.8032 is a fast ring-breaking protocol specifically designed for ring topologies. Its main advantage lies in its extremely fast convergence speed, reaching sub-second levels (typically within 50 milliseconds). However, its configuration is extremely complex. The protocol relies on CFM (Connectivity Fault Management, IEEE 802.1ag) to detect the connectivity status of links on the ring. This requires binding the CFM link status judgment function to a specific ring instance and configuring the ring network node roles (RPL owner, RPL neighbor, ordinary node, etc.) on a node-by-node basis. The planning and debugging workload is significantly greater than that of MSTP. Secondly, the ring topology must be a physical ring, which inherently limits its applicability and prevents it from handling arbitrary mesh or tree topologies like MSTP. Furthermore, different vendors have significant differences in the implementation details of G.8032 and the degree of CFM adaptation, resulting in poor cross-vendor interoperability and a tendency for protection switching failures. Maintenance personnel need to possess high levels of professional skills to maintain it effectively. Summary of the Invention

[0007] The present invention addresses the problems of existing loop-breaking schemes, such as slow convergence, complex configuration, or strong dependence on auxiliary protocols such as CFM, and provides a method for intelligently maintaining loops in network topology.

[0008] To solve the above problems, the present invention is achieved through the following technical solution:

[0009] A method for intelligently maintaining loops in network topology includes the following steps:

[0010] Different roles are assigned to different routers based on their location in the ring network, namely ordinary routers and critical node routers, and the blocking ports of the critical node routers are specified. The specified critical node routers and their blocking ports ensure that there are no loops in the ring network.

[0011] All loop ports of each router send continuity test messages at the same time intervals;

[0012] Each router periodically broadcasts its own status message to all its loop ports and starts the corresponding period counter. That is, when all loop ports of this router can receive the continuity detection message sent by the neighboring router, it sends a normal status message and starts the loop fault-free period counter; otherwise, it sends a fault status message and starts the loop fault period counter.

[0013] Upon receiving a status message, each router checks whether the source router's MAC address in the status message is the same as its own MAC address. If so, the status message is discarded; otherwise, it is forwarded from the loop port. Simultaneously, a corresponding counter is activated based on the type of the status message: when the status message is a normal status message, the loop fault-free cycle counter is started; when the status message is a fault status message, the loop fault cycle counter is started.

[0014] When a faulty router exists in the loop, the faulty router will block its loop port when the loop fault cycle counter reaches the set fault cycle threshold N1; the critical node router will open its blocked port when the loop fault cycle counter reaches the set critical fault cycle threshold M1; where M1 > N1.

[0015] When there are no faulty links in the loop, the critical node router will change its blocked port to a blocked state when the count value of the loop fault-free cycle counter reaches the set critical fault-free cycle threshold M2; the recovery fault router will change its recovery loop port to an open state when the count value of the loop fault-free cycle counter reaches the set fault-free cycle threshold N2; where N2 > M2.

[0016] In the above scheme, the formats of continuous detection messages, normal status messages, or fault status messages are as follows:

[0017]

[0018] Where DA is the destination router MAC address, SA is the source router MAC address, ETH-TYPE is a custom protocol number, and OP-Code is used to identify the packet type. The OP-Code value of a continuity detection packet is 1, the OP-Code value of a normal state packet is 2, and the OP-Code value of a fault state packet is 3.

[0019] Compared with the prior art, the present invention has the following characteristics:

[0020] 1. Self-contained link detection mechanism: Link connectivity is determined through custom CC packets, without relying on external protocols such as CFM;

[0021] 2. Dual-timer state machine: Introducing a loop fault cycle counter and a loop fault-free cycle counter to achieve stable and orderly switching of port states during fault occurrence and recovery, thereby enhancing fault tolerance;

[0022] 3. Differentiate between critical node routers and ordinary routers. Only critical nodes are configured with static blocking ports, and in case of failure, the switch is uniformly handled by this port. Ordinary devices only handle their own faulty ports.

[0023] 4. It is easy to configure, has a fast convergence speed, and does not rely on other protocols or dedicated hardware. Attached Figure Description

[0024] Figure 1 This is a schematic diagram of a ring communication network as an example. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific examples.

[0026] A method for intelligently maintaining loops in network topology includes the following steps:

[0027] Step 1: Assign different roles to different routers based on their location in the ring network, namely ordinary routers and critical node routers, and specify the blocking ports of the critical node routers. The specified critical node routers and their blocking ports ensure that there are no loops in the ring network.

[0028] In the roles of a regular router and a critical node router, the critical node router is designated by the network administrator. Traffic blocking is configured on a designated port (blocking port) of the critical node router, i.e., bound to an Instance defined in the MSTP protocol. The blocking instance specifies the VLAN (Virtual Local Area Network) range to be blocked, ensuring no loops in the ring network. Blocking the blocking port of this critical node router does not affect normal communication. Subsequent continuity check packets and status packets whose source / destination router MAC addresses do not belong to the blocking VLAN range are forwarded to the software layer by setting ACL rules.

[0029] Step 2: All loop ports of each router send ContinuityCheck (CC) messages at the same time interval.

[0030] The network administrator enables loop functionality on the router's loop ports (loop ports). Ports with enabled loop functionality use timers to send CC (Continuity Check) messages at regular time intervals to determine link connectivity. The message format is shown in Table 1.

[0031] Table 1 CC Message Format

[0032]

[0033] Where DA is the destination router MAC address and SA is the source router MAC address; ETH-TYPE is a custom protocol number, and in this embodiment, 0x8903 is used as the protocol number for message interaction; OP-Code is used to identify the message type, and when the value of OP-Code is 1, it means that the current message being sent is a CC message.

[0034] Step 3: Each router periodically broadcasts its own status message to all its loop ports and starts the corresponding period counter. That is, when all loop ports of this router can receive continuity detection messages from neighboring routers, it sends a normal status message (No Request, NR) and starts the loop fault-free period counter; otherwise, it sends a fault status message (Signal Fail, SF) and starts the loop fault period counter.

[0035] When a router receives a CC packet, it forwards it to the upper-layer software for processing but does not forward it. The router's upper-layer software maintains a neighbor list. When the router's loop port receives a CC packet, it adds the neighbor's MAC address as a unique index to the neighbor list and marks the neighbor as alive. If no CC packets are received from the peer for two cycles, the neighbor's state is changed to invalid, indicating a fault in the current link.

[0036] The router starts the NR_SF timer to send NR or SF messages. Each time the NR_SF timer runs, it checks if the number of neighbors in the neighbor list equals the number of loop ports. If they do, it means all loop ports on this router are functioning correctly, and the loop function needs to be enabled to send NR messages to all loop ports. Simultaneously, the loop fault-free cycle counter needs to be started and then reset to zero. Otherwise, it means at least one loop port on this router has a fault, and the loop function needs to be enabled to send SF messages to all loop ports. The loop fault-free cycle counter and the loop fault-free cycle counter are used in the NR_SF timer as the basis for port blocking and opening.

[0037] When the router enables the loop function, the router broadcasts router status messages based on the current status of the loop port. The status messages include the following two types: NR messages and SF messages.

[0038] An NR message indicates that the router's link in the loop is functioning normally and that it can receive CC messages from neighboring routers, meaning that the router has no link failures or closed ports. The message format is shown in Table 2.

[0039] Table 2 NR Message Format

[0040]

[0041] Where DA is the destination router MAC address and SA is the source router MAC address; ETH-TYPE is a custom protocol number, and in this embodiment, 0x8903 is used as the protocol number for message interaction; OP-Code is used to identify the message type, and when the value of OP-Code is 2, it means that the current message being sent is an NR message.

[0042] SF messages indicate that the router is experiencing a link failure within a loop. The absence of CC messages from neighboring routers suggests a link failure or port closure on this router. The message format is shown in Table 3.

[0043] Table 3 SF Message Format

[0044]

[0045] Where DA is the destination router MAC address and SA is the source router MAC address; ETH-TYPE is a custom protocol number, and in this embodiment, 0x8903 is used as the protocol number for message interaction; OP-Code is used to identify the message type, and when the value of OP-Code is 3, it means that the current message being sent is an SF message.

[0046] Step 4: After receiving a status message, each router checks whether the source router's MAC address in the status message is the same as its own MAC address. If so, the status message is discarded; otherwise, the status message is forwarded from the loop port. At the same time, the corresponding counter is started according to the type of status message: when the status message is a normal status message, the loop fault-free cycle counter is started; when the status message is a fault status message, the loop fault cycle counter is started.

[0047] When a router receives a status message, it forwards it to the upper-layer software for processing. It only forwards status messages not generated by this router, and does not process status messages generated by this router. Specifically, status messages whose source router MAC address is the same as this router's MAC address are discarded, while status messages whose source router MAC address is not this router's MAC address are forwarded.

[0048] The router's upper-layer software maintains a list of loop devices with MAC addresses as unique indexes. If the MAC address of the SA in the current status message is not in the loop device list, the loop device information for sending the NR message is added to the loop device list.

[0049] Step 5: When there is a faulty router in the loop (the link in the loop is faulty), the routers on the loop make port adjustments according to their roles: When the count value of the loop fault cycle counter reaches the set fault cycle threshold N1 (N1≥1), the faulty router changes the faulty loop port to a blocked state; When the count value of the loop fault cycle counter reaches the set critical fault cycle threshold M1, the critical node router changes the blocked port to an open state.

[0050] Given that link state switching requires a delay when a loop link fails, M1 > N1 is set to ensure that the loop port of a normal node router is already blocked when the blocked port of a critical node router is opened. This time delay ensures the normal operation of the loop.

[0051] Step 6: When there are no faulty links in the loop (the links in the loop are restored), the routers on the loop make port adjustments according to their roles: When the count value of the loop fault-free cycle counter reaches the set critical fault-free cycle threshold M2 (M2≥1), the critical node router changes the blocked port of the critical node router to the blocked state; When the count value of the loop fault-free cycle counter reaches the set fault-free cycle threshold N2, the recovery fault loop port of the recovery fault router changes to the open state.

[0052] Given that link state switching requires a delay when recovering from a loop fault, N2 is set to be greater than M2 to ensure that the blocked port of the critical node router is already blocked when the loop port of a normal node router is opened. This time delay ensures the normal operation of the loop.

[0053] This invention implements a link protection switching function for Ethernet ring networks. When a link in the ring fails, it can quickly and automatically switch traffic to a backup link. When the failed link in the ring recovers, it can quickly and automatically switch back to the initial link state, ensuring almost uninterrupted service. Compared to STP and MSTP protocols, it has advantages such as lower bandwidth utilization, faster convergence speed, and simpler configuration compared to G.8032.

[0054] exist Figure 1 In the illustrated embodiment, PC1 and PC2 are two terminal routers that need to communicate through a ring communication network, which is a routing network composed of n routers. Based on the routers' positions within the ring communication network, the network administrator designates router Dev-1 as a critical node router and designates its port eth0 as a blocking port. The designated critical node router and its blocking port ensure that there are no loops in the ring communication network.

[0055] Routers in a loop communicate via CC messages between their ports. They determine link connectivity based on the liveness status of their neighbors. When the loop is running normally, the loop routers send NR messages to other routers in the loop. Other routers that receive the NR messages forward the messages and inform other routers in the loop. When the NR message returns to the sending router, the forwarding stops and the message is discarded.

[0056] When a link fails, the NR_SF timer of the failed router expires and sends an SF message to the normal port, informing other routers in the loop that a link failure exists. Routers receiving the SF message determine their behavior based on their router roles: if the router is a normal router and a local link failure exists, it blocks the failed port when the failure period reaches a preset value; if the router is a critical node router, it opens the local blocked port when the failure period reaches a preset value. For example, when the failure period of the failed router Dev-6 reaches the preset value, the port of the failed link will be changed from open to blocked; the designated blocked port of the critical node router will be changed to open when the failure period reaches the preset value. In this case, the existence of the failed link ensures that there is no loop in the communication path. Traffic forwarded from Dev-6 to Dev-n on PC2 is switched to router Dev-(n-1), and then forwarded from Dev-n to PC2.

[0057] When the link returns to normal, the restored router sends NR messages to the loop. Upon receiving the messages, the routers in the loop start a loop fault-free cycle count. When the loop fault-free cycle count reaches a preset value, the critical node router switches its designated blocked port from open to blocked, and the faulty port of the original faulty router switches from blocked to open. At this point, the loop state returns to its initial state.

[0058] It should be noted that this invention is only applicable when there is only one link failure. When there are too many link failures, network maintenance personnel still need to intervene.

[0059] Although the embodiments described above are illustrative, they are not intended to limit the invention. Therefore, the invention is not limited to the specific embodiments described above. Any other embodiments obtained by those skilled in the art under the guidance of this invention without departing from its principles are considered to be within the protection scope of this invention.

Claims

1. A method for intelligently maintaining loops in network topology, characterized in that, The steps include the following: Different roles are assigned to different routers based on their location in the ring network, namely ordinary routers and critical node routers, and the blocking ports of the critical node routers are specified. The specified critical node routers and their blocking ports ensure that there are no loops in the ring network. All loop ports of each router send continuity test messages at the same time intervals; Each router periodically broadcasts its own status message to all its loop ports and starts the corresponding period counter. That is, when all loop ports of this router can receive the continuity detection message sent by the neighboring router, it sends a normal status message and starts the loop fault-free period counter to start counting. Otherwise, send a fault status message and start the loop fault cycle counter to begin counting; Upon receiving a status message, each router checks whether the source router's MAC address in the status message is the same as its own MAC address. If so, the status message is discarded; otherwise, it is forwarded from the loop port. Simultaneously, a corresponding counter is activated based on the type of the status message: when the status message is a normal status message, the loop fault-free cycle counter is started; when the status message is a fault status message, the loop fault cycle counter is started. When a faulty router exists in the loop, the faulty router will block the faulty loop port when the count value of the loop fault cycle counter reaches the set fault cycle threshold N1. When the count value of the loop fault cycle counter reaches the set critical fault cycle threshold M1, the critical node router will open the blocked port of the critical node router; where M1 > N1. When there are no faulty links in the loop, the critical node router will change the blocked port of the critical node router to a blocked state when the count value of the loop fault-free cycle counter reaches the set critical fault-free cycle threshold M2. When the loop fault-free cycle counter of the recovery router reaches the set fault-free cycle threshold N2, the recovery loop port of the recovery router will be turned on. Where N2 > M2.

2. The method for intelligently maintaining loops in network topology according to claim 1, characterized in that, The formats for continuity monitoring messages, normal status messages, or fault status messages are as follows:

3. Among them, DA is the destination router MAC address, SA is the source router MAC address, ETH-TYPE is a user-defined protocol number, and OP-Code is used to identify the packet type. The OP-Code value is 1 for continuity detection packets, 2 for normal state packets, and 3 for fault state packets.