Link aggregation method and device, electronic equipment and storage medium

By receiving LLDP messages, the direct link and link aggregation conditions between switches are judged, and the aggregation port is automatically configured, which solves the problem that switches cannot automatically link aggregation in the prior art, and realizes automatic configuration and improves link utilization.

CN119788628AInactive Publication Date: 2025-04-08ZHEJIANG DAHUA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510271903.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-04-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the switch cannot automatically define the physical port as an aggregation port, and the administrator needs to configure it manually, resulting in inconvenient link aggregation and problems such as bandwidth waste and backup links being unusable.

Method used

By receiving the LLDP message sent by the second switch, it determines whether there is a direct link and meets the link aggregation conditions by receiving the LLDP message sent by the second switch, and automatically determines and configures the port to be aggregated as an aggregation port.

Benefits of technology

Automatic link aggregation between switches is realized, avoiding the steps of manual configuration by administrators, improving link utilization and reducing hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788628A_ABST
    Figure CN119788628A_ABST
Patent Text Reader

Abstract

The invention provides a link aggregation method and device, electronic equipment and a storage medium, and relates to the technical field of communication, a first LLDP message sent by a second switch is received, and the first LLDP message carries link aggregation information of the second switch. And if it is determined that a direct connection loop exists between the second switch and the first switch according to the link aggregation information and the second switch and the first switch satisfy a link aggregation condition, determining each first port corresponding to the direct connection loop as a first port to be aggregated, and configuring the first port to be aggregated as a first aggregation port. Therefore, when it is determined that there is a direct link between the switches through the LLDP message and the link aggregation condition is satisfied, the first ports corresponding to the direct link are determined as the first to-be-aggregated ports, and the first to-be-aggregated ports are configured as the first aggregation port, so that an administrator does not need to perform manual configuration, thereby realizing automatic link aggregation between the switches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a link aggregation method, device, electronic device and storage medium. Background Art

[0002] With the advent of the AI ​​and digital age, the demand for intelligent communications is growing. When building a complex network topology, the core of the current strategy is logical destruction, blocking one of the switch ports to prevent loops in the network topology. However, this solution wastes bandwidth and makes the backup link unusable.

[0003] In the related art, link aggregation can also be configured to prevent loops from occurring in the network topology. Link aggregation refers to aggregating multiple physical ports of a switch to form a logical port to achieve load sharing of traffic on each physical port.

[0004] LACP (link aggregation control protocol) is a protocol based on the IEEE802.3ad standard and is used to implement link aggregation between switches.

[0005] However, in the related art, the switch cannot define which physical ports are configured as aggregation ports, so the administrator needs to manually configure to achieve link aggregation. Summary of the invention

[0006] In order to solve the above-mentioned problems in the prior art, the embodiments of the present application provide a link aggregation method, device, electronic device and storage medium for realizing automatic link aggregation between switches.

[0007] In a first aspect, an embodiment of the present application provides a link aggregation method, the method comprising: receiving a first LLDP message sent by the second switch, where the first LLDP message carries link aggregation information of the second switch; Determine, according to the link aggregation information of the second switch, whether there is a direct connection loop between the second switch and the first switch, and determine whether the second switch and the first switch meet the link aggregation condition; If there is a direct connection loop between the second switch and the first switch, and the second switch and the first switch meet the link aggregation condition, determining each first port corresponding to the direct connection loop as a first port to be aggregated; The first port to be aggregated is configured as a first aggregation port.

[0008] In a possible implementation manner, the link aggregation information includes device identification information and port identification information of the second switch, and determining whether a direct connection loop exists between the second switch and the first switch according to the link aggregation information of the second switch includes: Determine, according to the device identification information and the port identification information of the second switch carried in each of the received multiple first LLDP messages, whether the received multiple first LLDP messages come from different ports of the second switch; If so, determining that there is a direct connection loop between the second switch and the first switch; Otherwise, it is determined that no direct connection loop exists between the second switch and the first switch.

[0009] In a possible implementation manner, each first port corresponding to the direct-connected loop is determined in the following manner: If the received multiple first LLDP messages come from different ports of the second switch, the multiple first ports that receive the multiple first LLDP messages are used as the first ports corresponding to the direct-connected loop.

[0010] In a possible implementation manner, determining, according to the link aggregation information of the second switch, whether the second switch and the first switch meet a link aggregation condition includes: Determine whether the link aggregation information of the second switch includes a target field for automatic loop aggregation; If yes, determining that the second switch and the first switch meet the link aggregation condition; Otherwise, it is determined that the second switch and the first switch do not meet the link aggregation condition.

[0011] In a possible implementation manner, the configuration format of the link aggregation information is TLV, and the target field of the loop automatic aggregation is configured based on an extended field of the TLV.

[0012] In a possible implementation manner, before determining, according to the link aggregation information of the second switch, whether there is a direct loop between the second switch and the first switch, and determining whether the second switch and the first switch meet a link aggregation condition, the step further includes: A second LLDP message is sent to the second switch, so that the second switch determines that each second port corresponding to the directly connected loop is a second port to be aggregated, and configures the second port to be aggregated as a second aggregation port, wherein the second LLDP message carries link aggregation information of the first switch, and the link aggregation information includes device identification information, port identification information, and a target field for automatic loop aggregation of the first switch.

[0013] In a second aspect, an embodiment of the present application provides a link aggregation device, the device comprising: A receiving unit, configured to receive a first LLDP message sent by a second switch, where the first LLDP message carries link aggregation information of the second switch; a determining unit, configured to determine, according to the link aggregation information of the second switch, whether there is a direct connection loop between the second switch and the first switch, and whether the second switch and the first switch meet a link aggregation condition; an aggregation unit, configured to, if a direct loop exists between the second switch and the first switch and the second switch and the first switch meet a link aggregation condition, determine that each first port corresponding to the direct loop is a first port to be aggregated; and configure the first port to be aggregated as a first aggregation port.

[0014] In a possible implementation manner, the determining unit is specifically configured to: Determine, according to the device identification information and the port identification information of the second switch carried in each of the received multiple first LLDP messages, whether the received multiple first LLDP messages come from different ports of the second switch; If so, determining that there is a direct connection loop between the second switch and the first switch; Otherwise, it is determined that no direct connection loop exists between the second switch and the first switch.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the computer program is executed by the processor, any one of the link aggregation methods in the first aspect is implemented.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the link aggregation methods in the first aspect is implemented.

[0017] A link aggregation method, device, electronic device and storage medium provided by an embodiment of the present application receive a first LLDP message sent by a second switch, and the first LLDP message carries the link aggregation information of the second switch. If it is determined according to the link aggregation information that there is a direct loop between the second switch and the first switch, and the second switch and the first switch meet the link aggregation conditions, then each first port corresponding to the direct loop is determined to be a first port to be aggregated, and the first port to be aggregated is configured as the first aggregation port. Thus, it can be determined through the LLDP message that there is a direct loop between the switches, and when the link aggregation conditions are met, each first port corresponding to the direct loop is determined to be a first port to be aggregated, and the first port to be aggregated is configured as the first aggregation port, without the need for manual configuration by the administrator, thereby realizing automatic link aggregation between switches. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 A flowchart of a link aggregation method provided in an embodiment of the present application; Figure 2 A schematic diagram of a network topology structure provided in an embodiment of the present application; Figure 3 An interactive flow chart of a link aggregation method provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of a link aggregation device provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0021] It should be noted that the terms "including" and "having" and their variations involved in the documents of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method may be executed or executed in parallel in the actual processing process or when the device is executed in accordance with the method sequence shown in the embodiment or drawings.

[0023] Figure 1 A flowchart of a link aggregation method provided by an embodiment of the present application is shown. Figure 1 As shown, the link aggregation method may include the following steps: Step S101: receiving a first LLDP message sent by a second switch.

[0024] The first LLDP message carries the link aggregation information of the second switch.

[0025] The first switch and the second switch in the embodiment of the present application both support the LLDP protocol, so the first switch and the second switch can exchange link aggregation information with each other by sending LLDP messages to each other and receiving LLDP messages sent by each other.

[0026] Exemplarily, in order to distinguish between the LLDP messages, in the embodiment of the present application, the received LLDP message sent by the second switch is described as the first LLDP message.

[0027] Step S102: Determine whether there is a direct connection loop between the second switch and the first switch according to the link aggregation information of the second switch, and determine whether the second switch and the first switch meet the link aggregation condition.

[0028] The link aggregation information of the second switch includes device identification information and port identification information of the second switch.

[0029] In a specific implementation, the first switch may determine whether the received multiple first LLDP messages come from different ports of the second switch according to the device identification information and port identification information of the second switch carried in each of the received multiple first LLDP messages.

[0030] Further, if it is determined that the received multiple first LLDP messages come from different ports of the second switch, it is determined that a direct loop exists between the second switch and the first switch; otherwise, it is determined that no direct loop exists between the second switch and the first switch.

[0031] Figure 2 A network topology diagram provided in an embodiment of the present application is shown, such as Figure 2 As shown, the first port 11 and the first port 12 of the first switch are connected to the second port 21 and the second port 22 of the second switch respectively through two Ethernet cables. That is to say, the link aggregation information carried by the first LLDP message received by the first port 11 of the first switch includes the device identification information of the second switch and the identification information of the second port 21. And the link aggregation information carried by the first LLDP message received by the first port 12 of the first switch includes the device identification information of the second switch and the identification information of the second port 22. At this time, the first switch can determine that the two received first LLDP messages are from two different ports of the second switch. Therefore, it can be determined that there is a direct loop between the second switch and the first switch.

[0032] In a specific implementation, the configuration format of the link aggregation information can be in TLV format. The LLDP protocol stipulates that each LLDPDU (link layer discovery protocol data unit) can carry a total of 32 TLVs, and each LLDPDU starts with Chassis ID TLV, Port ID TLV and Time to Live TLV, and ends with End of LLDPDU TLV. These four TLVs are mandatory TLVs, and the others are optional TLVs.

[0033] Among them, LLDPDU is the data part of the LLDP message, which is used to carry the link aggregation information in the embodiment of the present application.

[0034] Continue with Figure 2For example, the device identification information of the second switch carried by the two first LLDP messages is the same, which can be Chassis ID TLV: MAC address of the second switch. However, the port identification information of the second switch carried by the two first LLDP messages is different, which are Port ID TLV: Port GigabitEthernet21 of the second switch and Port ID TLV: Port GigabitEthernet22 of the second switch.

[0035] Thus, the first switch can determine that the received multiple first LLDP messages are from different ports of the second switch based on the device identification information and port identification information of the second switch carried in each of the received multiple first LLDP messages, thereby determining that a direct connection loop exists between the second switch and the first switch.

[0036] However, it should be noted that Figure 2 The example in which the first switch and the second switch are connected via two Ethernet cables is used for illustration. In a specific implementation, the switches may be connected via more Ethernet cables. For example, the first switch and the second switch may be connected via three Ethernet cables. This application does not limit this.

[0037] Furthermore, the first switch may also determine whether the second switch and the first switch meet the link aggregation condition according to the link aggregation information of the second switch.

[0038] In a specific implementation, it can be determined whether the link aggregation information of the second switch includes a target field for automatic loop aggregation. If the target field for automatic loop aggregation is included, it can be determined that the second switch and the first switch meet the link aggregation condition. Otherwise, it is determined that the second switch and the first switch do not meet the link aggregation condition.

[0039] Continue with Figure 2 For example, the target field of the loop automatic aggregation of the second switch carried by the two first LLDP messages can be configured in the Specific TLV: LoopAutoAgg.

[0040] Among them, Specific TLV is an extended field of TLV, and the target field of loop automatic aggregation LoopAutoAgg is used to indicate that the second switch supports automatic link aggregation. In other words, the first switch needs to determine whether the second switch also supports automatic link aggregation. If the second switch supports automatic link aggregation, the first switch can complete the subsequent automatic link aggregation operation, so that the ports corresponding to the direct-connected loop can be automatically aggregated to prevent loops.

[0041] It should be noted that, in step S102, the order of determining whether there is a direct loop between the second switch and the first switch, and determining whether the second switch and the first switch meet the link aggregation condition can be set according to actual needs.

[0042] In some embodiments, it is possible to first determine whether there is a direct loop between the second switch and the first switch, and if so, then determine whether the second switch and the first switch meet the conditions for link aggregation. In other embodiments, it is also possible to first determine whether the second switch and the first switch meet the conditions for link aggregation, and if the conditions for link aggregation are met, then determine whether there is a direct loop between the second switch and the first switch. In other embodiments, it is also possible to simultaneously determine whether there is a direct loop between the second switch and the first switch, and whether the second switch and the first switch meet the conditions for link aggregation, and this application does not impose any limitation on this.

[0043] Step S103: If a direct loop exists between the second switch and the first switch, and the second switch and the first switch meet the link aggregation condition, each first port corresponding to the direct loop is determined as a first port to be aggregated.

[0044] In a specific implementation, if it is determined that there is a direct connection loop between the second switch and the first switch, and the second switch and the first switch meet the link aggregation condition, then the first ports corresponding to the direct connection loop can be determined in the following manner: If the multiple first LLDP messages received come from different ports of the second switch, the multiple first ports that receive the multiple first LLDP messages may be used as the first ports corresponding to the direct-connected loops.

[0045] Continue with Figure 2 For example, the port identification information of the second switch carried by the two first LLDP messages is Port ID TLV: Port GigabitEthernet21 of the second switch, and Port ID TLV: Port GigabitEthernet22 of the second switch. Then, it can be determined that the port receiving the first LLDP message sent by the GigabitEthernet21 port is GigabitEthernet11, that is, the first port 11. Similarly, it can be determined that the port receiving the first LLDP message sent by the GigabitEthernet22 port is GigabitEthernet12, that is, the first port 12. Further, it can be determined that the first port 11 and the first port 12 are the first ports corresponding to the directly connected loop, and the first port 11 and the first port 12 are used as the first ports to be aggregated.

[0046] Step S104: configure the first port to be aggregated as a first aggregation port.

[0047] The first switch determines that there is a direct loop between the second switch and the first switch, and the second switch and the first switch meet the link aggregation condition. Then, after each first port corresponding to the direct loop is used as a first port to be aggregated, the first port to be aggregated can be configured as a first aggregation port.

[0048] Continue with Figure 2 For example, after the first switch determines that the first port 11 and the first port 12 are the first ports to be aggregated, it can automatically create a static aggregation group Aggr1 and add the first port 11 and the first port 12 to the static aggregation group Aggr1, thereby automatically configuring the first port to be aggregated as the first aggregation port.

[0049] In an optional implementation, before the first switch determines whether there is a direct loop between the second switch and the first switch based on the link aggregation information of the second switch, and determines whether the second switch and the first switch meet the link aggregation conditions, the first switch may also send a second LLDP message to the second switch, so that the second switch determines that each second port corresponding to the direct loop is a second port to be aggregated, and configures the second port to be aggregated as a second aggregation port.

[0050] The second LLDP message carries the link aggregation information of the first switch, and the link aggregation information includes the device identification information, port identification information and the target field of the automatic loop aggregation of the first switch. The target field of the automatic loop aggregation is used to indicate that the first switch supports automatic link aggregation.

[0051] A link aggregation method provided in an embodiment of the present application can determine the existence of a direct loop between switches through LLDP messages, and when the link aggregation conditions are met, determine the first ports corresponding to the direct loop as the first ports to be aggregated, and configure the first ports to be aggregated as the first aggregation ports, without the need for manual configuration by the administrator, thereby achieving automatic link aggregation between switches, thereby achieving the dual advantages of automatic loop breaking and increasing link bandwidth. At the same time, the switch device in the embodiment of the present application does not need to support the LACP protocol, so that the hardware cost when building the network topology can be saved.

[0052] Figure 3 An interactive flow chart of a link aggregation method provided by an embodiment of the present application is shown, such as Figure 3 As shown, the link aggregation method may include the following steps: Step S301: The first switch sends a second LLDP message to the second switch.

[0053] The second LLDP message carries the link aggregation information of the first switch.

[0054] Step S302: The second switch sends a first LLDP message to the first switch.

[0055] The first LLDP message carries the link aggregation information of the second switch.

[0056] Step S303: The first switch receives a first LLDP message sent by the second switch.

[0057] Step S304: The second switch receives the second LLDP message sent by the first switch.

[0058] Step S305: The first switch determines, based on the link aggregation information of the second switch, that there is a direct loop between the second switch and the first switch, and determines that the second switch and the first switch meet a link aggregation condition.

[0059] The link aggregation information of the second switch includes device identification information of the second switch, port identification information, and a target field for automatic loop aggregation.

[0060] Step S306: The second switch determines, based on the link aggregation information of the first switch, that there is a direct loop between the first switch and the second switch, and determines that the first switch and the second switch meet a link aggregation condition.

[0061] The link aggregation information of the first switch includes the device identification information, port identification information and the target field of the automatic loop aggregation of the first switch. The process of the second switch determining that there is a direct loop between the first switch and the second switch and determining that the first switch and the second switch meet the link aggregation conditions according to the link aggregation information of the first switch is the same as the process of the first switch determining that there is a direct loop between the second switch and the first switch and determining that the second switch and the first switch meet the link aggregation conditions according to the link aggregation information of the second switch, and will not be repeated here.

[0062] Step S307: The first switch determines each first port corresponding to the directly connected loop as a first port to be aggregated.

[0063] Step S308: The second switch determines each second port corresponding to the directly connected loop as a second port to be aggregated.

[0064] The process of the second switch determining each second port corresponding to the direct-connected loop as the second port to be aggregated is the same as the process of the first switch determining each first port corresponding to the direct-connected loop as the first port to be aggregated, which is not repeated here.

[0065] Step S309: The first switch configures the first port to be aggregated as a first aggregation port.

[0066] Step S310: The second switch configures the second port to be aggregated as a second aggregation port.

[0067] The process of configuring the second port to be aggregated as the second aggregate port by the second switch is the same as the process of configuring the first port to be aggregated as the first aggregate port by the first switch, which will not be described in detail here.

[0068] Based on the same inventive concept, an embodiment of the present invention further provides a schematic diagram of the structure of a link aggregation device, such as Figure 4 As shown, the link aggregation device includes: The receiving unit 401 is configured to receive a first LLDP message sent by a second switch, where the first LLDP message carries link aggregation information of the second switch.

[0069] The determining unit 402 is configured to determine whether a direct connection loop exists between the second switch and the first switch according to the link aggregation information of the second switch, and determine whether the second switch and the first switch meet a link aggregation condition.

[0070] The aggregation unit 403 is configured to determine that each first port corresponding to the direct-connected loop is a first port to be aggregated if a direct-connected loop exists between the second switch and the first switch and the second switch and the first switch meet the link aggregation condition; and configure the first port to be aggregated as a first aggregation port.

[0071] In a possible implementation manner, the determining unit 402 is specifically configured to: Determine, according to the device identification information and the port identification information of the second switch carried in each of the received first LLDP messages, whether the received multiple first LLDP messages come from different ports of the second switch; If so, it is determined that there is a direct loop between the second switch and the first switch; Otherwise, it is determined that no direct connection loop exists between the second switch and the first switch.

[0072] In a possible implementation manner, the determining unit 402 is specifically configured to: If the received multiple first LLDP messages come from different ports of the second switch, the multiple first ports that receive the multiple first LLDP messages are used as the first ports corresponding to the direct-connected loops.

[0073] In a possible implementation manner, the determining unit 402 is specifically configured to: Determine whether the link aggregation information of the second switch includes a target field for automatic loop aggregation; If yes, it is determined that the second switch and the first switch meet the link aggregation condition; Otherwise, it is determined that the second switch and the first switch do not meet the link aggregation condition.

[0074] In a possible implementation manner, the configuration format of the link aggregation information is TLV, and the target field of the loop automatic aggregation is configured based on the extended field of the TLV.

[0075] In a possible implementation manner, the link aggregation device further includes a sending unit 404, and the sending unit 404 is specifically configured to: A second LLDP message is sent to the second switch, so that the second switch determines that each second port corresponding to the directly connected loop is a second port to be aggregated, and configures the second port to be aggregated as a second aggregation port, the second LLDP message carries the link aggregation information of the first switch, and the link aggregation information includes the device identification information of the first switch, the port identification information and the target field of the automatic loop aggregation.

[0076] Based on the same inventive concept, an embodiment of the present application also provides an electronic device, which may be the switch mentioned above. The electronic device includes at least a memory and a processor for storing data, wherein, for the processor for data processing, when executing the processing, a microprocessor, a CPU, a GPU (Graphics Processing Unit), a DSP or an FPGA may be used for implementation. For the memory, an operation instruction is stored in the memory, and the operation instruction may be a computer executable code, and each step in the process of the link aggregation method of the embodiment of the present application mentioned above is implemented by the operation instruction.

[0077] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 500 includes a memory 501, a processor 502, a data acquisition module 503 and a bus 504. The memory 501, the processor 502 and the data acquisition module 503 are all connected via the bus 504, and the bus 504 is used to transmit data between the memory 501, the processor 502 and the data acquisition module 503.

[0078] Among them, the memory 501 can be used to store software programs and modules, and the processor 502 executes various functional applications and data processing of the electronic device 500 by running the software programs and modules stored in the memory 501, such as the link aggregation method provided in the embodiment of the present application. The memory 501 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application application, etc.; the data storage area may store data created according to the use of the electronic device 500, etc. In addition, the memory 501 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0079] The processor 502 is the control center of the electronic device 500, and uses the bus 504 and various interfaces and lines to connect various parts of the entire electronic device 500, and executes various functions of the electronic device 500 and processes data by running or executing software programs and / or modules stored in the memory 501, and calling data stored in the memory 501. Optionally, the processor 502 may include one or more processing units, such as a CPU, a GPU (Graphics Processing Unit), a digital processing unit, etc.

[0080] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer program is executed by a processor, it can be used to implement the link aggregation method described in any embodiment of the present application.

[0081] In some possible implementations, various aspects of the link aggregation method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the link aggregation method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 1 The process of the link aggregation method is shown.

[0082] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt 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 codes.

[0083] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. 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 produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. 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.

[0084] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0086] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A link aggregation method, characterized in that: Applied to a first switch, the method includes: receiving a first LLDP message sent by the second switch, where the first LLDP message carries link aggregation information of the second switch; Determine, according to the link aggregation information of the second switch, whether there is a direct connection loop between the second switch and the first switch, and determine whether the second switch and the first switch meet the link aggregation condition; If there is a direct connection loop between the second switch and the first switch, and the second switch and the first switch meet the link aggregation condition, determining each first port corresponding to the direct connection loop as a first port to be aggregated; The first port to be aggregated is configured as a first aggregation port.

2. The method according to claim 1, characterized in that: The link aggregation information includes device identification information and port identification information of the second switch, and determining whether there is a direct connection loop between the second switch and the first switch according to the link aggregation information of the second switch includes: Determine, according to the device identification information and the port identification information of the second switch carried in each of the received multiple first LLDP messages, whether the received multiple first LLDP messages come from different ports of the second switch; If so, determining that there is a direct connection loop between the second switch and the first switch; Otherwise, it is determined that no direct connection loop exists between the second switch and the first switch.

3. The method according to claim 2, characterized in that The first ports corresponding to the direct-connected loops are determined in the following manner: If the received multiple first LLDP messages come from different ports of the second switch, the multiple first ports that receive the multiple first LLDP messages are used as the first ports corresponding to the direct-connected loop.

4. The method according to claim 1, characterized in that: The determining, according to the link aggregation information of the second switch, whether the second switch and the first switch meet a link aggregation condition includes: Determine whether the link aggregation information of the second switch includes a target field for automatic loop aggregation; If yes, determining that the second switch and the first switch meet the link aggregation condition; Otherwise, it is determined that the second switch and the first switch do not meet the link aggregation condition.

5. The method according to claim 4, characterized in that The configuration format of the link aggregation information is TLV, and the target field of the loop automatic aggregation is configured based on the extended field of TLV.

6. The method according to claim 1, characterized in that Before determining whether there is a direct connection loop between the second switch and the first switch according to the link aggregation information of the second switch, and determining whether the second switch and the first switch meet the link aggregation condition, the method further includes: A second LLDP message is sent to the second switch, so that the second switch determines that each second port corresponding to the directly connected loop is a second port to be aggregated, and configures the second port to be aggregated as a second aggregation port, wherein the second LLDP message carries link aggregation information of the first switch, and the link aggregation information includes device identification information, port identification information, and a target field for automatic loop aggregation of the first switch.

7. A link aggregation device, characterized in that: The device comprises: A receiving unit, configured to receive a first LLDP message sent by a second switch, where the first LLDP message carries link aggregation information of the second switch; a determining unit, configured to determine whether a direct connection loop exists between the second switch and the first switch, and whether the second switch and the first switch meet a link aggregation condition, according to the link aggregation information of the second switch; an aggregation unit, configured to, if a direct loop exists between the second switch and the first switch and the second switch and the first switch meet a link aggregation condition, determine that each first port corresponding to the direct loop is a first port to be aggregated; and configure the first port to be aggregated as a first aggregation port.

8. The link aggregation device according to claim 7, characterized in that: The determining unit is specifically configured to: Determine, according to the device identification information and the port identification information of the second switch carried in each of the received multiple first LLDP messages, whether the received multiple first LLDP messages come from different ports of the second switch; If so, determining that there is a direct connection loop between the second switch and the first switch; Otherwise, it is determined that no direct connection loop exists between the second switch and the first switch.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, the method according to any one of claims 1 to 6 is implemented.

10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and system based on LLDP protocol detection link aggregation configuration

    CN104394034A

  • Link aggregation configuration method and device

    CN112953824A

  • Symmetric path / link over LAG interface using LLDP for time synchronization between two nodes using ptp

    EP3570505A1

  • Method and system for link aggregation across multiple switches

    US20110299536A1