Link aggregation method and device, electronic equipment and storage medium
By obtaining link aggregation information of device ports through the LLDP protocol, judging and controlling the ports to perform aggregation, the problems of system resource consumption and poor accuracy in link aggregation are solved, and efficient and accurate automatic link aggregation is achieved.
Patent Information
- Application Number
- CN202510156094.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-02-12
AI Technical Summary
Existing link aggregation technologies suffer from issues with system resource consumption and accuracy in device port configuration, leading to the risk of network paralysis.
The link aggregation information of the device port is obtained through the LLDP protocol, including port aggregation performance, status and device classification. It is then determined whether the information meets the preset aggregation information and the port is controlled to perform aggregation to achieve automatic link aggregation.
It reduces equipment operation and maintenance costs, avoids system resource consumption, improves the efficiency and accuracy of link aggregation, and avoids network paralysis caused by configuration errors.
Smart Images

Figure CN119996295B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, in particular to a link automatic aggregation method and device, electronic equipment and storage medium. BACKGROUND
[0002] Link aggregation is to aggregate multiple physical links used for communication between two devices together to combine a single logical link, thereby increasing network bandwidth of the link and improving network performance, realizing link transmission flexibility and engineering redundancy, so as to share and balance network traffic between ports. At present, the ports of the aggregated link are usually automatically discovered and negotiated by using Link Aggregation Control Protocol (LACP), or manually configured to realize link aggregation. However, when using the LACP protocol configuration method, the ports of the device need to support the LACP protocol, and the system resources occupied by the LACP protocol during operation need to be tolerated; when using the manual configuration method, it is difficult to guarantee the accuracy of wiring and configuration, and if the configuration is wrong, it will cause the service to be interrupted, and in severe cases, it will cause the network to be paralyzed. SUMMARY
[0003] The present application provides a link automatic aggregation method, device, electronic equipment and storage medium to solve the problem of occupying system resources and poor accuracy of device port configuration during link aggregation.
[0004] According to an aspect of the present application, a link automatic aggregation method is provided, which comprises:
[0005] Obtaining link aggregation information of a first device port based on the LLDP protocol, the first device port being an actual physical interface used for connecting devices for communication transmission, the link aggregation information comprising: port aggregation performance, port aggregation state and device classification of a device to which the port belongs, the port aggregation performance being whether the device port supports being configured to perform port aggregation, the port aggregation state being used to indicate whether the device port has been configured in the aggregation group to which it belongs, the device classification being a master device or a slave device, the aggregation group being a logical port established by multiple device ports belonging to the same device, and the port aggregation being to control the device port to be configured in the aggregation group to which it belongs;
[0006] If the link aggregation information of the first device port indicates that the device classification of the device to which the first device port belongs is a master device, it is judged whether the link aggregation information of the first device port conforms to preset aggregation information, the preset aggregation information indicating that the port aggregation performance in the link aggregation information indicates that the device port supports being configured to perform port aggregation, and the port aggregation state indicates that the device port is not configured in the aggregation group;
[0007] If the link aggregation information of the first device port conforms to the preset aggregation information, link aggregation information of a second device port is acquired based on the LLDP protocol, the second device port is connected with the first device port and the second device port and the first device port belong to different devices, and an aggregation group to which the second device port belongs can communicate with an aggregation group to which the first device port belongs;
[0008] If the link aggregation information of the second device port conforms to the preset aggregation information, the first device port and the second device port are controlled to perform link aggregation, and the link aggregation is realized by controlling the first device port to perform port aggregation and controlling the second device port to perform port aggregation.
[0009] According to another aspect of the present application, a link automatic aggregation device is provided, which comprises:
[0010] The first acquisition module is configured to acquire link aggregation information of a first device port based on the LLDP protocol, the first device port being an actual physical interface used for connecting devices for communication transmission, the link aggregation information comprising: port aggregation performance, a port aggregation state, and a device classification of a device to which a port belongs, the port aggregation performance being whether the device port supports being configured to perform port aggregation, the port aggregation state being used to indicate whether the device port has been configured in an aggregation group to which the device port belongs, the device classification being a master device or a slave device, the aggregation group being a logical port established by a plurality of device ports belonging to the same device, and the port aggregation being control of the device port being configured in the aggregation group to which the device port belongs;
[0011] The aggregation information judgment module is configured to, if the link aggregation information of the first device port indicates that the device classification of the device to which the first device port belongs is a master device, judge whether the link aggregation information of the first device port conforms to preset aggregation information, the preset aggregation information indicating that the port aggregation performance in the link aggregation information indicates that the device port supports being configured to perform port aggregation and the port aggregation state indicates that the device port is not configured in the aggregation group.
[0012] The second acquisition module is configured to, if the link aggregation information of the first device port conforms to the preset aggregation information, acquire link aggregation information of a second device port based on the LLDP protocol, the second device port being connected with the first device port and the second device port and the first device port belonging to different devices, and an aggregation group to which the second device port belongs being able to communicate with an aggregation group to which the first device port belongs.
[0013] The link aggregation module is configured to, if the link aggregation information of the second device port conforms to the preset aggregation information, control the first device port and the second device port to perform link aggregation, and the link aggregation is realized by controlling the first device port to perform port aggregation and controlling the second device port to perform port aggregation.
[0014] According to another aspect of the present application, there is provided an electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected with the at least one processor; wherein
[0017] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the link aggregation method of any of the embodiments of the present application.
[0018] According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the link aggregation method of any of the embodiments of the present application when executed by the processor.
[0019] The technical scheme of the embodiment of the application obtains the link aggregation information of the first device port based on the LLDP protocol, the first device port is an actual physical interface used for connecting devices for communication transmission, the link aggregation information includes: port aggregation performance, port aggregation state, and device classification of the device to which the port belongs, the port aggregation performance is whether the device port supports being configured to perform port aggregation, the port aggregation state is used to indicate whether the device port has been configured in the aggregation group to which it belongs, the device classification is a master device or a slave device, the aggregation group is a logical port established by multiple device ports belonging to the same device, and the port aggregation is to control the device port to be configured in the aggregation group to which it belongs, thereby realizing the link aggregation information of the first device port being obtained through the LLDP protocol, reducing the device operation and maintenance cost, and avoiding the occupation of system resources; if the link aggregation information of the first device port indicates that the device classification of the device to which the first device port belongs is a master device, it is judged whether the link aggregation information of the first device port conforms to preset aggregation information, the preset aggregation information indicates that the port aggregation performance in the link aggregation information indicates that the device port supports being configured to perform port aggregation, and the port aggregation state indicates that the device port is not configured in the aggregation group, thereby realizing the judgment of whether the first device port supports performing port aggregation through the link aggregation information of the first device port, and improving the efficiency of link aggregation; if the link aggregation information of the first device port conforms to the preset aggregation information, the link aggregation information of the second device port is obtained based on the LLDP protocol, the second device port is connected with the first device port, and the second device port and the first device port belong to different devices, the aggregation group to which the second device port belongs and the aggregation group to which the first device port belongs can communicate, thereby realizing the link aggregation information of the second device port being obtained through the LLDP protocol; if the link aggregation information of the second device port conforms to the preset aggregation information, the first device port and the second device port are controlled to perform link aggregation, the link aggregation is realized by controlling the first device port to perform port aggregation and controlling the second device port to perform port aggregation, thereby realizing the control of the first device port and the second device port to perform port aggregation, so as to control the execution of link aggregation, improve the accuracy of link aggregation, and avoid the aggregation configuration error from causing the business to be interrupted and the network to be paralyzed.
[0020] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the application, nor is it used to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0022] Figure 1 A flow chart of a link automatic aggregation method provided by an embodiment of the present application;
[0023] Figure 2 A schematic diagram of a device port provided by an embodiment of the present application;
[0024] Figure 3 A structural schematic diagram of a link automatic aggregation device provided by an embodiment of the present application;
[0025] Figure 4 A structural schematic diagram of an electronic device for implementing a link automatic aggregation method provided by an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by the person of ordinary skill in the art without creative labor should belong to the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0028] Figure 1 A flow chart of a link automatic aggregation method provided by an embodiment of the present application. The embodiment of the present application can be applicable to the case of automatically performing aggregation on link ports between different devices. The method can be performed by a link automatic aggregation device, which can be realized in the form of hardware and / or software, and can be configured in an electronic device for implementing the link automatic aggregation method. As shown in the figure, the method comprises: Figure 1
[0029] S101, link aggregation information of a first device port is acquired based on an LLDP protocol, the first device port is an actual physical interface used for connecting devices for communication transmission, the link aggregation information includes: port aggregation performance, port aggregation status, and device classification of a device to which the port belongs, the port aggregation performance is whether the device port supports being configured to perform port aggregation, the port aggregation status is used to indicate whether the device port has been configured in the belonging aggregation group, the device classification is a master device or a slave device, the aggregation group is a logical port established by multiple device ports belonging to the same device, and the port aggregation is to control the device port to be configured in the belonging aggregation group.
[0030] In the embodiment of the application, the link layer discovery protocol (LLDP) can refer to a network protocol used for mutual identification between devices and automatic discovery of a network topology. Referring to Figure 2 , the actual physical interface can refer to an actual physical port on a device in an Ethernet network, which is used for connection or communication transmission between different devices, for example Figure 2 port A1, A2, A3, B1, B2, and B3. The aggregation group can refer to a logical port established for multiple physical ports on the same device, for example Figure 2 aggregation group A includes ports A1, A2, and A3, and aggregation group B includes ports B1, B2, and B3. The port aggregation can refer to bundling multiple physical ports into an aggregation group. The port aggregation performance can refer to whether the device port has the performance to support performing port aggregation. The port aggregation status can refer to a state used to indicate whether the device port has performed port aggregation and has been configured in the belonging aggregation group.
[0031] Specifically, the port aggregation performance, the port aggregation state and the device classification of the device to which the port belongs of the first device port can be obtained through the LLDP protocol, thereby forming the link aggregation information of the first device port. For example, the LLDP protocol supports the TLV data encoding format, and thus the link aggregation information of the device port can be expressed in the TLV format. For example, three bits in the TLV format can be used to express the link aggregation information, i.e., bit 0: aggCap, representing the port aggregation performance, when the device port supports being configured to perform port aggregation, aggCap = 1, otherwise aggCap = 0; bit 1: aggStat, representing the port aggregation state, when the device port has been configured in the aggregation group to which it belongs, aggStat = 1, otherwise aggStat = 0; bit 2: aggAct, representing the device classification of the device to which the port belongs, when the device classification of the device to which the device port belongs is the master device, aggAct = 1, when the device classification of the device to which the device port belongs is the slave device, aggAct = 0. Further, the link aggregation information of the device port can be expressed as (aggCap, aggStat, aggAct).
[0032] As an optional implementation of the embodiment of the application, the link aggregation information of the first device port is obtained based on the LLDP protocol, including: if the first device port supports being configured in the aggregation group, the port aggregation performance in the link aggregation information of the first device port indicates that the device port supports being configured to perform port aggregation; and if the first device port can be controlled to communicate through the aggregation group to which it belongs, the port aggregation state in the link aggregation information of the first device port indicates that the device port has been configured in the aggregation group.
[0033] Specifically, if the first device port is set to support being configured in the aggregation group, the port aggregation performance of the first device port indicates that the first device port supports performing port aggregation, otherwise the port aggregation performance of the first device port indicates that the first device port does not support performing port aggregation. If the aggregation group to which the first device port belongs can control the first device port to connect between devices or transmit communication, the port aggregation state of the first device port indicates that the first device port is complete port aggregation and has been configured in the aggregation group to which it belongs, otherwise the port aggregation state of the first device port indicates that the first device port is not configured in the aggregation group to which it belongs.
[0034] S102, if the link aggregation information of the first device port indicates that the device classification of the device to which the first device port belongs is the master device, it is judged whether the link aggregation information of the first device port conforms to the preset aggregation information, the preset aggregation information indicating that the port aggregation performance in the link aggregation information indicates that the device port supports being configured to perform port aggregation and the port aggregation state indicates that the device port is not configured in the aggregation group.
[0035] In the embodiments of the present application, the preset aggregation information can refer to information preset for judging whether the device port can perform port aggregation. The preset aggregation information can be that the port aggregation performance indicates that the device port has the performance of performing port aggregation, and the port aggregation state indicates that the device port is in a state of not performing port aggregation configured in the aggregation group.
[0036] Specifically, according to the device classification of the device to which the first device port belongs in the link aggregation information of the first device port, it can be judged whether the device classification of the device to which the first device port belongs is the master device. Further, if the device classification of the device to which the first device port belongs is the master device, it can be judged whether the link aggregation information of the first device port conforms to the preset aggregation information according to the port aggregation performance and the port aggregation state in the link aggregation information of the first device port. If the device classification of the device to which the first device port belongs is the slave device, the link aggregation is not performed.
[0037] S103, if the link aggregation information of the first device port conforms to the preset aggregation information, the link aggregation information of the second device port is obtained based on the LLDP protocol, the second device port is connected with the first device port and belongs to different devices, the second device port and the first device port belong to different devices, and the aggregation group to which the second device port belongs can communicate with the aggregation group to which the first device port belongs.
[0038] In the embodiments of the present application, the second device port can refer to an actual physical interface on a different device from the first device port, and the second device port and the first device port can form a link when connected, and the aggregation group to which the second device port belongs can communicate with the aggregation group to which the first device port belongs. For example, referring to Figure 2 , the ports A1 and B1 are connected, the ports A2 and B2 are connected, the ports A3 and B3 are connected, and the aggregation group A and the aggregation group B can communicate.
[0039] Specifically, according to the link aggregation information of the first device port, it can be judged whether the link aggregation information of the first device port conforms to the preset aggregation information. Further, if the link aggregation information of the first device port conforms to the preset aggregation information, the port aggregation performance, the port aggregation state and the device classification of the device to which the second device port belongs can be obtained based on the LLDP protocol to form the link aggregation information of the second device port. The acquisition method of the link aggregation information of the second device port is similar to the acquisition method of the link aggregation information of the first device port. If the link aggregation information of the first device port does not conform to the preset aggregation information, the link aggregation is not performed.
[0040] For example, when the link aggregation information of the first device port is represented by the TLV format of the LLDP protocol as (1, 0, 1), it can be considered that the link aggregation information of the first device port conforms to the preset aggregation information.
[0041] As an alternative, the link aggregation information of the second device port is acquired based on the LLDP protocol, including: if the second device port supports being configured in an aggregation group, the port aggregation performance in the link aggregation information of the second device port indicates that the second device port supports being configured to perform port aggregation; and if the second device port can be controlled to communicate through the aggregation group to which the second device port belongs, the port aggregation state in the link aggregation information of the second device port indicates that the second device port has been configured in the aggregation group.
[0042] As an alternative embodiment of the embodiment of the application, after the link aggregation information of the second device port is acquired based on the LLDP protocol, it further includes: if the device classification of the device to which the port belongs in the link aggregation information of the second device port is a master device, determining the device classification of the device to which the port belongs in the link aggregation information of the first device port and the second device port according to the physical addresses of the devices to which the first device port and the second device port belong respectively.
[0043] Specifically, according to the device classification of the device to which the port belongs in the link aggregation information of the second device port, it can be determined whether the device classification of the device to which the second device port belongs is a master device. Further, if the device classification of the device to which the second device port belongs is a master device, the device classification of the device to which the port belongs in the link aggregation information of the first device port and the second device port is determined according to the physical addresses of the devices to which the first device port and the second device port belong respectively. If the device classification of the device to which the second device port belongs is a slave device, the device classification of the device to which the port belongs in the link aggregation information of the first device port and the second device port is not modified.
[0044] For example, if the physical address of the device to which the second device port belongs is less than the physical address of the device to which the first device port belongs, the device classification of the device to which the port belongs in the link aggregation information of the second device port is a master device, and the device classification of the device to which the port belongs in the link aggregation information of the first device port is a slave device. If the physical address of the device to which the second device port belongs is not less than the physical address of the device to which the first device port belongs, the device classification of the device to which the port belongs in the link aggregation information of the second device port is a slave device, and the device classification of the device to which the port belongs in the link aggregation information of the first device port is a master device.
[0045] S104, if the link aggregation information of the second device port conforms to the preset aggregation information, controlling the first device port and the second device port to perform link aggregation, and the link aggregation is realized by controlling the first device port to perform port aggregation and controlling the second device port to perform port aggregation.
[0046] Specifically, according to the link aggregation information of the second device port, it can be judged whether the link aggregation information of the second device port conforms to the preset aggregation information. Further, if the link aggregation information of the second device port conforms to the preset aggregation information, the first device port is controlled to perform port aggregation and the second device port is controlled to perform port aggregation, so as to realize link aggregation of the first device port and the second device port. If the link aggregation information of the second device port does not conform to the preset aggregation information, link aggregation is not performed.
[0047] As an optional implementation of the embodiment of the present application, the control of the first device port and the second device port to perform link aggregation comprises: if, in the process of performing link aggregation of the first device port and the second device port, the link aggregation information of the first device port or the second device port indicates that the port aggregation performance of the first device port or the second device port does not support the configured port aggregation, the first device port and the second device port are controlled to exit the link aggregation.
[0048] Specifically, in the process of performing link aggregation of the first device port and the second device port, if the first device port or the second device port does not support port aggregation, it indicates that the link aggregation information of the first device port or the second device port does not conform to the preset aggregation information. Further, the first device port and the second device port are respectively controlled to exit the port aggregation, so as to realize the exit of the link aggregation.
[0049] As an optional implementation of the embodiment of the present application, the control of the first device port and the second device port to exit the link aggregation comprises: if the link aggregation information of the second device port indicates that the second device port does not support the configured port aggregation, the first device port and the second device port are controlled to exit the link aggregation and wait for the link aggregation information of the second device port to conform to the preset aggregation information before performing the link aggregation again.
[0050] Specifically, in the process of performing link aggregation of the first device port and the second device port, if the second device port does not support port aggregation, the link aggregation information of the second device port does not conform to the preset aggregation information. Further, the first device port and the second device port are controlled to exit the link aggregation, and after the link aggregation information of the second device port conforms to the preset aggregation information, the first device port and the second device port are controlled to perform the link aggregation again, so as to avoid judging again whether the link aggregation information of the first device port conforms to the preset aggregation information.
[0051] As an optional implementation of this invention, controlling the first device port and the second device port to perform link aggregation includes: determining the order in which the first device port and the second device port perform port aggregation based on the device classification of the device to which the port belongs in the link aggregation information of the first device port and the second device port.
[0052] Specifically, when controlling the first and second device ports to perform link aggregation, the order in which the first and second device ports perform port aggregation can be determined by the device classification of the devices to which they belong. For example, a device port classified as a master device performs port aggregation before a device port classified as a slave device. Correspondingly, when controlling the first and second device ports to exit link aggregation, if a device port classified as a slave device does not support port aggregation, then the device port classified as a master device exits port aggregation and waits for the link aggregation information of the device port classified as a slave device to match preset aggregation information before re-executing port aggregation.
[0053] As an optional implementation of the present invention, the automatic link aggregation method of the present invention further includes: after the link aggregation is performed on the first device port and the second device port, updating the link aggregation information of the first device port and the second device port.
[0054] Specifically, after the first device port and the second device port complete link aggregation, the port aggregation status in the link aggregation information of both the first and second device ports is updated to indicate that the device port has been configured in its respective aggregation group. For example, after the first device port and the second device port complete link aggregation, when the link aggregation information is represented in TLV format, aggStat is updated to 1.
[0055] The technical scheme of the embodiment of the present application acquires the link aggregation information of the first device port based on the LLDP protocol, the first device port is an actual physical interface used for connecting devices for communication transmission, the link aggregation information includes: port aggregation performance, port aggregation state and device classification of the device to which the port belongs, the port aggregation performance is whether the device port supports being configured to perform port aggregation, the port aggregation state is used to indicate whether the device port has been configured in the aggregation group to which it belongs, the device classification is a master device or a slave device, the aggregation group is a logical port established by multiple device ports belonging to the same device, and the port aggregation is to control the device port to be configured in the aggregation group to which it belongs, thereby realizing the acquisition of the link aggregation information of the first device port through the LLDP protocol, reducing the device operation and maintenance cost, and avoiding the occupation of system resources; if the link aggregation information of the first device port indicates that the device classification of the device to which the first device port belongs is a master device, it is judged whether the link aggregation information of the first device port meets the preset aggregation information, the preset aggregation information indicates that the port aggregation performance in the link aggregation information indicates that the device port supports being configured to perform port aggregation, and the port aggregation state indicates that the device port is not configured in the aggregation group, thereby realizing the judgment of whether the first device port supports performing port aggregation through the link aggregation information of the first device port, and improving the efficiency of link aggregation; if the link aggregation information of the first device port meets the preset aggregation information, the link aggregation information of the second device port is acquired based on the LLDP protocol, the second device port is connected with the first device port, and the second device port and the first device port belong to different devices, the aggregation group to which the second device port belongs and the aggregation group to which the first device port belongs can communicate, thereby realizing the acquisition of the link aggregation information of the second device port through the LLDP protocol; if the link aggregation information of the second device port meets the preset aggregation information, the first device port and the second device port are controlled to perform link aggregation, the link aggregation is realized by controlling the first device port to perform port aggregation and controlling the second device port to perform port aggregation, thereby realizing the control of the first device port and the second device port to perform port aggregation, so as to control the execution of link aggregation, improve the accuracy of link aggregation, and avoid the aggregation configuration error to cause the business to be not connected and the network to be paralyzed.
[0056] Figure 3 A structural schematic diagram of a link automatic aggregation device provided by the embodiment of the present application. The embodiment of the present application can be applied to the case that the link ports between different devices are automatically aggregated, the device can be realized in the form of hardware and / or software, and can be configured in an electronic device for implementing the link automatic aggregation method. As shown in the figure, the device includes: Figure 3
[0057] The first obtaining module 201 is configured to obtain link aggregation information of a first device port based on the LLDP protocol, the first device port being an actual physical interface used for connecting a device for communication transmission, and the link aggregation information including port aggregation performance, a port aggregation state, and a device classification of a device to which the port belongs, the port aggregation performance being whether the device port supports being configured to perform port aggregation, the port aggregation state being used to indicate whether the device port has been configured in an aggregation group to which the port belongs, the device classification being a master device or a slave device, the aggregation group being a logical port established by a plurality of device ports belonging to the same device, and the port aggregation being control of configuring the device port in an aggregation group to which the device port belongs.
[0058] The aggregation information judging module 202 is configured to, if the link aggregation information of the first device port indicates that the device classification of the device to which the first device port belongs is a master device, judge whether the link aggregation information of the first device port meets preset aggregation information, the preset aggregation information indicating that the port aggregation performance in the link aggregation information indicates that the device port supports being configured to perform port aggregation and the port aggregation state indicates that the device port is not configured in an aggregation group.
[0059] The second obtaining module 203 is configured to, if the link aggregation information of the first device port meets the preset aggregation information, obtain link aggregation information of a second device port based on the LLDP protocol, the second device port being connected with the first device port and the second device port and the first device port belonging to different devices, and an aggregation group to which the second device port belongs being capable of communicating with an aggregation group to which the first device port belongs.
[0060] The link aggregation module 204 is configured to, if the link aggregation information of the second device port meets the preset aggregation information, control the first device port and the second device port to perform link aggregation, the link aggregation being realized by controlling the first device port to perform port aggregation and controlling the second device port to perform port aggregation.
[0061] In the above any optional technical solution, the first obtaining module 201 includes a port aggregation performance obtaining unit and a port aggregation state obtaining unit. The port aggregation performance obtaining unit is configured to, if the first device port supports being configured in an aggregation group, the port aggregation performance in the link aggregation information of the first device port indicating that the device port supports being configured to perform port aggregation. The port aggregation state obtaining unit is configured to, if the aggregation group to which the first device port belongs can control the first device port to communicate, the port aggregation state in the link aggregation information of the first device port indicating that the device port has been configured in the aggregation group.
[0062] On the basis of any optional technical solution, the link aggregation module 204 comprises: a link aggregation exit module. Wherein, the link aggregation exit module is configured to, if the port aggregation performance in the link aggregation information of the first device port or the second device port indicates that the first device port or the second device port does not support the configured port aggregation during the process of performing link aggregation on the first device port and the second device port, control the first device port and the second device port to exit the link aggregation.
[0063] On the basis of any optional technical solution, the link aggregation exit module is further configured to, if the port aggregation performance in the link aggregation information of the second device port indicates that the second device port does not support the configured port aggregation, control the first device port and the second device port to exit the link aggregation and wait for the link aggregation information of the second device port to meet the preset aggregation information before performing the link aggregation again.
[0064] On the basis of any optional technical solution, the link automatic aggregation device of the embodiment of the application further comprises: a link aggregation information updating module. Wherein, the link aggregation information updating module is configured to, after the link aggregation on the first device port and the second device port is completed, update the link aggregation information of the first device port and the second device port.
[0065] On the basis of any optional technical solution, the link automatic aggregation device of the embodiment of the application further comprises: a device classification determining module. Wherein, the device classification determining module is configured to, after obtaining the link aggregation information of the second device port based on the LLDP protocol, if the device classification of the device to which the port belongs in the link aggregation information of the second device port is the master device, determine the device classification of the device to which the port belongs in the link aggregation information of the first device port and the second device port according to the physical addresses of the devices to which the first device port and the second device port belong respectively.
[0066] The technical scheme of the embodiment of the present application acquires the link aggregation information of the first device port based on the LLDP protocol through the first acquisition module 201, the first device port is an actual physical interface used for connecting devices for communication transmission, the link aggregation information includes: port aggregation performance, port aggregation state, and device classification of the device to which the port belongs, the port aggregation performance is whether the device port supports being configured to perform port aggregation, the port aggregation state is used to indicate whether the device port has been configured in the aggregation group to which it belongs, the device classification is a master device or a slave device, the aggregation group is a logical port established by multiple device ports belonging to the same device, and the port aggregation is to control the device port to be configured in the aggregation group to which it belongs, thereby realizing the acquisition of the link aggregation information of the first device port through the LLDP protocol, reducing the device operation and maintenance cost, and avoiding the occupation of system resources; the aggregation information judgment module 202 judges whether the link aggregation information of the first device port conforms to the preset aggregation information when the link aggregation information of the first device port indicates that the device classification of the device to which the first device port belongs is a master device, the preset aggregation information indicates that the port aggregation performance in the link aggregation information indicates that the device port supports being configured to perform port aggregation, and the port aggregation state indicates that the device port is not configured in the aggregation group, thereby realizing the judgment of whether the first device port supports performing port aggregation through the link aggregation information of the first device port, and improving the efficiency of link aggregation; the second acquisition module 203 acquires the link aggregation information of the second device port based on the LLDP protocol when the link aggregation information of the first device port conforms to the preset aggregation information, the second device port is connected with the first device port, and the second device port and the first device port belong to different devices, the aggregation group to which the second device port belongs can communicate with the aggregation group to which the first device port belongs, thereby realizing the acquisition of the link aggregation information of the second device port through the LLDP protocol; the link aggregation module 204 controls the first device port and the second device port to perform link aggregation when the link aggregation information of the second device port conforms to the preset aggregation information, the link aggregation is realized by controlling the first device port to perform port aggregation and controlling the second device port to perform port aggregation, thereby realizing the control of the first device port and the second device port to perform port aggregation, so as to control the execution of link aggregation, improve the accuracy of link aggregation, and avoid the aggregation configuration error to cause the business to be not connected and the network to be paralyzed.
[0067] The link automatic aggregation device provided in the embodiment of the present application can execute the link automatic aggregation method provided in any embodiment of the present application, has the function modules and beneficial effects corresponding to the execution method.
[0068] Figure 4A structure schematic diagram of an electronic device for implementing a link aggregation method is provided for an embodiment of the present application. The electronic device is intended to represent a variety of forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections, and their functions, as described above, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed herein.
[0069] As shown in Figure 4 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., connected in communication with the at least one processor 11, wherein the memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded into the random access memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0070] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunications networks.
[0071] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the link aggregation method.
[0072] In some embodiments, the link aggregation method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as storage unit 18. In some embodiments, portions of or all of the computer program can be loaded onto the electronic device 10 via, for example, ROM 12 and / or communication unit 19. When a computer program is loaded onto RAM 13 and executed by processor 11, one or more of the steps of the link aggregation method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the link aggregation method by other means, such as with the aid of firmware.
[0073] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0074] Computer programs used to implement the processes of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed, can implement the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as part of a separate software package, or entirely on a remote machine or server.
[0075] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, 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 foregoing.
[0076] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0077] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0078] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0079] It should be understood that the various forms of flow shown above can be used to reorder, add or delete steps. For example, each step described in the present application can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which is not limited herein.
[0080] The above detailed description does not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for automatic link aggregation, characterized in that, The method includes: Link aggregation information of a first device port is obtained based on the LLDP protocol. The first device port is the actual physical interface used to connect devices for communication transmission. The link aggregation information includes: port aggregation performance, port aggregation status, and device classification of the device to which the port belongs. The port aggregation performance indicates whether the device port supports being configured to perform port aggregation. The port aggregation status indicates whether the device port has been configured in its own aggregation group. The device classification is master device or slave device. The aggregation group is a logical port established by multiple device ports belonging to the same device. The port aggregation controls the configuration of the device port in the aggregation group to which the device port belongs. If the link aggregation information of the first device port indicates that the device to which the first device port belongs is classified as a main device, then it is determined whether the link aggregation information of the first device port conforms to the preset aggregation information. The preset aggregation information indicates that the port aggregation performance in the link aggregation information indicates that the device port supports being configured for port aggregation and the port aggregation status indicates that the device port is not configured in the aggregation group. If the link aggregation information of the first device port matches the preset aggregation information, the link aggregation information of the second device port is obtained based on the LLDP protocol. The second device port is connected to the first device port and the second device port and the first device port belong to different devices. The aggregation group to which the second device port belongs can communicate with the aggregation group to which the first device port belongs. If the link aggregation information of the second device port matches the preset aggregation information, then the first device port and the second device port are controlled to perform link aggregation. The link aggregation is achieved by controlling the first device port to perform port aggregation and controlling the second device port to perform port aggregation.
2. The method according to claim 1, characterized in that, The link aggregation information of the first device port is obtained based on the LLDP protocol, including: If the first device port supports being configured in an aggregation group, then the port aggregation performance in the link aggregation information of the first device port indicates that the device port supports being configured to perform port aggregation. If the first device port can be controlled to communicate through the aggregation group to which the first device port belongs, then the port aggregation status in the link aggregation information of the first device port indicates that the device port has been configured in the aggregation group.
3. The method according to claim 2, characterized in that, Controlling the first device port and the second device port to perform link aggregation includes: If, during the link aggregation process between the first device port and the second device port, the port aggregation performance in the link aggregation information of the first device port or the second device port indicates that the first device port or the second device port does not support being configured to perform port aggregation, then the first device port and the second device port are controlled to exit link aggregation.
4. The method according to claim 3, characterized in that, Controlling the first device port and the second device port to exit link aggregation includes: If the port aggregation performance in the link aggregation information of the second device port indicates that the second device port does not support being configured to perform port aggregation, then the first device port and the second device port are controlled to exit link aggregation and wait for the link aggregation information of the second device port to meet the preset aggregation information before re-executing link aggregation.
5. The method according to claim 1, characterized in that, The method further includes: After link aggregation is performed on the first device port and the second device port, the link aggregation information of the first device port and the second device port is updated.
6. The method according to claim 1, characterized in that, After obtaining the link aggregation information of the second device port based on the LLDP protocol, the process also includes: If the device classification of the device to which the port belongs in the link aggregation information of the second device port is a master device, then the device classification of the device to which the port belongs in the link aggregation information of the first device port and the second device port is determined according to the physical addresses of the devices to which the first device port and the second device port belong, respectively.
7. An automatic link aggregation device, characterized in that, The device includes: The first acquisition module is used to acquire link aggregation information of a first device port based on the LLDP protocol. The first device port is the actual physical interface used to connect devices for communication transmission. The link aggregation information includes: port aggregation performance, port aggregation status, and device classification of the device to which the port belongs. The port aggregation performance indicates whether the device port supports being configured to perform port aggregation. The port aggregation status indicates whether the device port has been configured in its own aggregation group. The device classification is master device or slave device. The aggregation group is a logical port established by multiple device ports belonging to the same device. The port aggregation is used to control the configuration of the device port in the aggregation group to which the device port belongs. The aggregation information judgment module is used to determine whether the link aggregation information of the first device port conforms to preset aggregation information if the link aggregation information of the first device port indicates that the device classification of the device to which the first device port belongs is a main device. The preset aggregation information indicates that the port aggregation performance in the link aggregation information indicates that the device port supports being configured for port aggregation and the port aggregation status indicates that the device port is not configured in the aggregation group. The second acquisition module is used to acquire the link aggregation information of the second device port based on the LLDP protocol if the link aggregation information of the first device port matches the preset aggregation information. The second device port is connected to the first device port and the second device port and the first device port belong to different devices. The aggregation group to which the second device port belongs can communicate with the aggregation group to which the first device port belongs. The link aggregation module is used to control the first device port and the second device port to perform link aggregation if the link aggregation information of the second device port matches the preset aggregation information. The link aggregation is achieved by controlling the first device port to perform port aggregation and controlling the second device port to perform port aggregation.
8. The apparatus according to claim 7, characterized in that, The first acquisition module includes: The port aggregation performance acquisition unit is configured to, if the first device port supports being configured in an aggregation group, indicate in the link aggregation information of the first device port that the device port supports being configured to perform port aggregation. The port aggregation status acquisition unit is used to determine if the first device port can be controlled to communicate through the aggregation group to which the first device port belongs, and if so, the port aggregation status in the link aggregation information of the first device port indicates that the device port has been configured in the aggregation group.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the link automatic aggregation method according to any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the link auto-aggregation method according to any one of claims 1-6.
Citation Information
Patent Citations
Traffic transmission control method and device
CN104363181A
Data processing method, device, communication system, and network device
CN109495383A