Fast recovery method and device for STP-based backup port

09806990 ยท 2017-10-31

Assignee

Inventors

Cpc classification

International classification

Abstract

Disclosed is a fast recovery method for a Spanning Tree Protocol (STP) based backup port, and the method includes: it is detected that a failure occurs on a port of an STP-based device; and it is determined whether there is a backup port taking a failed port as a master port, and when it is determined that there is such a backup port, said backup port is changed to a master port; further disclosed is a fast recovery device for an STP based backup port. By means of the technical solutions of the disclosure, it is possible to shorten significantly recovery time of a backup port, and improve greatly performance of link recovery.

Claims

1. A fast recovery method for a Spanning Tree Protocol (STP) based backup port, the method comprising: detecting that a failure occurs on a port of an STP-based device; and determining whether there is a backup port taking a failed port as a master port, and when it is determined that there is such a backup port, changing said backup port to a master port; the method further comprising: after said backup port is changed to the master port, setting a state of the master port to a forwarding state; wherein before said backup port is changed to the master port, a state of said backup port is a blocked state; and when it is detected that a failure occurs on a port of an STP-based device, recording a port Identity (ID) of a failed port; wherein the determining whether there is a backup port taking a failed port as a master port comprises: determining whether in a port priority vector there is a port having a specified port field, i.e., port ID that is the same as the ID of the failed port, and when it is determined that there is such a port, determining said port as the backup port taking the failed port as a master port.

2. The fast recovery method for an STP-based backup port according to claim 1, further comprising: determining whether there is one or multiple backup ports taking the failed port as a master port; and when it is determined that there are multiple such backup ports, selecting a backup port having a highest priority as a backup port of the failed port.

3. A fast recovery device for an STP-based backup port, the device comprising: a detection unit configured to, when detecting that a failure occurs on a port of an STP-based device, trigger a determination unit; the determination unit configured to determine whether there is a backup port taking a failed port as a master port, and when it is determined that there is such a backup port, trigger a processing unit; and the processing unit configured to change said backup port to a master port; wherein the processing unit is further configured to, after said backup port is changed to the master port, set a state of the master port to a forwarding state; and wherein before said backup port is changed to the master port, a state of said backup port is a blocked state; wherein the detection unit is further configured to, when detecting that a failure occurs on a port of an STP-based device, record a port Identity (ID) of a failed port; and the determination unit is configured to: determine whether in a port priority vector there is a port having a specified port field, i.e., port ID that is the same as the ID of the failed port, and when it is determined that there is such a port, determine said port as the backup port taking the failed port as a master port and trigger the processing unit.

4. The fast recovery device for an STP-based backup port according to claim 3, wherein the determination unit is further configured to determine whether there is one or multiple backup ports taking the failed port as a master port, and when it is determined that there are multiple such backup ports, select a backup port having a highest priority as a backup port of the failed port and trigger the processing unit.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) FIG. 1 is a schematic diagram showing a typical application scenario when a backup port is taken as a link backup;

(2) FIG. 2 is a flow chart of a fast recovery method for an STP-based backup port according to an embodiment of the disclosure;

(3) FIG. 3 is a schematic diagram showing a specific embodiment of a fast recovery method for an STP-based backup port; and

(4) FIG. 4 is a schematic structural diagram of a fast recovery device for an STP-based backup port according to an embodiment of the disclosure.

DETAILED DESCRIPTION

(5) Preferred embodiments of the disclosure will be described below with reference to accompanying drawings, the drawings consist part of the present application and are used together with embodiments of the disclosure to explain the principle of the disclosure. It should be understood that the specific embodiments are only used to interpret the disclosure instead of limiting the disclosure. It should be noted that embodiments of the disclosure and features in the embodiments can be combined with each other in case of no conflicts.

(6) Firstly, the fast recovery method for an STP-based backup port according to an embodiment of the disclosure will be elaborated with reference to FIGS. 1 to 3.

(7) As shown in FIG. 2 that is a flow chart of a fast recovery method for an STP-based backup port according to the embodiment of the disclosure, the method specifically includes the following steps:

(8) step 201, an STP-based device detects that a failure occurs on a port of the device; and

(9) step 202, it is determined whether there is a backup port taking a failed port as a master port, and when it is determined that there is such a backup port, said backup port is changed to a master port.

(10) The embodiment takes a scenario shown in FIG. 1 as an example, where an CE is connected with different PEs, the CE runs the RSTP or MSTP.

(11) As shown in FIG. 3 that is a schematic diagram showing a specific embodiment of a fast recovery method for an STP-based backup port, the method may specifically include:

(12) step 301, the CE detects that port 1 of a device fails, and records a port identity (port_ID) of the port;

(13) step 302, the port failure results in re-calculation of spanning tree;

(14) step 303, respective ports of the CE are traversed to determine whether there is a backup port taking the failed port 1 as a master port, specifically, it is determined whether in a port priority vector there is a port having a specified port field, i.e., port_ID that is the same as the port_ID recorded in step 301, if there is, the port having the same port_ID as the port_ID recorded in step 301 is determined as the backup port taking the failed port 1 as a master port, then proceed to step 304; if there is not such a port, proceed to step 307;

(15) step 304, the number of backup ports taking the failed port 1 as a master port is acquired to determine whether there is one or multiple such backup ports, if there are multiple, proceed to step 305, otherwise, proceed to step 306;

(16) step 305, when there are multiple backup ports taking the failed port 1 as a master port, then a port having a highest priority is selected, according to a priority rule in the port priority vector, as a backup port of the failed port 1;

(17) step 306, the only backup port determined in step 304 or the backup port having a highest priority selected in step 305 is changed to a specified port, i.e., the original backup port is specified as master port, and the state of the master port is set to a forwarding state; and

(18) step 307, the process ends.

(19) It should be noted that the above embodiment of the method is described only in a networking environment where a CE is dual homed to PEs, and the fast recovery mechanism of the backup port is also applied to fast recovery scenario that takes other ports as a backup. For example, a scenario where a hub or a switch having an STP message transmission function is used to connect indirectly two ports of a switch.

(20) Then, the fast recovery device for an STP-based backup port according to an embodiment of the disclosure will be elaborated with reference to FIG. 4.

(21) As shown in FIG. 4 that is a schematic structural diagram of a fast recovery device for an STP-based backup port according to an embodiment of the disclosure, the device specifically includes a detection unit 41, a determination unit 42 and a processing unit 43, and respective functional units will be elaborated below.

(22) The detection unit 41 is configured to, when detecting that a failure occurs on a port of an STP-based device, trigger the determination unit 42;

(23) the determination unit 42 is configured to determine whether there is a backup port taking a failed port as a master port, and when it is determined that there is such a backup port, trigger the processing unit 43;

(24) the processing unit 43 is configured to change said backup port to a master port; and

(25) the processing unit 43 is further configured to, after said backup port is changed to a master port, set the state of the master port to a forwarding state.

(26) As a preferred embodiment of the disclosure, the detection unit 41 is specifically configured to, when it is detected that a failure occurs on a port of the STP-based device, record a port ID of the failed port.

(27) The determination unit 42 is specifically configured to traverse ports of the device to perform determination on each port:

(28) specifically, it is determined whether in a port priority vector of the device there is a port having a specified port field, i.e., port_ID that is the same as a recorded port_ID of the failed port, and when it is determined that there is such a port, the port having a specified port field port_ID that is the same as the recorded port ID is determined as a backup port taking the failed port as a master port; and the number of backup ports taking the failed port as a master port is acquired;

(29) when it is determined that there is one such backup port, the backup port is determined as the only backup port taking the failed port as a master port and the processing unit 43 is triggered;

(30) when it is determined that there are multiple such backup ports, the determination unit 42 selects a backup port having a highest priority as a backup port of the failed port and triggers the processing unit 43.

(31) In practical applications, the detection unit 41, the determination unit 42 and the processing unit 43 can all be implemented by a Central Processing unit (CPU), a Digital Signal Processor (DSP) or a Field Programmable Gate Array (FPGA); and the CPU, DSP, FPGA are built in an STP-based device that may be located on the network side.

(32) The specific implementation process of the device according to the disclosure will be omitted since it has been explained in the description of the corresponding method.

(33) To sum up, the embodiments of the disclosure provide a fast recovery method and device for an STP-based backup port, it can be seen from the technical solutions provided by above embodiments that since a device receives message information through a port and the device can detect whether there is a failure on its port, such information can be used to reduce recovery time of the backup port without leading to a loop; the technical solutions provided by the embodiments of the disclosure can significantly shorten recovery time of the backup port, and improve greatly performance of link recovery provided by the backup port during a link backup scenario.

(34) What described above are merely preferred embodiments of the disclosure, but the scope of protection of the disclosure is not limited thereto, any changes or substitutions easily made by those skilled in the art without departing from the technical scope disclosed herein should fall within the scope of protection of the disclosure. Therefore, the scope of protection of the disclosure should be defined as set forth in the following claims.