Cross-device link aggregation group ring prevention method, device, equipment and system

By adding and verifying VLAN tags in the cross-device link aggregation group, the problems arising from loops during link failure are solved, and the high reliability and redundancy of the network are achieved.

CN119544598AActive Publication Date: 2025-02-28AGRICULTURAL BANK OF CHINA
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In cross-device link aggregation groups, it is difficult for the prior art to effectively avoid the generation of loops, especially during link failure periods.

Method used

By adding a VLAN tag to the message to identify the aggregation port of the cross-device link, and verifying at the receiving end whether the VLAN tag is consistent with the pre-allocated VLAN tag, if it is consistent, the forwarding of the message will be stopped, thereby avoiding the generation of the loop.

Benefits of technology

It effectively avoids loop problems in cross-device link aggregation groups, ensuring high reliability and redundancy of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544598A_ABST
    Figure CN119544598A_ABST
Patent Text Reader

Abstract

The invention provides a cross-device link aggregation group ring prevention method, device, equipment and system, and the method comprises the steps that first network equipment receives a first message sent by a server, and adds a VLAN tag used for identifying a cross-device link aggregation port into the first message to obtain a second message, and the VLAN tag is used for identifying a link aggregation group from which the message comes; if the first message output interface is a cross-device link aggregation opposite-end interface, forwarding the second message to a second network device at the opposite end; the second network equipment determines whether a forwarding sending interface of the second message is a link aggregation port or not; if the forwarding outgoing interface is a link aggregation port, verifying whether the VLAN tag in the second message is the same as the VLAN tag allocated by the link aggregation port of the outgoing interface; and if yes, stopping forwarding the second message. Through the method, when the VLAN tag in the message is consistent with the pre-marked VLAN tag, the message is not forwarded, so that the generation of a loop is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Cross-device link aggregation is a common technical means to improve the high reliability and redundancy of the network. It aggregates the cross-device links of one device with those of two other devices, thereby improving the link reliability from the single-board level to the device level to form an active-active system.

[0003] The current technology has achieved cross-link aggregation group loop prevention in a steady state, but short-term loop problems still exist in some fault scenarios. To solve this problem, the existing cross-device link aggregation group loop prevention method generally adopts a port blocking isolation mechanism. However, when a link failure occurs between the link aggregation device and the downstream device, the normal device senses the failure of the opposite device and opens the isolated aggregation group port. At this time, there may still be broadcast, multicast, unknown unicast and other messages in the forwarding process. After opening the isolated aggregation group port, the downstream device will still receive its own original message and the loop will still occur.

[0004] Therefore, how to avoid loops in cross-device link aggregation groups is an issue that needs to be addressed urgently. Summary of the invention

[0005] The present application provides a method, apparatus, device and system for preventing loops in a cross-device link aggregation group, so as to solve the problem of avoiding loops in a cross-device link aggregation group.

[0006] In a first aspect, the present application provides a method for preventing loops in a cross-device link aggregation group, which is 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 a first message sent by the server;

[0008] The first network device adds a VLAN tag for identifying an inter-device link aggregation port to the first message to obtain a second message, wherein the same inter-device link aggregation port of the first network device and the second network device is pre-assigned with the same VLAN tag, and the VLAN tag is used to identify the link aggregation group from which the message comes;

[0009] If the first message outgoing interface is an inter-device link aggregation peer interface, the first network device forwards the second message to the second network device at the peer end;

[0010] The second network device determines, according to the second message, whether the forwarding interface is a link aggregation interface;

[0011] If the outgoing interface is a link aggregation interface, checking whether the VLAN tag in the second message is the same as the VLAN tag pre-assigned by the link aggregation interface of the outgoing interface;

[0012] If the VLAN tag in the second message is the same as the VLAN tag pre-assigned by the link aggregation interface of the outgoing interface, forwarding the second message is stopped.

[0013] Optionally, the first network device adds a VLAN tag of an inter-device link aggregation port to the first message to obtain a second message, including:

[0014] Insert a VLAN tag used to indicate an inter-device link aggregation group identifier into the Ethernet frame header of the first message to obtain the second message, wherein the second message includes two layers of VLAN tags, a first layer of VLAN tag is used to identify service traffic, and a second layer of VLAN tag is used to identify an inter-device link aggregation group, and the first layer of VLAN tag and the second layer of VLAN tag are different.

[0015] Optionally, the method further includes:

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

[0017] Optionally, the method further includes:

[0018] If the VLAN tag in the second message is different from the VLAN tag pre-assigned by 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 message output interface is not the peer interface of the inter-device link aggregation, the first network device deletes the VLAN tag used to identify the inter-device link aggregation interface, obtains the fifth message and forwards it.

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

[0022] In a second aspect, the present application further provides a device for preventing loops in a cross-device link aggregation group, the device comprising:

[0023] A receiving module, used for receiving a first message sent by the server;

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

[0025] a sending module, configured to forward the second message to the second network device at the opposite end if the first message output interface is an inter-device link aggregation opposite end interface;

[0026] A determination module, used to determine whether the forwarding interface is a link aggregation interface according to the second message;

[0027] a verification module, configured to verify whether the VLAN tag in the second message is the same as the VLAN tag pre-assigned by the link aggregation interface of the outgoing interface if the outgoing interface is a link aggregation interface;

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

[0029] On the third aspect, the present application also provides a cross-device link aggregation group anti-loop system, which includes 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 with the same VLAN tag.

[0030] The first network device is used to execute the method as described in any one of the first aspects;

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

[0032] In a fourth aspect, the present application further provides an electronic device, comprising: a memory, a processor;

[0033] The memory stores computer-executable instructions;

[0034] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method as described in any one of the first aspects.

[0035] In a fifth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.

[0036] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0037] The present application provides a method, apparatus, device and system for preventing loops in a cross-device link aggregation group. The method includes: a first network device receives a first message sent by a server, and adds a VLAN tag for identifying a cross-device link aggregation port to the first message to obtain a second message, wherein the VLAN tag is used to identify the link aggregation group from which the message comes; if the first message output interface is a cross-device link aggregation peer interface, the second message is forwarded to the peer second network device; the second network device determines whether the second message is forwarded from a link aggregation port; if the second message is forwarded from a link aggregation port, the VLAN tag in the second message is the same as the VLAN tag assigned to the link aggregation port of the output interface; if they are the same, the second message is stopped from being forwarded. By using this method, when the VLAN tag in the message is consistent with the pre-tagged one, the message is not forwarded, thereby avoiding the generation of loops. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 Schematic diagram of application scenarios of cross-device link aggregation groups provided for this application;

[0040] Figure 2 A loop diagram of a cross-device link aggregation group provided for this application;

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

[0042] Figure 4 A schematic diagram of loop prevention for a cross-device link aggregation group in the prior art;

[0043] Figure 5 A schematic diagram of loop prevention vulnerabilities of existing cross-device link aggregation groups provided for this application;

[0044] Figure 6 A schematic diagram of a method for preventing loops in a cross-device link aggregation group provided in this application Figure 1 ;

[0045] Figure 7 A schematic diagram of a method for preventing loops in a cross-device link aggregation group provided in this application Figure 2 ;

[0046] Figure 8 A schematic diagram of a method for preventing loops in a cross-device link aggregation group provided in this application Figure 3 ;

[0047] Fig. 9 A schematic diagram of the structure of the device for preventing loops in cross-device link aggregation groups provided by the present application;

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

[0049] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0051] First, the terms involved in this application are explained:

[0052] M-Lag: is a cross-device link aggregation technology. It improves the reliability of the link from the single board to the device level by performing cross-device link aggregation with the user-side device or server in the same state between two access switches.

[0053] Vlan tag: Virtual LAN tag, a logical network tag that is built on a switched LAN using network management software and can span end-to-end across different network segments and networks.

[0054] VRRP: Virtual Router Redundancy Protocol (VRRP) is a routing protocol proposed by IETF to solve the single point failure phenomenon of static gateway configuration in LAN. VRRP is widely used in edge networks. Its design goal is to support the failure transfer of IP data traffic in certain situations without causing confusion, allowing hosts to use a single router, and maintaining connectivity between routers even when the actual first-hop router fails. This message is sent by multicast.

[0055] Figure 1 The schematic diagram of the application scenario of the cross-device link aggregation group provided for this application is as follows: 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 externally. Under normal circumstances, the heartbeat between the VRRP maintenance systems between server 1 and server 2 passes through network device 1.

[0056] Figure 2 A loop diagram of a cross-device link aggregation group provided for this application, such as Figure 2 As shown, when the link between network device 1 and server 1 and server 2 fails, taking the VRRP message forwarding from server 1 to server 2 as an example, according to the processing mechanism of the cross-device link aggregation group, network device 1 will forward the VRRP message to network device 2 through the interconnection link between network device 1 and network device 2. When network device 2 receives the VRRP message, it will forward it to server 1, resulting in a short loop, affecting the application processing abnormality of server 1.

[0057] Figure 3 Another schematic diagram of the loop of the cross-device link aggregation group provided by this application, Figure 3 As shown, due to a short loop, the downstream devices such as servers receive unreasonable messages and generate system or application processing exceptions. The current technology has a loop when a link fails transiently, which will cause a loop in the network for a period of time after the failure, causing the sending device to receive its own originally sent message.

[0058] Figure 4 FIG. 1 is a schematic diagram of loop prevention of a cross-device link aggregation group in the prior art, such as Figure 4 As shown, the existing method for preventing loops in cross-device link aggregation groups generally adopts port blocking. A server is connected to two network devices as an aggregation group. When both devices in the cross-device link aggregation group are normal, the broadcast, unknown unicast, and multicast messages 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 messages to server 1 through the aggregation group port.

[0059] However, when a link failure occurs on a device in the link aggregation group, the isolation mechanism (such as port blocking or port isolation) will be released to ensure that another device can take over and forward the traffic of the failed link. In this way, the device can continue to transmit business traffic when a failure occurs. Figure 5 A schematic diagram of loop prevention vulnerabilities of existing cross-device link aggregation groups provided for this application is shown in FIG. 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 senses 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 messages being forwarded by the interconnection link. Network device 2 will send the message to server 1, and a loop will occur.

[0060] In view of the above problems, the present application provides a method for preventing loops in cross-device link aggregation groups, and reserves identification Vlan tag resources on network devices to identify messages from the same link aggregation group. The Vlan tag and service Vlan tag should be inconsistent. When the interface receives multicast, broadcast, or unknown unicast, the identification vlan tag is inserted into the forwarded data message. When the outgoing interface is an interconnection interface of a cross-device link aggregation peer device, the identification vlan tag is retained and forwarded to the peer device. When the peer device receives a message marked with the vlan tag and forwards it, if the outgoing interface is a link aggregation member port, the tag is checked to see if it is consistent. If it is consistent, the message is not forwarded, thereby avoiding the generation of loops.

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

[0062] Figure 6 A schematic diagram of a method for preventing loops in a cross-device link aggregation group provided in this application Figure 1 ,like Figure 6 As shown, the method comprises the following steps:

[0063] S101. A first network device receives a first message sent by a server.

[0064] In this step, the first network device receives a message from the server, and the 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 for identifying an inter-device link aggregation port in the first message to obtain a second message, wherein the same inter-device link aggregation port of the first network device and the second network device is pre-assigned with the same VLAN tag, and the VLAN tag is used to identify the link aggregation group from which the message comes.

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

[0068] This VLAN tag is pre-assigned and guaranteed to be the same in the aggregation group of related devices so as to maintain consistency in the entire link aggregation group. For example, the first network device has aggregation port 1 and aggregation port 2, and the second network device also has aggregation port 1 and aggregation port 2. The first network device and the second network device are an inter-device link aggregation group. The VLAN tag of aggregation port 1 on the first network device is the same as the VLAN tag of aggregation port 1 on the second network device. The VLAN tag of aggregation port 2 on the first network device is the same as the VLAN tag of aggregation port 2 on the second network device.

[0069] S103: If the first message outgoing interface is an inter-device link aggregation peer interface, the first network device forwards the second message to a second network device at the peer end.

[0070] In this step, when the first network device receives a message sent by the server from an aggregation port (e.g., aggregation port 1), the first network device needs to determine the forwarding path of the message based on multiple factors, that is, whether it should pass through the same cross-device link aggregation peer interface, different aggregation ports, or non-aggregation ports. 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 a specific implementation, in a link aggregation group (LAG), network devices usually use a load balancing algorithm to decide how to distribute traffic to different physical links. For example, based on the hash value of the source MAC address and the destination MAC address, it is decided through which aggregation interface the traffic should be forwarded. Sometimes, the forwarding path is determined based on the combination of the source IP address and the destination IP address. For specific TCP traffic, load balancing can also be performed by source port and destination port. If the traffic belongs to the same session or flow, and the load balancing policy decides 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 the traffic to different aggregation ports, different physical links will be selected for forwarding.

[0072] In a specific implementation, when a message arrives at Aggregation Port 1, the device will bind the source MAC address in the message to Aggregation Port 1 and learn it into the forwarding table. If the device has previously learned the target MAC address, and the corresponding outbound interface of the target MAC address has been determined in the forwarding table, the device will determine which interface the target device should forward through based on the MAC address table, which may be the same Aggregation Port, or different Aggregation Ports or non-Aggregation Ports.

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

[0074] If the first network device decides to forward the message through the peer interface of the inter-device link aggregation group (ie, the message is transmitted to another device through the inter-device link aggregation group), the first device retains the VLAN tag and forwards the message to the peer device.

[0075] S104: The second network device determines, according to the second message, whether the forwarding interface is a link aggregation interface.

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

[0077] S105: If the outgoing interface is a link aggregation interface, check whether the VLAN tag in the second message is the same as the VLAN tag pre-assigned by the link aggregation interface of the outgoing interface.

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

[0079] If the VLAN tags are consistent, it means that the message is traffic within the same link aggregation group (that is, the message has been forwarded by the devices in the aggregation group). In this case, it is necessary to prevent loops from occurring.

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

[0081] If the VLAN tags are the same (i.e. the packet has passed through the device in the loop and is trying 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 a cross-device link aggregation group, the method comprising: a first network device receives a first message sent by a server; the first network device adds a VLAN tag for identifying a cross-device link aggregation port in the first message to obtain a second message, the VLAN tag being used to identify the link aggregation group from which the message comes; if the outgoing interface of the first message is the opposite end interface of the cross-device link aggregation, the first network device forwards the second message to the opposite end second network device; the second network device determines whether the outgoing interface is a link aggregation port according to the second message; if the outgoing interface is a link aggregation port, checking whether 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; 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, stopping forwarding the second message. By this method, when the network device sends a message to a downstream server, if the VLAN tag in the message is consistent with the pre-tagged one, the message is not forwarded, thereby avoiding the generation of loops.

[0083] Based on the above embodiment, several other forwarding strategies for judging situations are introduced below.

[0084] Figure 7 A schematic diagram of a method for preventing loops in a cross-device link aggregation group provided in this application Figure 2 ,like Figure 7 As shown, the method comprises the following steps:

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

[0086] In this step, in a link aggregation environment, the VLAN tag is used to identify which link aggregation group the message 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 the traffic of the cross-device link aggregation group. If there is no link aggregation involved, the tag is no longer valid. After deleting the VLAN tag, the second network device obtains a new message (i.e., the third message) and forwards it in a conventional manner.

[0087] S108. If the VLAN tag in the second message is different from the VLAN tag pre-assigned by 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 a fourth message, and forwards it.

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

[0089] S109: If the outgoing interface of the first message is not the peer interface of the inter-device link aggregation, the first network device deletes the VLAN tag used to identify the inter-device link aggregation interface, obtains the fifth message, and forwards it.

[0090] If the outgoing interface of the message is not the link aggregation peer interface, the VLAN tag identifying the link aggregation is no longer valid. In order to prevent inconsistent VLAN identification from affecting network forwarding, the first network device deletes the VLAN tag. After deleting the VLAN tag, the first network device obtains a new message (i.e., the fifth message), and then continues to process the message according to the normal forwarding logic.

[0091] This embodiment can realize the processing of dynamic changes of VLAN tags in link aggregation, ensuring that the VLAN identifier of the link aggregation port always matches the outbound interface during the message forwarding process, avoiding forwarding errors caused by inconsistent VLAN tags. The action of deleting VLAN tags is a protection mechanism to ensure that link aggregation is correctly applied and forwarded between different devices.

[0092] The following is an introduction to the method of preventing loops in cross-device link aggregation groups using a specific example.

[0093] Figure 8 A schematic diagram of a method for preventing loops in a cross-device link aggregation group provided in this application Figure 3 ,like Figure 8 shown.

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

[0095] The following is an explanation of the message format:

[0096] The added message includes two layers of VLAN tags, one for identifying service traffic and the other for identifying link aggregation group (LAG) information. This dual-tag VLAN mechanism allows link aggregation groups to be identified without affecting the VLAN tags of service traffic.

[0097] The Ethernet frame structure usually 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), FCS (frame check sequence) (4 bytes). Each VLAN Tag field has 4 bytes and the format is as follows: TPID: 2 bytes, used to identify the VLAN type, usually 0x8100, indicating that this is an 802.1Q VLAN tag. TCI: 2 bytes, including the following fields: Priority (3 bits) priority field, used for QoS control; CFI (1 bit) is used to identify whether the frame format complies with the standard; VLAN ID (12 bits): VLAN identifier, used to identify the VLAN.

[0098] The solution of this application uses a dual VLAN tag mechanism, adding an external VLAN tag in addition to the traditional VLAN tag. Among them, the external VLAN tag is used to identify the link aggregation group. This tag is not transmitted externally and is only used between devices to distinguish different aggregation ports. The internal VLAN tag is used to identify the actual business traffic.

[0099] For example, assume that the message already contains a service VLAN tag, such as VLAN Tag 100, and it is necessary to add the aggregation port VLAN Tag 1 on this basis to identify the cross-device link aggregation group. After the link aggregation group port receives the message, it will add the aggregation port VLAN Tag (such as VLAN Tag 1) to the outer layer of the message according to the configuration. This means that the message that originally only had the service VLAN Tag 100 will now become a message with a double VLAN tag. Outer tag (VLAN Tag 1): identifies the aggregation port, is not reflected externally, and is dedicated to identifying the link aggregation group between devices. Inner tag (VLAN Tag 100): is still the VLAN tag of the service traffic, and is used to identify the traffic externally.

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

[0101] The network device 1 further includes an aggregation port 2, and an identifier assigned to the aggregation port 2 is VLAN tag 2. All packets transmitted through the aggregation port 2 need to retain the VLAN tag 2.

[0102] The VLAN tag of 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 ports depends on the actual number of physical interfaces of the device. In other words, there can be multiple aggregation ports. This VLAN is not used to identify the port. For example, if port 1 of both devices is aggregation group 1, the VLAN tag is defined as 1.

[0103] The network device 1 further has a non-aggregation port, and the message transmitted through the non-aggregation port does not need to retain the VLAN tag identifying the aggregation port.

[0104] The network device 1 also has a cross-link aggregation interconnection interface, through which it is connected to the cross-link aggregation interconnection interface of the network device 2. The cross-link aggregation interconnection interface sends broadcast, multicast, and unknown unicast messages with VLAN tags to the peer device.

[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-aggregation port, and the packets transmitted through the non-aggregation port do not need to retain the VLAN tag identifying the aggregation port. When sending packets, the non-aggregation ports of network device 1 and network device 2, as well as the non-aggregation ports, need to remove the VLAN tag.

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

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

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

[0110] This solution newly creates a method that can be used in cross-device link aggregation group anti-loop devices. This method mainly uses the vlan field in the Ethernet frame header to carry the original link aggregation group information of the message to the other end. The other end determines the forwarding rule according to the method rules to prevent the problem of short-term looping in the case of link aggregation group failure. If the message received by the link aggregation group port already contains a vlan tag, another layer of tag is added for identification. The service use tag and the reserved aggregation tag cannot be repeated 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 may change, that is, the second network device receives a message and sends it to the first network device.

[0112] Fig. 9 A schematic diagram of the structure of the device for preventing loops in cross-device link aggregation groups provided by the present application, such as Fig. 9 As shown, the apparatus 90 for preventing loops in a cross-device link aggregation group provided in this embodiment includes:

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

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

[0115] A sending module 903, configured to forward the second message to the second network device at the opposite end if the first message output interface is an inter-device link aggregation opposite end interface;

[0116] A determination module 904, configured to determine whether the forwarding interface is a link aggregation interface according to the second message;

[0117] a verification module 905, configured to verify whether the VLAN tag in the second message is the same as the VLAN tag pre-assigned by the link aggregation interface of the outgoing interface if the outgoing interface is a link aggregation interface;

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

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

[0120] Insert a VLAN tag used to indicate an inter-device link aggregation group identifier into the Ethernet frame header of the first message to obtain the second message, wherein the second message includes two layers of VLAN tags, a first layer of VLAN tag is used to identify service traffic, and a second layer of VLAN tag is used to identify an inter-device link aggregation group, and the first layer of VLAN tag and the second layer of VLAN tag are different.

[0121] Optionally, the sending module 903 is further used for:

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

[0123] Optionally, the sending module 903 is further used for:

[0124] If the VLAN tag in the second message is different from the VLAN tag pre-assigned by 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 used for:

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

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

[0128] The device for preventing loops in cross-device link aggregation groups provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effects are similar, and are not described in detail in this embodiment.

[0129] Fig.10 This is a schematic diagram of the structure of an electronic device provided in this application. The electronic device can be a first network device or a second network device. Fig.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 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.

[0130] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.

[0131] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment 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 (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.

[0133] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[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. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0135] The present application also provides a cross-device link aggregation group anti-loop system, which includes 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 with the same VLAN tag.

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

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

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

[0139] The second network device may also execute any method described in the first network device side in the above method embodiments.

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

[0141] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0142] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0143] The above-mentioned 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 memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0144] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium 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 be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0145] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

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

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

[0148] If the function is implemented in the form of 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0149] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0150] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for preventing loops in a cross-device link aggregation group, characterized in that: Applied to an inter-device link aggregation group system, the inter-device link aggregation group system includes at least a first network device, a second network device and a server, and the method includes: The first network device receives a first message sent by the server; The first network device adds a VLAN tag for identifying an inter-device link aggregation port to the first message to obtain a second message, wherein the same inter-device link aggregation port of the first network device and the second network device is pre-assigned with the same VLAN tag, and the VLAN tag is used to identify the link aggregation group from which the message comes; If the first message outgoing interface is an inter-device link aggregation peer interface, the first network device forwards the second message to the second network device at the peer end; The second network device determines, according to the second message, whether the forwarding interface is a link aggregation interface; If the outgoing interface is a link aggregation interface, checking whether the VLAN tag in the second message is the same as the VLAN tag pre-assigned by the link aggregation interface of the outgoing interface; If the VLAN tag in the second message is the same as the VLAN tag pre-assigned by the link aggregation interface of the outgoing interface, forwarding the second message is stopped.

2. The method according to claim 1, characterized in that The first network device adds a VLAN tag of the cross-device link aggregation port to the first message to obtain a second message, including: Insert a VLAN tag used to indicate an inter-device link aggregation group identifier into the Ethernet frame header of the first message to obtain the second message, wherein the second message includes two layers of VLAN tags, a first layer of VLAN tag is used to identify service traffic, and a second layer of VLAN tag is used to identify an inter-device link aggregation group, and the first layer of VLAN tag and the second layer of VLAN tag are different.

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

4. The method according to claim 1 or 2, characterized in that: The method further comprises: If the VLAN tag in the second message is different from the VLAN tag pre-assigned by 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 comprises: If the first message output interface is not the peer interface of the inter-device link aggregation, the first network device deletes the VLAN tag used to identify the inter-device link aggregation interface, obtains the fifth message 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 a cross-device link aggregation group, characterized in that: The device comprises: A receiving module, used for receiving a first message sent by a server; a message processing module, configured to add a VLAN tag of a cross-device link aggregation port to the first message to obtain a second message, wherein the VLAN tag is used to indicate a link aggregation group from which the message comes; a sending module, configured to forward the second message to the second network device at the opposite end if the first message output interface is an inter-device link aggregation opposite end interface; A determination module, used to determine whether the forwarding interface is a link aggregation interface according to the second message; a verification module, configured to verify whether the VLAN tag in the second message is the same as the VLAN tag pre-assigned by the link aggregation interface of the outgoing interface if the outgoing interface is a link aggregation interface; The anti-loop module is used to stop forwarding the second message if the VLAN tag in the second message 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 group anti-loop system comprises 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 with the same VLAN tag; The first network device is used to execute the method according to any one of claims 1 to 6; The second network device is used to execute the method according to any one of claims 1-6.

9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

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

Citation Information

Patent Citations

  • Ethernet looped network link polymerization group protecting method and device

    CN102208999A

  • Method and device for preventing loop from forming

    CN102752190A

  • Traffic backup method and core switching equipment

    CN103368775A

  • Message isolation method and device

    CN116781453A

  • Method and apparatus for MPLS label allocation for a BGP mac-vpn

    US20110286452A1