Switching method of erps ring network, switching device and storage medium

By generating SF R-APS messages that integrate all affected ring identifiers in the ERPS ring network, the problem of long recovery time in the existing ERPS ring network is solved, and fast switching and consistent recovery time are achieved.

CN120915629BActive Publication Date: 2026-06-26KYLAND TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
KYLAND TECH CO LTD
Filing Date
2025-08-22
Publication Date
2026-06-26

Smart Images

  • Figure CN120915629B_ABST
    Figure CN120915629B_ABST
Patent Text Reader

Abstract

The application relates to a switching method of an ERPS ring network, a switching device and a storage medium. In the scheme, when the link between the first switching device and the adjacent switching device is disconnected, all affected rings are determined, a target ring and a target port are determined from the affected rings, an SF R-APS message is generated according to the identifiers of all the affected rings, and the message is sent to the second switching device through the target port. The second switching device adjusts the port state and the FDB table of the affected ring to which the second switching device belongs according to the identifier of the affected ring in the message. In this way, the first switching device does not need to send the SF R-APS message multiple times, and only needs to integrate the identifiers of all the affected rings into the SF R-APS message. The second switching device can uniformly execute corresponding port state and FDB table adjustment operations on all the affected rings, so that the ring network recovery time is significantly improved, and the fast switching of the ERPS ring network is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Ethernet communication technology, and in particular to a switching method, switching equipment and storage medium for an ERPS ring network. Background Technology

[0002] ERPS (Ethernet Ring Protection Switching) is a Layer 2 ring breaking protocol standard defined by the ITU-T (International Telecommunication Union-Telecommunication Standardization Sector). An ERPS ring is the basic unit of the ERPS protocol, consisting of a group of interconnected switching devices configured with the same control VLAN (Virtual Local Area Network).

[0003] Since ERPS rings are VLAN-based, each ERPS ring can be configured with a list of VLANs to be protected, typically supporting up to 64 ERPS rings. When a link between switching devices fails, the node detecting the fault checks which ERPS ring the faulty port belongs to, and then sequentially sends SF R-APS messages (Signal Fail Ring Auto Protection Switching) specifying these ring IDs. Other nodes then receive these messages in sequence and perform port blocking and FDB (Forwarding Database) refresh operations. If the faulty port belongs to rings 1-16, the faulty node will send SF R-APS messages 16 times in sequence, and other nodes will sequentially perform 16 FDB clearing and port blocking operations. However, due to limitations in CPU (Central Processing Unit) packet sending and receiving capabilities, network transmission protocol message time, and node hardware configuration efficiency, the actual network recovery time is much longer than expected, especially for ERPS rings processed later in the order, where recovery time is often longer.

[0004] Therefore, how to achieve rapid switching of the ERPS ring network when the link between switching devices fails is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0005] This application provides a switching method, switching equipment, and storage medium for an ERPS ring network, enabling rapid switching of the ERPS ring network when a link between the switching equipment fails.

[0006] In a first aspect, this application provides a switching method for an ERPS ring network, the switching method being applied to a first switching device, the method comprising:

[0007] If a link is detected to the first switching device from an adjacent switching device, then all affected rings of the first switching device are identified;

[0008] A target ring is determined from the affected rings, and a target port corresponding to the faulty port is found in the target ring; wherein, the faulty port is the port in the target ring where the first switching device is connected to the adjacent switching device;

[0009] SF R-APS message is generated based on the identifier of the affected ring;

[0010] The SF R-APS message is sent through the target port to the second switching device in the direction of the non-faulty link, so that the second switching device can adjust the port status and FDB table of the affected ring to which the second switching device belongs based on the identifier of the affected ring in the SF R-APS message.

[0011] Optionally, an SF R-APS message is generated based on the identifier of the affected ring, including:

[0012] Determine the number of rings in the affected ring;

[0013] An SFR-APS message is generated based on the number of affected rings, the identifier of the affected rings, and the R-APS message format; wherein, the destination MAC of the SFR-APS message contains special bytes for indicating ring network switching.

[0014] Optionally, after determining all affected rings of the first switching device, the method further includes:

[0015] Determine whether the faulty link between the first switching device and the adjacent switching device in each affected ring is a ring network protection link;

[0016] If not, set the status of the faulty port of the first switching device in the affected ring to blocked state and refresh the FDB table.

[0017] Optionally, if the link between the first switching device and the adjacent switching device is detected to be restored, the handover method further includes:

[0018] Based on the number of affected rings, the identifier of the affected rings, and the R-APS message format, an NRR-APS message is generated, and the NRR-APS message is sent through the target port to the second switching device in the direction of the non-faulty link, so that the second switching device can perform a switchback operation based on the NRR-APS message.

[0019] Optionally, after sending the NR R-APS message through the target port to the second switching device in the direction of the non-faulty link, the method further includes:

[0020] Receive NRRB R-APS messages sent by the second switching device; wherein, the NRRB R-APS message is a message generated by the second switching device through the number of rings to be switched back, the identifier of the rings to be switched back, and the R-APS message format;

[0021] If the port of the first switching device in the loop to be switched back is an RPL neighbor port, then set the state of the RPL neighbor port to blocked state and refresh the FDB table.

[0022] If the port of the first switching device in the loop to be switched back is a normal port, then the status of the normal port is set to forwarding status, and the FDB table is refreshed.

[0023] Secondly, this application provides a switching method for an ERPS ring network, the switching method being applied to a second switching device, the method comprising:

[0024] Receive an SF R-APS message sent by the first switching device; wherein the SF R-APS message is generated by the above-described switching method;

[0025] Based on the identifier of the affected ring in the SF R-APS message, the port status and FDB table of the affected ring to which the second switching device belongs are adjusted.

[0026] Optionally, based on the identifier of the affected ring in the SF R-APS message, the port status and FDB table of the affected ring to which the second switching device belongs are adjusted, including:

[0027] From the identifier of the affected ring in the SF R-APS message, find the affected ring to which the second switching device belongs;

[0028] Determine the port type of the second switching device within its affected ring;

[0029] If the port type is an RPL owner port or an RPL neighbor port, then set the port status to forwarding status and refresh the FDB table.

[0030] Optionally, if the second switching device receives an NR R-APS message sent by the first switching device, the switchback operation performed by the second switching device based on the NR R-APS message includes:

[0031] From the identifier of the affected ring in the NR R-APS message, find the affected ring to which the second switching device belongs, and determine the configuration mode of the RPL owner port of the second switching device in the affected ring to which it belongs;

[0032] If the configuration mode is switchback mode, then start the timer of the affected ring and add it to the timer task list;

[0033] The timer task list is periodically polled, and the affected rings corresponding to the timers that have expired in the timer task list are taken as rings to be switched back. The status of the RPL owner port in the rings to be switched back is set to the blocked state, and the FDB table is refreshed.

[0034] Based on the number of rings to be switched back, the identifier of the rings to be switched back, and the R-APS message format, an NRRB R-APS message is generated, and the NRRB R-APS message is sent to the adjacent switching device through the second switching device at the two ports of the target ring.

[0035] Thirdly, this application provides a switching device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus.

[0036] Memory, used to store computer programs;

[0037] When a processor executes a program stored in memory, it implements the steps of the switching method described above.

[0038] Fourthly, this application also provides a computer storage medium storing computer-executable instructions for performing the steps of the switching method described above.

[0039] Compared with the prior art, the technical solution provided in this application has the following advantages: This application provides a switching method, switching equipment, and storage medium for an ERPS ring network. In this solution, if a link between the first switching equipment and an adjacent switching equipment is detected to be disconnected, all affected rings of the first switching equipment are determined, and a target ring is determined from the affected rings. The target port corresponding to the faulty port is then found in the target ring. Then, an SF R-APS message is generated based on the identifiers of all affected rings and sent to the second switching equipment in the direction of the non-faulty link through the target port. This allows the second switching equipment to adjust the port status and FDB table of the affected rings to which the second switching equipment belongs based on the identifiers of the affected rings in the SF R-APS message. In this way, the first switching equipment does not need to send SF R-APS messages multiple times, and the second switching equipment does not need to perform port status and FDB table adjustment operations multiple times. The first switching equipment only needs to integrate the identifiers of all affected rings into the SF R-APS message, and the second switching equipment can uniformly perform the corresponding adjustment operations on all affected rings, thereby significantly improving the ring network recovery time and realizing fast switching of the ERPS ring network. Attached Figure Description

[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0043] Figure 1 A schematic diagram of an ERPS ring provided in an embodiment of this application;

[0044] Figure 2 A schematic diagram of an ERPS message format provided in an embodiment of this application;

[0045] Figure 3 This is a schematic diagram illustrating the Request / state value retrieval method provided in an embodiment of this application.

[0046] Figure 4Another schematic diagram of an ERPS ring provided in an embodiment of this application;

[0047] Figure 5 Another schematic diagram of an ERPS ring provided in an embodiment of this application;

[0048] Figure 6 A schematic flowchart of a switching method for an ERPS ring network provided in an embodiment of this application;

[0049] Figure 7 Another schematic diagram of an ERPS ring provided in an embodiment of this application;

[0050] Figure 8 This is a schematic diagram of a switching device structure provided in an embodiment of this application. Detailed Implementation

[0051] Before describing the embodiments of this application, the technical terms involved in this application will be explained below:

[0052] 1. ERPS is a Layer 2 ring disruption protocol standard that defines the R-APS (Ring Auto Protecting Switching) protocol messages and protection switching mechanism. Compared to other Layer 2 ring protocols such as STP (Spanning Tree Protocol), RSTP (Rapid Spanning Tree Protocol), and MSTP (Multiple Spanning Tree Protocol), ERPS features fast convergence speed (optimized detection mechanism, recovery time can reach millisecond level) and high compatibility.

[0053] 2. An ERPS ring is the basic unit of the ERPS protocol, consisting of a group of interconnected switching devices configured with the same control VLAN. In a multi-ring structure, it includes one main ring and at least one sub-ring.

[0054] 3. Node (Ethernet ring node): A Layer 2 switching device added to an ERPS ring is called a node. Each node cannot have more than two ports added to the same ERPS ring. See [link to relevant documentation]. Figure 1 The figure shows a schematic diagram of an ERPS ring provided in an embodiment of this application. Switch A to Switch D are switching devices A to D. Switch A to Switch D in the figure are the four nodes in this ERPS ring.

[0055] 4. Ring Protection Link (RPL): In non-faulty conditions, this link prevents loops by blocking the ports at both ends. The ports at both ends are the RPL owner port and the RPL neighbor port, respectively.

[0056] 5. Port Role: The ERPS protocol specifies three main types of port roles: RPL owner port, RPL neighbor port, and ordinary port.

[0057] RPL owner port: The port located at one end of the RPL link, specified by the user configuration. There is only one RPL owner port per ERPS ring. Under non-fault conditions, the RPL owner port is in a blocked state to prevent loops from forming in the link. A node containing an RPL owner port is also called an RPL owner node.

[0058] RPL neighbour port: A port located at the other end of an RPL link. An RPL neighbour port refers to a node port directly connected to the RPL owner port. Under normal fault conditions, the RPL neighbour port is blocked to prevent loops. When a non-RPL link in the ERPS ring network fails, both the RPL owner port and the RPL neighbour port will be opened. A node containing an RPL neighbour port is also called an RPL neighbour node.

[0059] Normal ports: In the ERPS ring, all ports except those of the RPL owner and RPL neighbor are normal ports. Normal ports are responsible for monitoring the status of their directly connected links and promptly notifying other nodes in the ring network of any changes in link status.

[0060] like Figure 1 As shown, the link between Switch A and Switch B is an RPL link. Therefore, the port of Switch A connected to Switch B is the RPL owner port, and the port of Switch B connected to Switch A is the RPL neighbor port. The other ports of Switch A, the other ports of Switch B, and the ports of Switch C and Switch D are all ordinary ports.

[0061] See Figure 2The figure shows a schematic diagram of an ERPS message format provided in an embodiment of this application. As shown in the figure, the ERPS message includes Request / State, Sub-code, Node ID, and Reserved.

[0062] See Figure 3 This figure illustrates a Request / state value retrieval method provided in an embodiment of this application. As shown, the field in the figure represents Request / state, and the value and corresponding description of this field are as follows:

[0063] 1101 - Forced switch, 1110 - Event, 1011 - Signal fail (SF), 0111 - Manual switch (MS), 0000 - No request (NR), Other (other values).

[0064] like Figure 1-3 As shown, in a non-faulty state, the RPL owner port and RPL neighbor port will be blocked to prevent the formation of a loop. At the same time, the RPL owner node will periodically send NRRB (No Request with Request Blocked) R-APS messages to other nodes in its ERPS ring (i.e., the Request / state value is 0000, and the RB bit of the Status field is 1, indicating that the RPL link is in a blocked state), indicating that there is no fault in the current ERPS ring.

[0065] See Figure 4 This diagram illustrates another ERPS ring provided in this application embodiment. A link failure occurs between Switch C and Switch D (i.e., a link down is detected), triggering a protection switching mechanism. This involves blocking the ports at both ends of the faulty link and refreshing the FDB table on the local device. Switch C and Switch D then send SF R-APS messages to other nodes in the ERPS ring to disseminate the fault information. Upon receiving the SF R-APS messages, Switch A and Switch B respectively open the RPLowner port and RPL neighbour port and refresh the FDB table, enabling traffic switching and restoring normal network communication.

[0066] See Figure 5This is another ERPS ring diagram provided in this application embodiment. When the link fault between Switch C and Switch D is removed (i.e., the link is detected to be relinked up), the fault return mode is started. First, Switch C and Switch D stop sending SF R-APS messages and send NR R-APS messages to indicate that the fault has been removed. After Switch A receives the NR R-APS message, it blocks the RPL owner port and refreshes the FDB table. At the same time, the RPL owner node sends NRRB R-APS messages. When Switch C and Switch D receive the NRRB R-APS messages, they open the ports that were previously blocked in the fault state, stop sending NR R-APS messages, and refresh the FDB table. After Switch B receives the NRRB, it sets the RPL neighbor port to the blocked state and refreshes the FDB table.

[0067] However, when sending messages in the above manner, if a link failure occurs, the faulty node will send multiple SF R-APS messages sequentially. Other nodes, needing to receive each SF R-APS message, will perform multiple FDB table clearing and port blocking actions, resulting in an actual network recovery time that is much longer than expected, especially for ERPS rings processed later in the order, where recovery time is often longer. Therefore, this application provides a switching method, switching equipment, and storage medium for ERPS ring networks. This solution can achieve rapid switching of the ERPS ring network when a link failure occurs between switching equipment, improving the ring network recovery speed.

[0068] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0069] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0070] See Figure 6This is a schematic flowchart of a switching method for an ERPS ring network provided in an embodiment of this application. The switching method is applied to a first switching device and includes:

[0071] S101. If the link between the first switching device and the adjacent switching device is detected to be disconnected, then all affected rings of the first switching device are determined.

[0072] In this embodiment, the execution entity of the switching method is a first switching device, which is the switching device on both sides of the faulty link, the adjacent switching device is the switching device on the other side of the faulty link of the first switching device, and the second switching device is the switching device on the non-faulty link direction; as shown Figure 4 In the case of a link failure between Switch C and Switch D, both Switch C and Switch D are considered the first switching devices. If the first switching device is Switch C, then the adjacent switching device is Switch D. After Switch C generates an SF R-APS message through this application, it sends it to the second switching device in the direction of the non-faulty link, which is Switch A. If the first switching device is Switch D, then the adjacent switching device is Switch C. After Switch D generates an SF R-APS message through this application, it sends it to the second switching device in the direction of the non-faulty link, which is Switch B.

[0073] In this application, each switching device is associated with multiple rings. After the link between the first switching device and its adjacent switching devices is broken, it is necessary to determine all the affected rings of the first switching device. See [link to application]. Figure 7 This is another schematic diagram of an ERPS ring provided in an embodiment of this application, such as... Figure 7 As shown, Switch A, Switch B, Switch C, and Switch D form an 8-ERPS ring network, namely ERPS1 to 8. The RPL links of ERPS1 to 4 are located between Switch A and B, and the RPL links of ERPS5 to 8 are located between Switch C and D. Under normal fault conditions, ERPS1-4 are blocked in the RPL between Switch A and B, and ERPS5-8 are blocked in the RPL between Switch C and D; the overall network traffic forwarding is normal. If the link between Switch C and Switch D is broken, and Switch C is the first switching device, then the ports of the first switching device are associated with ERPS1-8, which are the affected rings. The identifier of each affected ring is recorded; this identifier is the ring ID of the affected ring.

[0074] S102. Determine the target ring from the affected rings, and find the target port corresponding to the faulty port in the target ring; wherein, the faulty port is the port of the first switching device in the target ring that is connected to the adjacent switching device;

[0075] In this application, when determining all affected rings of the first switching device, it is also necessary to determine the target ring from the affected rings. The target ring is one of the affected rings. The target ring can be the first ring found. Then, the target port corresponding to the faulty port is found from the target ring. The faulty port is the port of the first switching device in the target ring that is connected to the adjacent switching device. The target port is another port of the first switching device in the target ring other than the faulty port. The target port is used to send / receive each R-APS message.

[0076] Specifically, the switching equipment is configured with two ports on each ring. For example, if the first switching equipment is SwitchC and the target ring is ERPS1, SwitchC has two ports in ERPS1: Port 1 and Port 2. Port 1 is the port connected to SwitchD, and Port 2 is the port connected to SwitchA. If the link between SwitchC and SwitchD is broken, then Port 1 becomes the faulty port, and Port 2 becomes the target port, which can be referred to as RPort.

[0077] S103. Generate an SF R-APS message based on the identifier of the affected ring;

[0078] After identifying all affected rings of the first switching device, this application needs to record the identifier of each affected ring, i.e., each ring ID. Then, based on the identifier of each affected ring, an SF R-APS message is generated. The SF R-APS message integrates the identifiers of all affected rings so that other switching devices that receive the message can uniformly perform FDB clearing and port blocking actions for each affected ring according to the identifier of the affected ring in the SF R-APS message.

[0079] S104. Send the SF R-APS message through the target port to the second switching device in the direction of the non-faulty link, so that the second switching device can adjust the port status and FDB table of the affected ring to which the second switching device belongs based on the identifier of the affected ring in the SF R-APS message.

[0080] In this application, after generating the SF R-APS message, it needs to be sent to the second switching device in the non-faulty link direction through the target port determined above. The non-faulty link direction in this application refers to the direction without a faulty link, such as... Figure 7As shown, if the link between Switch C and Switch D is broken, and if Switch C is the first switching device, the target ring is ERPS1, the target port of Switch C in ERPS1 is RPort, and the non-faulty link direction is from Switch C to Switch A, then after generating an SF R-APS message, the SF R-APS message is sent to Switch A through RPort; and when sending the SF R-APS message, the control VID (VLAN ID) is the control VID of ERPS1, and the node Id is the Id of Switch C.

[0081] The second switching device in this application receives the SF R-APS message and adjusts the port status and FDB table of the affected ring to which the second switching device belongs based on the identifier of the affected ring in the SF R-APS message.

[0082] In another embodiment of this application, the process of adjusting the port status and FDB table of the affected ring to which the second switching device belongs based on the identifier of the affected ring in the SF R-APS message includes: finding the affected ring to which the second switching device belongs from the identifier of the affected ring in the SF R-APS message; determining the port type of the port of the second switching device in the affected ring to which it belongs; if the port type is an RPL owner port or an RPL neighbor port, then setting the port status to forwarding status and refreshing the FDB table.

[0083] In this application, since different switching devices are associated with different rings, after receiving the SF R-APS message, the second switching device will filter out the affected ring to which the second switching device belongs from the identifier of the affected ring in the SF R-APS message, and generate a ring ID list based on the ring identifier of the affected ring to which the second switching device belongs. For example, if the identifier of the affected ring in the SF R-APS message is 1-8, and the identifier of the ring associated with the second switching device is 4-10, then the affected ring to which the second switching device belongs is the ERPS ring with identifier 4-8.

[0084] After obtaining the ring ID list, it is necessary to traverse the ring ID list. If the second switching device is a normal node in a certain ERPS ring, then only the FDB refresh is performed on the ports of the second switching device in that ERPS ring. If the second switching device is an RPL node in that ERPS ring, that is, the second switching device is an RPL owner port or an RPL neighbor port in that ERPS ring, then the RPL owner port or RPL neighbor port needs to be opened, the port status needs to be set to forwarding status, and the FDB refresh action needs to be performed at the same time.

[0085] In summary, in this application, the first switching device does not need to send SF R-APS messages multiple times, and the second switching device does not need to perform port status and FDB table adjustment operations multiple times. The first switching device only needs to integrate the identifiers of all affected rings into the SF R-APS message, and the second switching device can uniformly perform the corresponding adjustment operations on all affected rings, thereby significantly improving the ring network recovery time and realizing the rapid switching of the ERPS ring network.

[0086] In another embodiment of this application, the process of generating an SF R-APS message based on the identifier of the affected ring includes:

[0087] Determine the number of affected rings; generate SF R-APS messages based on the number of affected rings, the identifiers of the affected rings, and the R-APS message format; wherein, the destination MAC of the SF R-APS message contains special bytes used to indicate ring network switching.

[0088] In this application, the number of affected rings is the total number of affected rings. After determining the number of affected rings and the identifier of the affected rings, an SF R-APS message can be generated according to the R-APS message format. In order to distinguish it from other messages, this application can set a special byte in the destination MAC of the SF R-APS message to indicate ring network switching.

[0089] Specifically, the destination MAC (Media Access Control) of the R-APS message is fixed as {0x01,0x19,0xa7,0x00,0x00,0x00}, and the last byte represents the Ring ID. In this application, the destination MAC of all R-APS messages uses {0x01,0x19,0xa7,0x00,0x00,0xff}, that is, the last byte of the original destination MAC is changed from 0x00 to a special byte 0xff (255). This special byte will not be repeated with other ring IDs and is used to distinguish specific R-APS messages in this application.

[0090] Furthermore, in this application, the source MAC address of the SF R-APS message is the MAC address of the ring port RPort, the transmission VLAN is the VID of the target ring, the Request field is SF, and a new field is added after the original R-APS message to record the number of affected rings and their identifiers. That is: {RingCount: 1 byte, RingIDArray: 1 byte [1…64]}; where RingCount represents the total number of affected ERPS rings, and RingIDArray is a variable-length array of 1 to 64 bytes, with each element also being 1 byte, used to store the identifier of the affected ring.

[0091] In summary, when sending SF R-APS messages, this application can generate a message that integrates all affected rings based on the number of affected rings and the identifiers of the affected rings, eliminating the need to send multiple SF R-APS messages separately, thus reducing the number of message transmissions and improving transmission efficiency.

[0092] In another embodiment of this application, after determining all affected rings of the first switching device, the method further includes:

[0093] Determine whether the faulty link between the first switching device and the adjacent switching device in each affected ring is a ring network protection link; if not, set the status of the faulty port of the first switching device in the affected ring to blocked state and refresh the FDB table.

[0094] In this application, after identifying all affected rings of the first switching device, port status configuration and FDB clearing operations are also required. The port status configuration operation must be performed before or after sending the SF R-APS message; there is no specific limitation here.

[0095] Furthermore, when performing port status configuration operations and FDB table clearing actions, this application first needs to determine whether the faulty link between the first switching device and the adjacent switching device in each affected ring is a ring network protection link. If it is a ring network protection link, it means that the link between the first switching device and the adjacent switching device was originally in a blocked state, and there is no need to adjust the port status. If it is not a ring network protection link, it is necessary to set the status of the faulty port of the first switching device in the affected ring to a blocked state and refresh the FDB table.

[0096] In summary, after locating the affected ring, this application can switch the faulty port from the forwarding state to the blocking state by performing port state configuration operations, thereby stopping it from sending and receiving service data; through the FDB clearing action, the old path records stored in the FDB can be cleared so that new paths can be relearned.

[0097] In another embodiment of this application, if the link between the first switching device and the adjacent switching device is detected to be restored, the switching method further includes: generating an NR R-APS message according to the number of affected rings, the identifier of the affected rings and the R-APS message format, and sending the NR R-APS message to the second switching device in the direction of the non-faulty link through the target port, so that the second switching device can perform a switchback operation according to the NR R-APS message.

[0098] In this application, when the link between the first switching device and the adjacent switching device is restored, that is, when the link fault is eliminated, the first switching device will send an NR R-APS message to both ends. After receiving the NR R-APS message, the second switching device can know that the fault has been removed, so that the second switching device can perform a back-switch operation according to the NR R-APS message and actively switch the ERPS ring network back to the original optimal path operation mode.

[0099] In another embodiment of this application, after receiving the NR R-APS message sent by the first switching device, the back-off operation performed by the second switching device includes: searching for the affected ring to which the second switching device belongs from the identifier of the affected ring in the NR R-APS message, and determining the configuration mode of the RPL owner port of the second switching device in the affected ring; if the configuration mode is back-off mode, starting the timer of the affected ring and adding it to the timer task list; periodically polling the timer task list, taking the affected rings corresponding to the timers that have expired in the timer task list as the rings to be back-off, setting the status of the RPL owner port in the rings to be back-off to a blocked state, and refreshing the FDB table; generating an NRRB R-APS message according to the number of rings to be back-off, the identifier of the rings to be back-off, and the R-APS message format, and sending the NRRB R-APS message to the adjacent switching device through the two ports of the second switching device on the target ring.

[0100] In this application, the back-switch mode refers to the operation mode in which the ERPS ring network actively switches back to the original optimal path after the faulty link is restored. Therefore, after the second switching device receives the NR R-APS message, if the second switching device has an RPL owner port in each affected ring and the RPL owner port is configured with the back-switch mode, then the WTR timer (wait to restore) of the affected ring is started and added to the timer task list.

[0101] The timer task periodically polls to check if any WTR timers have expired and records the ring ID of the expired ERPS ring. This recorded ring ID is the ring ID of the ring to be switched back. Then, the number of rings to be switched back and their ring IDs are aggregated into a single NRRB R-APS message. The format of the NRRB R-APS message is consistent with the format of other messages in this application, with request / state set to 0000 (NR) and RB value set to 1. Next, the RPL owner port is set to a blocked state to block the RPL links of each ring to be switched back, the FDB table is refreshed, and the NRRB R-APS message is simultaneously sent to both ring ports of the RPL owner.

[0102] In another embodiment provided in this application, after the NR R-APS message is sent to the second switching device in the direction of the non-faulty link through the target port, if the NRRB R-APS message sent by the second switching device is received; wherein the NRRB R-APS message is a message generated by the second switching device through the number of rings to be switched back, the identifier of the ring to be switched back, and the R-APS message format; if the port of the first switching device in the ring to be switched back is an RPL neighbor port, then the state of the RPL neighbor port is set to the blocked state and the FDB table is refreshed; if the port of the first switching device in the ring to be switched back is a normal port, then the state of the normal port is set to the forwarding state and the FDB table is refreshed.

[0103] In this application, after receiving the NRRB R-APS message, other nodes parse the message to obtain the ring ID list in the NRRB R-APS message. The ring IDs in this list are the ring IDs of the ring to be switched back, and the ring IDs in the list are processed sequentially. If the current switching device is in an ERPS ring and is an RPL neighbor node, the RPL link port of that ring will be blocked. That is, the state of the RPL neighbor port of the current switching device in the ring to be switched back will be set to blocked state, and the FDB table will be refreshed. If the current switching device is a normal node in an ERPS ring, the ring port of that ERPS ring will be opened from blocked state and changed to forwarding state. That is, the state of the normal port of the current switching device in the ring to be switched back will be set to forwarding state, and the FDB table will be refreshed.

[0104] To clearly illustrate this solution, this embodiment is based on... Figure 7 Provide a specific switching process, such as Figure 7 As shown, Switch A, Switch B, Switch C, and Switch D form eight ERPS ring networks, designated ERPS1 through 8, with different protection VLANs for each ERPS ring network. The RPL links for ERPS1 through 4 are located between Switch A and Switch B, while the RPL links for ERPS5 through 8 are located between Switch C and Switch D. Under normal fault conditions, ERPS1-4 experience RPL congestion between Switch A and Switch B, and ERPS5-8 experience RPL congestion between Switch C and Switch D; overall network traffic forwarding remains normal.

[0105] The specific switching method includes the following steps:

[0106] 1. If the link between Switch C and Switch D is broken, Switch C and Switch D will detect the link port disconnection. At this time, Switch C and Switch D will query the affected ring IDs, which are 1-8. Since Switch C and Switch D are RPLs of ERPS 5-8, Switch C and Switch D are in a blocked state in ERPS 5-8. At this time, Switch C and Switch D will configure ERPS1-4 to a blocked state and refresh the FDB table.

[0107] 2. Switch C and Switch D generate SF R-APS messages with a destination MAC address of {0x01,0x19,0xa7,0x00,0x00,0xff} and source MAC addresses of the non-RPL ports of Switch C and Switch D, respectively. The VLAN uses ERPS1's control VLAN 21, the RingCount field is 8, indicating 8 rings, and the RingIDArray is [1,2,3,4,5,6,7,8]. After generating the SF R-APS messages, Switch C and Switch D send the messages to the non-faulty link direction.

[0108] 3. After receiving the SF R-APS message, Switch A and Switch B know that a link failure has occurred. They parse the message and find that the number of affected rings is 8, and the ring ID array is [1,2,3,4,5,6,7,8]. They then begin processing these ring IDs.

[0109] 4. In ERPS rings 1, 2, 3, and 4, Switch A and Switch B are RPL links. Therefore, the blocking state of the RPL link between Switch A and Switch B is opened, and it is changed to forwarding state. In ERPS rings 5, 6, 7, and 8, Switch A and Switch B are ordinary nodes, and only FDB refresh is needed. At this time, network traffic forwarding returns to normal.

[0110] 5. When the link between Switch C and Switch D is restored, Switch C and Switch D will send NR R-APS messages to both ends. After receiving the NR R-APS, Switch A, if configured for handover, will start a WTR timer and add it to the timer task list. The timer task polls the task list periodically at 1-second intervals, recording ring information if any rings have expired. After polling is complete, the expired ring information is aggregated into a single message. When Switch A's WTR expires, the ring IDs that need to be handed back are ERPS rings 1, 2, 3, and 4.

[0111] 6. Switch A generates a new NRRB R-APS message with a destination MAC address of {0x01,0x19,0xa7,0x00,0x00,0xff}, a source MAC address using the port addresses at both ends of Switch A, a VLAN using the control VLAN 21 of ERPS1, and a RingCount of 4, indicating that four rings need to be switched back. Switch A blocks the RPL links of ERPS rings 1, 2, 3, and 4, refreshes the FDB table, and simultaneously sends NRRB R-APS messages to both ends.

[0112] 7. After receiving the NRRB R-APS, Switch B blocks the RPL links of ERPS rings 1, 2, 3 and 4, and refreshes the FDB table at the same time.

[0113] 8. After Switch C and Switch D receive the NRRB R-APS, they open the ring ports of ERPS rings 1, 2, 3, and 4 to block, and simultaneously refresh the FDB table. At this time, traffic returns to normal, and ERPS rings 1, 2, 3, and 4 successfully switch back, re-blocking on the RPL link between Switch A and Switch B.

[0114] In summary, in this application, when a switching device detects a link failure, the switching node does not need to process all affected ERPS rings sequentially. Instead, it calculates all affected ERPS rings and their corresponding ports, aggregates this information into a single SF R-APS protocol message, and sends it to other nodes. Similarly, when the failed link of an ERPS ring recovers, if the RPL owner node has configured a switchback, it records the expired ring ID when the WTR timer expires, aggregates it into a single NRRB R-APS message, and sends it to other nodes for processing. Upon receiving the NRRB R-APS message, other nodes parse it to obtain the ring ID list, enabling them to uniformly handle ring state switching. This significantly improves ring network recovery time and ensures consistent recovery times for different ERPS rings.

[0115] In another embodiment of this application, a switching method for an ERPS ring network is provided. The switching method is applied to a second switching device. The method includes: receiving an SF R-APS message sent by a first switching device; wherein the SF R-APS message is generated by any of the above method embodiments; and adjusting the port status and FDB table of the affected ring to which the second switching device belongs based on the identifier of the affected ring in the SF R-APS message.

[0116] In another exemplary embodiment, the port status and FDB table of the affected ring to which the second switching device belongs are adjusted according to the identifier of the affected ring in the SF R-APS message, including:

[0117] From the identifier of the affected ring in the SF R-APS message, find the affected ring to which the second switching device belongs; determine the port type of the port of the second switching device in the affected ring to which it belongs; if the port type is an RPL owner port or an RPL neighbor port, set the port status to forwarding status and refresh the FDB table.

[0118] In another exemplary embodiment, if an NR R-APS message is received from the first switching device, the switchback operation performed by the second switching device based on the NR R-APS message includes:

[0119] From the identifier of the affected ring in the NR R-APS message, find the affected ring to which the second switching device belongs, and determine the configuration mode of the RPL owner port of the second switching device in the affected ring; if the configuration mode is the switchback mode, start the timer of the affected ring and add it to the timer task list;

[0120] The timer task list is periodically polled, and the affected rings corresponding to the timers that have expired in the timer task list are taken as rings to be switched back. The status of the RPL owner port in the rings to be switched back is set to the blocked state, and the FDB table is refreshed.

[0121] Based on the number of rings to be switched back, the identifier of the rings to be switched back, and the R-APS message format, an NRRB R-APS message is generated, and the NRRB R-APS message is sent to the adjacent switching device through the second switching device at the two ports of the target ring.

[0122] In this embodiment, the specific execution method of each of the above steps has been described in detail in the previous embodiments, and will not be elaborated here.

[0123] See Figure 8 , Figure 8 A schematic diagram of a switching device structure provided in this application embodiment includes a processor 11, a communication interface 12, a memory 13, and a communication bus 14, wherein the processor 11, the communication interface 12, and the memory 13 communicate with each other through the communication bus 14;

[0124] Memory 13 is used to store computer programs;

[0125] When the processor 11 executes the program stored in the memory 13, it implements the steps of the switching method described in any of the above method embodiments, which will not be repeated here.

[0126] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0127] The communication interface is used for communication between the aforementioned terminal and other devices.

[0128] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0129] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0130] In another exemplary embodiment, a computer storage medium is also provided, wherein the program instructions, when executed by a processor, implement the steps of the switching method described in any of the above method embodiments. The storage medium may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0131] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.

[0132] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0133] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A switching method for an ERPS ring network, characterized in that, The switching method is applied to a first switching device, and the method includes: If a link is detected to the first switching device from an adjacent switching device, then all affected rings of the first switching device are identified; A target ring is determined from the affected rings, and a target port corresponding to the faulty port is found in the target ring; wherein, the faulty port is the port in the target ring where the first switching device is connected to the adjacent switching device; SF R-APS message is generated based on the identifier of the affected ring; The SF R-APS message is sent through the target port to the second switching device in the direction of the non-faulty link, so that the second switching device can adjust the port status and FDB table of the affected ring to which the second switching device belongs based on the identifier of the affected ring in the SF R-APS message.

2. The switching method according to claim 1, characterized in that, An SFR-APS message is generated based on the identifier of the affected ring, including: Determine the number of rings in the affected ring; An SF R-APS message is generated based on the number of affected rings, the identifier of the affected rings, and the R-APS message format; wherein the destination MAC of the SF R-APS message contains special bytes for indicating ring network switching.

3. The switching method according to claim 1, characterized in that, After identifying all affected rings of the first switching device, the process further includes: Determine whether the faulty link between the first switching device and the adjacent switching device in each affected ring is a ring network protection link; If not, set the status of the faulty port of the first switching device in the affected ring to blocked state and refresh the FDB table.

4. The switching method according to claim 2, characterized in that, If the link between the first switching device and the adjacent switching device is detected to be restored, the handover method further includes: Based on the number of affected rings, the identifier of the affected rings, and the R-APS message format, an NR R-APS message is generated and sent through the target port to the second switching device in the direction of the non-faulty link, so that the second switching device can perform a switchback operation based on the NR R-APS message.

5. The switching method according to claim 4, characterized in that, After sending the NR R-APS message through the target port to the second switching device in the direction of the non-faulty link, the process further includes: Receive NRRB R-APS messages sent by the second switching device; wherein, the NRRB R-APS message is a message generated by the second switching device through the number of rings to be switched back, the identifier of the rings to be switched back, and the R-APS message format; If the port of the first switching device in the loop to be switched back is an RPL neighbor port, then set the state of the RPL neighbor port to blocked state and refresh the FDB table. If the port of the first switching device in the loop to be switched back is a normal port, then the status of the normal port is set to forwarding status, and the FDB table is refreshed.

6. A switching method for an ERPS ring network, characterized in that, The switching method is applied to a second switching device, and the method includes: Receive an SF R-APS message sent by a first switching device; wherein the SF R-APS message is generated by the switching method described in any one of claims 1 to 5 above; Based on the identifier of the affected ring in the SF R-APS message, the port status and FDB table of the affected ring to which the second switching device belongs are adjusted.

7. The switching method according to claim 6, characterized in that, Based on the identifier of the affected ring in the SF R-APS message, the port status and FDB table of the affected ring to which the second switching device belongs are adjusted, including: From the identifier of the affected ring in the SF R-APS message, find the affected ring to which the second switching device belongs; Determine the port type of the second switching device within its affected ring; If the port type is an RPL owner port or an RPL neighbor port, then set the port status to forwarding status and refresh the FDB table.

8. The switching method according to claim 6, characterized in that, If the second switching device receives an NRR-APS message from the first switching device, the switchback operation performed by the second switching device based on the NRR-APS message includes: From the identifier of the affected ring in the NR R-APS message, find the affected ring to which the second switching device belongs, and determine the configuration mode of the RPL owner port of the second switching device in the affected ring to which it belongs; If the configuration mode is switchback mode, then start the timer of the affected ring and add it to the timer task list; The timer task list is periodically polled, and the affected rings corresponding to the timers that have expired in the timer task list are taken as rings to be switched back. The status of the RPL owner port in the rings to be switched back is set to the blocked state, and the FDB table is refreshed. Based on the number of rings to be switched back, the identifier of the rings to be switched back, and the R-APS message format, an NRRB R-APS message is generated, and the NRRB R-APS message is sent to the adjacent switching device through the second switching device at the two ports of the target ring.

9. A switching device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the steps of the switching method according to any one of claims 1 to 5, or the steps of the switching method according to any one of claims 6 to 8.

10. A computer storage medium, characterized in that, The computer storage medium stores computer-executable instructions for performing the steps of the switching method according to any one of claims 1 to 5, or for implementing the steps of the switching method according to any one of claims 6 to 8.