Mlag port path cost update method, system, device and medium
By synchronously updating the path cost value of the root port among MLAG devices, the problem that a fixed path cost value cannot adapt to changes in port speed is solved, thus achieving stable convergence and efficient path selection for the spanning tree protocol.
Patent Information
- Application Number
- CN202411841569.0
- 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
On MLAG devices, the fixed path cost value cannot be obtained according to the current MLAG port rate, which affects the root bridge path cost during spanning tree protocol election and leads to unstable spanning tree protocol convergence.
The path cost value is calculated based on the transmission rate of each port of the MLAG device, and the path cost value of the root port is synchronously updated among the MLAG devices to ensure that ports with the same MLAG ID use the same path cost value to participate in the spanning tree protocol calculation.
It enables dynamic updating of the path cost value of the MLAG port based on the rate, which improves the convergence stability of the spanning tree protocol and avoids port oscillation and protocol oscillation.
Smart Images

Figure CN119676153B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of network communication, and particularly relates to an MLAG port path cost updating method, system, device and 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 or even collapse. The spanning tree protocol forms a tree structure by identifying and disabling part of the paths in the network topology, ensuring that data packets are transmitted along only one path, thereby avoiding loops. In the spanning tree network, the root bridge ID, root path cost RPC, sending device bridge ID, and sending port ID carried by the BPDU are used to elect the role of each port according to the spanning tree.
[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 is usually used in combination with the spanning tree protocol to ensure that there are no loops in the network and to provide redundant paths. However, in actual application, when the MLAG port on the MLAG device uses multiple links, the fixed path cost value cannot obtain the corresponding path cost value according to the current MLAG port rate, causing the MLAG port to be unable to publish the BPDU corresponding to the port rate to the connected bridge device, affecting the root bridge path cost during the spanning tree protocol election.
[0004] Therefore, in view of the above technical problems, it is necessary to provide a dynamic path cost updating strategy.
[0005] The information disclosed in this BACKGROUND section is only intended to increase an understanding of the general context of the application and is not to be taken in any way as an acknowledgment or any form of suggestion that this information forms prior art that is already known in the art. SUMMARY
[0006] The purpose of the present application is to provide an MLAG port path cost updating method, system, device and readable storage medium, which can realize the participation of MLAG port in the spanning tree protocol calculation according to the rate adaptive path cost, and the MLAG port of the MLAG device uses the same path cost value, thereby improving the stability of the spanning tree protocol convergence.
[0007] In order to achieve the above-mentioned purpose, the technical scheme provided by an embodiment of the present application is as follows:
[0008] In a first aspect, the present application provides an MLAG port path cost updating method, which comprises:
[0009] calculating a path cost value of each MLAG port of the second MLAG device based on a transmission rate of each MLAG port of the second MLAG device;
[0010] receiving a synchronization message from the first MLAG device, and parsing the synchronization message to obtain a path cost corresponding to a root port of the first MLAG device and an MLAG ID of the first MLAG device;
[0011] comparing the path cost value of the root port of the first MLAG device with the path cost value of the root port of the second MLAG device, and updating the path cost value corresponding to the root port of the second MLAG device.
[0012] In one or more embodiments of the present application, updating the path cost value corresponding to the root port of the second MLAG device comprises:
[0013] if the MLAG ID of the root port of the second MLAG device is the same as the MLAG ID of the root port of the first MLAG device, then when the path cost value of the root port of the first MLAG device is less than the path cost value of the root port of the second MLAG device, updating the path cost value of the root port of the second MLAG device to the path cost value of the root port of the first MLAG device;
[0014] when the path cost value of the root port of the first MLAG device is greater than or equal to the path cost value of the root port of the second MLAG device, maintaining the current path cost of the root port of the second MLAG device.
[0015] In one or more embodiments of the present application, the method further comprises:
[0016] if the MLAG ID corresponding to the root port of the second MLAG device is different from the MLAG ID of the root port of the first MLAG device, then maintaining the current path cost of the root port of the first MLAG device and the current path cost of the root port of the second MLAG device.
[0017] In a second aspect, the present application provides a method for updating a path cost of an MLAG port, comprising:
[0018] obtaining a transmission rate of each MLAG port in a first MLAG device, and calculating a path cost value corresponding to each MLAG port based on the transmission rate of each MLAG port;
[0019] electing a root port of the first MLAG device based on the path cost value of each MLAG port;
[0020] sending a synchronization message to a second MLAG device, the synchronization message comprising a path cost value corresponding to a root port of the first MLAG device and a MLAG ID of the first MLAG device;
[0021] causing the second MLAG device to update the path cost value corresponding to the root port of the second MLAG device based on the synchronization message.
[0022] In one or more embodiments of the present application, the method further comprises:
[0023] periodically sending a synchronization message to the second MLAG device based on the root port of the first MLAG device, to start a new round of MLAG port path cost update.
[0024] In one or more embodiments of the present application, the method further comprises:
[0025] when the MLAG protocol is disconnected or there is a new link accessed by the MLAG port, reacquiring the transmission rate of each MLAG port of the first MLAG device, calculating the corresponding path cost value and electing the corresponding root port, and starting a new round of MLAG port path cost update.
[0026] In a third aspect, the present application provides a MLAG port path cost update system, which applies the MLAG port path cost update method as described, and comprises:
[0027] a first calculation module configured to calculate the path cost value of each MLAG port of the second MLAG device based on the transmission rate of each MLAG port of the second MLAG device;
[0028] a receiving module configured to cause the second MLAG device to receive a synchronization message from the first MLAG device, and parse the synchronization message to obtain the path cost value corresponding to the root port of the first MLAG device and the MLAG ID of the first MLAG device;
[0029] an updating module configured to, when the MLAG ID of the root port of the second MLAG device is the same as the MLAG ID of the root port of the first MLAG device, compare the path cost value of the root port of the first MLAG device with the path cost value of the root port of the second MLAG device, to update the path cost value corresponding to the root port of the second MLAG device.
[0030] In a fourth aspect, a MLAG port path cost update system applies the MLAG port path cost update method as described, and comprises:
[0031] a second calculation module configured to obtain the transmission rate of each MLAG port in the first MLAG device, and calculate the path cost value corresponding to each MLAG port based on the transmission rate of each MLAG port.
[0032] The election module is configured to elect a root port of the first MLAG device based on the path cost value of each MLAG port.
[0033] The sending module is configured to send a synchronization message to the second MLAG device, wherein the synchronization message comprises the path cost value corresponding to the root port of the first MLAG device and the MLAG ID.
[0034] The synchronization module is configured to enable the second MLAG device to update the path cost value corresponding to the root port of the second MLAG device based on the synchronization message.
[0035] In a fifth 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 MLAG port path cost updating method.
[0036] In a sixth aspect, the present application provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to perform the MLAG port path cost updating method.
[0037] Compared with the prior art, the MLAG port path cost updating method provided by the present application determines the optimal port on one side and the path cost of the optimal port by calculating the root port of the MLAG device forming a logical unit, and transmits the above information to another MLAG device in the logical unit through a protocol through a message, compares the path cost values of the MLAG ports with the same number, and updates to the one with a lower path cost value. Thus, the MLAG port can adaptively use the path cost value according to the rate, and the MLAG port of the MLAG device uses the same path cost value to participate in the spanning tree protocol calculation, thereby improving the stability of the spanning tree protocol convergence. Further, the present application provides a method for updating the path cost value of the MLAG port, and when the path cost values of the MLAG ports as root ports are inconsistent, the MLAG port can adaptively use the rate of the MLAG port to participate in the spanning tree protocol calculation according to the MLAG protocol state and the spanning tree root port state after synchronization of the peer-link. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present application, and those skilled in the art can also obtain other drawings according to these drawings without any creative effort.
[0039] Figure 1 is a schematic diagram of an MLAG port path cost update scenario in an embodiment of the present application;
[0040] Figure 2 is a flowchart of an MLAG port path cost update method in an embodiment of the present application;
[0041] Figure 3 is a block diagram of an MLAG port path cost update system in an embodiment of the present application;
[0042] Figure 4 is a block diagram of an electronic device in an embodiment of the present application;
[0043] Figure 5 is a flowchart of an MLAG port path cost update method in another embodiment of the present application;
[0044] Figure 6 is a block diagram of an MLAG port path cost update system in another embodiment of the present application;
[0045] Figure 7 is a flowchart of synchronizing path costs when an MLAG port is a root port in an embodiment of the present application;
[0046] Figure 8 is a flowchart of updating path costs of an MLAG port in another embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the technical solution in the present application better understood by the people in the technical field, the technical solution in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by the people in the technical field without creative labor should belong to the scope of protection 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” etc. should be understood as including the stated elements or components, but not excluding other elements or components.
[0049] In the prior art, there is a method of simultaneously using a spanning tree network and MLAG technology to provide a network infrastructure with high availability, high performance and elasticity.
[0050] In the prior art, a fixed path cost value is set for each port of the MLAG master and slave device. The path cost values of the ports with the same MLAG ID between the master and slave device are the same, so as to ensure the stability of the spanning tree protocol convergence.
[0051] However, it can be understood that the setting of the fixed path cost value can improve the stability of the convergence, but at the same time, it limits the adaptive selection of the optimal path cost value according to the port rate in the scheme, so that the precision of the spanning tree convergence is reduced. When the MLAG port of the MLAG device uses multiple links, the fixed path cost value cannot obtain the corresponding path cost value according to the current MLAG port rate, so that the MLAG port cannot publish the BPDU corresponding to the port rate to the connected bridge device, which affects the root bridge path cost in the spanning tree protocol election.
[0052] On the other hand, if the actual port rate is used to obtain the path cost value of each MLAG port, the MLAG port rate of the master device and the standby device will be inconsistent, which will cause the MLAG port to oscillate, and the BPDU carrying the root bridge path cost sent downstream through the other specified port of the MLAG device will be inconsistent, which will cause the spanning tree protocol to oscillate or fail to converge.
[0053] The inventors of the present application found the main shortcomings of the prior art and proposed a new technical implementation idea based on the shortcomings of the prior art: generating the path cost value of each port based on the actual transmission rate. Based on the spanning tree protocol, the root port is elected in the device. The root port can represent the optimal port in the device. The port information is sent to other switching devices in the MLAG logical unit through the synchronization message, and it is judged whether the path cost value of the port with the same sequence number is better than the path cost value of the aforementioned root port, and the corresponding path cost value is updated. Based on the above scheme, the dynamic update of the MLAG port path cost is realized, and the problem that the spanning tree protocol cannot converge due to the inconsistent MLAG port rate of the master device and the standby device is solved.
[0054] Please refer to Figure 1 which shows an application scene of the MLAG port path cost update method provided by the present application in an embodiment, and the scene specifically includes a first MLAG device 101, a second MLAG device 102 and a user terminal 103.
[0055] It should be noted that the first MLAG device 101, the second MLAG device 102 and the user terminal 103 are all provided with communication connections, and the communication network extended by the communication connections can include various connection types, including but not limited to wired connections, wireless connections or fiber cable connections, etc. Meanwhile, the communication network can be a local area network, a metropolitan area network, a wide area network or any combination of the three.
[0056] The first MLAG device is a MLAG device that determines a root port in a logical unit and then sends a synchronization message; and the second MLAG device is a MLAG device that receives the synchronization message and updates the port path cost.
[0057] The user terminal 103 is used to configure the custom items necessary for the implementation of the scheme, such as configuring the format of the synchronization message for initializing each port.
[0058] It should be noted that the user terminal 103 is installed with a computer software program matched with the MLAG port path cost updating method provided by the method; 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 embodiments of the present application do not limit the above.
[0059] Please refer to Figure 2 Fig. 1 shows a flowchart of the MLAG port path cost updating method in an embodiment of the present application. The MLAG port path cost updating method specifically includes the following steps:
[0060] S201: calculating the path cost value of each MLAG port of the second MLAG device based on the transmission rate of each MLAG port of the second MLAG device;
[0061] It should be noted that each port activated with the STP spanning tree protocol maintains a corresponding path cost value. The path cost value can be used to calculate the root path cost. The root path cost refers to the cost of the port to reach the root bridge, that is, the cumulative path cost value of all incoming interface paths along the way from the port to the root bridge.
[0062] The path cost value maintained by each port is negatively related to its interface bandwidth, that is, the larger the interface bandwidth, the smaller the corresponding path cost value; the smaller the interface bandwidth, the larger the corresponding path cost value. It can be understood that the calculation method of the port cost is different, and the obtained port path cost value is also different, so the calculation method of the port cost is not limited by the embodiments of the present application. Preferably, the IEEE 802.11 standard can be used to calculate the path cost of each port in the embodiments of the present application.
[0063] It should be noted that, in order to reduce the load pressure caused by calculation and avoid redundant calculation operations, when the port transmission rate is not changed, the path cost value of the port is not recalculated by the transmission rate of the port in each round in the periodic root port overhead update. Preferably, the corresponding new path cost value can be recalculated when the port rate is changed.
[0064] S202: The second MLAG device receives the synchronization message from the first MLAG device, parses the synchronization message to obtain the path cost corresponding to the root port of the first MLAG device and the MLAG ID.
[0065] It should be noted that in the environment applying the spanning tree protocol, each switch running the STP in a given broadcast domain has a unique bridge ID, which is composed of bridge priority and switch MAC address. By comparing the bridge priority first and then the MAC address, the root bridge in the switch network can be elected. The root bridge is the reference point for the topology calculation of the spanning tree and is also the root node of the calculated loop-free topology. Further, there can be multiple ports in the remaining non-root network bridges, but only one port leading to the root switch is called the root port.
[0066] On the other hand, MLAG (Multichassis Link Aggregation Group) provides a technology of cross-device link aggregation. MLAG improves the reliability of the link from the single board level to the device level by aggregating the links of multiple switches in the same state and user-side devices or servers across devices. It allows multiple physical switches (usually two) to be connected to the same subnet and to be regarded as a logical unit.
[0067] In the embodiment of the application, each port on the MLAG device maintains an MLAG ID. There must be ports with the same MLAG ID on the MLAG devices in the same logical unit. For example, a master-slave MLAG device is set, which is a master device A and a slave device B respectively. The master device A is configured with a port with an MLAG ID of 1, and the slave device B must have a port with an MLAG ID of 1.
[0068] It should be noted that the first MLAG device and the second MLAG device in the application do not refer to a specific device. The first MLAG device generally refers to the party that sends the synchronization message when implementing the MLAG port path cost update method provided by the application; and the second MLAG device generally refers to the party that receives the synchronization message and implements the root port path cost update.
[0069] For example, two MLAG devices constituting a logical unit, MLAG master device and MLAG slave device, in the process of root port election, the MLAG master device completes the election of root port first, at this time the MLAG master device as the first MLAG device sends a synchronization message to the MLAG slave device, so that the MLAG slave device updates the corresponding port path cost. When the MLAG slave device completes the corresponding root port election at a moment, the MLAG slave device becomes the first MLAG device to send a synchronization message to the MLAG master device.
[0070] In the above embodiment, the transmission time of the synchronization message is only related to the determination of the root port. That is, the adjacent MLAG devices will certainly transmit the synchronization message twice. In this embodiment, the accuracy and consistency of the root port path cost of the adjacent devices in the logical unit can be guaranteed to the greatest extent. However, the load pressure caused by the message transmission will be larger due to the existence of the redundant packet sending process. Therefore, the present application further provides another embodiment as follows.
[0071] In another embodiment of the present application, when the MLAG device A sends a synchronization message to the MLAG device B, if the MLAG device B updates the path cost of the root port of the MLAG device A carried in the synchronization message to the root port of the MLAG device B. Then in this round of path cost update for the MLAG device A and the MLAG device B, the MLAG device B no longer sends a synchronization message to the MLAG device A; if the MLAG device B still maintains the current path cost of the root port after receiving the synchronization message, it sends a synchronization message to the above-mentioned MLAG device A based on the root port information of the MLAG device B.
[0072] In the above embodiment, part of the redundant packet sending update process is removed, and part of the complex pressure is released without greatly affecting the accuracy of the update, which can be applied to the scene of insufficient message transceiving resources to update the MLAG port path cost.
[0073] S203: comparing the path cost value of the root port of the first MLAG device with the path cost value of the root port of the second MLAG device to update the corresponding path cost value of the root port of the second MLAG device.
[0074] In an exemplary embodiment of the present application, if the MLAG ID of the root port of the second MLAG device is the same as the MLAG ID of the root port of the first MLAG device, then when the path cost value of the root port of the first MLAG device is less than the path cost value of the root port of the second MLAG device, the path cost value of the root port of the second MLAG device is updated to the path cost value of the root port of the first MLAG device; and when the path cost value of the root port of the first MLAG device is greater than or equal to the path cost value of the root port of the second MLAG device, the current path cost of the root port of the second MLAG device is maintained.
[0075] It should be noted that the MLAG IDs corresponding to the adjacent root ports of the MLAG devices should be the same, otherwise the member port will oscillate. Therefore, when the second MLAG device receives the corresponding synchronization message, it should first check whether the MLAG ID of the root port of the first MLAG device recorded in the synchronization message is the same as the MLAG ID of the root port of the second MLAG device.
[0076] On the other hand, if the MLAG ID corresponding to the root port of the second MLAG device is different from the MLAG ID of the root port of the first MLAG device, the current path cost of the root port of the first MLAG device and the current path cost of the root port of the second MLAG device are maintained.
[0077] Please refer to Figure 5 Fig. 2 is a flow diagram of the MLAG port path cost updating method in another embodiment of the present application. The MLAG port path cost updating method specifically includes the following steps:
[0078] S501: Obtain the transmission rate of each MLAG port in the first MLAG device, and calculate the corresponding path cost value based on the transmission rate of each MLAG port;
[0079] The path cost value maintained by each port in the second MLAG device is negatively related to the interface bandwidth, that is, the larger the interface bandwidth, the smaller the corresponding path cost value; and the smaller the interface bandwidth, the larger the corresponding path cost value. The calculation method of the port cost is different, and the obtained port path cost value is also different.
[0080] However, correspondingly, in order to ensure that the root port path costs of the first MLAG device and the second MLAG device are different due to the calculation method of the path cost, therefore, even if the calculation method of the port cost in the embodiment of the present application is not limited, it must be ensured that the calculation method of the port cost of each MLAG device in the logical unit is uniform.
[0081] S502: electing a root port of the first MLAG device based on the path cost value of each MLAG port;
[0082] Since the root port election is a standard of the spanning tree protocol, the MLAG environment also elects the root port of each MLAG device according to the standard of the spanning tree protocol, that is, the root port election is based on the STP priority vector corresponding to each port.
[0083] S503: sending a synchronization message to the second MLAG device, the synchronization message including the path cost value corresponding to the root port of the first MLAG device and the MLAG ID;
[0084] It should be noted that in the embodiments of the present application, in order to ensure that the path cost of the root port is always synchronized during operation, in an exemplary embodiment, the synchronization message is periodically sent to the second MLAG device based on the current root port of the first MLAG device, starting a new round of MLAG port path cost update, and each time the synchronization message is sent, it represents the start of a round of path cost update.
[0085] In particular, in some occasional cases, the cost of the MLAG device port may change, at which time the root port should be re-elected immediately for a new round of update. Specifically, when the MLAG protocol is disconnected or there is a new link connected to the MLAG port, the transmission rate of each MLAG port corresponding to the first MLAG device is reacquired and the corresponding path cost value is calculated, starting a new round of MLAG port path cost update.
[0086] It should be further noted that since MLAG actually allows multiple physical switches to be connected to the same network, that is, in the same logical unit, the redundant MLAG devices can be greater than or equal to two. Therefore, the case of two or more MLAG devices forming a logical unit.
[0087] For the above case, an embodiment of the present application is to determine the MLAG device with the root port to send a synchronization message to other MLAG devices in the logical unit in which it is located, so that other MLAG devices in the same logical unit update the root port based on the synchronization message. In this embodiment, although the number of packets sent will increase, under the premise of meeting the load pressure of sending and receiving messages, the efficiency of root port path cost update will be greatly improved.
[0088] In another embodiment, the MLAG device that determines the root port preferentially sends a synchronization message to the adjacent MLAG device in the logical unit in which it is located. Since the sending of the synchronization message is periodic, all MLAG devices in the logical unit can eventually be synchronized. This embodiment can reduce the load pressure of sending and receiving messages, and is suitable for scenarios in which there are many MLAG devices in the same logical unit and the synchronization efficiency requirement is not high.
[0089] S504: updating, by the second MLAG device, the path cost value corresponding to the root port of the second MLAG device based on the synchronization message.
[0090] To further illustrate the MLAG port path cost updating method provided by the present application, the following is a complete implementation flow of an embodiment of the present application. The flow implementation diagram is shown in Figures 7-8
[0091] The MLAG device calculates the path cost value (START) of the MLAG port using the actual rate. When the MLAG port is determined to be a root port by the spanning tree protocol, the MLAG master device and the backup device synchronize the path cost value on the MLAG port, and select the better path cost to participate in the spanning tree protocol calculation according to the comparison result (END). Thus, the purpose of using the actual rate corresponding path cost value of the MLAG port of the MLAG device for the spanning tree protocol calculation is achieved.
[0092] Specifically, as shown in Figure 7 , P1 is a step in which the MLAG port calculates the path cost value of the spanning tree protocol according to the port rate. P2 is a step in which the MLAG port uses the current path cost value to participate in the spanning tree protocol calculation, and finally calculates the MLAG port to be a root port. P3 is a step in which the MLAG protocol is used to synchronize the root port, that is, the path cost value on the MLAG port, to the adjacent MLAG device. J1 is a step in which the MLAG device receives the message sent by the adjacent MLAG device to synchronize the path cost value of the MLAG port, and then executes J2; otherwise, P6 is executed. J2 is a step in which it is determined whether the MLAG port with the same MLAG ID on the local device is a root port and whether the path cost value is better. If the MLAG port on the local MLAG device is a root port and the path cost value is better or the same, P6 is executed; otherwise, P4 is executed. P4 is a step in which the path cost value of the MLAG port of the adjacent MLAG device is better, and the path cost value of the local MLAG port is updated. P5 is a step in which the path cost value on the current MLAG port is used to update the root path cost value according to the spanning tree protocol. P6 is a step in which the path cost value on the current MLAG port is used to calculate and send the BPDU according to the spanning tree protocol.
[0093] Understandably, after the MLAG port of the MLAG device synchronously updates the path cost value, if the current MLAG protocol is disconnected, or the MLAG port is elected as a non-root port by the spanning tree protocol, or the path cost value calculated by the rate when the MLAG port connects to a new link is better (START), it is necessary to restore the path cost value according to the local MLAG port rate (END), thus completing the update of the path cost value according to the local MLAG port rate.
[0094] Specifically, such as Figure 8 As shown, step P1 calculates the Spanning Tree Protocol (STP) path cost value for the MLAG port based on its port rate and updates it. Step P2 calculates the root path cost value using the new path cost value according to the Spanning Tree Protocol. Step J1 determines whether the current MLAG protocol is disconnected or whether the MLAG port has connected to a new link. If the current MLAG protocol is disconnected or the MLAG port has connected to a new link, then step P4 is executed; otherwise, step J2 is executed. Step J2 determines whether the current MLAG port is still the root port. If the current MLAG port is the root port, then step P3 is executed; otherwise, step P4 is executed. Step P3 synchronizes the root port, i.e., the path cost value on the MLAG port, with neighboring MLAG devices using the MLAG protocol. Step P4 calculates and sends the BPDU using the current path cost value on the MLAG port according to the Spanning Tree Protocol.
[0095] Please refer to Figure 3 As shown, based on the same inventive concept as the aforementioned MLAG port path overhead update method, one embodiment of the present invention provides an MLAG port path overhead update system 300, including: a receiving module 301, a first calculation module 302, and an update module 303.
[0096] Specifically, the receiving module 301 is used to enable the second MLAG device to receive a synchronization message from the first MLAG device, and parse the synchronization message to obtain the path cost and MLAG ID corresponding to the root port of the first MLAG device; the first calculation module 302 is used to calculate the path cost value of each MLAG port of the second MLAG device based on the transmission rate of each MLAG port of the second MLAG device; the updating module 303 is used to compare the path cost value of the root port of the first MLAG device and the path cost value of the root port of the second MLAG device when the MLAG ID of the root port of the second MLAG device is the same as that of the root port of the first MLAG device, so as to update the path cost value corresponding to the root port of the second MLAG device.
[0097] Please refer to Figure 6As shown, based on the same inventive concept as the MLAG port path cost updating method in the foregoing another embodiment, the present application also provides another MLAG port path cost updating system 600, which comprises a second computing module 601, an election module 602, a sending module 603 and a synchronization module 604.
[0098] Specifically, the second computing module is configured to obtain the transmission rate of each MLAG port in the first MLAG device, and calculate a corresponding path cost value based on the transmission rate of each MLAG port.
[0099] The election module is configured to elect a root port of the first MLAG device based on the path cost value of each MLAG port.
[0100] The sending module is configured to send a synchronization message to the second MLAG device, wherein the synchronization message comprises the path cost value corresponding to the root port of the first MLAG device and the MLAG ID.
[0101] The synchronization module is configured to enable the second MLAG device to update the path cost value corresponding to the root port of the second MLAG device based on the synchronization message.
[0102] Please refer to Figure 4 As shown, the electronic device 400 comprises 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 MLAG port path cost updating method described in various embodiments of the present specification.
[0103] 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, etc.
[0104] The embodiments of the present application also provide a computer readable medium, which carries computer execution instructions, and the computer execution instructions can be used to implement various operations and functions of the MLAG port path cost updating method described in various embodiments of the present specification when executed by a processor.
[0105] 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.
[0106] 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, in which computer readable program code is embodied. Such propagated data signal can take a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium that is not a 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.
[0107] 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.
[0108] 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 create a means for implementing the functions specified in the flowcharts and / or block diagrams. These 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 readable medium contains an order to make the computer program instructions executed by the computer or other programmable data processing apparatus. The computer readable medium can be, but is not limited to, a semiconductor, magnetic disk, optical disk, or any suitable combination of the above.Figure One One or more processes and / or boxes Figure One A device that provides the functions specified in one or more boxes.
[0109] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.
[0110] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0111] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for updating MLAG port path cost, characterized in that, include: Obtain the transmission rate of each MLAG port in the first MLAG device, and calculate the corresponding path cost value based on the transmission rate of each MLAG port; elect the root port of the first MLAG device based on the path cost value of each MLAG port; calculate the path cost value of each MLAG port of the second MLAG device based on the transmission rate of each MLAG port, and determine the root port of the second MLAG device. The second MLAG device receives a synchronization message from the first MLAG device and parses the synchronization message to obtain the path cost and MLAG ID corresponding to the root port of the first MLAG device. The path cost value of the root port of the first MLAG device is compared with the path cost value of the root port of the second MLAG device, and the path cost value corresponding to the root port of the second MLAG device is updated to the lower of the path cost values of the root ports of the first and second MLAG devices.
2. The MLAG port path cost update method according to claim 1, characterized in that, Update the path cost value corresponding to the root port of the second MLAG device, including: If the MLAG ID of the root port of the second MLAG device is the same as the MLAG ID of the root port of the first MLAG device, then when the path cost value of the root port of the first MLAG device is less than the path cost value of the root port of the second MLAG device, the path cost value of the root port of the second MLAG device is updated to the path cost value of the root port of the first MLAG device. When the path cost of the root port of the first MLAG device is greater than or equal to the path cost of the root port of the second MLAG device, the current path cost of the root port of the second MLAG device is maintained.
3. The MLAG port path cost update method according to claim 1, characterized in that, The method further includes: If the MLAG ID corresponding to the root port of the second MLAG device is different from the MLAG ID of the root port of the first MLAG device, then the current path cost of the root port of the first MLAG device and the current path cost of the root port of the second MLAG device are maintained.
4. A method for updating MLAG port path cost, characterized in that, include: Obtain the transmission rate of each MLAG port in the first MLAG device, and calculate the corresponding path cost value based on the transmission rate of each MLAG port; Based on the path cost values of each MLAG port, the root port of the first MLAG device is selected; Send a synchronization message to the second MLAG device. The synchronization message includes the path cost value corresponding to the root port of the first MLAG device and the MLAG ID. The second MLAG device updates the path cost value corresponding to the root port of the second MLAG device to the path cost value of the root port of the first MLAG device and the path cost value of the root port of the second MLAG device based on the synchronization message.
5. The MLAG port path cost update method according to claim 4, characterized in that, The method further includes: Based on the root port of the first MLAG device, a synchronization message is periodically sent to the second MLAG device to start a new round of MLAG port path cost update.
6. The MLAG port path cost update method according to claim 4, characterized in that, The method further includes: When the MLAG protocol is disconnected or a new link is connected to an MLAG port, the transmission rate of each MLAG port of the first MLAG device is re-acquired, the corresponding path cost value is calculated, and the corresponding root port is elected to start a new round of MLAG port path cost update.
7. An MLAG port path cost update system, employing the MLAG port path cost update method as described in any one of claims 1-3, characterized in that, include: The first calculation module is used to calculate the path cost value of each MLAG port of the second MLAG device based on the transmission rate of each MLAG port of the second MLAG device. The receiving module is used to enable the second MLAG device to receive the synchronization message from the first MLAG device, and parse the synchronization message to obtain the path cost and MLAG ID corresponding to the root port of the first MLAG device; The update module is used to compare the path cost value of the first MLAG device root port and the path cost value of the second MLAG device root port when the MLAG ID of the second MLAG device root port is the same as the MLAG ID of the first MLAG device root port, so as to update the path cost value corresponding to the second MLAG device root port.
8. An MLAG port path cost update system, using the MLAG port path cost update method as described in any one of claims 4-6, characterized in that, include: The second calculation module is used to obtain the transmission rate of each MLAG port in the first MLAG device and calculate the corresponding path cost value based on the transmission rate of each MLAG port. An election module is used to elect the root port of the first MLAG device based on the path cost value of each MLAG port. The sending module is used to send a synchronization message to the second MLAG device. The synchronization message includes the path cost value corresponding to the root port of the first MLAG device and the MLAG ID. The synchronization module is used to enable the second MLAG device to update the path cost value corresponding to the root port of the second MLAG device based on the synchronization message.
9. 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 port path overhead update method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the MLAG port path overhead update method according to any one of claims 1-7.
Citation Information
Patent Citations
Synchronously replicating datasets and other managed objects to cloud-based storage systems
CN110392876A
Balancing Data Transfer Amongst Paths Between A Host and A Storage System
US20230236767A1