Disclosure of Invention
The embodiment of the invention discloses a port fault processing method and a port fault processing device, which are used for avoiding the loss of a message on a fault link caused by the fault of an IRF port of member equipment and further reducing the condition of IRF link splitting.
The specific scheme is as follows:
in one aspect, an embodiment of the present invention provides a port fault processing method, which is applied to a member device in an IRF system, and the method includes:
when a first heartbeat message is not received through any IRF port of the member equipment within a preset time length, determining that the port has a fault, and setting the working state of the port from an initial effective state to an invalid state, wherein the IRF port in the effective state allows the first heartbeat message and the data message to be sent; the IRF port in the invalid state only allows to send a first heartbeat message;
when the member device is a slave member device and the port is a master port, selecting one port meeting a first predetermined screening rule from other IRF ports of the member device, and determining the selected port as a proxy master port of the member device, wherein the master port is: the member device is set after receiving a second heartbeat message which is sent by the main member device and informs the main member device that a port corresponding to the port is a main port used for maintaining the stability of the IRF system, and sets other IRF ports as slave ports;
sending a third heartbeat message carrying the working state of the port to all the neighbor devices through the proxy main port, so that the ports corresponding to the ports are set to be in an invalid state after all the neighbor devices receive the third heartbeat message;
when a fourth heartbeat message which is sent by the main member equipment and carries the identity information of the new main port is received, the port corresponding to the new main port is set as the new main port of the main member equipment, wherein the fourth heartbeat message is sent after the main member equipment selects a new main port from other IRF ports of the main member equipment according to a second preset screening rule after receiving the third heartbeat message.
Optionally, selecting one port meeting the first predetermined screening rule from other IRF ports of the member device specifically includes:
and selecting a port with the minimum port number from other IRF ports of the member equipment to obtain the selected port.
Optionally, after determining that the port fails, the method further includes:
when the member device is a main member device and the port is a main port, selecting one port which meets the second preset screening rule from other IRF ports of the member device, and determining the selected port as a new main port of the member device;
and sending a fifth heartbeat message carrying the working state of the port and the identity information of the new main port to all the neighbor devices through the new main port, so that after all the neighbor devices receive the fifth heartbeat message, the port corresponding to the port is set to be in an invalid state, and the port corresponding to the new main port is set to be the main port.
Optionally, after determining that the port fails, the method further includes:
when the member device is a main member device and the port is a main port, selecting a port which accords with a third preset screening rule from other IRF ports of the member device, and determining the selected port as a standby main port of the member device;
sending the third heartbeat message to all the neighbor devices through the alternative main port, so that after all the neighbor devices receive the third heartbeat message, the ports corresponding to the ports are set to be in an invalid state;
selecting one port which accords with the second preset screening rule from other IRF ports of the member equipment, and determining the selected port as a new main port of the member equipment;
and sending a sixth heartbeat message carrying the identity information of the new main port to all the neighbor devices through the new main port, so that all the neighbor member devices set the port corresponding to the new main port as the main port after receiving the sixth heartbeat message.
Optionally, after determining that the port fails, the method further includes:
and when the port is a slave port, sending the third heartbeat message to all neighbor devices through the master port of the member device, so that all the neighbor devices set the port corresponding to the port in an invalid state after receiving the third heartbeat message.
Optionally, the method further includes:
and after receiving the first heartbeat message through the port, restoring the working state of the port to an effective state, and sending the third heartbeat message to all the neighbor devices through the current main port of the member device, so that all the neighbor devices restore the port corresponding to the port to the effective state after receiving the third heartbeat message.
In one aspect, an embodiment of the present invention provides a port fault processing apparatus, which is applied to a member device in an IRF system, and the apparatus includes: the device comprises a first determining module, a first setting module, a first screening module, a second determining module, a first sending module and a second setting module;
the first determining module is configured to determine that a port fails when a first heartbeat packet is not received through any IRF port of the member device within a predetermined time period;
the first setting module is configured to set the working state of the port from an initial valid state to an invalid state when the first determining module determines that the port has a fault, where the IRF port in the valid state allows sending a first heartbeat packet and a data packet; the IRF port in the invalid state only allows to send a first heartbeat message;
the first screening module is configured to select, when the member device is a slave member device and the port is a master port, one port that meets a first predetermined screening rule from other IRF ports of the member device;
the second determining module is configured to determine the selected port as a proxy master port of the member device, where the master port is: the member device is set after receiving a second heartbeat message which is sent by the main member device and informs the main member device that a port corresponding to the port is a main port used for maintaining the stability of the IRF system, and sets other IRF ports as slave ports;
the first sending module is configured to send a third heartbeat packet carrying the working state of the port to all neighboring devices through the proxy master port, so that after receiving the third heartbeat packet, all neighboring devices set the port corresponding to the port to an invalid state;
the second setting module is configured to set, when receiving a fourth heartbeat packet which is sent by a master member device and carries identity information of a new master port, a port corresponding to the new master port as a new master port of the master device, where the fourth heartbeat packet is sent after the master member device receives the third heartbeat packet and selects a new master port from other IRF ports of the master member device according to a second predetermined screening rule.
Optionally, the first screening module is specifically configured to select a port with a smallest port number from other IRF ports of the member device, so as to obtain the selected port.
Optionally, the apparatus further includes a second screening module, a third determining module, and a second sending module;
the second screening module is configured to, after it is determined that the port has a fault, select a port that meets the second predetermined screening rule from other IRF ports of the member device when the member device is a master member device and the port is a master port;
the third determining module is configured to determine the selected port as a new primary port of the member device;
and the second sending module is used for sending a fifth heartbeat message carrying the working state of the port and the identity information of the new main port to all the neighbor devices through the new main port, so that after all the neighbor devices receive the fifth heartbeat message, the port corresponding to the port is set to be in an invalid state, and the port corresponding to the new main port is set to be the main port.
Optionally, the apparatus further comprises: the device comprises a third screening module, a fourth determining module, a third sending module, a fourth screening module, a fifth determining module and a fourth sending module;
the third screening module is configured to, after it is determined that the port has a fault, select a port that meets a third predetermined screening rule from other IRF ports of the member device when the member device is a master member device and the port is a master port;
the fourth determining module is configured to determine the selected port as the alternative primary port of the member device;
the third sending module is configured to send the third heartbeat packet to all neighboring devices through the alternative master port, so that after receiving the third heartbeat packet, all neighboring devices set the ports corresponding to the ports to be in an invalid state;
the fourth screening module is configured to select one port that meets the second predetermined screening rule from other IRF ports of the member device;
the fifth determining module is configured to determine the selected port as a new primary port of the member device;
the fourth sending module is configured to send a sixth heartbeat packet carrying the identity information of the new master port to all neighboring devices through the new master port, so that after receiving the sixth heartbeat packet, all neighboring member devices set a port corresponding to the new master port as the master port.
Optionally, the apparatus further comprises: a fifth sending module;
the fifth sending module is configured to send the third heartbeat packet to all neighboring devices through the master port of the member device when the port is the slave port after determining that the port has a fault, so that all neighboring devices set the port corresponding to the port in an invalid state after receiving the third heartbeat packet.
Optionally, the apparatus further comprises: a recovery sending module;
the recovery sending module is configured to recover the working state of the port to an effective state after receiving the first heartbeat message through the port, and send the third heartbeat message to all neighboring devices through the current master port of the member device, so that all neighboring devices recover the port corresponding to the port to an effective state after receiving the third heartbeat message.
In the scheme, the member equipment in the IRF system sets the IRF port with the fault as an invalid state, so that the IRF port can only send a first heartbeat message and cannot send a data message; further, when the member device is a slave member device and the IRF port with the fault is a master port, the proxy master port is re-screened from other IRF ports of the member device to notify the neighbor device to set the port corresponding to the IRF port with the fault to an invalid state, so that the situation that when the port at one end on the IRF link fails, and the port at the opposite end continuously sends a data message to the port with the fault due to the unknown fault, so that the data message is lost is avoided. And when receiving the heartbeat message which is sent by the main member device and carries the identity information of the new main port, the member device sets the port corresponding to the new main port as the new main port of the member device. The main port on the main member device is used for maintaining the stability of the IRF system, and the main port on the main member device in the IRF system is in an effective state, so that the situation of IRF link splitting in the IRF system is reduced.
Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a port fault processing method and device, which are used for avoiding message loss on a fault link caused by port faults of member equipment and further reducing the condition of IRF link splitting.
First, a port failure processing method provided in an embodiment of the present invention is described below.
It should be noted that, if a link failure (for example, a port failure) occurs during the setup of the multi-link star IRF system, a network administrator may remove and solve the occurred failure at the first time, so that the significance of the failure solution during the setup of the IRF system is not great. The ports mentioned in the embodiments of the present invention are all IRF ports. The method for establishing the IRF system is substantially the same as that in the prior art, and is not described herein.
Specifically, the port failure processing method provided in the embodiment of the present invention may be applied to any member device of an IRF system, and as shown in fig. 4, the method may include the following steps:
s401: and when the first heartbeat message is not received through any IRF port of the member equipment within the preset time, determining that the port has a fault.
In this step, the predetermined duration may be set according to a sending frequency of the member device sending the first heartbeat packet.
S402: and setting the working state of the port from the initial valid state to the invalid state.
In the step, the IRF port in the effective state allows to send a first heartbeat message and a data message; the IRF port in the invalid state is only allowed to send the first heartbeat message.
In the invention, after the IRF system is successfully established, the working state of each IRF port of the member equipment is set to be an effective state by default, valid marks can be used, the member equipment can send data messages through the set IRF port in the effective state, and also can send first heartbeat messages to neighbor equipment through the set IRF port in the effective state at a certain sending frequency so as to detect the connection condition of links between the member equipment. The first heartbeat message may be a Hello message. Subsequently, the second heartbeat message, the third heartbeat message, the fourth heartbeat message, the fifth heartbeat message and the sixth heartbeat message may be Hello messages.
It should be noted that, after it is determined that the port fails, the working state of the port is set from the initial valid state to the invalid state, which is mainly for subsequently enabling the neighbor device to send only the first heartbeat packet, so that the neighbor device maintains the neighbor relationship with the non-failed member device, and does not send the data packet any more, thereby reducing the packet loss. Wherein the invalid state may use an invalid flag.
S403: and when the member device is a slave member device and the port is a master port, selecting one port which meets the first preset screening rule from other IRF ports of the member device.
In this step, the main port is set by the member device after receiving, through the port, a second heartbeat message that notifies that the port corresponding to the port on the main member device is the main port for maintaining the stability of the IRF system, where the second heartbeat message is sent by the main member device, and sets other IRF ports as slave ports.
In the present invention, after the main member device is elected, the main member device selects an IRF port with the highest priority from all IRF ports of the main member device (for example, the port number is smaller and the priority is higher), and sets the IRF port as a main port, sets other IRF ports as slave ports, and subsequently uses the main port to maintain the stability of the IRF system. In addition, the master member device may also notify all the neighbor devices of the set identity information of the master port through a Hello message (i.e., a second heartbeat message), so that after all the neighbor devices receive the Hello message, the port corresponding to the master port of the master member device is set as the master port, and other IRF ports are set as slave ports. Of course, to facilitate distinguishing between master and slave ports, different flag bits may be used for marking.
It should be noted that the stability of the IRF system of the present invention is maintained by the main port of each member device, that is, each member device only uses the first heartbeat packet received by the main port to select the main member device, and only uses the main port to decide whether IRF link splitting occurs. Under the condition that the working states of all IRF ports of the member equipment are effective, if a first heartbeat message is received through a main port, processing the first heartbeat message according to the existing processing mode; if the first heartbeat message is received from the port, no processing is carried out.
Further, in this step, selecting one port that meets the first predetermined screening rule from other IRF ports of the member device specifically includes:
and selecting a port with the minimum port number from other IRF ports of the member equipment to obtain the selected port.
Of course, the present invention may also adopt other screening methods, which are not listed herein.
S404: the selected port is determined to be the proxy master port for the member device.
S405: and sending a third heartbeat message carrying the working state of the port to all the neighbor devices through the proxy main port, so that all the neighbor devices set the ports corresponding to the ports to be in an invalid state after receiving the third heartbeat message.
In the invention, after all the neighbor devices receive the third heartbeat message, the ports corresponding to the ports are set to be in an invalid state, so that the ports corresponding to the ports can only send the first heartbeat message, and the condition that the data message is lost because the port at the opposite end cannot receive the data message due to faults is avoided.
It should be noted that, for the master member device in the present invention, after receiving the third heartbeat packet, in addition to executing the above operations, the master member device may re-screen a new master port from other IRF ports according to a certain screening rule, and notify the identity information of the new master port to its own neighbor devices (all slave member devices) to change the roles of the corresponding ports, so as to better maintain the stability of the IRF system and avoid frequent IRF link splitting due to port failure.
S406: and when a fourth heartbeat message which is sent by the main member equipment and carries the identity information of the new main port is received, setting the port corresponding to the new main port as the new main port of the port.
In this step, the fourth heartbeat message is sent after the main member device selects a new main port from other IRF ports of the main member device according to a second predetermined screening rule after receiving the third heartbeat message.
The second predetermined filtering rule may be the same as or different from the first predetermined filtering rule. Accordingly, the third predetermined filtering rule mentioned later may be the same as or different from the second predetermined filtering rule and the first predetermined filtering rule.
By applying the embodiment of the invention, the member equipment in the IRF system sets the IRF port with the fault to be in an invalid state, so that the IRF port can only send the first heartbeat message and can not send the data message; further, when the member device is a slave member device and the IRF port with the fault is a master port, the proxy master port is re-screened from other IRF ports of the member device to notify the neighbor device to set the port corresponding to the IRF port with the fault to an invalid state, so that the situation that when the port at one end on the IRF link fails, and the port at the opposite end continuously sends a data message to the port with the fault due to the unknown fault, so that the data message is lost is avoided. And when receiving the heartbeat message which is sent by the main member device and carries the identity information of the new main port, the member device sets the port corresponding to the new main port as the new main port of the member device. The main port on the main member device is used for maintaining the stability of the IRF system, and the main port on the main member device in the IRF system is in an effective state, so that the situation of IRF link splitting in the IRF system is reduced.
Further, in the present invention, after determining that the port has failed, if the member device is a master member device and the port is a master port, the member device may perform the following first processing operation or may perform a second processing operation:
the first method comprises the following steps: selecting one port meeting the second preset screening rule from other IRF ports of the member equipment, and determining the selected port as a new main port of the member equipment;
and sending a fifth heartbeat message carrying the working state of the port and the identity information of the new main port to all the neighbor devices through the new main port, so that after all the neighbor devices receive the fifth heartbeat message, the port corresponding to the port is set to be in an invalid state, and the port corresponding to the new main port is set to be the main port.
And the second method comprises the following steps: selecting one port which accords with a third preset screening rule from other IRF ports of the member equipment, and determining the selected port as a standby main port of the member equipment;
sending the third heartbeat message to all the neighbor devices through the alternative main port, so that after all the neighbor devices receive the third heartbeat message, the ports corresponding to the ports are set to be in an invalid state;
selecting one port meeting the second preset screening rule from other IRF ports of the member equipment, and determining the selected port as a new main port of the member equipment;
and sending a sixth heartbeat message carrying the identity information of the new main port to all the neighbor devices through the new main port, so that all the neighbor member devices set the port corresponding to the new main port as the main port after receiving the sixth heartbeat message.
It should be noted that, in the present invention, after determining that the port fails, the member device, regardless of whether the member device is a master member device or a slave member device, may perform: and sending the third heartbeat message to all the neighbor devices through the main port of the member device, so that all the neighbor devices set the ports corresponding to the ports to be in an invalid state after receiving the third heartbeat message. Therefore, all the neighbor devices do not send data messages through the IRF link where the port is located any more, and packet loss is reduced.
Furthermore, in the present invention, when the port of the member device fails, the port needs to be recovered to ensure normal data communication.
After the recovering, it may further be performed for the member device to: after receiving the first heartbeat message through the port, the working state of the port is recovered to be an effective state, and the third heartbeat message is sent to all the neighbor devices through the current main port of the member device. After all the neighbor devices receive the third heartbeat message, the ports corresponding to the ports are recovered to be in an effective state, and therefore normal transmission of data messages is guaranteed.
The port fault handling method provided by the embodiment of the present invention is described below by using a specific embodiment. The first, second, third and fourth subsequently occurring Hello messages are all Hello messages in the IRF system.
As shown in fig. 2, after the IRF system is successfully established, assuming that the priority of the device a-IRF1 is greater than the priorities of the device B-IRF2 and the device C-IRF3, the device a-IRF1 is a master member device, and the device B-IRF2 and the device C-IRF3 are all slave member devices.
For device a-IRF1, assuming that port1/1 is selected as the master port according to the second predetermined filtering rule, port1/2 and port1/3 are set as slave ports, and a second heartbeat packet (second Hello packet) is sent to device B-IRF2 and device C-IRF3 through port1/1, and identity information that port1/1 is the master port is notified to device B-IRF2 and device C-IRF 3. Subsequently, after receiving the second Hello message, the device B-IRF2 sets the Port2/1 corresponding to the Port1/1 as a master Port, and sets the ports 2/2 and 2/3 as slave ports; after receiving the second Hello packet, the device C-IRF3 sets Port3/1 corresponding to Port1/1 as the master Port, and sets Port3/2 and Port3/3 as the slave ports.
In addition, in the initial state, port1/1, port1/2 and port1/3 of device a-IRF1, port2/1, port2/2 and port2/3 of device B-IRF2, and port3/1, port3/2 and port3/3 of device C-IRF3 are all set to be valid states (valid), that is, a first heartbeat message (first Hello message) and a data message can be sent between each other. It should be noted that each device only processes the first heartbeat packet received through the primary port.
As shown in fig. 3, assuming that a port2/1 connected to a two-layer network on the device B-IRF2 is loose, the device B-IRF2 cannot receive the first Hello message sent by the device a-IRF1 or the device C-IRF3 through the port2/1 within a predetermined time period, in this case, device B-IRF2 determines that port2/1 failed, sets port2/1 to an inactive state, since port2/1 is the master port of device B-IRF2, at this time, device B-IRF2 selects one from port2/2 and port2/3 as a proxy master port according to a first predetermined filtering rule, assuming that the port number of port2/2 is smaller than the port number of port2/3, determines port2/2 as a proxy master port, and sending a third heartbeat message (a third Hello message) carrying the working state of the port2/1 to the device A-IRF1 and the device C-IRF3 through the port 2/2. Subsequently, device a-IRF1 sets corresponding port1/1 to be in an invalid state (only sends a first heartbeat packet), selects one of port1/2 and port1/3 as a master port, and determines port1/2 as the master port of device a-IRF1, assuming that the port number of port1/2 is smaller than the port number of port1/3, device a-IRF1 sends a fourth heartbeat packet (fourth Hello packet) to device B-IRF2 and device C-IRF3, where the fourth Hello packet carries the identity information of the new master port of device a-IRF1 (at this time, port1/2), device B-IRF2 receives the fourth Hello packet, and determines corresponding port2/2 as the new master port of device B-IRF 2.
After receiving the third Hello message, the device C-IRF3 sets the corresponding port3/1 to an invalid state (only sends the first heartbeat message); after receiving the fourth Hello message, determining the corresponding port3/2 as a new master port of the device C-IRF 3.
When device B-IRF2 receives the first Hello packet sent by device a-IRF1 or device C-IRF3 again through failed port2/1, port2/1 is set to an active state, and a third heartbeat packet (third Hello packet) carrying the recovery of the working state of port2/1 is sent to device a-IRF1 and device C-IRF3 through port2/2, and after device a-IRF1 receives the third Hello packet, port1/1 is set to an active state, and at this time, port1/1 may send both the first Hello packet and the data packet to device B-IRF 2.
After receiving the third Hello packet, the device C-IRF3 sets the port3/1 to an active state, and at this time, the port3/1 may send the first Hello packet to the device B-IRF2 and the device a-IRF1, and may send a data packet.
Assuming that port2/2 or port2/3 of device B-IRF2 fails, device B-IRF2 sends a third heartbeat packet to device a-IRF1 and device C-IRF3 through port 2/1. After the subsequent device A-IRF1 receives the third heartbeat message, the port1/2 of the device A-IRF1 is set to be in an invalid state; after receiving the third heartbeat message, the device C-IRF3 sets the port3/2 of the device C-IRF3 to an invalid state.
For the processing procedure of the failure of port1/1 and the processing procedure of the failure of port1/2 or port1/3 of the device a-IRF1, see the related description in the above method, which is not illustrated here.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a port failure processing apparatus, which may be applied to a member device in an IRF system, and as shown in fig. 5, the apparatus may include: a first determination module 501, a first setup module 502, a first filtering module 503, a second determination module 504, a first sending module 505, and a second setup module 506.
The first determining module 501 is configured to determine that a port fails when a first heartbeat packet is not received through any IRF port of the member device within a predetermined time period;
the first setting module 502 is configured to set the working state of the port from an initial valid state to an invalid state when the first determining module determines that the port has a fault, where an IRF port in the valid state allows sending a first heartbeat packet and a data packet; the IRF port in the invalid state only allows to send a first heartbeat message;
the first screening module 503 is configured to select, when the member device is a slave member device and the port is a master port, one port that meets a first predetermined screening rule from other IRF ports of the member device;
the second determining module 504 is configured to determine the selected port as a proxy master port of the member device, where the master port is: the member device is set after receiving a second heartbeat message which is sent by the main member device and informs the main member device that a port corresponding to the port is a main port used for maintaining the stability of the IRF system, and sets other IRF ports as slave ports;
the first sending module 505 is configured to send a third heartbeat packet carrying the working state of the port to all neighboring devices through the proxy master port, so that after receiving the third heartbeat packet, all neighboring devices set the port corresponding to the port to an invalid state;
the second setting module 506 is configured to, when a fourth heartbeat packet carrying identity information of a new master port and sent by a master member device is received, set a port corresponding to the new master port as a new master port of the master device, where the fourth heartbeat packet is sent after the master member device receives the third heartbeat packet and selects a new master port from other IRF ports of the master member device according to a second predetermined screening rule.
By applying the embodiment of the invention, the member equipment in the IRF system sets the IRF port with the fault to be in an invalid state, so that the IRF port can only send the first heartbeat message and can not send the data message; further, when the member device is a slave member device and the IRF port with the fault is a master port, the proxy master port is re-screened from other IRF ports of the member device to notify the neighbor device to set the port corresponding to the IRF port with the fault to an invalid state, so that the situation that when the port at one end on the IRF link fails, and the port at the opposite end continuously sends a data message to the port with the fault due to the unknown fault, so that the data message is lost is avoided. And when receiving the heartbeat message which is sent by the main member device and carries the identity information of the new main port, the member device sets the port corresponding to the new main port as the new main port of the member device. The main port on the main member device is used for maintaining the stability of the IRF system, and the main port on the main member device in the IRF system is in an effective state, so that the situation of IRF link splitting in the IRF system is reduced.
In a specific implementation manner, the first screening module 503 is specifically configured to select a port with a minimum port number from other IRF ports of the member device, and obtain the selected port.
In a specific implementation manner, the apparatus further includes a second screening module, a third determining module, and a second sending module;
the second screening module is configured to, after it is determined that the port has a fault, select a port that meets the second predetermined screening rule from other IRF ports of the member device when the member device is a master member device and the port is a master port;
the third determining module is configured to determine the selected port as a new primary port of the member device;
and the second sending module is used for sending a fifth heartbeat message carrying the working state of the port and the identity information of the new main port to all the neighbor devices through the new main port, so that after all the neighbor devices receive the fifth heartbeat message, the port corresponding to the port is set to be in an invalid state, and the port corresponding to the new main port is set to be the main port.
In a specific implementation manner, the apparatus further includes: the device comprises a third screening module, a fourth determining module, a third sending module, a fourth screening module, a fifth determining module and a fourth sending module;
the third screening module is configured to, after it is determined that the port has a fault, select a port that meets a third predetermined screening rule from other IRF ports of the member device when the member device is a master member device and the port is a master port;
the fourth determining module is configured to determine the selected port as the alternative primary port of the member device;
the third sending module is configured to send the third heartbeat packet to all neighboring devices through the alternative master port, so that after receiving the third heartbeat packet, all neighboring devices set the ports corresponding to the ports to be in an invalid state;
the fourth screening module is configured to select one port that meets the second predetermined screening rule from other IRF ports of the member device;
the fifth determining module is configured to determine the selected port as a new primary port of the member device;
the fourth sending module is configured to send a sixth heartbeat packet carrying the identity information of the new master port to all neighboring devices through the new master port, so that after receiving the sixth heartbeat packet, all neighboring member devices set a port corresponding to the new master port as the master port.
In a specific implementation manner, the apparatus further includes: a fifth sending module;
the fifth sending module is configured to send the third heartbeat packet to all neighboring devices through the master port of the member device when the port is the slave port after determining that the port has a fault, so that all neighboring devices set the port corresponding to the port in an invalid state after receiving the third heartbeat packet.
In a specific implementation manner, the apparatus further includes: a recovery sending module;
the recovery sending module is configured to recover the working state of the port to an effective state after receiving the first heartbeat message through the port, and send the third heartbeat message to all neighboring devices through the current master port of the member device, so that all neighboring devices recover the port corresponding to the port to an effective state after receiving the third heartbeat message.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Those skilled in the art will appreciate that all or part of the steps in the above method embodiments may be implemented by a program to instruct relevant hardware to perform the steps, and the program may be stored in a computer-readable storage medium, which is referred to herein as a storage medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.