MLAG port path overhead updating method, system and device and medium

By dynamically calculating and updating the path overhead value of the MLAG port on the MLAG device, the problem that the fixed path overhead value cannot be obtained according to the port rate is solved, and the path overhead update of the MLAG port rate is realized, which improves the stability of the spanning tree protocol.

CN119676153AActive Publication Date: 2025-03-21SUZHOU CENTEC COMM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411841569.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-21
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

On MLAG devices, the fixed path overhead value cannot be obtained based on the current MLAG port rate, resulting in the MLAG port being unable to publish the BPDU corresponding to the port rate, affecting the root bridge path overhead during the spanning tree protocol election.

Method used

By calculating the path overhead value of the MLAG port and dynamically update based on the transmission rate, we ensure that the MLAG port can participate in the spanning tree protocol calculation adaptively, and synchronize the path overhead value between MLAG devices to maintain consistency.

Benefits of technology

The MLAG port is updated according to the rate adaptive path overhead value, which improves the stability of the spanning tree protocol convergence and avoids the problem of oscillation or inability to converge due to port rate inconsistent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676153A_ABST
    Figure CN119676153A_ABST
Patent Text Reader

Abstract

The invention discloses an MLAG port path overhead updating method, system and device and a medium, and the method specifically comprises the steps that a second MLAG device receives a synchronization message from a first MLAG device, and analyzes the synchronization message to obtain the path overhead corresponding to a root port of the first MLAG device and an MLAG ID; calculating a path overhead value of each MLAG port of the second MLAG device based on the transmission rate of each MLAG port of the second MLAG device; and comparing the path overhead value of the root port of the first MLAG device with the path overhead value of the root port of the second MLAG device to update the path overhead value corresponding to the root port of the second MLAG device. Compared with the prior art, the self-adaptive MLAG port rate can participate in spanning tree protocol calculation according to the MLAG protocol state and the spanning tree root port state, and the MLAG ports of the MLAG equipment use the same path overhead value to participate in spanning tree protocol calculation, so that the stability of spanning tree protocol convergence is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network communication technology, and in particular relates to a method, system, device and readable storage medium for updating MLAG port path overhead. Background Art

[0002] Spanning tree network is a protocol used to avoid loops in the 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 infinitely in the network, causing network congestion or even collapse. The spanning tree protocol forms a tree structure by identifying and disabling some paths in the network topology, ensuring that data packets are transmitted only along a unique 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 BPDU are used to elect the roles 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 single logical unit. MLAG is usually used in conjunction with the spanning tree protocol to ensure that there are no loops in the network and to provide redundant paths. However, in actual applications, when the MLAG port on the MLAG device is composed of multiple links, the fixed path cost value cannot obtain the corresponding path cost value based on 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 update strategy.

[0005] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention

[0006] The object of the present invention is to provide a MLAG port path cost update method, system, device and readable storage medium, which can enable the MLAG port to participate in the spanning tree protocol calculation according to the rate adaptive path cost, and the MLAG ports of the MLAG device use the same path cost value, thereby improving the stability of the spanning tree protocol convergence.

[0007] In order to achieve the above object, a technical solution provided by a specific embodiment of the present invention is as follows:

[0008] In a first aspect, the present invention provides a method for updating an MLAG port path cost, comprising:

[0009] 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;

[0010] The second MLAG device receives the 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;

[0011] The path cost value of the first MLAG device root port is compared with the path cost value of the second MLAG device root port to update the path cost value corresponding to the second MLAG device root port.

[0012] In one or more embodiments of the present invention, updating the path cost value corresponding to the root port of the second MLAG device includes:

[0013] If the MLAG ID of the second MLAG device root port is the same as the MLAG ID of the first MLAG device root port, when the path cost value of the first MLAG device root port is less than the path cost value of the second MLAG device root port, update the path cost value of the second MLAG device root port to the path cost value of the first MLAG device root port;

[0014] When the path cost value of the first MLAG device root port is greater than or equal to the path cost value of the second MLAG device root port, the current path cost of the second MLAG device root port is maintained.

[0015] In one or more embodiments of the present invention, the method further comprises:

[0016] If the MLAG ID corresponding to the second MLAG device root port is different from the MLAG ID of the first MLAG device root port, the current path cost of the first MLAG device root port and the current path cost of the second MLAG device root port are maintained.

[0017] In a second aspect, the present invention provides a method for updating an MLAG port path overhead, which includes:

[0018] Acquire a 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;

[0019] Selecting a root port of the first MLAG device based on the path cost value of each of the MLAG ports;

[0020] Sending a synchronization message to the second MLAG device, where the synchronization message includes a path cost value corresponding to the root port of the first MLAG device and an MLAG ID;

[0021] The second MLAG device is enabled to update a 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 invention, the method further comprises:

[0023] Based on the root port of the current 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.

[0024] In one or more embodiments of the present invention, the method further comprises:

[0025] When the MLAG protocol is disconnected or a MLAG port is connected to a new link, the transmission rate of each MLAG port corresponding to 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.

[0026] In a third aspect, the present invention provides an MLAG port path cost update system, which applies the MLAG port path cost update method as described above, and includes:

[0027] A first calculation module, configured to calculate 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;

[0028] A receiving module, configured to enable the second MLAG device to receive a synchronization message from the first MLAG device, and parse the synchronization message to obtain a path cost and an MLAG ID corresponding to a root port of the first MLAG device;

[0029] An updating 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.

[0030] In a fourth aspect, a MLAG port path cost update system is provided, which applies the MLAG port path cost update method as described above, and includes:

[0031] A second calculation module, configured to obtain a 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;

[0032] An election module, configured to elect a root port of the first MLAG device based on the path cost value of each of the MLAG ports;

[0033] A sending module, configured to send a synchronization message to the second MLAG device, wherein the synchronization message includes a path cost value corresponding to the root port of the first MLAG device and an MLAG ID;

[0034] The synchronization module is configured to enable the second MLAG device to update a path cost value corresponding to a root port of the second MLAG device based on the synchronization message.

[0035] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the MLAG port path overhead updating method by executing the computer instructions.

[0036] In a sixth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the MLAG port path cost updating method.

[0037] Compared with the prior art, the MLAG port path cost update method provided by the present invention calculates the root port of the MLAG device forming the logical unit, determines the optimal port on one side and the path cost of the optimal port, transmits the above information to another MLAG device in the logical unit through a message through a protocol, compares the path cost values ​​of the MLAG ports with the same number, and updates to the one with the lower path cost value of the two compared parties. Thereby, the MLAG port is adapted to 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, a method for updating the path cost value of the MLAG port is provided for the MLAG device, which realizes that when the path cost value of the MLAG port as the root port is inconsistent, after the MLAG port synchronizes the peer-link, it can adapt the MLAG port rate to participate in the spanning tree protocol calculation according to the MLAG protocol state and the spanning tree root port state. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 It is a schematic diagram of a MLAG port path overhead update scenario in one embodiment of the present invention;

[0040] Figure 2 It is a flowchart of a method for updating an MLAG port path cost in one embodiment of the present invention;

[0041] Figure 3 is a structural block diagram of an MLAG port path cost update system in one embodiment of the present invention;

[0042] Figure 4 is a structural block diagram of an electronic device in one embodiment of the present invention;

[0043] Figure 5 is a flow chart of a method for updating an MLAG port path cost in another embodiment of the present invention;

[0044] Figure 6 is a structural block diagram of an MLAG port path cost update system in another embodiment of the present invention;

[0045] Figure 7 It is a schematic diagram of a process of synchronizing path overhead when the MLAG port is a root port in one embodiment of the present invention;

[0046] Figure 8 It is a schematic diagram of a flow chart of updating the path cost of an MLAG port in another embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0048] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.

[0049] In the prior art, there is a method of using a spanning tree network and MLAG technology simultaneously to provide a high-availability, high-performance, and resilient network infrastructure.

[0050] The implementation of the prior art specifically includes: setting a fixed path cost value for each port of the MLAG master and slave devices, wherein the ports with the same MLAG ID between the master and slave devices are set with the same path cost value to ensure the stability of the spanning tree protocol during convergence.

[0051] However, it is understandable that setting a fixed path cost value can improve the stability of convergence, but at the same time it limits the solution from adaptively selecting a better path cost value according to the port rate to participate in the spanning tree protocol calculation, which reduces the spanning tree convergence accuracy. When the MLAG port on the MLAG device is composed of 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 issue the BPDU corresponding to the port rate to the connected bridge device, affecting the root bridge path cost during 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 rates of the MLAG master and backup devices will inevitably be inconsistent, which will cause the member ports of the MLAG port to vibrate, and the BPDU sent downstream through other designated ports of the MLAG device to carry inconsistent root bridge path costs, causing spanning tree protocol vibration or non-convergence problems.

[0053] The inventor of the present invention has discovered the main shortcomings of the prior art, and based on the shortcomings of the prior art, has proposed a new technical implementation idea: based on the actual transmission rate, the path cost value of each port is generated. Based on the spanning tree protocol, a 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 logic unit through a synchronization message, and it is determined 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 it can ensure that the spanning tree protocol will not oscillate and fail to converge due to the inconsistent rate of the MLAG ports composed of the master device and the backup device.

[0054] Please refer to Figure 1 , which is a schematic diagram of an application scenario of the MLAG port path overhead update method provided by the present invention under one implementation mode, and the scenario specifically includes: a first MLAG device 101, a second MLAG device 102 and a user terminal 103.

[0055] It should be noted that a communication connection is provided between the first MLAG device 101, the second MLAG device 102 and the user terminal 103, and the communication network derived from the above communication connection may include various connection types, including but not limited to: wired connection, wireless connection or optical fiber cable connection, etc. At the same time, the communication network may 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 an MLAG device that preferentially determines the root port in the logical unit and then sends a synchronization message; the second MLAG device is an MLAG device that receives the aforementioned synchronization message and updates the port path overhead.

[0057] The user terminal 103 is used to configure the custom items necessary for implementing the solution, 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 that matches the MLAG port path overhead update method provided by this method; the user terminal 103 may include but is not limited to a desktop computer (PC), a desktop computer, a smart phone, a handheld computer, a tablet computer, a personal digital assistant (PDA), and other portable electronic devices or wearable electronic devices, and the embodiments of the present invention do not limit the above contents.

[0059] Please refer to Figure 2 FIG. 1 is a flow chart of a method for updating MLAG port path cost in one embodiment of the present invention. The method for updating MLAG port path cost specifically includes the following steps:

[0060] S201: Calculate 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;

[0061] It should be noted that each port with the STP spanning tree protocol activated 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 the root bridge, that is, the accumulation of the path cost values ​​of all inbound interfaces along the way from the port to the root bridge.

[0062] Among them, the path cost value maintained by each port is negatively correlated with 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 different calculation methods for port cost will result in different port path cost values, so the embodiment of the present invention does not limit the calculation method of port cost. Preferably, the IEEE 802.11 standard can be used to calculate the path cost of each port in the embodiment of the present invention.

[0063] It should also be noted that, in order to reduce the load pressure caused by calculation and avoid redundant calculation operations, when the port transmission rate has not changed, in the periodic root port cost update, it is not necessary to recalculate the path cost value of the port according to the port transmission rate in each round. Preferably, when the port rate changes, the corresponding new path cost value can be calculated again.

[0064] S202: The second MLAG device receives a synchronization message from the first MLAG device, and parses the synchronization message to obtain a path cost and an MLAG ID corresponding to a root port of the first MLAG device.

[0065] It should be noted that in an environment where the spanning tree protocol is applied, each switch running STP in a given broadcast domain has a unique bridge ID, which is composed of the bridge priority and the 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 spanning tree to calculate the topology and is also the root node of the calculated loop-free topology. Furthermore, there may be multiple ports in the remaining non-root 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 cross-device link aggregation technology. MLAG improves the reliability of the link from the single board level to the device level by aggregating multiple switches in the same state with user-side devices or servers. It allows multiple physical switches (usually two) to be connected to the same subnet and treated as a single logical unit.

[0067] In the embodiment of the present invention, 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, namely, master device A and slave device B. If a port with MLAG ID 1 is configured on the master device A, there must be a port with MLAG ID 1 on the slave device B.

[0068] It should also be noted that the first MLAG device and the second MLAG device of the present invention 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 present invention; the second MLAG device generally refers to the party that receives the above synchronization message and implements the root port path cost update.

[0069] For example, two MLAG devices constituting a logical unit are respectively an MLAG master device and an MLAG slave device. During the root port election, the MLAG master device takes precedence in completing the root port election. 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 its corresponding port path cost. At a certain moment, the MLAG slave device completes the corresponding root port election, and at this time, the MLAG slave device becomes the first MLAG device and sends 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 synchronization message must be transmitted twice between adjacent MLAG devices. Under this implementation, the accuracy and consistency of the path overhead of the root ports of adjacent devices in the logical unit can be guaranteed to the greatest extent. However, due to the redundant packet sending process, the load pressure caused by the message transmission will increase. Therefore, the present invention also provides another implementation as follows.

[0071] In another embodiment of the present invention, when MLAG device A sends a synchronization message to MLAG device B, if MLAG device B updates the path cost of the root port of MLAG device A carried in the synchronization message to the root port of MLAG device B, then in this round of path cost update for MLAG device A and MLAG device B, MLAG device B no longer sends a synchronization message to MLAG device A; if MLAG device B still maintains the current path cost of its root port after receiving the synchronization message, then a synchronization message is sent to the above MLAG device A based on the root port information of MLAG device B.

[0072] In the above embodiment, some redundant packet update processes are removed, and some complex pressures are released without significantly affecting the update accuracy. This embodiment can be applied to update the MLAG port path overhead in scenarios where message sending and receiving resources are insufficient.

[0073] S203: Compare the path cost value of the first MLAG device root port with the path cost value of the second MLAG device root port to update the path cost value corresponding to the second MLAG device root port.

[0074] In an exemplary embodiment of the present invention, if the MLAG ID of the second MLAG device root port is the same as the MLAG ID of the first MLAG device root port, when the path cost value of the first MLAG device root port is less than the path cost value of the second MLAG device root port, the path cost value of the second MLAG device root port is updated to the path cost value of the first MLAG device root port; when the path cost value of the first MLAG device root port is greater than or equal to the path cost value of the second MLAG device root port, the current path cost of the second MLAG device root port is maintained.

[0075] It should be noted that the MLAG IDs corresponding to the root ports of adjacent MLAG devices should be the same, otherwise it will cause member port oscillation. 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 this device.

[0076] On the other hand, if the MLAG ID corresponding to the second MLAG device root port is different from the MLAG ID of the first MLAG device root port, the current path cost of the first MLAG device root port and the current path cost of the second MLAG device root port are maintained.

[0077] Please refer to Figure 5 FIG. 2 is a flow chart of a method for updating the MLAG port path cost in another embodiment of the present invention. The method for updating the MLAG port path cost specifically includes the following steps:

[0078] S501: Acquire a transmission rate of each MLAG port in a first MLAG device, and calculate a corresponding path cost value based on the transmission rate of each MLAG port;

[0079] Similar to the path cost value of the second MLAG device, the path cost value maintained by each port is negatively correlated with 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. Different port cost calculation methods will result in different port path cost values.

[0080] However, correspondingly, in order to ensure that the difference in the root port path overhead between the first MLAG device and the second MLAG device is not caused by the method for calculating the path overhead, therefore, even if the embodiment of the present invention does not restrict the method for calculating the port overhead, it must ensure that the method for calculating the port overhead of each MLAG device in the logical unit is unified.

[0081] S502: electing a root port of a first MLAG device based on the path cost value of each of the MLAG ports;

[0082] Since 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 is elected based on the STP priority vector corresponding to each port.

[0083] S503: Send a synchronization message to the second MLAG device, where the synchronization message includes a path cost value corresponding to the root port of the first MLAG device and an MLAG ID;

[0084] It should be noted that in an implementation manner of the present invention, in order to ensure that the path overhead of the root port is always synchronized during operation, in an exemplary embodiment, based on the root port of the current first MLAG device, a synchronization message is periodically sent to the second MLAG device to start a new round of MLAG port path overhead update. Each time a synchronization message is sent, it represents the start of a round of path cost update.

[0085] In particular, in some occasional situations, the cost of the MLAG device port may change. At this time, the root port should be re-elected immediately and a new round of updates should be performed. Specifically, when the MLAG protocol is disconnected or a MLAG port is connected to a new link, the transmission rate of each MLAG port corresponding to the first MLAG device is re-obtained and the corresponding path cost value is calculated, and a new round of MLAG port path cost update is started.

[0086] It should also be noted that, since MLAG actually allows multiple physical switches to be connected to the same network, that is, in the same logical unit, the number of redundant MLAG devices may be greater than or equal to two. Therefore, there are more than two MLAG devices forming a logical unit.

[0087] In view of the above situation, an implementation method of the present invention is: the MLAG device that preferentially determines the root port sends a synchronization message to other MLAG devices in the logical unit where it is located, so that other MLAG devices in the same logical unit update the root port based on the synchronization message. Under this implementation method, although the number of packets sent will increase, the efficiency of updating the root port path overhead will be greatly improved under the premise of meeting the load pressure of sending and receiving messages.

[0088] In another implementation, the MLAG device that preferentially determines the root port sends synchronization messages to the adjacent MLAG devices in the logical unit where it is located. Since the sending of synchronization messages is periodic, all MLAG devices in the logical unit can still be synchronized in the end. This implementation can reduce the load pressure of sending and receiving messages, and is suitable for scenarios where there are many MLAG devices in the same logical unit and the synchronization efficiency is not required.

[0089] S504: 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.

[0090] To further illustrate the MLAG port path cost update method provided by the present invention, the following is a complete implementation flow of an embodiment of the present invention. Figure 7-Figure 8 shown.

[0091] The MLAG port of the MLAG device uses the actual rate to calculate the path cost value of the port (START). When the spanning tree protocol calculates that the MLAG port is the root port, the path cost value on the MLAG port is synchronized between the MLAG master device and the standby device, and a better path cost is selected to participate in the spanning tree protocol calculation according to the comparison result (END). In this way, the MLAG port of the MLAG device uses the same path cost value corresponding to the actual rate to perform spanning tree protocol calculation.

[0092] Specifically, Figure 7 As shown, step P1 is that the MLAG port calculates the path cost value of the spanning tree protocol according to the port rate. Step P2 is that the MLAG port uses the current path cost value to participate in the spanning tree protocol calculation, and finally calculates that the MLAG port is the root port. Step P3 is to use the MLAG protocol to synchronize the root port to the adjacent MLAG device, that is, the path cost value on the MLAG port. Step J1 is that when the MLAG device receives a message sent by the adjacent MLAG device to synchronize the path cost value of the MLAG port, step J2 is executed; otherwise, step P6 is executed. Step J2 is to determine whether the MLAG port with the same local MLAG ID is the root port and whether the path cost value is better. If the MLAG port on the local MLAG device is the root port and the path cost value is better or the same, step P6 is executed; otherwise, step P4 is executed. Step P4 is that 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. Step P5 is to use the path cost value on the current MLAG port to update the root path cost value according to the spanning tree protocol. Step P6 uses the path cost value on the current MLAG port to calculate and send BPDU according to the spanning tree protocol.

[0093] It can be understood that after the MLAG port of the MLAG device synchronously updates the path cost value, 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 accesses a new link is better (START), the path cost value needs to be restored according to the local MLAG port rate (END), and then the path cost value is updated according to the local MLAG port rate.

[0094] Specifically, Figure 8 As shown, step P1 is that the MLAG port calculates the path cost value of the spanning tree protocol according to the port rate and updates it to the MLAG port. Step P2 is that the MLAG port uses the new path cost value to calculate the root path cost value according to the spanning tree protocol. Step J1 is to determine whether the current MLAG protocol is disconnected / whether the MLAG port is connected to a new link. If the current MLAG protocol is disconnected / the MLAG port is connected to a new link, then execute step P4; otherwise, execute step J2. Step J2 is to determine whether the current MLAG port is still the root port. If the current MLAG port is the root port, then execute step P3; otherwise, execute step P4. Step P3 is to use the MLAG protocol to synchronize the root port, that is, the path cost value on the MLAG port, to the adjacent MLAG device. Step P4 is to use the path cost value on the current MLAG port to calculate and send BPDU 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 cost update method, an embodiment of the present invention provides an MLAG port path cost update system 300 , which includes: 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 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 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 the MLAG ID 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 update method in another embodiment described above, the present invention also provides another MLAG port path cost update system 600, which includes: a second calculation module 601, an election module 602, a sending module 603 and a synchronization module 604.

[0098] Specifically, 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;

[0099] An election module, configured to elect a root port of the first MLAG device based on the path cost value of each of the MLAG ports;

[0100] A sending module, configured to send a synchronization message to the second MLAG device, wherein the synchronization message includes a path cost value corresponding to the root port of the first MLAG device and an MLAG ID;

[0101] The synchronization module is configured to enable the second MLAG device to update a path cost value corresponding to a root port of the second MLAG device based on the synchronization message.

[0102] Please refer to Figure 4 As shown, an embodiment of the present invention further provides an electronic device 400, which includes at least one processor 401, a memory 402 (for example, a non-volatile memory), a memory 403, and a communication interface 404, and the at least one processor 401, the memory 402, the memory 403, and the communication interface 404 are connected together via a bus 405. At least one processor 401 is used to call at least one program instruction stored or encoded in the memory 402, so that the at least one processor 401 performs various operations and functions of the MLAG port path cost update method described in various embodiments of this specification.

[0103] In an embodiment of the present specification, the electronic device 400 may 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.

[0104] An embodiment of the present invention also provides a computer-readable medium, which carries computer-executable instructions. When the computer-executable instructions are executed by a processor, they can be used to implement various operations and functions of the MLAG port path cost update method described in various embodiments of this specification.

[0105] The computer-readable medium in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0106] In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0107] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may 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 invention is described with reference to flowcharts and / or block diagrams of methods, apparatuses, systems, and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, 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 device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0109] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.

[0110] It will be apparent to those skilled in the art that the 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 the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

[0111] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A method for updating MLAG port path cost, characterized in that: include: 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 second MLAG device receives the 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 first MLAG device root port is compared with the path cost value of the second MLAG device root port to update the path cost value corresponding to the second MLAG device root port.

2. The MLAG port path cost updating method according to claim 1, characterized in that: Updating the path cost value corresponding to the root port of the second MLAG device includes: If the MLAG ID of the second MLAG device root port is the same as the MLAG ID of the first MLAG device root port, when the path cost value of the first MLAG device root port is less than the path cost value of the second MLAG device root port, update the path cost value of the second MLAG device root port to the path cost value of the first MLAG device root port; When the path cost value of the first MLAG device root port is greater than or equal to the path cost value of the second MLAG device root port, the current path cost of the second MLAG device root port is maintained.

3. The MLAG port path cost updating method according to claim 1, characterized in that: The method further comprises: If the MLAG ID corresponding to the second MLAG device root port is different from the MLAG ID of the first MLAG device root port, the current path cost of the first MLAG device root port and the current path cost of the second MLAG device root port are maintained.

4. A method for updating MLAG port path cost, characterized in that: include: Acquire a 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; Selecting a root port of the first MLAG device based on the path cost value of each of the MLAG ports; Sending a synchronization message to the second MLAG device, where the synchronization message includes a path cost value corresponding to the root port of the first MLAG device and an MLAG ID; The second MLAG device is enabled to update a path cost value corresponding to the root port of the second MLAG device based on the synchronization message.

5. The MLAG port path cost updating method according to claim 4, characterized in that: The method further comprises: Based on the root port of the current 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 updating method according to claim 4, characterized in that: The method further comprises: When the MLAG protocol is disconnected or a MLAG port is connected to a new link, the transmission rate of each MLAG port corresponding to 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. A MLAG port path cost update system, applying the MLAG port path cost update method according to any one of claims 1 to 3, characterized in that: include: A first calculation module, configured to calculate 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; A receiving module, configured to enable the second MLAG device to receive a synchronization message from the first MLAG device, and parse the synchronization message to obtain a path cost and an MLAG ID corresponding to a root port of the first MLAG device; An updating 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 MLAGID of the first MLAG device root port, so as to update the path cost value corresponding to the second MLAG device root port.

8. A MLAG port path cost update system, applying the MLAG port path cost update method according to any one of claims 4 to 6, characterized in that: include: A second calculation module, configured to obtain a 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; An election module, configured to elect a root port of the first MLAG device based on the path cost value of each of the MLAG ports; A sending module, configured to send a synchronization message to the second MLAG device, wherein the synchronization message includes a path cost value corresponding to the root port of the first MLAG device and an MLAG ID; The synchronization module is configured to enable the second MLAG device to update a path cost value corresponding to a 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, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the MLAG port path cost updating method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the MLAG port path cost updating method according to any one of claims 1 to 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

  • Application replication among storage systems synchronously replicating a dataset

    WO2022159157A1