Method and device for improving link aggregation protocol timeout
11683257 · 2023-06-20
Assignee
Inventors
Cpc classification
H04L43/10
ELECTRICITY
Y02D30/50
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
International classification
Abstract
The present disclosure is to propose a method and device for improving a link aggregation protocol timeout. method for improving a link aggregation timeout. The method includes the following steps: setting a timeout value and a timeout threshold count of link aggregation control protocol data unit (LACPDU) packet reception of a switch; obtaining a timeout count statistically, in response to a timeout of reception of a link aggregation control protocol data unit (LACPDU) packet from a second switch by a first switch; determining, through a network controller, in response to that the timeout count is greater than the timeout threshold count and that an aggregated link between the switches is in an out-of-band management mode, whether a port of the second switch is abnormal; and removing, in response to the port of the second switch being abnormal, the abnormal port of the second switch from the aggregated link.
Claims
1. A method for improving a link aggregation timeout, comprising following steps: setting a timeout value and a timeout threshold count of link aggregation control protocol data unit packet reception; obtaining a timeout count statistically, in response to a timeout of reception of a link aggregation control protocol data unit packet from a second switch by a first switch; determining, through a network controller, in response to that the timeout count is greater than the timeout threshold count and that an aggregated link between the first switch and the second switch is in an out-of-band management mode, whether a port of the second switch is abnormal; and removing, in response to the port of the second switch being abnormal, the abnormal port of the second switch from the aggregated link.
2. The method according to claim 1, wherein the determining, through a network controller, in response to that the timeout count is greater than the timeout threshold count and that an aggregated link between the first switch and the second switch is in an out-of-band management mode, whether a port of the second switch is abnormal, comprises: submitting, by the first switch, in response to the timeout count being greater than the timeout threshold count, a request of querying a state of the port of the second switch; obtaining, by the network controller, in response to that the request is received by the network controller, the state of the port of the second switch, and determining whether the state of the port of the second switch is abnormal; and sending, by the network controller, a determining result of whether the state is abnormal to the first switch.
3. The method according to claim 1, wherein the setting a timeout value and a timeout threshold count of link aggregation control protocol data unit packet reception, comprises: setting a threshold time for link aggregation control protocol data unit packet reception; and in response to time for receiving a link aggregation control protocol data unit packet being greater than the threshold time, determining one timeout, and restarting counting.
4. The method according to claim 1, wherein the timeout threshold count is three.
5. The method according to claim 1, further comprising: modifying a field of a reserved block of the link aggregation control protocol data unit packet, so as to switch whether the aggregated link of a switch supports the out-of-band management mode.
6. A device for improving a link aggregation timeout, comprising: a processor; and a memory, containing instructions therein executable by the processor, wherein, in response to that the instructions are executed by the processor, the processor is configured to: set a timeout value and a timeout threshold count of link aggregation control protocol data unit reception; obtain a timeout count statistically, in response to a timeout of reception of a link aggregation control protocol data unit from a second switch by a first switch; determine, through a network controller, in response to that the timeout count is greater than the timeout threshold count and that an aggregated link between the first switch and the second switch is in an out-of-band management mode, whether a port of the second switch is abnormal; and remove, in response to the port of the second switch being abnormal, the abnormal port of the second switch from the aggregated link.
7. The device according to claim 6, wherein the processor is further configured to: make the first switch submit, in response to the timeout count being greater than the timeout threshold count, a request of querying a state of the port of the second switch; make the network controller obtain, in response to that the request is received by the network controller, the state of the port of the second switch, and determine whether the state of the port of the second switch is abnormal; and make the network controller send, a determining result of whether the state is abnormal to the first switch.
8. The device according to claim 6, wherein the processor is further configured to: set a threshold time for link aggregation control protocol data unit packet reception; and in response to time for receiving a link aggregation control protocol data unit packet being greater than the threshold time, determine one timeout, and restart counting.
9. The device according to claim 6, wherein the timeout threshold count is three.
10. The device according to claim 6, wherein the processor is further configured to modify a field of a reserved block of the link aggregation control protocol data unit packet, so as to switch whether the aggregated link of a switch supports the out-of-band management mode.
11. The method according to claim 1, wherein the setting a timeout value and a timeout threshold count of link aggregation control protocol data unit packet reception, comprises: setting an interval of thirty seconds or one second to send the link aggregation control protocol data unit packet.
12. The method according to claim 2, wherein the determining, through a network controller, in response to that the timeout count is greater than the timeout threshold count and that an aggregated link between the first switch and the second switch is in an out-of-band management mode, whether a port of the second switch is abnormal, comprises: adding an aggregated link state monitoring and control module in the network controller; and submitting, by the first switch, the request of querying the state of the port of the second switch to aggregated link state monitoring and control module.
13. The method according to claim 12, wherein, in response to that the first switch submits the request of querying the state of the port of the second switch to aggregated link state monitoring and control module, the aggregated link state monitoring and control module confirms a link state table in a database.
14. The method according to claim 13, wherein, in response to that information in the table expires, the aggregated link state monitoring and control module sends the request of querying the state of the port of the second switch to the second switch.
15. The method according to claim 5, wherein, the modifying a field of a reserved block of the link aggregation control protocol data unit packet, so as to switch whether the aggregated link of a switch supports the out-of-band management mode, comprises: using a first bit of a first byte to determine whether the out-of-band management is supported, where 1 represents the out-of-band management mode, and 0 represents an in-band management mode.
16. The device according to claim 6, wherein the processor is further configured to: set an interval of thirty seconds or one second to send the link aggregation control protocol data unit packet.
17. The device according to claim 7, wherein the processor is further configured to: add an aggregated link state monitoring and control module in the network controller; and submit, by the first switch, the request of querying the state of the port of the second switch to aggregated link state monitoring and control module.
18. The device according to claim 17, wherein, in response to that the first switch submits the request of querying the state of the port of the second switch to aggregated link state monitoring and control module, the aggregated link state monitoring and control module confirms a link state table in a database.
19. The device according to claim 10, wherein, the processor is further configured to: use a first bit of a first byte to determine whether the out-of-band management is supported, where 1 represents the out-of-band management mode, and 0 represents an in-band management mode.
20. A non-transitory storage medium, containing instructions thereon, wherein, in response to that the instructions are executed by a processor, the processor implements operations according to claim 1.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) In order to describe the technical solutions in the embodiments of the present disclosure or the prior art more clearly, the drawings required to be used in descriptions about the embodiments or the prior art will be introduced briefly below. Apparently, the drawings in the description below are only some embodiments of the present disclosure. Those of ordinary skill in the art may further obtain other embodiments according to these drawings without creative work.
(2)
(3)
(4)
DETAILED DESCRIPTION OF THE EMBODIMENTS
(5) In order to make the object, technical solutions, and advantages of the present disclosure clearer, the embodiments of the present disclosure will further be described below in detail in combination with specific embodiments and with reference to the drawings.
(6) Based on the above object, a first aspect of the embodiments of the present disclosure proposes an embodiment of a method for improving a link aggregation protocol timeout.
(7) As shown in
(8) In S1, setting a timeout value and a timeout threshold count of LACPDU packet reception of a switch. According to standard IEEE802.3ad, a user may set a long interval (thirty seconds) or a short interval (one second) to send LACPDU packets.
(9) In S2, obtaining a timeout count statistically in response to a timeout of reception of an LACPDU from a second switch by a first switch.
(10) In S3, determines, through a network controller, in response to that the timeout count is greater than the timeout threshold count and that an aggregated link between the switches is in an out-of-band management mode, whether a port of the second switch is abnormal. Generally, a data center has a network controller configured to monitor all network devices of the data center, and an aggregated link state monitoring and control module may be added in the controller, such that a switch may query an aggregated link state of a peer switch through the controller to avoid the aggregated link state being affected by an in-band data flow.
(11) In S4, removing, in response to the port of the second switch being abnormal, the abnormal port of the second switch from the aggregated link. After determining that the port of the second switch is abnormal, the network controller may regularly monitor the abnormal port, and when a state of the abnormal port is normal, add the port to the aggregated link again.
(12) By the technical solution of the present disclosure, the problem that the stability of in-band management may be affected by an in-band data flow may be solved, the stability of an aggregated link may further be improved, and the forward compatibility is retained.
(13) In an embodiment of the present disclosure, the step of determining, through a network controller, in response to that the timeout count is greater than the timeout threshold count and that an aggregated link between the switches is in an out-of-band management mode, whether a port of the second switch is abnormal, includes the following steps:
(14) the first switch submits, in response to the timeout count being greater than the timeout threshold count, a request of querying a state of the port of the second switch;
(15) in response to that the request is received by the network controller, the network controller obtains the state of the port of the second switch, and determines whether the state of the port of the second switch is abnormal; and
(16) the network controller sends a determining result of whether the state is abnormal to the first switch. When the timeout count of LACPDU packet reception of the first switch reaches three, the first switch submits a request of querying the aggregated link of the second switch to the aggregated link state monitoring and control module of the controller. Then, the aggregated link state monitoring and control module confirms a link state table in a database. If information in the table expires, the aggregated link state monitoring and control module sends a state request to the second switch. After the second switch transmits a link state back to the aggregated link state monitoring and control module, and then the aggregated link state monitoring and control module transmits a query result back to the first switch. Then, the first switch determines whether the port is required to be disabled according to the link state of peer switch.
(17) In an embodiment of the present disclosure, the step of setting a timeout value and a timeout threshold count of LACPDU reception of a switch, includes the following steps:
(18) a threshold time for LACPDU packet reception is set; and
(19) in response to time for receiving an LACPDU packet being greater than the threshold time, one timeout is determined, and counting is restarted.
(20) In an embodiment of the present disclosure, the timeout threshold count is three.
(21) In an embodiment of the present disclosure, the method further includes: modifying a field of a reserved block of the LACPDU packet, so as to switch whether the aggregated link of the switch supports the out-of-band management mode. It is the reserved block where an LACP field may be modified. In the standards, totally fifty bytes are reserved in this block for function extension, so modifying this field may not affect existing functions. The first bit of the first byte is used to determine whether the out-of-band management is supported, where 1 represents out-of-band management, and 0 represents in-band management. Therefore, forward compatibility with old devices that do not support this technology may be achieved. If the reserved block in the received LACPDU packet is not modified, the aggregated link state continues to be maintained by in-band management.
(22) By the technical solution of the present disclosure, the problem that the stability of in-band management may be affected by an in-band data flow may be solved, the stability of an aggregated link may further be improved, and the forward compatibility is retained.
(23) It is to be noted that those of ordinary skill in the art may understand that all or part of the flows in the method of the above-mentioned embodiment may be completed by a computer program instructing related hardware. The above program may be stored in a computer-readable storage medium. When the program is executed, the flows of the embodiments of the respective methods may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), or the like. The embodiment of the computer program may have effects the same as or similar to those in any corresponding method embodiment.
(24) In addition, the methods disclosed according to the embodiments of the present disclosure may also be implemented as a computer program executed by a CPU. The computer program may be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above functions defined in the methods disclosed in the embodiments of the present disclosure are executed.
(25) Based on the above object, a second aspect of the embodiments of the present disclosure proposes a device for improving a link aggregation protocol timeout. As shown in
(26) a setting module 201, configured to set a timeout value and a timeout threshold count of LACPDU reception of a switch;
(27) a statistical module 202, configured to obtain a timeout count statistically in response to a timeout of reception of an LACPDU from a second switch by a first switch;
(28) a determining module 203, configured to determine, through a network controller, in response to that the timeout count is greater than the timeout threshold count and that an aggregated link between the switches is in an out-of-band management mode, whether a port of the second switch is abnormal; and
(29) a removing module 204, configured to remove, in response to the port of the second switch being abnormal, the abnormal port of the second switch from the aggregated link.
(30) In an embodiment of the present disclosure, the determining module is further configured to:
(31) make the first switch submit, in response to the timeout count being greater than the timeout threshold count, a request of querying a state of the port of the second switch;
(32) make the network controller, in response to that the request is received by the network controller, obtain the state of the port of the second switch, and determine whether the state of the port of the second switch is abnormal; and
(33) make the network controller send, a determining result of whether the state is abnormal to the first switch.
(34) In an embodiment of the present disclosure, the setting module is further configured to:
(35) set a threshold time for LACPDU packet reception; and
(36) in response to time for receiving an LACPDU packet being greater than the threshold time, determine one timeout, and restart counting.
(37) In an embodiment of the present disclosure, the timeout threshold count is three.
(38) In an embodiment of the present disclosure, the device further includes a modification module, configured to modify a field of a reserved block of the LACPDU packet, so as to switch whether the aggregated link of the switch supports the out-of-band management mode. Based on the above object, as shown in
(39) The above embodiments, especially any “preferred” embodiments, are possible examples of implementation, and are proposed only for a clear understanding of the principles of the present disclosure. Many changes and modifications may be made to the above embodiments without departing from the spirit and principles of the techniques described herein, all of which are intended to be included in the scope of the present disclosure and protected by the appended claims.