Method, system, device and medium for rapid negotiation of mlag protocol in spanning tree environment
By encapsulating BPDU and replacing MAC addresses on the peer-link ports of MLAG devices under the Spanning Tree Protocol (STP), the MLAG protocol connection timeout problem is solved, enabling fast negotiation and normal message transmission in the STP environment, thus improving the system's flexibility and stability.
Patent Information
- Application Number
- CN202411841566.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-13
AI Technical Summary
Under the Spanning Tree Protocol (STP), when the peer-link port of an MLAG device is blocked, the MLAG protocol connection times out, the function fails, and messages cannot be sent or received normally, affecting system operating efficiency.
By maintaining a timer on the peer-link port at the sending end, and encapsulating the message with BPDU or replacing the destination MAC address during the waiting delay period, and adding a message identifier, fast negotiation is achieved by ensuring that the message is not dropped in the blocking state.
This avoids message loss, prevents MLAG protocol connection timeouts, improves the adaptability and stability of system functions, and ensures normal interaction and negotiation of the MLAG protocol.
Smart Images

Figure CN119676152B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of network communication, and particularly relates to a method, system and device for quickly negotiating MLAG protocol in a spanning tree environment and a readable storage medium. BACKGROUND
[0002] A spanning tree network is a protocol used to avoid loops in a network and ensure that data packets are transmitted normally in the network. In a complex network topology, if there are multiple paths connecting two nodes, data packets may circulate indefinitely in the network, causing network congestion and even collapse.
[0003] MLAG is a technology used to enhance network link redundancy and bandwidth utilization. It allows multiple physical switches (usually two) to be connected to the same subnet and treated as a logical unit. MLAG provides the benefits of fast recovery from failures and bandwidth aggregation by aggregating links together to form a logical link.
[0004] Spanning tree networks and MLAG technology are usually used together to provide a highly available, high-performance and resilient network infrastructure. When enabling the spanning tree protocol on an MLAG device, the spanning tree protocol will first block all ports. At this time, the MLAG device negotiates the use of peer-link port interaction protocol messages discarded by the spanning tree protocol, causing the MLAG protocol connection to timeout, resulting in MLAG failure.
[0005] Therefore, in view of the above technical problems, it is necessary to provide a strategy that can normally forward protocol messages under the spanning tree protocol.
[0006] The information disclosed in this BACKGROUND section is only intended to increase an understanding of the general context in which the present application can be practiced. It is not admitted that this information constitutes prior art that is already known in the art. SUMMARY
[0007] The purpose of the present application is to provide a method, system, device and readable storage medium for quickly negotiating MLAG protocol in a spanning tree environment, which can provide an MLAG device with a method for normally sending and receiving protocol messages after the spanning tree protocol sets the peer-link port to the Block blocked state.
[0008] To achieve the above-mentioned purpose, the technical scheme provided by an embodiment of the present application is as follows:
[0009] In a first aspect, the present application provides a method for quickly negotiating MLAG protocol in a spanning tree environment, which comprises:
[0010] determining whether the sending peer-link port is in the blocked state of the spanning tree protocol;
[0011] If yes, a BPDU message header is added to the to-be-sent protocol message, or a destination MAC of the to-be-sent protocol message is replaced by the preset BPDU MAC;
[0012] A message identifier is added to the processed to-be-sent protocol message, and the processed to-be-sent protocol message with the added message identifier is sent from a sending peer-link port.
[0013] In one or more embodiments of the present application, adding a message identifier to the to-be-sent protocol message comprises:
[0014] writing the message identifier into an unused value in a defined field of the processed to-be-sent protocol message; or
[0015] inserting a new field for writing the message identifier.
[0016] In one or more embodiments of the present application, writing the message identifier into an unused value in a defined field of the processed to-be-sent protocol message comprises:
[0017] writing the message identifier into a BPDU_TYPE field of the processed to-be-sent protocol message.
[0018] In one or more embodiments of the present application, the method further comprises:
[0019] deleting a message identifier of a protocol message received by a receiving peer-link port and a new field inserted for writing the message identifier.
[0020] In one or more embodiments of the present application, the method further comprises:
[0021] If the protocol message received by the receiving peer-link port contains an encapsulated BPDU message header, the protocol message is identified and the protocol message is decapsulated;
[0022] the protocol message stripped of the BPDU message header is sent from the receiving peer-link port to an MLAG protocol stack.
[0023] In one or more embodiments of the present application, the method further comprises:
[0024] maintaining a timer at a sending peer-link port;
[0025] when the sending peer-link port changes from a blocking state to a forwarding state, the corresponding timer is refreshed and started;
[0026] The timer stops when a preset waiting time period is reached.
[0027] In one or more embodiments of the present application, the method further comprises:
[0028] If the current sending peer-link port is not in a blocking state of the spanning tree protocol, it is determined whether the current sending peer-link port is in a waiting time period;
[0029] If yes, a BPDU message header is added to the protocol message to be sent, or a destination MAC of the protocol message to be sent is replaced by the preset BPDU MAC, a message identifier is added to the processed protocol message to be sent, and the processed protocol message to be sent with the message identifier is sent from the sending peer-link port.
[0030] If no, the protocol message to be sent is sent from the sending peer-link port.
[0031] In a second aspect, the present application provides a system for fast negotiation of MLAG protocol in a spanning tree environment, comprising:
[0032] A first module is configured to determine whether a sending peer-link port is in a blocking state of a spanning tree protocol;
[0033] A second module is configured to add a BPDU message header to a protocol message to be sent, or replace a destination MAC of the protocol message to be sent by a preset BPDU MAC;
[0034] A third module is configured to add a message identifier to a processed protocol message to be sent;
[0035] A fourth module is configured to send the processed protocol message to be sent with the message identifier from the sending peer-link port.
[0036] In a third aspect, the present application provides a computer device, comprising a memory and a processor, which are communicatively connected with each other, and the memory stores computer instructions, and the processor executes the computer instructions to perform the method for fast negotiation of MLAG protocol in a spanning tree environment.
[0037] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions for making a computer execute the method for fast negotiation of MLAG protocol in a spanning tree environment.
[0038] In the port blocking state, the received common MLAG message is discarded. Compared with the prior art, the provided MLAG protocol fast negotiation method in the spanning tree environment of the application enables the function of the MLAG device to normally operate by performing the encapsulation operation on the MLAG protocol message and the like. Further, the application also provides another optimization scheme, which replaces the destination MAC address of the message, so that the peer-link port can identify and send the MLAG protocol message and the like to the CPU, and then the original message is processed and sent to the MLAG protocol stack. This avoids the loss of the message, and further avoids the MLAG function failure caused by the MLAG protocol connection timeout, which improves the adaptability and stability of the system function implementation, and at the same time, speeds up the MLAG protocol negotiation in the spanning tree scene. Secondly, the application sets a waiting delay period, which can effectively prevent the problem that the spanning tree protocol state of the peer-link port of the connected MLAG device is not synchronized to the Forward forwarding state, that is, the peer-link port is detected to be in the forwarding state, but the associated peer-link port on the opposite side is still in the blocking state, resulting in the loss of the message. Further, the stability of the system function implementation is maintained. Finally, the application sets a plurality of different implementation manners for different scenes to add the message identification and make the message not be discarded by the peer-link port in the blocking state, which improves the flexibility of the system. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0040] Figure 1 is a spanning tree environment MLAG protocol fast negotiation method flowchart in an embodiment of the application;
[0041] Figure 2 is a spanning tree environment MLAG protocol fast negotiation method flowchart in an embodiment of the application;
[0042] Figure 3 is a spanning tree environment MLAG protocol fast negotiation system structure block diagram in an embodiment of the application;
[0043] Figure 4 is an electronic device structure block diagram in an embodiment of the application;
[0044] Figure 5 is a peer-link port sending protocol message flowchart in an embodiment of the application;
[0045] Figure 6 is the application flow diagram of peer-link port sending protocol message waiting for delay period in an embodiment of the present application;
[0046] Figure 7 is the flow diagram of peer-link port receiving BPDU encapsulated protocol message in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the personnel in the technical field better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work should belong to the protection scope of the present application.
[0048] Unless otherwise clearly indicated, in the entire specification and claims, the term "comprise" or its variants such as "contain" or "include" and the like will be understood to include the stated element or component, but not to exclude the presence of other elements or components.
[0049] In the prior art, there is a method of simultaneously using spanning tree network and MLAG technology, which specifically includes: when the peer-link port on the MLAG device is blocked by the spanning tree protocol, the prior art can only wait for the completion of the interaction of the spanning tree protocol, and then the peer-link port of the MLAG device enters the Forward state, at which time, the normal sending and receiving of the message to be forwarded is performed. After the MLAG protocol reconnection waiting period, the MLAG protocol interaction is performed again. At this time, the normal sending and receiving of the protocol message on the peer-link port of the MLAG device is performed, and the MLAG negotiation is completed.
[0050] It can be understood that the normal sending and receiving of the message cannot be performed during the waiting process, which will seriously affect the efficiency of the system operation; if the packet is continuously sent, the sent message will inevitably be lost due to the peer-link port on the MLAG device being blocked by the spanning tree protocol, thereby causing the problems of MLAG protocol connection timeout and MLAG function failure. At the same time, even if the current peer-link port is in the Forward state, it is still impossible to guarantee that the peer-link port at the other end is not in the blocked state, that is, there is still a possibility of message loss.
[0051] The inventor of the present application finds the main shortcomings of the prior art and proposes a new technical implementation idea based on the shortcomings of the prior art: a timer is maintained at the sending end peer-link port, and when the port changes from the blocking state to the forwarding state, the timer starts. Within the preset waiting time period, the port restored to the forwarding state and the peer-link port associated with it on the opposite side are both considered to be in the blocking state, preventing the loss of messages caused by the blocking of one end. Further, by detecting the current port state, when in the blocking state, the BPDU header is used to encapsulate the protocol message to be forwarded, or the destination MAC address of the message is replaced with the BPDU MAC, so that the MLAG protocol messages and the like are not discarded when the peer-link port is blocked, thereby normally completing the purpose of MLAG protocol interaction and negotiation.
[0052] Please refer to Figure 1 , which shows an application scenario of the method for fast negotiation of MLAG protocol in a spanning tree environment provided by the present application, which specifically includes: an MLAG master device 101, an MLAG slave device 102, and a user terminal 103.
[0053] It should be noted that the MLAG master device 101, the MLAG slave device 102, and the user terminal 103 are all provided with communication connections, and the communication network extended by the above communication connections can include various connection types, including but not limited to: wired connection, wireless connection, or optical cable connection, etc. At the same time, the communication network can be a local area network, a metropolitan area network, a wide area network, or any combination of the three.
[0054] Among them, the MLAG master device 101 and the MLAG slave device belong to the same logical unit, and the two transmit data protocol through the peer-link port. The user terminal is used to set the necessary custom items for the line of sight of the method for fast negotiation of MLAG protocol in a spanning tree environment provided by the present application, such as the format of the protocol message to be forwarded, the length and position of the newly added identification field, etc.
[0055] It should be noted that the user terminal 103 is installed with a computer software program matched with the method for fast negotiation of MLAG protocol in a spanning tree environment provided by the present application; the user terminal 103 can include but is not limited to a desktop computer (PC terminal), a desktop computer, a smart phone, a handheld computer, a tablet computer, a personal digital assistant (PDA), and the like portable electronic devices or wearable electronic devices, and the present application does not limit the above content.
[0056] It should be noted that the MLAG protocol fast negotiation method in the spanning tree environment of the embodiment of the application can be applied to the MLAG protocol fast negotiation system in the spanning tree environment of the embodiment of the application. The MLAG protocol fast negotiation system in the spanning tree environment can be configured in a terminal. The terminal can include, but is not limited to, a PC (Personal Computer), a PDA (Personal Digital Assistant), a smart phone, a smart wearable device, and the like.
[0057] Please refer to Figure 2 Fig. 1 shows a flowchart of the MLAG protocol fast negotiation method in the spanning tree environment in an embodiment of the application. The MLAG protocol fast negotiation method in the spanning tree environment specifically includes the following steps:
[0058] S201: determining whether the peer-link port of the sending end is in a blocking state of the spanning tree protocol;
[0059] It should be noted that in an Ethernet switching network, in order to perform link backup and improve network reliability, a redundant link is usually used. However, the use of the redundant link can generate a loop on the switching network, causing a broadcast storm and MAC address table instability and other failure phenomena. This results in poor user communication quality, and even communication interruption. In order to solve the loop problem in the switching network, the STP (Spanning Tree Protocol) is proposed. The device running the spanning tree protocol discovers the loop in the network by interacting with each other, and selectively blocks a certain interface, and finally prunes the loop network structure into a tree network structure without loops, thereby preventing the message from continuously circulating in the loop network, and also avoiding the processing capacity of the device due to repeated reception of the same message.
[0060] On the other hand, the MLAG (Multichassis LinkAggregation Group) provides a technology of cross-device link aggregation. The MLAG improves the reliability of the link from the single board level to the device level by cross-device link aggregation with multiple switches in the same state and user-side devices or servers. It allows multiple physical switches (usually two) to be connected to the same subnet and to be regarded as a logical unit, and improves the reliability of the link from the single board level to the device level.
[0061] When the M-LAG is working normally, the known unicast traffic from the user side to the network side is formed by the M-LAG master and standby devices to form flow-based load sharing, and the traffic is forwarded together. Conversely, the known unicast traffic from the network side to the user side is also formed by the M-LAG master and standby devices to form flow-based load sharing, and the traffic is forwarded together. Therefore, the data transmission between the MLAG master device and the MLAG standby device based on the peer-link port is crucial to the implementation of the function of the MLAG.
[0062] In enterprise network and data center environment, spanning tree network and MLAG technology are usually used simultaneously to provide high availability, high performance and resilience of network infrastructure. But under spanning tree protocol, peer-link port of redundant MLAG device is blocked to prevent loop formation at the port. At this time, the data transmission between MLAG devices in the same logical unit is blocked. In a specific embodiment of the present application, since the port state is calculated based on spanning tree protocol, the spanning tree protocol calculation result of the corresponding sending peer-link port can be directly called to determine whether the peer-link port is in forwarding state or blocking state.
[0063] S202: If the sending peer-link port is in the blocking state of the spanning tree protocol, encapsulate the protocol message to be sent based on the BPDU message header, or replace the destination MAC of the protocol message to be sent with the preset BPDU MAC;
[0064] Since the port state in the spanning tree network needs to be determined through the interaction of spanning tree protocol BPDU and convergence, and the purpose of setting the port blocking state by the spanning tree protocol is to prevent the transmission of its message and avoid loop formation. Therefore, if the current peer-link port is in the blocking state, only spanning tree protocol message BPDU is transmitted and received on the port, and other received messages will be discarded.
[0065] In order to realize normal transmission and reception of different protocol messages on the peer-link port in the blocking state due to the spanning tree protocol, the protocol message to be sent can be encapsulated based on the BPDU message header, or the destination MAC of the protocol message to be sent can be replaced with the preset BPDU MAC.
[0066] Further, if the protocol message to be sent is processed by encapsulating the protocol message to be sent based on the BPDU message header, the receiving peer-link port needs to judge whether the protocol message is encapsulated with the BPDU message header after receiving the protocol message; if yes, the protocol message is identified and decapsulated; and the protocol message after stripping the BPDU message header is sent to the MLAG protocol stack along the receiving peer-link port. At the same time, if the message identifier is not written in the message header, but a new field is inserted, the receiving end also needs to delete the inserted new field, restore the original MLAG message format and send it to the MLAG protocol stack.
[0067] On the other hand, if the destination MAC of the protocol message to be sent is replaced by the preset BPDU MAC, the message does not need to be unpacked, but the receiving end needs to delete the inserted message identifier, restore the original MLAG message format, and then send the protocol message based on the sending end peer-link port.
[0068] It should be noted that for the MLAG master and slave devices, under the spanning tree protocol, one peer-link port is in a forwarding state, and the other peer-link port is in a blocking state. Therefore, when it is detected that the sending end peer-link port is in the forwarding state, if the corresponding protocol message is directly sent, the message may be discarded at the receiving end peer-link port. Similarly, this can cause the MLAG device negotiation to time out and the MLAG function to fail. Since the sending end side cannot perceive the port state of the receiving end side, the port states of the sending and receiving sides cannot be obtained at the same time, and thus the processing strategy for the protocol message to be forwarded cannot be determined. In the above case, the present embodiment proposes a new implementation manner as follows.
[0069] In an exemplary embodiment of the present application, a timer is maintained at the sending end peer-link port; when the state of the sending end peer-link port changes from the blocking state to the forwarding state, the corresponding timer is refreshed and started; and the timer stops counting when a preset waiting time delay period is reached.
[0070] If the current sending end peer-link port is not in the blocking state of the spanning tree protocol, it is determined whether the current sending end peer-link port is in the waiting time delay period; if yes, the protocol message to be sent is encapsulated with a BPDU message header, or the destination MAC of the protocol message to be sent is replaced by the preset BPDU MAC, a message identifier is added to the processed protocol message to be sent, and the processed protocol message to be sent with the message identifier is sent from the sending end peer-link port.
[0071] The setting of the waiting time delay period can effectively avoid the problem of message loss caused by the fact that one peer-link port is in the forwarding state and the other peer-link port is in the blocking state. When the peer-link port changes from the blocking state to the forwarding state, the timer is started, and during the preset waiting time delay period, the sending and receiving end peer-link ports are considered to be in the blocking state at the same time. The specific value of the waiting time delay period can be dynamically adjusted based on the actual use scenario, and the present embodiment does not limit this.
[0072] It should be noted that the protocol message to be sent in the application can include, but is not limited to, MLAG protocol messages, ARP protocol messages, ND protocol messages, etc. The type of protocol message is not limited in the embodiments of the application.
[0073] S203: adding a message identifier in the processed protocol message to be sent, and sending the processed protocol message to which the message identifier is added from a peer-link port of a sending end.
[0074] In an exemplary embodiment, adding the message identifier in the protocol message to be sent includes: writing the message identifier in an unused value in a defined field of the protocol message; or defining a new field for writing the message identifier.
[0075] It should be noted that for the message processed by replacing the destination MAC with a preset BPDU MAC, it is actually expected that the message to be forwarded is still forwarded in the form of an Ethernet message. In an embodiment, the message identifier can be written in a defined protocol field, but the newly added message identifier is likely to cause confusion of the original field content, and therefore, preferably, a new TYPE field can be inserted in this case for writing the corresponding message identifier.
[0076] On the other hand, the encapsulated protocol message includes a MAC field, a Length field, an LLC field, a BPDU_Type field, etc. In an embodiment, a new TYPE field can be defined for writing the message identifier when adding the message identifier. It can be understood that in the case of encapsulation, there is a BPDU_TYPE field in the message header, and therefore, if a new TYPE field is inserted, redundancy will be caused, and the link transmission pressure will be increased. Therefore, preferably, the message identifier is written in the BPDU_TYPE field of the encapsulated BPDU message header, and an unused value other than the defined BPDU_TYPE is used.
[0077] In order to further illustrate the MLAG protocol fast negotiation method in a spanning tree environment provided by the application, the following is a complete implementation flow of a specific embodiment of the application. The flow implementation diagram is shown in Figures 5-7 .
[0078] When the MLAG device sends a protocol message, it will check the spanning tree protocol calculation state (START) of the peer-link port at this moment, determine whether the protocol message needs to be processed (END) according to the comparison result, and then complete the sending of the MLAG protocol when the spanning tree protocol calculation is performed on the peer-link port.
[0079] Specifically, as shown in Figure 5As shown, P1 step is that the MLAG protocol stack encapsulates the original protocol packet according to the peer-link port configuration.
[0080] J1 step is to determine whether the current peer-link port is in the Block blocked state of the Spanning Tree Protocol. If the current peer-link port is already in the Block blocked state of the Spanning Tree Protocol, step P2 is executed; otherwise, step J2 is executed. J2 step is to determine whether the current peer-link port is in the Forward forwarding state of the Spanning Tree Protocol and whether the current peer-link port is in the BPDU waiting delay period for encapsulating the protocol packet. If the peer-link port is in the BPDU waiting delay period for encapsulating the protocol packet, step P2 is executed; otherwise, step P3 is executed. P2 step is to add the encapsulated BPDU packet header to the current original protocol packet, or replace the destination MAC of the protocol packet to be sent with the BPDU MAC representing the same receiving end, and add an identifier indicating that the encapsulated packet is a protocol packet, and then send the processed packet through the peer-link port. P3 step is to directly send the current original protocol packet through the peer-link port.
[0081] Further, the process of setting the waiting delay period is as shown in Figure 6 Specifically, P1 step is to calculate the peer-link port to be in the Block blocked state of the Spanning Tree Protocol. P2 step is to calculate the peer-link port to be in the Forward forwarding state of the Spanning Tree Protocol through BPDU interaction according to the protocol standard. P3 step is to start the waiting delay of the protocol packet using BPDU encapsulation when the peer-link port migrates to the Forward forwarding state of the Spanning Tree Protocol, which prevents the peer-link port of the connected MLAG device from being in the Forward forwarding state of the Spanning Tree Protocol. P4 step is to terminate the waiting delay when the waiting delay of the protocol packet using BPDU encapsulation ends.
[0082] When the peer-link port receives the protocol packet encapsulated by BPDU, as shown in Figure 7As shown in the figure, specifically, P1 step is that the MLAG device receives the BPDU message and parses the receiving port and message protocol field of the BPDU message. J1 step is to judge whether the receiving port of the current BPDU message to be processed is the peer-link port. If the receiving port of the current BPDU to be processed is the peer-link port, step J2 is executed; otherwise, END, the BPDU is processed according to the spanning tree protocol. J2 step is to judge the identification information of the current BPDU message to be processed to determine whether it is the MLAG type. If the current BPDU message to be processed is the MLAG type, step P2 is executed; otherwise, END, the BPDU is processed according to the spanning tree protocol. P2 step is that the MLAG device decapsulates the current BPDU to be processed, strips the BPDU message header to obtain the protocol message, or directly obtains the protocol message whose destination MAC is replaced. P3 step is that the MLAG device sends the protocol message to the MLAG protocol stack for processing.
[0083] Please refer to Figure 3 As shown in the figure, based on the same inventive concept as the MLAG protocol fast negotiation method in the foregoing spanning tree environment, an embodiment of the present application provides an MLAG protocol fast negotiation system 300 in a spanning tree environment, which comprises a first module 301, a second module 302, a third module 303 and a fourth module 304.
[0084] Specifically, the first module 301 is configured to judge whether the sending peer-link port is in the blocking state of the spanning tree protocol; the second module 302 is configured to encapsulate the BPDU message header for the protocol message to be sent, or replace the destination MAC of the protocol message to be sent with the preset BPDU MAC; the third module 303 is configured to add a message identification in the processed protocol message to be sent; and the fourth module 304 is configured to send the processed protocol message to be sent with the message identification from the sending peer-link port.
[0085] It should be noted that the third module 303 is further configured to write the message identification into an unused value in a defined field in the processed protocol message to be sent, or insert a new field for writing the message identification.
[0086] It should be further noted that the MLAG negotiation system 300 provided by the present application further comprises a timing module, which is configured to maintain a timer in the sending peer-link port; when the sending peer-link port changes from the blocking state to the forwarding state, the corresponding timer is refreshed and started; and the timer stops counting when the preset waiting time delay period is reached.
[0087] If the current sending peer-link port is not in the blocking state of the spanning tree protocol, it is determined whether the current sending peer-link port is in a waiting time delay period; if yes, a BPDU message header is added to the protocol message to be sent, or a destination MAC of the protocol message to be sent is replaced by the preset BPDU MAC, a message identifier is added to the processed protocol message to be sent, and the processed protocol message to be sent with the message identifier is sent from the sending peer-link port.
[0088] If no, the protocol message to be sent is sent from the sending peer-link port.
[0089] Please refer to Figure 4 The electronic device 400 includes at least one processor 401, a memory 402 (for example, a non-volatile memory), a storage 403, and a communication interface 404, and the at least one processor 401, the memory 402, the storage 403, and the communication interface 404 are connected together via a bus 405. The at least one processor 401 is configured to invoke at least one program instruction stored or encoded in the memory 402, so as to enable the at least one processor 401 to perform various operations and functions of the method for fast negotiation of MLAG protocol in a spanning tree environment described in various embodiments of the present specification.
[0090] In the embodiments of the present specification, the electronic device 400 can include but is not limited to a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile electronic device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable electronic device, a consumer electronic device, and the like.
[0091] The embodiments of the present application also provide a computer readable medium, and the computer readable medium carries computer execution instructions. When the computer execution instructions are executed by a processor, the computer execution instructions can be used to implement various operations and functions of the method for fast negotiation of MLAG protocol in a spanning tree environment described in various embodiments of the present specification.
[0092] The computer readable medium in the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0093] In the present application, the computer readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave in a propagated data signal that can bear computer readable program code. Such propagated data signal can take a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the above.
[0094] Those skilled in the art should clearly understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0095] The present application is described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, systems, and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the flow of the flowcharts and / or block diagrams. The computer program instructions can also be stored in a computer readable medium that can guide the computer or other programmable data processing apparatus to work in a specific manner, so that the computer program instructions stored in the computer readable medium produce a device that implements the flow of the flowcharts and / or block diagrams.Figure One apparatus for performing the function specified by the one or more processes and / or blocks Figure One apparatus for performing the function specified by the one or more processes and / or blocks
[0096] The foregoing description of specific exemplary embodiments of the application has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the application to the precise forms disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain the principles of the application and its practical application and to thereby enable others skilled in the art to best utilize the application and various embodiments with various modifications as are suited to the particular use contemplated. It is intended that the scope of the application be defined by the claims appended hereto and their equivalents.
[0097] It will be apparent to those skilled in the art that the application is not limited to the details of the foregoing exemplary embodiments and that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the application. The exemplary embodiments are to be considered in all respects as illustrative only and not restrictive in any manner. The scope of the application is to be given by the appended claims and their equivalents rather than by the foregoing description, and it is intended that all changes and modifications which come within the meaning of the claims are embraced thereby. No feature of the claims is to be construed as limiting the claim to the exact disclosure herein.
[0098] Furthermore, it should be understood that although the description has been set forth in the context of implementations, the present description is not only intended to encompass one independent technical solution in each implementation, and the description is set forth in this way only for the purpose of clarity, and those skilled in the art should consider the description as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other implementations that those skilled in the art can understand.
Claims
1. A fast negotiation method for the MLAG protocol in a spanning tree environment, characterized in that, include: Determine whether the peer-link port at the sending end is in a blocking state of the Spanning Tree Protocol; If so, then encapsulate the protocol message to be sent with a BPDU header, or replace the destination MAC of the protocol message to be sent with a preset BPDU MAC; Add a message identifier to the processed protocol message to be sent, and send the processed protocol message with the added message identifier from the peer-link port of the sending end; The method further includes: maintaining a timer on the peer-link port at the transmitting end; When the sending peer-link port changes from a blocked state to a forwarding state, the corresponding timer is refreshed and started; the timer stops counting when it reaches the preset waiting delay period; if the sending peer-link port is not currently in a blocked state of the Spanning Tree Protocol, it is determined whether the sending peer-link port is currently within the waiting delay period; if so, a BPDU header is added to the protocol message to be sent, or the destination MAC of the protocol message to be sent is replaced with the preset BPDU MAC, a message identifier is added to the processed protocol message to be sent, and the processed protocol message to be sent with the added message identifier is sent from the sending peer-link port; if not, the protocol message to be sent is sent from the sending peer-link port.
2. The method for fast negotiation of MLAG protocol in a spanning tree environment according to claim 1, characterized in that, Add a message identifier to the protocol message to be sent, including: Write the message identifier into an unused value in the defined fields of the processed protocol message to be sent; or Insert a new field for writing the message identifier.
3. The method for fast negotiation of MLAG protocol in a spanning tree environment according to claim 2, characterized in that, Write the message identifier into an unused value in the defined fields of the processed protocol message to be sent, including: Write the message identifier into the BPDU_TYPE field of the processed protocol message to be sent.
4. The method for fast negotiation of MLAG protocol in a spanning tree environment according to claim 2, characterized in that, The method further includes: Delete the message identifier of the protocol message received by the peer-link port at the receiving end, as well as the new field inserted for writing the message identifier.
5. The method for fast negotiation of MLAG protocol in a spanning tree environment according to claim 1, characterized in that, The method further includes: If the protocol message received by the peer-link port at the receiving end contains an encapsulated BPDU header, then the protocol message is identified and decapsulated. The protocol message, after the BPDU message header has been removed, is sent from the peer-link port of the receiving end to the MLAG protocol stack.
6. A fast negotiation system for the MLAG protocol in a spanning tree environment, applied to the fast negotiation method for the MLAG protocol in a spanning tree environment as described in any one of claims 1-5, characterized in that, include: The first module is used to determine whether the peer-link port of the sending end is in a blocking state of the spanning tree protocol; The second module is used to encapsulate the protocol message to be sent with a BPDU header, or to replace the destination MAC of the protocol message to be sent with a preset BPDU MAC. The third module is used to add a message identifier to the processed protocol message to be sent; The fourth module is used to send the processed protocol message to be sent, with the message identifier added, from the peer-link port of the sending end.
7. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the MLAG protocol fast negotiation method in a spanning tree environment as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to execute the MLAG protocol fast negotiation method in a spanning tree environment as described in any one of claims 1-5.
Citation Information
Patent Citations
Message transmitting method and device
CN104270297A