Link aggregation method and device
By dividing aggregate links within the network and determining active and backup port groups, the problem of one-to-many device link aggregation and backup in the existing technology is solved, enabling simultaneous communication between multiple virtual devices and physical devices, and improving resources. Utilization and communication reliability.
Patent Information
- Application Number
- CN202310073778.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-29
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-01-29
AI Technical Summary
The existing technology is difficult to implement link aggregation backup of one-to-many devices, resulting in a waste of resources and the inability to achieve simultaneous communication between multiple virtual devices and physical devices.
By dividing the aggregated links in the network, the active port group and the backup port group among multiple member port groups are determined, and link switching is performed during the transmission of LACP messages to ensure that the active link forwards LACP messages first. Achieve aggregated connections for multiple devices.
It enables one device to aggregate connections with multiple devices at the same time, improves network device resource utilization, reduces resource waste, and improves communication reliability.
Smart Images

Figure CN116032831B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a link aggregation method and device. Background Art
[0002] With the rapid development of network communication technology, various data services are showing a rapid growth trend. LACP aggregation links are widely used in voice, data, video and other business fields due to their advantages of increasing network bandwidth, improving network connection reliability, and load sharing traffic.
[0003] In order to increase the bandwidth and communication reliability between physical devices and servers, link aggregation is usually required between physical devices and servers. Since link aggregation is usually performed one-to-one between devices, that is, link aggregation is performed on a physical device and a virtual device, other virtual devices will be unable to communicate with the physical device due to the inability to perform link aggregation, resulting in a waste of resources. Summary of the invention
[0004] The embodiments of the present application provide a link aggregation method and device to at least solve the problem that related technologies are difficult to implement link aggregation backup of one-to-many devices.
[0005] According to an embodiment of the present application, a link aggregation method is provided, including: dividing the aggregated links in the network to obtain multiple member port groups for connecting the aggregated links, wherein the aggregated links are formed by the aggregation of multiple links between at least one first network device and at least one second network device in the network; recording LACP messages transmitted by the link corresponding to each member port group to obtain a recording result; determining a primary port group and a backup port group among the multiple member port groups based on the recording result, and determining to use the primary link corresponding to the primary port group to forward the LACP message, wherein the priority of the primary link corresponding to the primary port group in forwarding the LACP message is higher than that of the backup link corresponding to the backup port group.
[0006] In an exemplary embodiment, dividing the aggregated links in the network to obtain multiple member port groups for connecting the aggregated links also includes: determining a relay node of the aggregated links in the network; and dividing the aggregated links through the relay nodes to obtain multiple member port groups.
[0007] In an exemplary embodiment, LACP messages transmitted by the aggregated links in each member port group are recorded to obtain a recording result, which also includes: monitoring the LACP messages transmitted by the aggregated links in each member port group at a relay node; and recording the LACP messages to obtain a recording result, wherein the recording result includes at least one of the following: a sending port number of a port that sends the LACP message, a receiving port number of a port that receives the LACP message, and a MAC address of a source network device that sends the LACP message.
[0008] In an exemplary embodiment, before obtaining the recording results, the method also includes: determining the link status of the aggregated link, wherein the link status includes: normal status and abnormal status; if the member port group does not receive the LACP message within the monitoring period, determining that the link status of the aggregated link is a normal state; if the member port group does not receive the LACP message within the monitoring period, determining that the link status of the aggregated link is an abnormal state, and issuing a corresponding alarm prompt information.
[0009] In an exemplary embodiment, determining a primary port group and a backup port group among multiple member port groups based on the recording results also includes: when the aggregated link is normal, determining, based on the recording results, to use a member port group among the multiple member port groups that preferentially receives the LACP message as the primary port group, and to use other member port groups among the multiple member port groups except the primary port group as backup port groups.
[0010] In an exemplary embodiment, determining to use the primary link corresponding to the primary port group to forward the LACP message also includes: when the first network device forwards the LACP message to the second network device, determining to use the primary link corresponding to the primary port group to forward the LACP message, and placing the backup port group in a blocked state.
[0011] In an exemplary embodiment, when the first network device forwards the LACP message to the second network device and the active port group is in a blocked state, it is determined to use a standby link corresponding to the standby port group to forward the LACP message.
[0012] According to another embodiment of the present application, a link aggregation device is provided, including: a division module, used to divide the aggregated links in the network to obtain multiple member port groups for connecting the aggregated links, wherein the aggregated links are formed by the convergence of multiple links between at least one first network device and at least one second network device in the network; a recording module, used to record LACP messages transmitted by the aggregated links in each member port group to obtain recording results; a determination module, used to determine the main port group and the backup port group among the multiple member port groups based on the recording results, and determine to use the main link corresponding to the main port group to forward the LACP message, wherein the priority of the main link corresponding to the main port group in forwarding the LACP message is higher than the backup link corresponding to the backup port group.
[0013] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned link aggregation method embodiments when running.
[0014] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above-mentioned link aggregation method embodiments.
[0015] In the present application, the aggregated link between the first network device and the second network device in the local area network is divided to obtain multiple member port groups, each member port group corresponds to the corresponding first network device and the second network device, so that the LACP message transmitted for the link between each member port group can be recorded, and information exchange and link aggregation between the local end and the opposite end can be realized across devices. At the same time, the main port group and the backup port group are determined in the divided multiple member port groups, and link switching can be realized during the LACP message transmission process. Therefore, the present application can solve the technical problem that the related technology is difficult to realize link aggregation backup of one-to-many devices, thereby achieving the technical effect of a device being aggregated and connected with multiple devices at the same time, thereby improving the utilization rate of network device resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a hardware structure block diagram of a mobile terminal of a link aggregation method according to an embodiment of the present application;
[0017] Figure 2 is a flow chart of a link aggregation method according to an embodiment of the present application;
[0018] Figure 3 is a schematic diagram of an optional link switching structure according to an embodiment of the present application;
[0019] Figure 4 It is a structural diagram of a link aggregation device according to an embodiment of the present application. DETAILED DESCRIPTION
[0020] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0022] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0023] LA (Link Aggregation) is a technology that bundles multiple physical ports into one logical port. This technology can treat multiple physical connections as a single logical connection, thereby allowing two network devices to be linked in parallel through multiple ports to achieve simultaneous data transmission, provide higher bandwidth and throughput, and increase system stability.
[0024] LACP (Link Aggregation Control Protocol): LACP is a dynamic link aggregation protocol based on the IEEE802.3ad standard. The LACP protocol exchanges information with the peer end through LACPDU (Link Aggregation Control Protocol Data Unit). After the LACP protocol of a port is enabled, the port will send LACPDU to inform the peer end of its system priority, system MAC address, port priority, port number and operation key. After receiving this information, the peer end compares this information with the information stored in other ports to select the port that can be aggregated, so that both parties can reach an agreement on whether the port joins or exits a dynamic aggregation group and determine the link that bears the business traffic. Therefore, the main work of LACP includes: sending LACPDU messages to each other, determining the active end, determining the active link, link switching, etc.
[0025] LACP message: also known as Link Aggregation Control Protocol Data Unit (LACPDU).
[0026] Relay Node (ND): located between the base station and the mobile station, forwarding the wireless signal once or multiple times. Taking two-hop relay as an example, a base station-terminal link is split into two links: base station-relay station and relay station-terminal, so as to replace a poor quality link with two good quality links to obtain higher link capacity and better coverage.
[0027] Currently, in order to increase the bandwidth and communication reliability between a physical device and a server, it is necessary to create multiple virtual devices on the server, thereby aggregating the links between the physical device and the multiple virtual devices on the server.
[0028] However, usually, link aggregation is usually performed one-to-one between devices, that is, link aggregation is performed between a virtual device and a physical device. This will cause other virtual devices to be unable to communicate with the physical device due to the inability to perform link aggregation, resulting in a waste of resources.
[0029] In order to solve the above technical problems, this application proposes a link aggregation method, which aims to achieve the technical effect of a device being able to aggregate connections with multiple devices at the same time and reduce resource waste. After verification by a large amount of experimental data and practical applications, the method provided by this application has achieved very good expected results.
[0030] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] Example 1
[0032] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a link aggregation method according to an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1Different configurations are shown.
[0033] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the link aggregation method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0035] In this embodiment, a link aggregation method running on a mobile terminal is provided. Figure 2 is a flowchart of link aggregation according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0036] Step S202: divide the aggregated links in the network to obtain a plurality of member port groups for connecting the aggregated links, wherein the aggregated links are formed by aggregating a plurality of links between at least one first network device and at least one second network device in the network.
[0037] In the technical solution provided in the above step S202 of the present invention, the first network device can be any virtual device among multiple virtual devices on a physical server, or any physical server among multiple physical servers, and the second network device can be a physical device connected to the physical server, and the first network device and the second network device have the same IP address, that is, they are in the same local area network. Since there are multiple links between multiple first network devices and one second network device on the physical server, and these links can be aggregated to obtain an aggregated link under the local area network where the first network device and the second network device are located, the aggregated link can be divided to obtain multiple member port groups, wherein each member port group can be used to connect the aggregated link.
[0038] Step S204: Record the LACP messages transmitted by the link corresponding to each member port group to obtain a recording result.
[0039] In the technical solution provided in the above step S204 of the present invention, the LACP message transmitted by the link corresponding to each member port group is monitored and recorded by the relay system, thereby realizing information interconnection between the network devices at both ends of the link corresponding to each member port group.
[0040] Step S206, determining the active port group and the standby port group among the multiple member port groups according to the recording results, and determining to use the active link corresponding to the active port group to forward the LACP message, wherein the priority of the active link corresponding to the active port group in forwarding the LACP message is higher than the standby link corresponding to the standby port group.
[0041] In the technical solution provided in the above step S206 of the present invention, the primary port group and the backup port group for subsequent transmission of the LACP message can be determined according to the recording result obtained by the relay node recording the LACP message. The conditions for determining the primary port group and the backup port group in the present application can be but are not limited to the priority of the received message.
[0042] Through the above steps, the aggregated link between the first network device and the second network device in the local area network is divided to obtain multiple member port groups, each member port group corresponds to the corresponding first network device and the second network device, so that the LACP message transmitted between each member port group can be recorded, and information exchange and link aggregation between the local end and the opposite end can be realized across devices. At the same time, the main port group and the backup port group are determined in the divided multiple member port groups, and link switching can be realized during the LACP message transmission process. Therefore, the present application can solve the technical problem that the related technology is difficult to realize link aggregation backup of one-to-many devices, thereby achieving the technical effect of a device being aggregated and connected with multiple devices at the same time, thereby improving the utilization rate of network device resources.
[0043] The above method of this embodiment is further introduced below.
[0044] In an exemplary embodiment, in the technical solution provided in the above step S202 of the present invention, the method may include: determining a relay node of an aggregated link in the network; and dividing the aggregated link by the relay node to obtain a plurality of member port groups.
[0045] In this embodiment, by determining the relay node of the aggregated link and dividing the aggregated link at the relay node, the aggregated link can be divided into two segments, obtaining a first link connecting the first node corresponding to the first network device and the relay node, and a second link connecting the second node corresponding to the second network device and the relay node, and multiple member port groups connected to the aggregated link are determined through the first link and the second link, wherein each member port group corresponds to a first network device and a second network device, and includes the port number of the corresponding network device.
[0046] In an exemplary embodiment, in the technical solution provided in the above step S204 of the present invention, the method may include: monitoring the LACP messages transmitted by the aggregated link in each member port group at the relay node; and recording the LACP messages to obtain recording results, wherein the recording results include at least one of the following: the sending port number of the port sending the LACP message, the receiving port number of the port receiving the LACP message, and the MAC address of the source network device sending the LACP message.
[0047] In this embodiment, the relay system monitors the LACP messages received by the relay node in the aggregation link, reducing the operation and maintenance costs caused by the relevant technicians monitoring the first network device and the second network device at the same time. At the same time, the central processing unit (CPU) on the relay node analyzes and records the LACP messages received at the relay node to obtain the recording results, so that the LACP messages can be forwarded to the corresponding member port group according to the recording results.
[0048] In an exemplary embodiment, in the technical solution provided in the above step S204 of the present invention, before obtaining the recording result, the method may also include: judging the link status of the aggregated link, wherein the link status includes: normal status and abnormal status; if the member port group does not receive the LACP message within the monitoring period, determining that the link status of the aggregated link is a normal state; if the member port group does not receive the LACP message within the monitoring period, determining that the link status of the aggregated link is an abnormal state, and issuing a corresponding alarm prompt information.
[0049] In this embodiment, the link status of the aggregated link is determined based on whether the member port group receives the LACP message during the monitoring period, thereby ensuring the normal transmission of the LACP message. Specifically, during the monitoring period, if the member port group receives the LACP message sent from the relay node, it is determined that the target link is up; otherwise, the target link is down. The link status of the aggregated link is obtained according to the above rules, and the obtained link status can also be reported to the network management monitoring system to realize real-time monitoring of the link status of the aggregated link. Once the link is abnormal, the relevant technical personnel can timely discover and perform corresponding management operations through the network management monitoring system.
[0050] In an exemplary embodiment, in the technical solution provided in the above step S206 of the present invention, the method may include: when the aggregated link is normal, determining, based on the recording results, to use the member port group among multiple member port groups that preferentially receives the LACP message as the main port group, and to use the other member port groups among the multiple member port groups except the main port group as backup port groups.
[0051] In this embodiment, when the aggregate link is in the up state, the member port group that first receives the LACP message can be used as the main port group, and the other member port groups can be used as backup port groups, among which the main port group has the highest priority for forwarding LACP messages, and the other member port groups have the same priority for forwarding LACP messages, which is lower than that of the main port group.
[0052] As another optional implementation, in the technical solution provided in the above step S206 of the present invention, the method may include: when the first network device forwards the LACP message to the second network device, determining to use the primary link corresponding to the primary port group to forward the LACP message, and placing the backup port group in a blocking state.
[0053] As another optional implementation, in the technical solution provided in the above step S206 of the present invention, the method may include: when the first network device forwards the LACP message to the second network device and the active port group is in a blocked state, determining to use the standby link corresponding to the standby port group to forward the LACP message.
[0054] In this embodiment, a primary port group and a backup port group are divided on the relay node. When the primary port group is in a normal state, it is determined to establish a primary link through the primary port group, and forward LACP messages through the primary link. At this time, the backup port group is in a blocked state; once the primary link is in a blocked state, it is determined to use the backup link corresponding to the backup port group to forward LACP messages.
[0055] For example, Figure 3 is a schematic diagram of an optional link switching structure according to an embodiment of the present application, such as Figure 3 As shown, DUT (Device Under Test) 1 is a physical device, DUT2, DUT3 and DUT4 are any two virtual devices on the server, and DUT1, DUT2, DUT3 and DUT4 are in the same local area network, LACPRelay is a relay node of the aggregated link, if DUT1-LACPRelay-DUT2 is set to establish port group 1, DUT1-LACPRelay-DUT3 to establish port group 2, and DUT1-LACPRelay-DUT4 to establish port group 3, wherein port group 1 receives the LACP message first, then port group 1 is determined to be the main port group, and port group 2 and port group 3 are standby port groups. Specifically, if the link between port group 1 is normal, port group 2 and port group 3 are in a blocked state; if port group 1 is in a blocked state, port switching can be performed, that is, the main port group is reduced to the standby port group, and the standby port group is upgraded to the main port group, and message forwarding continues.
[0056] In the present application, the aggregated links in the local area network are divided through relay nodes, and the transmitted LACP messages are monitored and analyzed through the relay nodes, thereby reducing the operation and maintenance costs of the relevant technical personnel for monitoring the aggregated links; and the primary port group and the backup port group for forwarding LACP messages are determined through multiple member port groups divided by the relay nodes, thereby realizing the link switching function when the link is abnormal, and realizing that multiple virtual devices on the server under the local area network can perform link aggregation and communicate with physical devices, effectively improving the reliability of communication between the server and physical devices under the local area network.
[0057] The execution subject of the above steps may be a server, a terminal, etc., but is not limited thereto.
[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0059] Example 2
[0060] In this embodiment, a link aggregation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0061] Figure 4 is a schematic diagram of the structure of a link aggregation device according to an embodiment of the present application, such as Figure 4 As shown, the device includes: a division module 41, a recording module 42 and a determination module 43, wherein:
[0062] The division module 41 is used to divide the aggregated link in the network to obtain multiple member port groups for connecting the aggregated link, wherein the aggregated link is formed by aggregating multiple links between at least one first network device and at least one second network device in the network.
[0063] Specifically, the first network device in the partitioning module 41 can be any virtual device among multiple virtual devices on a physical server, or any physical server among multiple physical servers, and the second network device can be a physical device connected to the physical server, and the first network device and the second network device have the same IP address, that is, they are in the same local area network. Since there are multiple links between multiple first network devices and one second network device on the physical server, and these links can be aggregated to obtain an aggregated link under the local area network where the first network device and the second network device are located, the partitioning module 41 can divide the aggregated link to obtain multiple member port groups, wherein each member port group can be used to connect the aggregated link.
[0064] In an exemplary embodiment, the division module 41 may determine a relay node of an aggregated link in the network; and divide the aggregated link by the relay node to obtain a plurality of member port groups.
[0065] In this embodiment, the division module 41 can divide the aggregated link into two segments by determining the relay node of the aggregated link and dividing the aggregated link at the relay node, thereby obtaining a first link connecting the first node corresponding to the first network device and the relay node, and a second link connecting the second node corresponding to the second network device and the relay node, and determining multiple member port groups connected to the aggregated link through the first link and the second link, wherein each member port group corresponds to a first network device and a second network device, and includes the port number of the corresponding network device.
[0066] The recording module 42 is used to record the LACP messages transmitted by the aggregation link in each member port group to obtain a recording result.
[0067] Specifically, the recording module 42 may monitor and record LACP messages transmitted by the link corresponding to each member port group, thereby realizing information interconnection between network devices at both ends of the link corresponding to each member port group.
[0068] In an exemplary embodiment, the recording module 42 monitors the LACP messages transmitted by the aggregated link within each member port group at the relay node; and records the LACP messages to obtain recording results, wherein the recording results include at least one of the following: the sending port number of the port that sends the LACP message, the receiving port number of the port that receives the LACP message, and the MAC address of the source network device that sends the LACP message.
[0069] In this embodiment, the recording module 42 can monitor the LACP messages received by the relay node in the aggregation link, reducing the operation and maintenance costs caused by the relevant technicians monitoring the first network device and the second network device at the same time. At the same time, the central processing unit (CPU) on the relay node will analyze and record the LACP messages received at the relay node to obtain the recording results, so that the LACP messages can be forwarded to the corresponding member port group according to the recording results.
[0070] In an exemplary embodiment, before obtaining the recording results, the recording module 42 can also determine the link status of the aggregated link, where the link status includes: normal status and abnormal status; if the member port group does not receive the LACP message within the monitoring period, the link status of the aggregated link is determined to be a normal state; if the member port group does not receive the LACP message within the monitoring period, the link status of the aggregated link is determined to be an abnormal state, and a corresponding alarm prompt information is issued.
[0071] In this embodiment, the recording module 42 can determine the link status of the aggregated link based on whether the member port group receives the LACP message during the monitoring period, thereby ensuring the normal transmission of the LACP message. Specifically, during the monitoring period, if the member port group receives the LACP message sent from the relay node, it is determined that the target link is up; otherwise, the target link is down. The link status of the aggregated link is obtained according to the above rules, and the obtained link status can also be reported to the network management monitoring system to realize real-time monitoring of the link status of the aggregated link. Once the link is abnormal, the relevant technical personnel can timely discover and perform corresponding management operations through the network management monitoring system.
[0072] The determination module 43 is used to determine the main port group and the backup port group in the multiple member port groups according to the recording results, and determine to use the main link corresponding to the main port group to forward the LACP message, wherein the main link corresponding to the main port group has a higher priority than the backup link corresponding to the backup port group in forwarding the LACP message.
[0073] Specifically, the determination module 43 can determine the primary port group and the backup port group for subsequent transmission of the LACP message according to the record result obtained by the relay node recording the LACP message. The conditions for determining the primary port group and the backup port group in the present application can be but are not limited to the priority of the received message.
[0074] In an exemplary embodiment, when the aggregated link is normal, the determination module 43 can determine, based on the recording results, to use the member port group that preferentially receives the LACP message among multiple member port groups as the primary port group, and to use the other member port groups among the multiple member port groups except the primary port group as the backup port groups.
[0075] In this embodiment, when the aggregate link is in the up state, the determination module 43 may use the member port group that first receives the LACP message as the primary port group, and other member port groups as backup port groups, wherein the primary port group has the highest priority for forwarding LACP messages, and other member port groups have the same priority for forwarding LACP messages, which is lower than that of the primary port group.
[0076] As another optional implementation, when the first network device forwards the LACP message to the second network device, the determination module 43 may determine to use the primary link corresponding to the primary port group to forward the LACP message and put the backup port group into a blocking state.
[0077] As another optional implementation, when the first network device forwards the LACP message to the second network device and the active port group is in a blocked state, the determination module 43 may determine to use a standby link corresponding to the standby port group to forward the LACP message.
[0078] In this embodiment, a primary port group and a backup port group are divided on the relay node. When the primary port group is in a normal state, the determination module 43 can establish a primary link through the primary port group and forward LACP messages through the primary link. At this time, the backup port group is in a blocked state; once the primary link is in a blocked state, the determination module 43 will use the backup link corresponding to the backup port group to forward the LACP message.
[0079] It should be noted that each module in the link aggregation device in the embodiment of the present application corresponds one by one to each implementation step of the link aggregation method in Example 1. Since a detailed description has been given in Example 1, some details not reflected in this embodiment can be referred to Example 1 and will not be repeated here.
[0080] In addition, the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0081] Example 3
[0082] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned link aggregation method embodiments when running.
[0083] In an exemplary embodiment, an aggregated link in a network is divided to obtain a plurality of member port groups for connecting the aggregated link, wherein the aggregated link is formed by the convergence of a plurality of links between at least one first network device and at least one second network device in the network; LACP messages transmitted by the link corresponding to each member port group are recorded to obtain a recording result; a primary port group and a backup port group among the plurality of member port groups are determined based on the recording result, and it is determined to use a primary link corresponding to the primary port group to forward the LACP message, wherein the priority of the primary link corresponding to the primary port group in forwarding the LACP message is higher than that of the backup link corresponding to the backup port group.
[0084] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0085] An embodiment of the present application further provides a processor, which is used to run a program, wherein the program executes the steps of any of the above-mentioned link aggregation method embodiments when running.
[0086] In an exemplary embodiment, an aggregated link in a network is divided to obtain a plurality of member port groups for connecting the aggregated link, wherein the aggregated link is formed by the convergence of a plurality of links between at least one first network device and at least one second network device in the network; LACP messages transmitted by the link corresponding to each member port group are recorded to obtain a recording result; a primary port group and a backup port group among the plurality of member port groups are determined based on the recording result, and it is determined to use a primary link corresponding to the primary port group to forward the LACP message, wherein the priority of the primary link corresponding to the primary port group in forwarding the LACP message is higher than that of the backup link corresponding to the backup port group.
[0087] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above-mentioned link aggregation method embodiments.
[0088] In an exemplary embodiment, an aggregated link in a network is divided to obtain a plurality of member port groups for connecting the aggregated link, wherein the aggregated link is formed by the convergence of a plurality of links between at least one first network device and at least one second network device in the network; LACP messages transmitted by the link corresponding to each member port group are recorded to obtain a recording result; a primary port group and a backup port group among the plurality of member port groups are determined based on the recording result, and it is determined to use a primary link corresponding to the primary port group to forward the LACP message, wherein the priority of the primary link corresponding to the primary port group in forwarding the LACP message is higher than that of the backup link corresponding to the backup port group.
[0089] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0090] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0091] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0092] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A link aggregation method, characterized in that: include: Dividing an aggregated link in the network to obtain a plurality of member port groups for connecting the aggregated link, wherein the aggregated link is formed by aggregating a plurality of links between at least one first network device and at least one second network device in the network; Recording the LACP messages transmitted by the link corresponding to each of the member port groups to obtain a recording result; Determine the active port group and the standby port group among the multiple member port groups according to the record results, and determine to use the active link corresponding to the active port group to forward the LACP message, wherein the active link corresponding to the active port group has a higher priority in forwarding the LACP message than the standby link corresponding to the standby port group; The recording of the LACP messages transmitted by the aggregated link in each of the member port groups to obtain the recording results further includes: monitoring the LACP messages transmitted by the aggregated link in each of the member port groups at the relay node of the aggregated link in the network, recording the LACP messages to obtain the recording results, wherein the recording results include at least one of the following: the sending port number of the port sending the LACP message, the receiving port number of the port receiving the LACP message, and the MAC address of the source network device sending the LACP message; Among them, determining the primary port group and the backup port group among the multiple member port groups based on the recording results also includes: when the aggregated link is normal, determining according to the recording results to use the member port group among the multiple member port groups that preferentially receives the LACP message as the primary port group, and using the other member port groups among the multiple member port groups except the primary port group as the backup port group.
2. The method according to claim 1, characterized in that Dividing the aggregated links in the network to obtain a plurality of member port groups for connecting the aggregated links also includes: Determining a relay node of an aggregated link within the network; The aggregated link is divided by the relay node to obtain a plurality of the member port groups.
3. The method according to claim 1, characterized in that Before obtaining the recording result, the method further includes: Determine the link status of the aggregated link, wherein the link status includes: a normal state and an abnormal state; If the member port group does not receive the LACP message within the monitoring period, determining that the link state of the aggregated link is the normal state; If the member port group does not receive the LACP message within the monitoring period, it is determined that the link state of the aggregated link is the abnormal state, and a corresponding alarm prompt information is issued.
4. The method according to claim 1, characterized in that: Determining to use the primary link corresponding to the primary port group to forward the LACP message also includes: When the first network device forwards the LACP message to the second network device, it is determined to use the active link corresponding to the active port group to forward the LACP message, and the standby port group is placed in a blocking state.
5. The method according to claim 1, characterized in that The method further comprises: When the first network device forwards the LACP message to the second network device and the active port group is in a blocked state, it is determined to use the standby link corresponding to the standby port group to forward the LACP message.
6. A link aggregation device, characterized in that: include: A division module, used to divide the aggregated link in the network to obtain a plurality of member port groups for connecting the aggregated link, wherein the aggregated link is formed by aggregating a plurality of links between at least one first network device and at least one second network device in the network; A recording module, used for recording the LACP messages transmitted by the aggregation link in each of the member port groups to obtain a recording result; A determination module, configured to determine an active port group and a standby port group among the multiple member port groups according to the record result, and determine to use an active link corresponding to the active port group to forward the LACP message, wherein the priority of the active link corresponding to the active port group in forwarding the LACP message is higher than that of the standby link corresponding to the standby port group; The recording of the LACP messages transmitted by the aggregated link in each of the member port groups to obtain the recording results further includes: monitoring the LACP messages transmitted by the aggregated link in each of the member port groups at the relay node of the aggregated link in the network, recording the LACP messages to obtain the recording results, wherein the recording results include at least one of the following: the sending port number of the port sending the LACP message, the receiving port number of the port receiving the LACP message, and the MAC address of the source network device sending the LACP message; Among them, determining the primary port group and the backup port group among the multiple member port groups based on the recording results also includes: when the aggregated link is normal, determining according to the recording results to use the member port group among the multiple member port groups that preferentially receives the LACP message as the primary port group, and using the other member port groups among the multiple member port groups except the primary port group as the backup port group.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the link aggregation method described in any one of claims 1 to 5.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the link aggregation method described in any one of claims 1 to 5 are implemented.
