Method, apparatus, device and system for cross-device link aggregation group loop prevention

By adding VLAN tags to cross-device link aggregation groups and verifying their consistency, the loop problem caused by faults in cross-device link aggregation groups is resolved, and the reliability and stability of data transmission are achieved.

CN119544598BActive Publication Date: 2025-11-11AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411699043.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-11-11
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

Existing cross-device link aggregation groups are prone to short-term loop problems in fault scenarios, causing loops to occur during the forwarding of broadcast, multicast, and unknown unicast messages, affecting the normal operation of the devices.

Method used

By adding a VLAN tag for the cross-device link aggregation port to the message, the consistency between the forwarding interface and the pre-assigned VLAN tag is ensured. If they are consistent, the forwarding of the message is stopped to avoid the generation of loops.

Benefits of technology

It effectively prevents loop problems caused by faults in cross-device link aggregation groups, ensuring the reliability and stability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544598B_ABST
    Figure CN119544598B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and system for preventing loops in cross-device link aggregation groups. The method includes: a first network device receiving a first packet sent by a server and adding a VLAN tag to the first packet to identify the cross-device link aggregation port, resulting in a second packet. The VLAN tag is used to identify the link aggregation group from which the packet originates. If the outgoing interface of the first packet is the peer interface of the cross-device link aggregation, the second packet is forwarded to the peer second network device. The second network device determines whether the forwarding interface of the second packet is a link aggregation port. If the forwarding interface is a link aggregation port, it verifies whether the VLAN tag in the second packet is the same as the VLAN tag assigned to the link aggregation port of the outgoing interface. If they are the same, the forwarding of the second packet is stopped. By using this method, when the VLAN tag in the packet matches the pre-marked tag, the packet is not forwarded, thus preventing loops.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, device and system for preventing loops in cross-device link aggregation groups. Background Technology

[0002] Cross-device link aggregation is a common technique for improving network reliability and redundancy. It involves aggregating the links of one device with two other devices across devices, thereby improving link reliability from the single-board level to the device level and forming a dual-active system.

[0003] Current technology has achieved loop prevention across link aggregation groups under steady-state conditions, but short-term loop problems still exist in some fault scenarios. To solve this problem, existing methods for preventing loops in cross-device link aggregation groups generally employ port blocking isolation mechanisms. However, when a link failure occurs between the aggregation device and the downstream device, the normal device detects the fault at the other end and opens the isolated aggregation group port. At this time, broadcast, multicast, and unknown unicast packets may still be being forwarded. After the isolated aggregation group port is opened, the downstream device will still receive its own originating packets, and the loop will still occur.

[0004] Therefore, how to avoid loops in cross-device link aggregation groups is an urgent problem to be solved. Summary of the Invention

[0005] This application provides a method, apparatus, device, and system for preventing loops in cross-device link aggregation groups, in order to solve the problem of avoiding loops in cross-device link aggregation groups.

[0006] In a first aspect, this application provides a method for preventing loops in a cross-device link aggregation group, applied to a cross-device link aggregation group system, wherein the cross-device link aggregation group system includes at least a first network device, a second network device, and a server, and the method includes:

[0007] The first network device receives the first message sent by the server;

[0008] The first network device adds a VLAN tag to the first packet to identify the cross-device link aggregation port, and obtains a second packet. The same cross-device link aggregation port of the first network device and the second network device are pre-assigned the same VLAN tag. The VLAN tag is used to identify the link aggregation group from which the packet comes.

[0009] If the first message output interface is a cross-device link aggregation peer interface, then the first network device will forward the second message to the peer second network device;

[0010] The second network device determines whether the forwarding interface is a link aggregation port based on the second message;

[0011] If the forwarding interface is a link aggregation port, then verify whether the VLAN tag in the second packet is the same as the VLAN tag pre-assigned to the link aggregation port of the outgoing interface.

[0012] If the VLAN tag in the second packet is the same as the VLAN tag pre-assigned to the link aggregation port of the outgoing interface, then the forwarding of the second packet will stop.

[0013] Optionally, the first network device adds a VLAN tag for the cross-device link aggregation port to the first packet to obtain a second packet, including:

[0014] A VLAN tag representing the cross-device link aggregation group identifier is inserted into the Ethernet frame header of the first packet to obtain the second packet. The second packet includes two layers of VLAN tags: a first layer VLAN tag for identifying service traffic and a second layer VLAN tag for identifying the cross-device link aggregation group. The first layer VLAN tag and the second layer VLAN tag are different.

[0015] Optionally, the method further includes:

[0016] If the forwarding interface of the second message is not a link aggregation port, the second network device deletes the VLAN tag used to identify the cross-device link aggregation port in the second message, obtains the third message, and forwards it.

[0017] Optionally, the method further includes:

[0018] If the VLAN tag in the second message is different from the VLAN tag pre-assigned to the link aggregation port of the outgoing interface, the second network device deletes the VLAN tag used to identify the cross-device link aggregation port, obtains the fourth message, and forwards it.

[0019] Optionally, the method further includes:

[0020] If the first packet output interface is not the peer interface of the cross-device link aggregation, the first network device deletes the VLAN tag used to identify the cross-device link aggregation interface, obtains the fifth packet, and forwards it.

[0021] Optionally, the first message is a Virtual Router Redundancy Protocol (VRRP) message.

[0022] Secondly, this application also provides a device for preventing loops in cross-device link aggregation groups, the device comprising:

[0023] The receiving module is used to receive the first message sent by the server;

[0024] The message processing module is used to add a VLAN tag of the cross-device link aggregation port to the first message to obtain a second message, wherein the VLAN tag is used to indicate the link aggregation group from which the message comes;

[0025] The sending module is used to forward the second message to the peer network device if the first message output interface is a cross-device link aggregation peer interface;

[0026] The determination module is used to determine whether the forwarding interface is a link aggregation port based on the second message;

[0027] The verification module is used to verify whether the VLAN tag in the second packet is the same as the VLAN tag pre-assigned to the link aggregation port of the outgoing interface if the forwarding interface is a link aggregation port.

[0028] The anti-loop module is used to stop forwarding the second packet if the VLAN tag in the second packet is the same as the VLAN tag pre-assigned by the link aggregation port of the outgoing interface.

[0029] Thirdly, this application also provides a system for preventing loops in cross-device link aggregation groups, the cross-device link aggregation group anti-loop system including at least a first network device, a second network device and a server; the same cross-device link aggregation ports of the first network device and the second network device are pre-assigned the same VLAN tag.

[0030] The first network device is configured to perform the method as described in any of the first aspects;

[0031] The second network device is used to perform the method as described in any of the first aspects.

[0032] Fourthly, this application also provides an electronic device, including: a memory and a processor;

[0033] The memory stores computer-executed instructions;

[0034] The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any of the first aspects.

[0035] Fifthly, this application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.

[0036] In a sixth aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0037] This application provides a method, apparatus, device, and system for preventing loops in cross-device link aggregation groups. The method includes: a first network device receiving a first packet sent by a server and adding a VLAN tag to the first packet to identify the cross-device link aggregation port, resulting in a second packet. The VLAN tag is used to identify the link aggregation group from which the packet originates. If the outgoing interface of the first packet is the peer interface of the cross-device link aggregation, the second packet is forwarded to the peer second network device. The second network device determines whether the forwarding interface of the second packet is a link aggregation port. If the forwarding interface is a link aggregation port, it verifies whether the VLAN tag in the second packet is the same as the VLAN tag assigned to the link aggregation port of the outgoing interface. If they are the same, the forwarding of the second packet is stopped. By using this method, when the VLAN tag in the packet matches the pre-marked tag, the packet is not forwarded, thus preventing loops. Attached Figure Description

[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0039] Figure 1 This is a schematic diagram illustrating the application scenario of the cross-device link aggregation group provided in this application;

[0040] Figure 2 This is a loop diagram of the cross-device link aggregation group provided in this application;

[0041] Figure 3 Another schematic diagram of the loop in the cross-device link aggregation group provided in this application;

[0042] Figure 4 This is a schematic diagram illustrating loop prevention in cross-device link aggregation groups in existing technologies;

[0043] Figure 5 A vulnerability diagram illustrating the loop prevention mechanism of existing cross-device link aggregation groups provided in this application;

[0044] Figure 6 A flowchart illustrating a method for preventing loops in cross-device link aggregation groups provided in this application. Figure 1 ;

[0045] Figure 7 A flowchart illustrating a method for preventing loops in cross-device link aggregation groups provided in this application. Figure 2 ;

[0046] Figure 8 A flowchart illustrating a method for preventing loops in cross-device link aggregation groups provided in this application. Figure 3 ;

[0047] Figure 9 A schematic diagram of the anti-loop device for cross-device link aggregation groups provided in this application;

[0048] Figure 10 A schematic diagram of the structure of the electronic device provided in this application.

[0049] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0050] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0051] First, let me explain the terms used in this application:

[0052] M-Lag is a cross-device link aggregation technology. By aggregating links between two access switches and user-side devices or servers in the same state across devices, it improves link reliability from the single board level to the device level.

[0053] VLAN tag: A virtual local area network tag, which is an end-to-end logical network tag built on the basis of a switched local area network using network management software, and can span different network segments and different networks.

[0054] VRRP (Virtual Router Redundancy Protocol) is a routing protocol proposed by the IETF to address the single point of failure issue that occurs when a static gateway is configured in a local area network (LAN). VRRP is widely used in edge networks. Its design goal is to support seamless IP data traffic failover under specific circumstances, allow hosts to use a single router, and maintain connectivity between routers even if the actual first-hop router fails. This message is sent via multicast.

[0055] Figure 1 This is a schematic diagram illustrating the application scenario of the cross-device link aggregation group provided in this application, such as... Figure 1 As shown, network device 1 and network device 2 form a cross-device M-Lag link aggregation group for server 1 and server 2. Server 1 and server 2 use VRRP addresses to provide services to the outside world. Under normal circumstances, the heartbeat between the VRRP maintenance system of server 1 and server 2 is transmitted through network device 1.

[0056] Figure 2 This is a loop diagram of the cross-device link aggregation group provided in this application, such as... Figure 2 As shown, when the links between network device 1 and server 1 and server 2 fail, taking the forwarding of VRRP packets from server 1 to server 2 as an example, according to the processing mechanism of cross-device link aggregation group, network device 1 will forward the VRRP packet to network device 2 through the interconnection link between network device 1 and network device 2. When network device 2 receives the VRRP packet, it will forward it to server 1, resulting in a brief loop and affecting the abnormal application processing of server 1.

[0057] Figure 3 This is another schematic diagram of the loop in the cross-device link aggregation group provided in this application. Figure 3 As shown, a brief loop can cause downstream devices such as servers to receive unreasonable messages, resulting in system or application processing abnormalities. Current technology can cause loops during the transient state of a link failure, which can lead to a loop in the network for a period of time, causing the sending device to receive its own original message.

[0058] Figure 4 This is a schematic diagram illustrating loop prevention in existing cross-device link aggregation groups, such as... Figure 4 As shown, existing methods for preventing loops in cross-device link aggregation groups generally use port blocking. A server connected to two network devices forms an aggregation group. When both devices in the cross-device link aggregation group are functioning normally, broadcast, unknown unicast, and multicast packets received from the interconnection cable between the devices will no longer be sent to the same aggregation group. That is, network device 2 will no longer send packets to server 1 through the aggregation group port.

[0059] However, when a link in a link aggregation group fails, the isolation mechanism (such as port blocking or port isolation) is lifted to ensure that another device can take over and forward traffic from the failed link. This allows the device to continue transmitting service traffic during a failure. Figure 5 A vulnerability diagram illustrating the loop prevention mechanism of existing cross-device link aggregation groups provided in this application is shown below. Figure 5As shown, network device 1 and network device 2 form an aggregation group. When a link failure occurs between one of the network devices and the downstream server device, network device 2 detects the failure of network device 1 and opens the isolation aggregation group port. At this time, there may still be broadcast, multicast, and unknown unicast packets being forwarded by the interconnection link. Network device 2 will send the packets to server 1, and a loop will occur.

[0060] In view of the above problems, this application provides a method for preventing loops in cross-device link aggregation groups. A VLAN tag resource is reserved on the network device to identify packets from the same link aggregation group. This VLAN tag should be inconsistent with the service VLAN tag. When an interface receives multicast, broadcast, or unknown unicast packets, the VLAN tag is inserted into the forwarded data packets. When the outgoing interface is an interconnection interface between cross-device link aggregation peer devices, the VLAN tag is retained and forwarded to the peer device. When the peer device receives a packet with the VLAN tag and forwards it from an outgoing interface that is a member port of the link aggregation group, it checks whether the tag is consistent. If they are consistent, the packet is not forwarded, thus avoiding the generation of loops.

[0061] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0062] Figure 6 A flowchart illustrating a method for preventing loops in cross-device link aggregation groups provided in this application. Figure 1 ,like Figure 6 As shown, the method includes the following steps:

[0063] S101, The first network device receives the first message sent by the server.

[0064] In this step, the first network device receives a message from the server. This message may be a data packet, multicast, broadcast, or unknown unicast message.

[0065] Optionally, the first message is a Virtual Router Redundancy Protocol (VRRP) message.

[0066] S102. The first network device adds a VLAN tag to the first packet to identify the cross-device link aggregation port, and obtains the second packet. The same cross-device link aggregation port of the first network device and the second network device are pre-assigned the same VLAN tag. The VLAN tag is used to identify the link aggregation group from which the packet comes.

[0067] The first network device inserts a special VLAN tag into the received packet to identify that the packet comes from a link aggregation group. This VLAN tag is different from the VLAN tag used for actual service traffic; it is specifically used to identify the link aggregation group.

[0068] These VLAN tags are pre-assigned and guaranteed to be identical across the aggregation group of related devices to ensure consistency throughout the entire link aggregation group. For example, a first network device has aggregation port 1 and aggregation port 2, and a second network device also has aggregation port 1 and aggregation port 2. The first and second network devices form a cross-device link aggregation group. Therefore, the VLAN tag for aggregation port 1 on the first network device is the same as the VLAN tag for aggregation port 1 on the second network device. Similarly, the VLAN tag for aggregation port 2 on the first network device is the same as the VLAN tag for aggregation port 2 on the second network device.

[0069] S103. If the first message output interface is a cross-device link aggregation peer interface, then the first network device will forward the second message to the peer second network device.

[0070] In this step, when the first network device receives a packet from the server through an aggregation port (e.g., aggregation port 1), the first network device needs to determine the packet forwarding path based on various factors, namely, whether it should be aggregated through the same cross-device link to the peer interface, a different aggregation port, or a non-aggregation port. These factors mainly involve traffic load balancing strategies, MAC address learning, routing decisions, and the working mode of link aggregation protocols (such as LACP).

[0071] In one specific implementation, within a Link Aggregation Group (LAG), network devices typically employ load balancing algorithms to determine how to distribute traffic across different physical links. For example, the hash value of the source and destination MAC addresses might be used to determine which aggregation interface traffic should be forwarded through. Sometimes, the forwarding path is determined based on a combination of source and destination IP addresses. For specific TCP traffic, load balancing can also be performed using source and destination ports. If traffic belongs to the same session or flow, and the load balancing strategy determines to send it to aggregation port 1, the traffic will continue to pass through the same aggregation port. Conversely, if the load balancing algorithm decides to distribute traffic to different aggregation ports, different physical links will be selected for forwarding.

[0072] In one specific implementation, when a packet arrives at aggregation port 1, the device binds the source MAC address in the packet to aggregation port 1 and learns it in the forwarding table. If the device has already learned the destination MAC address and the corresponding outgoing interface of the destination MAC address has been determined in the forwarding table, then the device will determine which interface the destination device should forward through based on the MAC address table. This could be the same aggregation port, a different aggregation port, or a non-aggregation port.

[0073] In one specific implementation, if the link aggregation interface has the LACP protocol enabled, the device will exchange LACP messages with the peer to determine which physical links are in an aggregated state and which are not. LACP will negotiate a set of aggregated links, and the device will select appropriate links to forward traffic based on the LACP configuration.

[0074] If the first network device decides to forward the packet through the peer interface of the cross-device link aggregation group (i.e., the packet is passed to another device through the cross-device link aggregation group), the first device retains the VLAN tag and forwards the packet to the peer device.

[0075] S104. The second network device determines whether the forwarding interface is a link aggregation port based on the second message.

[0076] After receiving the second packet with a VLAN tag, the second network device determines the outgoing interface of the packet according to its forwarding rules. At this time, the second device checks the destination address, traffic type, and other information of the packet to determine whether it needs to be forwarded through a member interface of the link aggregation group.

[0077] S105. If the forwarding interface is a link aggregation port, then verify whether the VLAN tag in the second packet is the same as the VLAN tag pre-assigned to the link aggregation port of the outgoing interface.

[0078] If the second device decides to forward a packet from the link aggregation port, it will check whether the VLAN tag in the packet is consistent with the VLAN tag pre-assigned to the outgoing interface.

[0079] If the VLAN tags are consistent, it means that the packet is traffic within the same link aggregation group (i.e., the packet has been forwarded by devices within the aggregation group). In this case, it is necessary to prevent the generation of loops.

[0080] S106. If the VLAN tag in the second message is the same as the VLAN tag pre-assigned to the link aggregation port of the outgoing interface, then stop forwarding the second message.

[0081] If the VLAN tag matches (meaning the packet has already passed through the device in the loop and was attempted to be forwarded again), the second device will stop forwarding the packet. This avoids loops and prevents the same packet from being forwarded repeatedly in the network.

[0082] This embodiment provides a method for preventing loops in cross-device link aggregation groups. The method includes: a first network device receiving a first packet sent by a server; the first network device adding a VLAN tag to the first packet to identify the cross-device link aggregation port, resulting in a second packet, where the VLAN tag identifies the link aggregation group from which the packet originates; if the outgoing interface of the first packet is the peer interface of the cross-device link aggregation, the first network device forwards the second packet to the peer second network device; the second network device determines whether the forwarding interface is a link aggregation port based on the second packet; if the forwarding interface is a link aggregation port, it checks whether the VLAN tag in the second packet is the same as the pre-allocated VLAN tag of the link aggregation port of the outgoing interface; if the VLAN tag in the second packet is the same as the pre-allocated VLAN tag of the link aggregation port of the outgoing interface, it stops forwarding the second packet. By using this method, when a network device sends a packet to a downstream server, if the VLAN tag in the packet matches the pre-marked tag, the packet is not forwarded, thus preventing loops.

[0083] Based on the above embodiments, the following section introduces forwarding strategies for several other judgment scenarios.

[0084] Figure 7 A flowchart illustrating a method for preventing loops in cross-device link aggregation groups provided in this application. Figure 2 ,like Figure 7 As shown, the method includes the following steps:

[0085] S107. If the forwarding interface of the second message is not a link aggregation port, the second network device deletes the VLAN tag used to identify the cross-device link aggregation port in the second message, obtains the third message, and forwards it.

[0086] In this step, within a link aggregation environment, the VLAN tag is used to identify which link aggregation group a packet belongs to. Since the outgoing interface is not a link aggregation port, the second network device needs to delete the VLAN tag used to identify the link aggregation. This is because the VLAN tag is used to identify traffic across device link aggregation groups; without the participation of link aggregation, the tag is no longer valid. After deleting the VLAN tag, the second network device receives the new packet (i.e., the third packet) and forwards it in the normal manner.

[0087] S108. If the VLAN tag in the second message is different from the VLAN tag pre-assigned to the link aggregation port of the outgoing interface, the second network device deletes the VLAN tag used to identify the cross-device link aggregation port, obtains the fourth message, and forwards it.

[0088] In this step, each Link Aggregator (LAG) will have a corresponding pre-assigned VLAN tag. If the VLAN tag in the packet does not match the VLAN tag of the outgoing interface, it means that the packet does not need to be forwarded through the same aggregation port as the first device, but should be forwarded through the new aggregation port. In this case, the second network device needs to delete the original VLAN tag and forward the packet.

[0089] S109. If the first packet output interface is not the cross-device link aggregation peer interface, the first network device deletes the VLAN tag used to identify the cross-device link aggregation port, obtains the fifth packet, and forwards it.

[0090] If the outgoing interface of the packet is not the peer interface of the link aggregation, then the VLAN tag identifying the link aggregation is no longer valid. To avoid inconsistent VLAN tags affecting network forwarding, the first network device will delete the VLAN tag. After deleting the VLAN tag, the first network device receives a new packet (i.e., the fifth packet) and then continues to process the packet according to the normal forwarding logic.

[0091] This embodiment enables the dynamic handling of VLAN tag changes in link aggregation, ensuring that the VLAN identifier of the link aggregation port always matches the outgoing interface during packet forwarding, thus avoiding forwarding errors caused by inconsistent VLAN tags. Deleting a VLAN tag is a protective mechanism to ensure that link aggregation is correctly applied and forwarded across different devices.

[0092] The following example illustrates the method for preventing loops in cross-device link aggregation groups.

[0093] Figure 8 A flowchart illustrating a method for preventing loops in cross-device link aggregation groups provided in this application. Figure 3 ,like Figure 8 As shown.

[0094] The server sends a message to aggregation port 1 of network device 1; aggregation port 1 receives broadcast, multicast, and unknown unicast messages and adds VLAN tag 1 to the original message.

[0095] The message format is explained below:

[0096] The added message includes two layers of VLAN tags: one layer to identify service traffic and the other layer to identify link aggregation groups (LAGs). This dual-tag VLAN mechanism allows for the identification of link aggregation groups without affecting the VLAN tags of service traffic.

[0097] An Ethernet frame structure typically includes the following parts: Destination MAC address (6 bytes), Source MAC address (6 bytes), Ethernet type (2 bytes), VLAN Tag (4 bytes), Payload (data) (46 to 1500 bytes), and FCS (Frame Check Sequence) (4 bytes). Each VLAN Tag field is 4 bytes long and has the following format: TPID: 2 bytes, used to identify the VLAN type, usually 0x8100, indicating an 802.1Q VLAN tag. TCI: 2 bytes, including the following fields: Priority (3 bits) priority field, used for QoS control; CFI (1 bit) used to identify whether the frame format conforms to the standard; VLAN ID (12 bits): VLAN identifier, used to identify the VLAN.

[0098] This application's solution uses a dual VLAN tagging mechanism, adding an external VLAN tag in addition to the traditional VLAN tag. The external VLAN tag identifies the link aggregation group. This tag is not propagated externally; it is only used between devices to distinguish different aggregation ports. The internal VLAN tag identifies the actual service traffic.

[0099] For example, suppose a packet already contains a service VLAN tag, such as VLAN Tag 100, and needs to be supplemented with an aggregation port VLAN Tag 1 to identify the cross-device link aggregation group. When the link aggregation group port receives the packet, it will add the aggregation port VLAN tag (e.g., VLAN Tag 1) to the outer layer of the packet according to the configuration. This means that a packet that originally only had the service VLAN Tag 100 will now become a packet with two layers of VLAN tags. Outer tag (VLAN Tag 1): Identifies the aggregation port, not exposed externally, and is used exclusively for identifying the link aggregation group between devices. Inner tag (VLAN Tag 100): Still the VLAN tag for the service traffic, used for external traffic identification.

[0100] The final message will be in the following format: | Destination MAC address | Source MAC address | Type (EtherType) | VLAN Tag 1 (aggregation port) | VLAN Tag 100 (service traffic) | Data load | FCS |.

[0101] Network device 1 also has an aggregation port 2, which is assigned the identifier VLAN tag 2. All packets transmitted through aggregation port 2 must retain VLAN tag 2.

[0102] The VLAN tag for a pair of cross-device link aggregation group devices should be bound to the physical interface of the aggregation group. The specific number of reserved tags depends on the actual number of physical interfaces on the devices. In other words, there can be multiple aggregation ports. This VLAN is not exposed externally and is used for port identification. For example, if both devices have port 1 in aggregation group 1, then the VLAN tag is defined as 1.

[0103] Network device 1 also has a non-aggregated port, and packets transmitted through the non-aggregated port do not need to retain the VLAN tag that identifies the aggregated port.

[0104] Network device 1 also has a cross-link aggregation interconnection interface, through which it connects to the cross-link aggregation interconnection interface of network device 2. Broadcast, multicast, and unknown unicast packets with VLAN tags are sent to the peer device via the cross-link aggregation interconnection interface.

[0105] Similarly, network device 2 has aggregation port 1 and aggregation port 2. The identifier assigned to aggregation port 1 is VLAN tag 1, and the identifier assigned to aggregation port 2 is VLAN tag 2.

[0106] Network device 2 also has a non-aggregated port. Packets transmitted through the non-aggregated port do not need to retain the VLAN tag identifying the aggregated port. When sending packets, the VLAN tag needs to be removed from both the non-aggregated and non-aggregated ports of network device 1 and network device 2.

[0107] For network device 2, packets transmitted through aggregation port 1 need to retain VLAN tag 1, and packets transmitted through aggregation port 2 need to retain VLAN tag 2.

[0108] Aggregator port 1 does not forward broadcast, multicast, or unknown unicast packets with the same VLAN tag 1, thus avoiding the generation of loops.

[0109] Similarly, if the packet received by network device 2 is identified by VLAN tag 2, the aggregation port 2 of the second network device will not forward broadcast, multicast, or unknown unicast packets with VLAN tag 2.

[0110] This solution introduces a novel method for preventing loops in cross-device link aggregation groups. This method primarily utilizes the VLAN field in the Ethernet frame header to carry the original link aggregation group information to the peer. The peer then determines the forwarding rules based on the method's rules, thus preventing brief loops in the event of a link aggregation group failure. If the packet received by the link aggregation group port already contains a VLAN tag, an additional tag is added for identification. The tag used by the service and the reserved aggregation tag cannot be duplicated to prevent conflicts. The forwarding device determines its forwarding behavior according to the method based on the judgment of the reserved aggregation tag.

[0111] It should be noted that in the above embodiments, the roles of the first network device and the second network device can change, that is, the second network device receives the message and sends it to the first network device.

[0112] Figure 9 A schematic diagram of the anti-loop device for cross-device link aggregation groups provided in this application is shown below. Figure 9 As shown, the cross-device link aggregation group anti-loop device 90 provided in this embodiment includes:

[0113] Receiving module 901 is used to receive the first message sent by the server;

[0114] The message processing module 902 is used to add a VLAN tag of the cross-device link aggregation port to the first message to obtain a second message, wherein the VLAN tag is used to indicate the link aggregation group from which the message comes;

[0115] The sending module 903 is used to forward the second message to the peer network device if the first message output interface is a cross-device link aggregation peer interface;

[0116] The determination module 904 is used to determine whether the forwarding interface is a link aggregation port based on the second message;

[0117] The verification module 905 is used to verify whether the VLAN tag in the second packet is the same as the VLAN tag pre-assigned to the link aggregation port of the outgoing interface if the forwarding interface is a link aggregation port.

[0118] The anti-loop module 906 is used to stop forwarding the second packet if the VLAN tag in the second packet is the same as the VLAN tag pre-assigned by the link aggregation port of the outgoing interface.

[0119] Optionally, the message processing module 902 is specifically used for:

[0120] A VLAN tag representing the cross-device link aggregation group identifier is inserted into the Ethernet frame header of the first packet to obtain the second packet. The second packet includes two layers of VLAN tags: a first layer VLAN tag for identifying service traffic and a second layer VLAN tag for identifying the cross-device link aggregation group. The first layer VLAN tag and the second layer VLAN tag are different.

[0121] Optionally, the sending module 903 is further configured to:

[0122] If the forwarding interface of the second message is not a link aggregation port, the second network device deletes the VLAN tag used to identify the cross-device link aggregation port in the second message, obtains the third message, and forwards it.

[0123] Optionally, the sending module 903 is further configured to:

[0124] If the VLAN tag in the second message is different from the VLAN tag pre-assigned to the link aggregation port of the outgoing interface, the second network device deletes the VLAN tag used to identify the cross-device link aggregation port, obtains the fourth message, and forwards it.

[0125] Optionally, the sending module 903 is further configured to:

[0126] If the first packet output interface is not the peer interface of the cross-device link aggregation, the first network device deletes the VLAN tag used to identify the cross-device link aggregation interface, obtains the fifth packet, and forwards it.

[0127] Optionally, the first message is a Virtual Router Redundancy Protocol (VRRP) message.

[0128] The cross-device link aggregation group anti-loop device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0129] Figure 10 This is a schematic diagram of the structure of the electronic device provided in this application. The electronic device can be a first network device or a second network device. Figure 10 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.

[0130] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.

[0131] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0132] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0133] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0134] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0135] This application also provides a system for preventing loops in cross-device link aggregation groups, the cross-device link aggregation group anti-loop system including at least a first network device, a second network device and a server; the same cross-device link aggregation port of the first network device and the second network device is pre-assigned the same VLAN tag.

[0136] The first network device is used to perform the method described in any one of the above method embodiments on the first network device side;

[0137] The first network device may also perform any of the methods described on the second network device side in the above method embodiments;

[0138] The second network device is used to perform any of the methods described in the above method embodiments on the second network device side.

[0139] The second network device can also perform any of the methods described in the above method embodiments on the first network device side.

[0140] In addition, the server in the cross-device link aggregation group anti-loop system provided in this application only refers to the downstream device of the cross-device link aggregation group.

[0141] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0142] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0143] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0144] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0145] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0146] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0147] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0148] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0149] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0150] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for preventing loops in cross-device link aggregation groups, characterized in that, An application to a cross-device link aggregation group system, wherein the cross-device link aggregation group system includes at least a first network device, a second network device, and a server, the method comprising: The first network device receives the first message sent by the server; The first network device adds a VLAN tag to the first packet to identify the cross-device link aggregation port, and obtains a second packet. The same cross-device link aggregation port of the first network device and the second network device are pre-assigned the same VLAN tag. The VLAN tag is used to identify the link aggregation group from which the packet comes. If the first message output interface is a cross-device link aggregation peer interface, then the first network device will forward the second message to the peer second network device; The second network device determines whether the forwarding interface is a link aggregation port based on the second message; If the forwarding interface is a link aggregation port, then verify whether the VLAN tag in the second packet is the same as the VLAN tag pre-assigned to the link aggregation port of the outgoing interface. If the VLAN tag in the second packet is the same as the VLAN tag pre-assigned to the link aggregation port of the outgoing interface, then the forwarding of the second packet will stop.

2. The method according to claim 1, characterized in that, The first network device adds a VLAN tag for the cross-device link aggregation port to the first packet to obtain a second packet, which includes: A VLAN tag representing the cross-device link aggregation group identifier is inserted into the Ethernet frame header of the first packet to obtain the second packet. The second packet includes two layers of VLAN tags: a first layer VLAN tag for identifying service traffic and a second layer VLAN tag for identifying the cross-device link aggregation group. The first layer VLAN tag and the second layer VLAN tag are different.

3. The method according to claim 1 or 2, characterized in that, The method further includes: If the forwarding interface of the second message is not a link aggregation port, the second network device deletes the VLAN tag used to identify the cross-device link aggregation port in the second message, obtains the third message, and forwards it.

4. The method according to claim 1 or 2, characterized in that, The method further includes: If the VLAN tag identifying the cross-device link aggregation port in the second message is different from the VLAN tag pre-assigned to the link aggregation port of the outgoing interface, the second network device deletes the VLAN tag used to identify the cross-device link aggregation port, obtains the fourth message, and forwards it.

5. The method according to claim 1 or 2, characterized in that, The method further includes: If the first packet output interface is not the peer interface of the cross-device link aggregation, the first network device deletes the VLAN tag used to identify the cross-device link aggregation interface, obtains the fifth packet, and forwards it.

6. The method according to claim 1 or 2, characterized in that, The first message is a Virtual Router Redundancy Protocol (VRRP) message.

7. A device for preventing loops in cross-device link aggregation groups, characterized in that, The device includes: The receiving module is used to receive the first message sent by the server; The message processing module is used to add a VLAN tag of the cross-device link aggregation port to the first message to obtain a second message, wherein the VLAN tag is used to indicate the link aggregation group from which the message comes; The sending module is configured to forward the second message to the peer's second network device if the first message output interface is a cross-device link aggregation peer interface; The determination module is used to determine whether the forwarding interface is a link aggregation port based on the second message; The verification module is used to verify whether the VLAN tag in the second packet is the same as the VLAN tag pre-assigned to the link aggregation port of the outgoing interface if the forwarding interface is a link aggregation port. The anti-loop module is used to stop forwarding the second packet if the VLAN tag in the second packet is the same as the VLAN tag pre-assigned by the link aggregation port of the outgoing interface.

8. A system for preventing loops in cross-device link aggregation groups, characterized in that, The cross-device link aggregation anti-loop system includes at least a first network device, a second network device, and a server; the same cross-device link aggregation ports of the first network device and the second network device are pre-assigned the same VLAN tag; The first network device is configured to perform the method as described in any one of claims 1-6; The second network device is used to perform the method as described in any one of claims 1-6.

9. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Ethernet looped network link polymerization group protecting method and device

    CN102208999A

  • Method and device for preventing loop from forming

    CN102752190A