A message forwarding method and device, electronic equipment and storage medium

By establishing a physical link between the user equipment and the first switching device, and establishing a Layer 2 tunnel between the first switching device and the second switching device, and using loopback processing to achieve MLAG aggregation of the remote switching device, the problem of traffic load sharing caused by the long distance between the user equipment and the switching device is solved, and a low-cost load sharing effect is achieved.

CN119172303BActive Publication Date: 2025-11-25NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In cross-device link aggregation groups, if a user equipment is close to one switching device and far from another, traffic load balancing cannot be achieved, and the networking cost is high. User equipment can only be physically connected to the closer switching device.

Method used

By establishing a physical link between the user equipment and the first switching device, and establishing a Layer 2 tunnel between the first switching device and the second switching device, loopback processing is used to simulate receiving the original packets on the second switching device, thereby realizing MLAG aggregation on the remote switching device and achieving traffic load sharing at a lower cost.

Benefits of technology

With a user equipment physically connected to an MLAG switch, traffic load balancing is achieved, reducing networking costs, and the user equipment is unaware of the specific forwarding method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172303B_ABST
    Figure CN119172303B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a message forwarding method and device, electronic equipment and storage medium, relates to the communication technical field, is applied to the first switching device and the second switching device included in MLAG, the first port is connected with the user equipment through the physical link, the first port is connected with the second port through the second layer tunnel, and the aggregation member port of MLAG includes the second port;The first switching device receives the first original message sent by the user equipment through the first port, encapsulates the first original message to obtain the first tunnel message, and sends the first tunnel message to the second switching device through the second layer tunnel;The second switching device carries out the decapsulation processing to the first tunnel message and obtains the first original message, loops back the first original message to the second port, and sends the first original message to the three layer network device.The technical scheme provided by the embodiment of the application can realize the traffic load sharing in the case that the user equipment is physically connected with one MLAG switching device.
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 message forwarding method, apparatus, electronic device, and storage medium. Background Technology

[0002] Multi-Chassis Link Aggregation (MLAG) is a technology that enables cross-device link aggregation. By aggregating a user device with two switching devices across devices, it improves link reliability from the board level to the device level, thereby providing device-level redundancy protection and traffic load balancing.

[0003] However, in practical applications, there are situations where user equipment (UE) is located close to one switch and far from another. In this case, considering networking costs, UE can only be physically connected to the closer switch and cannot be physically connected to the farther switch. If UE is only physically connected to one switch, the goal of traffic load balancing cannot be achieved. Summary of the Invention

[0004] The purpose of this application is to provide a message forwarding method, apparatus, electronic device, and storage medium to achieve traffic load balancing when a user equipment is physically connected to an MLAG switching device. The specific technical solution is as follows:

[0005] In a first aspect, embodiments of this application provide a message forwarding method applied to a first switching device included in an MLAG, wherein the MLAG further includes a second switching device, a first port on the first switching device is connected to a user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel, wherein the aggregated member port of the MLAG includes the second port, and the method includes:

[0006] Receive the first raw message sent by the user equipment through the first port;

[0007] The first original message is encapsulated to obtain the first tunnel message;

[0008] The first tunnel message is sent to the second switching device through the Layer 2 tunnel, so that the second switching device can decapsulate the first tunnel message to obtain the first original message, loop the first original message back to the second port, and send the first original message to the Layer 3 network device.

[0009] In some embodiments, the method further includes:

[0010] The second tunnel message sent by the second switching device is received through the second layer tunnel;

[0011] The second tunnel message is decapsulated to obtain the second original message;

[0012] The second original message is sent to the user equipment through the first port.

[0013] In some embodiments, the second original message carries an outgoing port field, the value of which is an identifier of the second port; the step of sending the second original message to the user equipment through the first port includes: modifying the source port identifier of the second original message to the value of the outgoing port field; sending the modified second original message to the user equipment through the first port; or,

[0014] The source port identifier of the second original message is the identifier of the second port; the step of sending the second original message to the user equipment through the first port includes: keeping the source port identifier of the second original message as the identifier of the second port; and sending the kept second original message to the user equipment through the first port.

[0015] In some embodiments, the aggregated member port of the MLAG further includes a third port on the first switching device, the third port being connected to the user equipment via a physical link; the method further includes:

[0016] The third raw message sent by the user equipment is received through the third port;

[0017] Send the third original message to the Layer 3 network device.

[0018] In some embodiments, the method further includes:

[0019] Receive the fourth raw message sent by the Layer 3 network device to the user equipment;

[0020] The fourth original message is sent to the user equipment through the third port.

[0021] Secondly, embodiments of this application provide a message forwarding method applied to a second switching device included in an MLAG. The MLAG further includes a first switching device, a first port on the first switching device is connected to a user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel. The aggregated member ports of the MLAG include the second port. The method includes:

[0022] The first tunnel message sent by the first switching device is received through the second-layer tunnel.

[0023] The first tunnel message is decapsulated to obtain the first original message;

[0024] Loop the first original message back to the second port;

[0025] Send the first original message to the Layer 3 network device.

[0026] In some embodiments, the method further includes:

[0027] Receive the second raw message sent by the Layer 3 network device to the user equipment;

[0028] Loop the second original message back to the second port;

[0029] The second original message is encapsulated to obtain the second tunnel message;

[0030] The second tunnel message is sent to the first switching device through the Layer 2 tunnel, so that the first switching device can decapsulate the second tunnel message to obtain the second original message, and send the second original message to the user equipment through the first port.

[0031] Thirdly, embodiments of this application provide a message forwarding device applied to a first switching device included in an MLAG, wherein the MLAG further includes a second switching device, a first port on the first switching device is connected to a user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel, wherein the aggregated member port of the MLAG includes the second port, and the device includes:

[0032] The first receiving module is configured to receive the first raw message sent by the user equipment through the first port;

[0033] The first encapsulation module is used to encapsulate the first original message to obtain the first tunnel message;

[0034] The first sending module is configured to send the first tunnel message to the second switching device through the Layer 2 tunnel, so that the second switching device can decapsulate the first tunnel message to obtain the first original message, loop the first original message back to the second port, and send the first original message to the Layer 3 network device.

[0035] In some embodiments, the apparatus further includes:

[0036] The third receiving module is used to receive the second tunnel message sent by the second switching device through the second layer tunnel;

[0037] The second decapsulation module is used to decapsulate the second tunnel packet to obtain the second original packet;

[0038] The third sending module is used to send the second original message to the user equipment through the first port.

[0039] In some embodiments, the second original message carries an outgoing port field, the value of which is an identifier of the second port; the third sending module is specifically configured to: modify the source port identifier of the second original message to the value of the outgoing port field; and send the modified second original message to the user equipment through the first port; or,

[0040] The source port identifier of the second original message is the identifier of the second port; the third sending module is specifically used to: keep the source port identifier of the second original message as the identifier of the second port; and send the kept second original message to the user equipment through the first port.

[0041] In some embodiments, the aggregation member port of the MLAG further includes a third port on the first switching device, the third port being connected to the user equipment via a physical link; the apparatus further includes:

[0042] The fourth receiving module is used to receive the third raw message sent by the user equipment through the third port;

[0043] The fourth sending module is used to send the third original message to the Layer 3 network device.

[0044] In some embodiments, the apparatus further includes:

[0045] The fifth receiving module is used to receive the fourth raw message sent by the Layer 3 network device to the user equipment;

[0046] The fifth sending module is used to send the fourth original message to the user equipment through the third port.

[0047] Fourthly, embodiments of this application provide a message forwarding device applied to a second switching device included in an MLAG. The MLAG further includes a first switching device, a first port on the first switching device is connected to a user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel. The aggregated member ports of the MLAG include the second port. The device includes:

[0048] The second receiving module is used to receive the first tunnel message sent by the first switching device through the second-layer tunnel;

[0049] The first decapsulation module is used to decapsulate the first tunnel packet to obtain the first original packet;

[0050] The first loopback module is used to loop back the first original message to the second port;

[0051] The second sending module is used to send the first original message to the Layer 3 network device.

[0052] In some embodiments, the apparatus further includes:

[0053] The sixth receiving module is used to receive the second raw message sent by the Layer 3 network device to the user equipment;

[0054] The second loopback module is used to loop back the second original message to the second port;

[0055] The second encapsulation module is used to encapsulate the second original message to obtain the second tunnel message;

[0056] The sixth sending module is used to send the second tunnel message to the first switching device through the Layer 2 tunnel, so that the first switching device can decapsulate the second tunnel message to obtain the second original message, and send the second original message to the user equipment through the first port.

[0057] Fifthly, embodiments of this application provide an electronic device including a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being prompted by the machine-executable instructions to implement the method described in either the first or second aspect above.

[0058] Sixthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described in either the first or second aspect above.

[0059] In a seventh aspect, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described in the first and second aspects of the above embodiments.

[0060] Beneficial effects of the embodiments in this application:

[0061] In the technical solution provided in this application embodiment, MLAG includes a first switching device and a second switching device. The user equipment is connected to a first port on the first switching device via a physical link, and the first port on the first switching device is connected to a second port on the second switching device via a Layer 2 tunnel. The user equipment transmits packets to the second switching device through the first port and the Layer 2 tunnel. The second switching device then uses loopback processing to simulate receiving the original packets sent by the user equipment, and thus the second switching device can use MLAG technology to process the original packets normally. Therefore, in this application embodiment, the mapping between the second port and the port on the user equipment is achieved through the first port on the first switching device and the Layer 2 tunnel, realizing MLAG aggregation on the remote second switching device. Thus, when the user equipment is physically connected to one MLAG switching device, there is no need for the user equipment to be physically connected to another MLAG switching device, achieving traffic load balancing at a lower networking cost.

[0062] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0064] Figure 1 This is a schematic diagram of a networking scenario;

[0065] Figure 2a A schematic diagram illustrating an uplink traffic forwarding scenario;

[0066] Figure 2b This is a schematic diagram of a downlink traffic forwarding scenario;

[0067] Figure 3 A schematic diagram of the structure of a message forwarding system provided in an embodiment of this application;

[0068] Figure 4 A first signaling diagram of the message forwarding method provided in the embodiments of this application;

[0069] Figure 5 This is a first schematic diagram of a two-layer tunnel forwarding provided in an embodiment of this application;

[0070] Figure 6 A second signaling diagram for the message forwarding method provided in the embodiments of this application;

[0071] Figure 7This is a second schematic diagram of a two-layer tunnel forwarding provided in an embodiment of this application;

[0072] Figure 8a This is a first schematic diagram of a forwarding scenario provided in an embodiment of this application;

[0073] Figure 8b This is a second schematic diagram of a forwarding scenario provided in an embodiment of this application;

[0074] Figure 9 A third signaling diagram for the message forwarding method provided in the embodiments of this application;

[0075] Figure 10 A fourth signaling diagram for the message forwarding method provided in the embodiments of this application;

[0076] Figure 11a A schematic diagram of an uplink traffic forwarding scenario provided in an embodiment of this application;

[0077] Figure 11b A schematic diagram of a downlink traffic forwarding scenario provided in an embodiment of this application;

[0078] Figure 12 A schematic diagram of a configuration port provided in an embodiment of this application;

[0079] Figure 13 This is a schematic diagram of the construction of a two-layer tunnel provided in an embodiment of this application;

[0080] Figure 14 This is a schematic diagram of a first type of message forwarding method provided in an embodiment of this application;

[0081] Figure 15 This is a second flowchart illustrating the message forwarding method provided in the embodiments of this application;

[0082] Figure 16 A schematic diagram of a first structure of a message forwarding device provided in an embodiment of this application;

[0083] Figure 17 This is a second structural schematic diagram of the message forwarding device provided in the embodiments of this application;

[0084] Figure 18 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0085] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0086] MLAG is a technology for cross-device link aggregation. By aggregating a user device with two switching devices across devices, it improves link reliability from the board level to the device level, thereby providing device-level redundancy protection and traffic load balancing.

[0087] However, in practical applications, there are situations where user equipment (UE) is located close to one switch and far from another. In this case, considering networking costs, UE can only be physically connected to the closer switch and cannot be physically connected to the farther switch. If UE is only physically connected to one switch, the goal of traffic load balancing cannot be achieved.

[0088] like Figure 1 In the network scenario shown, the switching device (MLAG-1) is deployed in Data Center (DC)-1, and the switching device (MLAG-2) is deployed in DC-2. MLAG-1 and MLAG-2 can establish an Intra-Portal Link (IPL) between their IPPs via an IntraPortal Port (IPP) to achieve a physical connection between them.

[0089] The user equipment (client) is deployed in DC-1, which is the same as MLAG-1. The user equipment is relatively close to MLAG-1. Therefore, the user equipment can establish one or more physical links with MLAG-1 through the Distributed Relay (DR) interface on MLAG-1 to realize the physical connection between the user equipment and MLAG-1.

[0090] The distance between DC-1 and DC-2 is relatively large. Consequently, the distance between the user equipment deployed in DC-1 and the MLAG-2 deployed in DC-2 is also large. Establishing a physical link between the user equipment and MLAG-2 is costly, and the user equipment cannot afford this expense. Therefore, the user equipment can only physically connect to MLAG-1, and cannot physically connect to MLAG-2; that is, the user equipment is solely connected to the MLAG.

[0091] In this case, Figure 2aThe uplink traffic forwarding scenario shown and Figure 2b In the downlink traffic forwarding scenario, ports P2 and P4 are DR interfaces. Layer 2 user equipment L2 establishes two physical links with MLAG-1 through ports P2 and P4; MLAG-1 establishes one physical link with Layer 3 network device L3 through port P6; and MLAG-2 establishes one physical link with Layer 3 network device L3 through port P7.

[0092] exist Figure 2a In the uplink traffic forwarding scenario shown, the user equipment sends all uplink traffic packets to MLAG-1. After receiving the uplink traffic packets through ports P2 and P4, MLAG-1 forwards the uplink traffic packets to the Layer 3 network device L3 through port P6.

[0093] exist Figure 2b In the downlink traffic forwarding scenario, the Layer 3 network device L3 sends all downlink traffic packets to MLAG-1. After receiving the downlink traffic packets through port P6, MLAG-1 forwards the downlink traffic packets to the user equipment through ports P2 and P4.

[0094] It is evident that when a user device is equipped with a single MLAG, the MLAG-2 cannot share the user device's traffic and cannot meet the user device's traffic load sharing requirements.

[0095] To address the aforementioned problems, embodiments of this application provide a message forwarding system, such as... Figure 3 As shown, the system includes a first switching device 31 and a second switching device 32. The first port 311 on the first switching device 31 is connected to the fourth port 331 of the user equipment 33 via a physical link. The third port 312 on the first switching device 31 is connected to the fifth port 332 of the user equipment 33 via a physical link. The first port 311 is connected to the second port 321 on the second switching device 32 via a Layer 2 tunnel. The aggregation member ports of MLAG include the second port 321 and the third port 312.

[0096] In this embodiment, the first switching device 31 and the second switching device 32 constitute an MLAG. The first switching device 31 is physically connected to the user equipment 33, such as... Figure 1 In MLAG-1, the second switching device 32 is not physically connected to the user equipment 33, such as... Figure 1 The MLAG-2 in the example. The number of the first port 311, the third port 312, and the second port 321 can be one or more. The user equipment 33 can be a Layer 2 (L2) forwarding device such as a mobile phone, personal computer, switching equipment, or routing equipment, and there is no limitation on this.

[0097] A Layer 2 tunnel is a virtual link established based on the IPL between the first and second switching devices. A Layer 2 tunnel can be a Virtual Local Area Network (VLAN) tunnel or an extended VLAN tunnel such as two-layer VLAN encapsulation (802.1Q-in-802.1Q, QinQ), and there are no restrictions on this.

[0098] In this embodiment, an internal loopback or an external loopback is configured on the second port 321 to ensure that messages can be sent and received within the second port 321. After configuring the internal loopback or external loopback on the second port 321, the active (UP) state of the second port 321 is enabled.

[0099] Based on the aforementioned message forwarding system, embodiments of this application provide a message forwarding method, such as... Figure 4 The first signaling diagram of the message forwarding method shown may include the following steps:

[0100] In step S41, user equipment 33 obtains the first original message corresponding to the second switching device 32.

[0101] In this embodiment of the application, the user equipment 33 can generate its own original uplink traffic packets or receive original uplink traffic packets sent by other devices.

[0102] After obtaining the original packet of the uplink traffic, user equipment 33 uses a traffic load balancing algorithm such as a hash algorithm to determine the switching device to perform load balancing, that is, to determine the switching device that processes the original packet. In this embodiment of the application, the original packet of the uplink traffic processed by the second switching device is referred to as the first original packet.

[0103] In step S42, the user equipment 33 determines the fourth port 331 corresponding to the second port 321 based on the pre-recorded correspondence between the aggregation member ports and the output ports.

[0104] In this embodiment, the output port is the port on the user equipment 33 that is connected to the corresponding aggregation member port. The user equipment 33 has pre-recorded the correspondence between the aggregation member ports and the output ports, such as the correspondence between the second port 321 and the fourth port 331, and the correspondence between the third port 312 and the fifth port 332.

[0105] After obtaining the first original message, the user equipment 33 can know that the aggregation member port of the second switching device is the second port 321, and then look up the pre-recorded correspondence between the aggregation member port and the output port to obtain the fourth port 331 corresponding to the second port 321.

[0106] In step S43, user equipment 33 sends the first raw message to first switching device 31 through fourth port 331.

[0107] After determining the fourth port 331, the user equipment 33 sends the first raw message to the first switching device 31 through the physical link between the fourth port 331 and the first switching device 31.

[0108] In step S44, the first switching device 31 receives the first raw message sent by the user equipment 33 through the first port 311.

[0109] The first port 311 of the first switching device 31 is physically connected to the fourth port 331. When the user equipment 33 sends the first original message through the fourth port 331, the first switching device 31 receives the first original message sent by the user equipment 33 through the first port 311. That is, the forwarding chip of the first switching device 31 receives the first original message sent by the user equipment 33.

[0110] In step S45, the first switching device 31 encapsulates the first original message to obtain the first tunnel message.

[0111] In this embodiment of the application, a two-layer tunnel is established between the first port 311 and the second port 321.

[0112] After receiving the first raw message through the first port 311, the first switching device 31 does not send the first raw message to the CPU of the first switching device 31 for processing. Instead, the forwarding chip of the first switching device 31 encapsulates the first raw message according to the Layer 2 tunnel configuration. The encapsulated first raw message is the first tunnel message. The first tunnel message can be forwarded through the Layer 2 tunnel.

[0113] For example, the Layer 2 tunnel is a VLAN tunnel, and the VLAN ID of the VLAN tunnel is 4000. The first switching device 31 encapsulates the first original packet with a VLAN tunnel tag header carrying the VLAN ID 4000, thus obtaining the first tunnel packet.

[0114] In step S46, the first switching device 31 sends a first tunnel message to the second switching device 32 through a two-layer tunnel.

[0115] After receiving the first tunnel message, the first tunnel message can be forwarded to the second switching device 32 via the second-level tunnel.

[0116] In this embodiment of the application, the two-layer tunnel allows all packets from the first port 311 to be directly transmitted to the other end (i.e., the second switching device 32).

[0117] In step S47, the second switching device 32 receives the first tunnel message sent by the first switching device 31 through the second layer tunnel.

[0118] The second port 321 of the second switching device 32 is connected to the first port 311 of the first switching device 31 via a Layer 2 tunnel. When the first switching device 31 sends a first tunnel message through the Layer 2 tunnel, the second switching device 32 receives the first tunnel message sent by the first switching device 31 through the Layer 2 tunnel. That is, the forwarding chip of the second switching device 32 receives the first tunnel message sent by the first switching device 31.

[0119] For example Figure 5 The diagram shows a Layer 2 tunnel forwarding scheme. The first port (P2) on MLAG-1 (the first switching device) and the second port (P1) on MLAG-2 (the second switching device) have their receive (Rx) and transmit (Tx) functions enabled, respectively. An IPL (Integrated Port Level) is established between IPP1 on MLAG-1 and IPP2 on MLAG-2. Based on the IPL, a VLAN tunnel is established between P2 and P1. The VLAN ID corresponding to this VLAN tunnel is 4000.

[0120] After receiving the original packet 1 through P2, MLAG-1's forwarding chip encapsulates the original packet 1 with a VLAN tunnel header carrying VLAN ID 4000, resulting in tunnel packet 1. MLAG-1's forwarding chip then transparently transmits tunnel packet 1 to MLAG-2 via IPL. MLAG-2's forwarding chip receives tunnel packet 1 via IPL and forwards it to P1. This completes the Layer 2 tunnel forwarding.

[0121] In step S48, the second switching device 32 decapsulates the first tunnel message to obtain the first original message.

[0122] After receiving the first tunnel packet through the second port 321, the forwarding chip of the second switching device 32 decapsulates the first tunnel packet according to the Layer 2 tunnel configuration. The decapsulated first tunnel packet is the first original packet. For example Figure 5 As shown, the MLAG-2 forwarding chip performs decapsulation processing to obtain the original message 1 for subsequent loopback processing.

[0123] In this embodiment, the Layer 2 tunnel can be a VLAN tunnel. In this case, the above decapsulation process can be as follows: the second switching device 32 removes the VLAN tunnel header from the first tunnel packet to obtain the first original packet.

[0124] In step S49, the second switching device 32 loops the first original message back to the second port 321.

[0125] After receiving the first original message, the second switching device 32 performs loopback processing on the second port 321 to simulate receiving the first original message sent by the user equipment 33. Then, the second switching device can use MLAG technology to process the first original message normally.

[0126] In step S410, the second switching device 32 sends the first raw message to the Layer 3 network device.

[0127] Among them, the Layer 3 network device is a network device that performs Layer 3 forwarding, and the Layer 3 network device can be a switching device or a routing device, etc.

[0128] After receiving the first original message, the second switching device 32 can report the first original message to the CPU of the second switching device 32. The CPU of the second switching device 32 uses MLAG technology to perform deep packet inspection and other processing on the first original message, and then sends the first original message to the Layer 3 (L3) network device.

[0129] In the technical solution provided in this application embodiment, MLAG includes a first switching device and a second switching device. The user equipment is connected to a first port on the first switching device via a physical link, and the first port on the first switching device is connected to a second port on the second switching device via a Layer 2 tunnel. The user equipment transmits packets to the second switching device through the first port and the Layer 2 tunnel. The second switching device then uses loopback processing to simulate receiving the original packets sent by the user equipment, and thus the second switching device can use MLAG technology to process the original packets normally. Therefore, in this application embodiment, the mapping between the second port and the port on the user equipment is achieved through the first port on the first switching device and the Layer 2 tunnel, realizing MLAG aggregation on the remote second switching device. Thus, when the user equipment is physically connected to one MLAG switching device, there is no need for the user equipment to be physically connected to another MLAG switching device, achieving traffic load balancing at a lower networking cost.

[0130] Based on the aforementioned message forwarding system, embodiments of this application provide a message forwarding method, such as... Figure 6 The second signaling diagram of the message forwarding method shown may include the following steps:

[0131] Step S61: The second switching device 32 receives the second original message sent by the Layer 3 network device to the user equipment 33.

[0132] In this embodiment, the Layer 3 network device receives the original packets of downlink traffic sent to user equipment 33 from the first data center, the second data center, other data centers, or servers. The Layer 3 network device uses a traffic load balancing algorithm, such as a hash algorithm, to determine the switching device that performs load balancing, i.e., the switching device that processes the original packet. In this embodiment, the original packet of downlink traffic processed by the second switching device is simply referred to as the second original packet.

[0133] When the switch device performing load balancing is determined to be the second switch device 32, the Layer 3 network device forwards the second original message to the second switch device 32, and then the second switch device 32 receives the second original message.

[0134] In step S62, the second switching device 32 loops the second original message back to the second port 321.

[0135] After receiving the second original message, the second switching device 32 performs loopback processing on the aggregation member port (i.e., the second port 321) to simulate sending the second original message to the user equipment 33. Then, the forwarding chip of the second switching device 32 can process the second original message normally.

[0136] In step S63, the second switching device 32 encapsulates the second original message to obtain the second tunnel message.

[0137] After the second original message loops back to the second port 321, that is, after the second switching device 32 receives the second original message again through the second port 321, it will not send the second original message to the CPU of the second switching device 32 for processing. Instead, the forwarding chip of the second switching device 32 will encapsulate the second original message according to the Layer 2 tunnel configuration. The encapsulated second original message is the second tunnel message. The second tunnel message can be forwarded through the Layer 2 tunnel.

[0138] For example, the second-layer tunnel is a VLAN tunnel, and the VLAN ID of the VLAN tunnel is 4000. The second switching device 32 encapsulates the second original packet with a VLAN tunnel header carrying the VLAN ID 4000, thus obtaining the second tunnel packet.

[0139] In step S64, the second switching device 32 sends a second tunnel message to the first switching device 31 through the second layer tunnel.

[0140] After receiving the second tunnel message, the second tunnel message can be forwarded to the first switching device 31 through the second-level tunnel.

[0141] In this embodiment of the application, the two-layer tunnel allows all packets on the second port 321 to be directly transmitted to the other end (i.e., the first switching device 31).

[0142] In step S65, the first switching device 31 receives the second tunnel message sent by the second switching device 32 through the second layer tunnel.

[0143] The second port 321 of the second switching device 32 is connected to the first port 311 of the first switching device 31 via a Layer 2 tunnel. When the second switching device 32 sends a second tunnel message through the Layer 2 tunnel, the first switching device 31 receives the second tunnel message sent by the second switching device 32 through the Layer 2 tunnel. That is, the forwarding chip of the first switching device 31 receives the second tunnel message sent by the second switching device 32.

[0144] For example Figure 7 The diagram shows a Layer 2 tunnel forwarding scheme. The first port (P2) on MLAG-1 (the first switching device) and the second port (P1) on MLAG-2 (the second switching device) have Rx and Tx functions enabled, respectively. An IPL is established between IPP1 on MLAG-1 and IPP2 on MLAG-2. Based on the IPL, a VLAN tunnel is established between P2 and P1. The VLAN ID corresponding to this VLAN tunnel is 4000.

[0145] After MLAG-2 receives the original packet 2 via loopback through P1, its forwarding chip encapsulates the original packet 2 with a VLAN tunnel header carrying VLAN ID 4000, resulting in tunnel packet 2. MLAG-2's forwarding chip then transparently transmits tunnel packet 2 to MLAG-1 via IPL. MLAG-1's forwarding chip receives tunnel packet 2 via IPL and forwards it to P2. This completes the Layer 2 tunnel forwarding.

[0146] In step S66, the first switching device 31 decapsulates the second tunnel message to obtain the second original message.

[0147] After receiving the second tunnel message through the first port 311, the first switching device 31 does not report the second tunnel message to the CPU of the first switching device 31. Instead, the forwarding chip of the first switching device 31 decapsulates the second tunnel message according to the Layer 2 tunnel configuration. The decapsulated second tunnel message is the second original message. For example Figure 7 As shown, the MLAG-1 forwarding chip performs decapsulation processing to obtain the original message 2.

[0148] In this embodiment, the Layer 2 tunnel can be a VLAN tunnel. In this case, the above decapsulation process can be as follows: the first switching device 31 removes the VLAN tunnel header from the second tunnel packet to obtain the second original packet.

[0149] In step S67, the first switching device 31 sends a second raw message to the user equipment 33 through the first port 311.

[0150] After receiving the second original message, the first switching device 31 forwards the second original message directly to the user equipment 33 through the first port 311.

[0151] In some embodiments, the first switching device 31 can achieve the user equipment 33's unawareness of the first switching device 31 in different ways.

[0152] In Method 1, the second switching device 32 can add an outgoing port field to the second original message. The second original message received by the first switching device 31 then carries the outgoing port field, the value of which is the identifier of the second port 321. In this case, the step of the first switching device 31 sending the second original message to the user equipment 33 through the first port 311 can be: modifying the source port identifier of the second original message to the value of the outgoing port field; and sending the modified second original message to the user equipment through the first port.

[0153] In this embodiment, before the first switching device 31 sends the second original message to the user equipment 33 through the first port 311, the first switching device 31 may not modify the source port identifier of the second original message to the identifier of the first port 311, but instead modify the source port identifier to the identifier of the second port 321, and then send the modified second original message to the user equipment 33. In this way, when the user equipment 33 receives the modified second original message, it can determine that the source port identifier is the identifier of the aggregation member port of MLAG, and consider the modified second original message to be the original message sent by the second switching device 32. This allows the user equipment 33 to be unaware of the specific forwarding method, achieving traffic load balancing at a lower networking cost.

[0154] Method 2: The source port identifier of the second original message obtained by the first switching device 31 is the identifier of the second port 321. In this case, the step of the first switching device 31 sending the second original message to the user equipment 33 through the first port 311 can be: keeping the source port identifier of the second original message as the identifier of the second port; sending the kept second original message to the user equipment through the first port.

[0155] In this embodiment, before the first switching device 31 sends the second original message to the user equipment 33 through the first port 311, the first switching device 31 prevents itself from modifying the source port identifier of the second original message to the identifier of the first port 311. Instead, it keeps the source port identifier as the identifier of the second port 321 and sends the kept second original message to the user equipment 33. In this way, when the user equipment 33 receives the kept second original message, the user equipment 33 can determine that the source port identifier is the identifier of the aggregation member port of MLAG, and consider that the modified second original message is the original message sent by the second switching device 32. This allows the user equipment 33 to be unaware of the specific forwarding method and achieves traffic load balancing with lower networking costs.

[0156] In this embodiment, when the user equipment does not care about the source port of the received packet, after receiving the second original packet, the first switching device 31 can directly send the second original packet to the user equipment 33, or it can modify the source port identifier of the second original packet to the identifier of the first port 311 before sending it to the user equipment 33. The processing of the second original packet by the first switching device 31 is not limited, and can be determined according to the actual forwarding strategy.

[0157] In step S68, user equipment 33 receives the second raw message sent by first switching device 31 through fourth port 331.

[0158] In this embodiment of the application, the first port 311 of the first switching device 31 is physically connected to the fourth port 331 of the user equipment 33. When the first switching device 31 sends a second original message to the user equipment 33 through the first port 311, the user equipment 33 receives the second original message through the fourth port 331.

[0159] In the technical solution provided in this application embodiment, MLAG includes a first switching device and a second switching device. The user equipment is connected to a first port on the first switching device via a physical link, and the first port on the first switching device is connected to a second port on the second switching device via a Layer 2 tunnel. The user equipment transmits packets to the second switching device through the first port and the Layer 2 tunnel. The second switching device then uses loopback processing to simulate sending the original packets to the user equipment. The second switching device then processes the original packets normally and uses the first switching device to send the original packets to the user equipment. Therefore, in this application embodiment, the mapping between the second port and the port on the user equipment is achieved through the first port on the first switching device and the Layer 2 tunnel, realizing MLAG aggregation on the remote second switching device. Thus, when the user equipment is physically connected to one MLAG switching device, there is no need for the user equipment to be physically connected to another MLAG switching device, achieving traffic load balancing at a lower networking cost.

[0160] Based on the above Figure 4 and Figure 6 The embodiments shown in this application are implemented through, as described above. Figure 8a The first port 311 on the first switching device 31, the Layer 2 tunnel established based on IPL, and the loopback processing of the second port 321 are used to receive (Rx) and forward (Tx) packets, thereby realizing the following: Figure 8b The mapping between the second port shown and the fourth port 331 on the user equipment establishes a virtual link between the user equipment and the second switching device, achieving non-direct connection MLAG aggregation of the remote second switching device.

[0161] Based on the aforementioned message forwarding system, embodiments of this application provide a message forwarding method, such as... Figure 9 The third signaling diagram of the message forwarding method shown may include the following steps:

[0162] In step S91, user equipment 33 obtains the third original message corresponding to the first switching device 31.

[0163] After obtaining the original packet of the uplink traffic, user equipment 33 uses a traffic load balancing algorithm such as a hash algorithm to determine the switching device to perform load balancing, that is, to determine the switching device that processes the original packet. In this embodiment of the application, the original packet of the uplink traffic processed by the first switching device 31 is referred to as the third original packet.

[0164] In step S92, the user equipment 33 determines the fifth port 332 corresponding to the third port 312 based on the pre-recorded correspondence between the aggregation member ports and the output ports.

[0165] After obtaining the third original message, the user equipment 33 can know that the aggregation member port of the first switching device 31 is the third port 312, and then look up the pre-recorded correspondence between the aggregation member port and the output port to obtain the fifth port 332 corresponding to the third port 312.

[0166] In step S93, user equipment 33 sends a third raw message to first switching device 31 through fifth port 332.

[0167] After determining the fifth port 332, the user equipment 33 sends the third original message to the first switching device 31 through the physical link between the fifth port 332 and the first switching device 31.

[0168] In step S94, the first switching device 31 receives the third raw message sent by the user equipment 33 through the third port 312.

[0169] The third port 312 of the first switching device 31 is physically connected to the fifth port 332. When the user equipment 33 sends a third original message through the fifth port 332, the first switching device 31 receives the third original message sent by the user equipment 33 through the third port 312.

[0170] In step S95, the first switching device 31 sends the third original message to the Layer 3 network device.

[0171] After receiving the third original message, the first switching device 31 can report the third original message to the CPU of the first switching device 31. The CPU of the first switching device 31 uses MLAG technology to perform deep packet inspection and other processing on the third original message, and then sends the third original message to the Layer 3 (L3) network device.

[0172] Based on the aforementioned message forwarding system, embodiments of this application provide a message forwarding method, such as... Figure 10 The fourth signaling diagram of the message forwarding method shown may include the following steps:

[0173] In step S101, the first switching device 31 receives the fourth original message sent by the Layer 3 network device to the user equipment 33.

[0174] In this embodiment, the Layer 3 network device receives the original packets of downlink traffic sent to user equipment 33 from the first data center, the second data center, other data centers, or servers. The Layer 3 network device uses a traffic load balancing algorithm, such as a hash algorithm, to determine the switching device that performs load balancing, i.e., the switching device that processes the original packet. In this embodiment, the original packet of downlink traffic processed by the first switching device is referred to as the fourth original packet.

[0175] When the first switching device 31 is determined to be the switching device performing load balancing, the Layer 3 network device forwards the fourth original message to the first switching device 31, and then the first switching device 31 receives the fourth original message.

[0176] In step S102, the first switching device 31 sends the fourth raw message to the user equipment 33 through the third port 312.

[0177] After receiving the fourth original message, the first switching device 31 sends the fourth original message to the user equipment 33 through the physical link between the aggregation member port (i.e., the third port 312) and the fifth port 332 of the user equipment 33.

[0178] In step S103, user equipment 33 receives the fourth raw message sent by first switching device 31 through fifth port 332.

[0179] In this embodiment, the third port 312 of the first switching device 31 is physically connected to the fifth port 332 of the user equipment 33. When the first switching device 31 sends a fourth original message to the user equipment 33 through the third port 312, the user equipment 33 receives the fourth original message through the fifth port 332.

[0180] Based on the above Figure 4 , Figure 6 , Figure 9 and Figure 10 The embodiment shown enables dual-homing uplink across DCs when a user equipment is single-connected to an MLAG in both uplink and downlink traffic forwarding scenarios, thus achieving load balancing of Layer 2 traffic.

[0181] For example, in Figure 11a The uplink traffic forwarding scenario shown and Figure 11b In the downlink traffic forwarding scenario, ports P2 and P4 are DR interfaces. Layer 2 user equipment L2 establishes two physical links with MLAG-1 through ports P2 and P4; MLAG-1 establishes one physical link with Layer 3 network device L3 through port P6; and MLAG-2 establishes one physical link with Layer 3 network device L3 through port P7.

[0182] exist Figure 11a In the uplink traffic forwarding scenario shown, the user equipment sends all uplink traffic packets to MLAG-1. After receiving the uplink traffic packets through port P2, MLAG-1 forwards the packets to MLAG-2 via IPL, and MLAG-2 then forwards the uplink traffic packets to the Layer 3 network device L3 through port P7. After receiving the uplink traffic packets through port P4, MLAG-1 forwards the uplink traffic packets to the Layer 3 network device L3 through port P6.

[0183] exist Figure 11b In the downlink traffic forwarding scenario shown, the Layer 3 network device L3 sends downlink traffic packets to MLAG-1 and MLAG-2 respectively. After receiving the downlink traffic packet through port P6, MLAG-1 forwards the downlink traffic packet to the user equipment through port P4. After receiving the downlink traffic packet through port P7, MLAG-2 transparently transmits the packet to MLAG-1 through IPL, and MLAG-1 then forwards the downlink traffic packet to the user equipment through port P2.

[0184] This enables MLAG aggregation between MLAG-1 and MLAG-2, achieving load balancing of Layer 2 traffic.

[0185] In this embodiment, before packet forwarding, administrators can configure MLAG information on the first and second switching devices through management equipment, enabling the first and second switching devices to form an MLAG. Administrators can also configure a Layer 2 tunnel between the first and second switching devices and a loopback port on the second switching device. The configuration processes are described in detail below.

[0186] 1) The user equipment is connected to the first switching device via at least two physical links, and the first switching device is connected to the second switching device via IPL.

[0187] 2) The user configures a port (e.g., port 3) on the first switching device that is physically connected to the user equipment as an aggregation member port of the MLAG. Additionally, the user configures an idle port (e.g., port 2) on the second switching device as an aggregation member port of the MLAG, configures port 2 for loopback, and then enables port 2. A Layer 2 tunnel is established between another port (e.g., port 1) on the first switching device that is physically connected to the user equipment and port 2. Ports 1 and 2 enable the Layer 2 tunnel, and configure the Layer 2 tunnel to allow aggregated VLANs to pass through; that is, configure the IPL between the first and second switching devices to allow aggregated VLANs to pass through. Ports 1, 2, and 3 are allowed to pass the same VLANs. Furthermore, the user configures ports 1 and 2 for encapsulation and decapsulation processing.

[0188] In this embodiment of the application, a port loopback module can be configured on the second switching device. Using the port loopback module, port 2 is configured. For details, please refer to [link to relevant documentation]. Figure 12 As shown, it includes: enabling the loopback function of port 2 and setting the port status to UP; adding port 2 to the aggregation group and adding the aggregation group to MLAG, that is, making port 2 an aggregation member port of MLAG; enabling the Layer 2 tunnel corresponding to port 2, so that the forwarding chip of the second switching device can be used to decapsulate the packets from the Layer 2 tunnel and encapsulate the packets for forwarding into the Layer 2 tunnel.

[0189] Layer 2 tunneling modules can be configured on both the first and second switching devices. These modules can be used to establish Layer 2 tunnels and enable packet forwarding. For details, please refer to [link to documentation]. Figure 13 As shown:

[0190] The first switching device enables the VLAN tunnel label on port 1, such as 4000. This VLAN tunnel label is used for MLAG data interaction; therefore, this VLAN tunnel label can also be called the MLAG tunnel label. The hardware entry for port 1 is configured, such as writing the tunnel label 4000, the correspondence between port 1 and port 2, etc., into the hardware entry for port 1. According to the hardware entry for port 1, the forwarding chip of the first switching device encapsulates the tunnel label into the packet. The forwarding chip of the first switching device forwards the encapsulated packet to the IPP of the first switching device, and then forwards the encapsulated packet to the IPP of the second switching device via IPL.

[0191] The forwarding chip of the second switching device receives the encapsulated packet via IPP and forwards it to port 2 of the second switching device. The second switching device configures hardware entries for port 2, such as writing tunnel tag 4000 and the correspondence between port 1 and port 2. The forwarding chip of the second switching device decapsulates the encapsulated packet according to the hardware entries for port 2, obtaining the original packet after decapsulation. In this embodiment, the order in which the hardware entries are configured on port 1 and port 2 is not limited. By configuring the hardware entries on port 1 and port 2, a Layer 2 tunnel can be established between port 1 and port 2, and the corresponding packet forwarding can be achieved.

[0192] In the technical solution provided in this application embodiment, a virtual MLAG is established across devices and ports through Layer 2 VLAN tunneling technology and port loopback technology. The remote port (such as the second port of the second switching device mentioned above) is mirrored to the local port (such as the first port of the first switching device mentioned above), thereby achieving MLAG aggregation of the remote device (such as the second switching device mentioned above). This enables dual-homed uplink and downlink packet forwarding across DCIs in the MLAG single-attached scenario, solving the problem of traffic load balancing and thus greatly reducing the high cost of cross-distance and cross-regional links.

[0193] Corresponding to the aforementioned message forwarding system, this application also provides a message forwarding method, see below. Figure 14 The method is applied to a first switching device included in MLAG, and MLAG also includes a second switching device. A first port on the first switching device is connected to a user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel. The aggregation member port of MLAG includes the second port. The above message forwarding method includes the following steps.

[0194] Step S141: Receive the first raw message sent by the user equipment through the first port;

[0195] Step S142: Encapsulate the first original message to obtain the first tunnel message;

[0196] Step S143: Send a first tunnel message to the second switching device through a Layer 2 tunnel, so that the second switching device can decapsulate the first tunnel message to obtain the first original message, loop the first original message back to the second port, and send the first original message to the Layer 3 network device.

[0197] In the technical solution provided in this application embodiment, MLAG includes a first switching device and a second switching device. The user equipment is connected to a first port on the first switching device via a physical link, and the first port on the first switching device is connected to a second port on the second switching device via a Layer 2 tunnel. The user equipment transmits packets to the second switching device through the first port and the Layer 2 tunnel. The second switching device then uses loopback processing to simulate receiving the original packets sent by the user equipment, and thus the second switching device can use MLAG technology to process the original packets normally. Therefore, in this application embodiment, the mapping between the second port and the port on the user equipment is achieved through the first port on the first switching device and the Layer 2 tunnel, realizing MLAG aggregation on the remote second switching device. Thus, when the user equipment is physically connected to one MLAG switching device, there is no need for the user equipment to be physically connected to another MLAG switching device, achieving traffic load balancing at a lower networking cost.

[0198] In some embodiments, the above-described message forwarding method may further include the following steps: receiving a second tunnel message sent by a second switching device through a Layer 2 tunnel; decapsulating the second tunnel message to obtain a second original message; and sending the second original message to a user equipment through a first port.

[0199] In some embodiments, the second original message carries an outgoing port field, the value of which is an identifier of the second port; the step of sending the second original message to the user equipment through the first port may include: modifying the source port identifier of the second original message to the value of the outgoing port field; sending the modified second original message to the user equipment through the first port; or,

[0200] The source port identifier of the aforementioned second original message is the identifier of the second port; the step of sending the second original message to the user equipment through the first port may include: keeping the source port identifier of the second original message as the identifier of the second port; and sending the kept second original message to the user equipment through the first port.

[0201] In some embodiments, the aggregation member port of MLAG may further include a third port on the first switching device, the third port being connected to the user equipment via a physical link; the above-described packet forwarding method may further include the following steps: receiving a third original packet sent by the user equipment through the third port; and sending the third original packet to the Layer 3 network device.

[0202] In some embodiments, the above-described message forwarding method may further include the following steps: receiving a fourth original message sent by a Layer 3 network device to a user equipment; and sending the fourth original message to the user equipment through a third port.

[0203] Corresponding to the aforementioned message forwarding system, this application also provides a message forwarding method, see below. Figure 15 The method is applied to the second switching device included in MLAG. MLAG also includes a first switching device. The first port on the first switching device is connected to the user equipment via a physical link, and the first port is connected to the second port on the second switching device via a Layer 2 tunnel. The aggregation member port of MLAG includes the second port. The above packet forwarding method includes the following steps.

[0204] Step S151: Receive the first tunnel message sent by the first switching device through the second-layer tunnel;

[0205] Step S152: Decapsulate the first tunnel message to obtain the first original message;

[0206] Step S153: Loop the first original message back to the second port;

[0207] Step S154: Send the first raw message to the Layer 3 network device.

[0208] In the technical solution provided in this application embodiment, MLAG includes a first switching device and a second switching device. The user equipment is connected to a first port on the first switching device via a physical link, and the first port on the first switching device is connected to a second port on the second switching device via a Layer 2 tunnel. The user equipment transmits packets to the second switching device through the first port and the Layer 2 tunnel. The second switching device then uses loopback processing to simulate receiving the original packets sent by the user equipment, and thus the second switching device can use MLAG technology to process the original packets normally. Therefore, in this application embodiment, the mapping between the second port and the port on the user equipment is achieved through the first port on the first switching device and the Layer 2 tunnel, realizing MLAG aggregation on the remote second switching device. Thus, when the user equipment is physically connected to one MLAG switching device, there is no need for the user equipment to be physically connected to another MLAG switching device, achieving traffic load balancing at a lower networking cost.

[0209] In some embodiments, the above-described packet forwarding method may further include the following steps: receiving a second original packet sent by a Layer 3 network device to a user equipment; looping the second original packet back to a second port; encapsulating the second original packet to obtain a second tunnel packet; and sending the second tunnel packet to a first switching device through a Layer 2 tunnel, so that the first switching device decapsulates the second tunnel packet to obtain a second original packet, and then sends the second original packet to the user equipment through the first port.

[0210] Corresponding to the aforementioned message forwarding system, this application also provides a message forwarding device, see below. Figure 16 The packet forwarding device is applied to a first switching device included in MLAG, which also includes a second switching device. A first port on the first switching device is connected to a user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel. The aggregation member port of MLAG includes the second port. The aforementioned packet forwarding device includes:

[0211] The first receiving module 161 is used to receive the first raw message sent by the user equipment through the first port;

[0212] The first encapsulation module 162 is used to encapsulate the first original message to obtain the first tunnel message;

[0213] The first sending module 163 is configured to send the first tunnel message to the second switching device through the Layer 2 tunnel, so that the second switching device can decapsulate the first tunnel message to obtain the first original message, loop the first original message back to the second port, and send the first original message to the Layer 3 network device.

[0214] In the technical solution provided in this application embodiment, MLAG includes a first switching device and a second switching device. The user equipment is connected to a first port on the first switching device via a physical link, and the first port on the first switching device is connected to a second port on the second switching device via a Layer 2 tunnel. The user equipment transmits packets to the second switching device through the first port and the Layer 2 tunnel. The second switching device then uses loopback processing to simulate receiving the original packets sent by the user equipment, and thus the second switching device can use MLAG technology to process the original packets normally. Therefore, in this application embodiment, the mapping between the second port and the port on the user equipment is achieved through the first port on the first switching device and the Layer 2 tunnel, realizing MLAG aggregation on the remote second switching device. Thus, when the user equipment is physically connected to one MLAG switching device, there is no need for the user equipment to be physically connected to another MLAG switching device, achieving traffic load balancing at a lower networking cost.

[0215] In some embodiments, the above-mentioned message forwarding apparatus may further include:

[0216] The third receiving module is used to receive the second tunnel message sent by the second switching device through the layer 2 tunnel;

[0217] The second decapsulation module is used to decapsulate the second tunnel message to obtain the second original message;

[0218] The third sending module is used to send the second raw message to the user equipment through the first port.

[0219] In some embodiments, the second original message carries an outgoing port field, the value of which is an identifier of the second port; the third sending module is specifically configured to: modify the source port identifier of the second original message to the value of the outgoing port field; and send the modified second original message to the user equipment through the first port; or,

[0220] The source port identifier of the second original message is the identifier of the second port; the third sending module is specifically used to: keep the source port identifier of the second original message as the identifier of the second port; and send the kept second original message to the user equipment through the first port.

[0221] In some embodiments, the aggregation member port of MLAG may further include a third port on the first switching device, the third port being connected to the user equipment via a physical link; the above-mentioned packet forwarding device may further include:

[0222] The fourth receiving module is used to receive the third raw message sent by the user equipment through the third port;

[0223] The fourth sending module is used to send the third raw message to the Layer 3 network device.

[0224] In some embodiments, the above-mentioned message forwarding apparatus may further include:

[0225] The fifth receiving module is used to receive the fourth raw message sent by the Layer 3 network device to the user equipment;

[0226] The fifth sending module is used to send the fourth raw message to the user equipment through the third port.

[0227] Corresponding to the aforementioned message forwarding system, this application also provides a message forwarding device, see below. Figure 17 The packet forwarding device is applied to the second switching device included in the MLAG. The MLAG also includes a first switching device. A first port on the first switching device is connected to the user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel. The aggregation member port of the MLAG includes the second port. The above-mentioned packet forwarding device includes:

[0228] The second receiving module 171 is used to receive the first tunnel message sent by the first switching device through the second layer tunnel;

[0229] The first decapsulation module 172 is used to decapsulate the first tunnel message to obtain the first original message;

[0230] The first loopback module 173 is used to loop back the first original message to the second port;

[0231] The second sending module 174 is used to send the first raw message to the Layer 3 network device.

[0232] In the technical solution provided in this application embodiment, MLAG includes a first switching device and a second switching device. The user equipment is connected to a first port on the first switching device via a physical link, and the first port on the first switching device is connected to a second port on the second switching device via a Layer 2 tunnel. The user equipment transmits packets to the second switching device through the first port and the Layer 2 tunnel. The second switching device then uses loopback processing to simulate receiving the original packets sent by the user equipment, and thus the second switching device can use MLAG technology to process the original packets normally. Therefore, in this application embodiment, the mapping between the second port and the port on the user equipment is achieved through the first port on the first switching device and the Layer 2 tunnel, realizing MLAG aggregation on the remote second switching device. Thus, when the user equipment is physically connected to one MLAG switching device, there is no need for the user equipment to be physically connected to another MLAG switching device, achieving traffic load balancing at a lower networking cost.

[0233] In some embodiments, the above-mentioned message forwarding apparatus may further include:

[0234] The sixth receiving module is used to receive the second raw message sent by the Layer 3 network device to the user equipment;

[0235] The second loopback module is used to loop back the second original message to the second port;

[0236] The second encapsulation module is used to encapsulate the second original message to obtain the second tunnel message;

[0237] The sixth sending module is used to send a second tunnel message to the first switching device through a Layer 2 tunnel, so that the first switching device can decapsulate the second tunnel message to obtain a second original message, and send the second original message to the user equipment through the first port.

[0238] This application also provides an electronic device, such as a first switching device and a second switching device. Figure 18As shown, it includes a processor 181 and a machine-readable storage medium 182, the machine-readable storage medium 182 storing machine-executable instructions that can be executed by the processor 181, the processor 181 being prompted by the machine-executable instructions to implement the steps of any of the above-described message forwarding methods.

[0239] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0240] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described message forwarding methods.

[0241] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the message forwarding methods described above.

[0242] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0243] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0244] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of methods, apparatus, electronic devices, computer-readable storage media, and computer program products are basically similar to the system embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the system embodiments.

[0245] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A message forwarding method, characterized in that, The method applies to a first switching device included in a cross-device link aggregation group (MLAG), wherein the MLAG further includes a second switching device, a first port on the first switching device is connected to a user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel, wherein the aggregation member port of the MLAG includes the second port, and the method includes: Receive the first raw message sent by the user equipment through the first port; The first original message is encapsulated to obtain the first tunnel message; The first tunnel message is sent to the second switching device through the Layer 2 tunnel, so that the second switching device can decapsulate the first tunnel message to obtain the first original message, loop the first original message back to the second port, and send the first original message to the Layer 3 network device.

2. The method according to claim 1, characterized in that, The method further includes: The second tunnel message sent by the second switching device is received through the second layer tunnel; The second tunnel message is decapsulated to obtain the second original message; The second original message is sent to the user equipment through the first port.

3. The method according to claim 2, characterized in that, The second original message carries an outgoing port field, the value of which is the identifier of the second port; the step of sending the second original message to the user equipment through the first port includes: modifying the source port identifier of the second original message to the value of the outgoing port field; sending the modified second original message to the user equipment through the first port; or, The source port identifier of the second original message is the identifier of the second port; the step of sending the second original message to the user equipment through the first port includes: keeping the source port identifier of the second original message as the identifier of the second port; and sending the kept second original message to the user equipment through the first port.

4. The method according to any one of claims 1-3, characterized in that, The MLAG aggregation member port further includes a third port on the first switching device, the third port being connected to the user equipment via a physical link; the method further includes: The third raw message sent by the user equipment is received through the third port; Send the third original message to the Layer 3 network device.

5. The method according to claim 4, characterized in that, The method further includes: Receive the fourth raw message sent by the Layer 3 network device to the user equipment; The fourth original message is sent to the user equipment through the third port.

6. A message forwarding method, characterized in that, The method applies to a second switching device included in a cross-device link aggregation group (MLAG), wherein the MLAG further includes a first switching device, a first port on the first switching device is connected to a user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel; the aggregation member ports of the MLAG include the second port; the method includes: The first tunnel message sent by the first switching device is received through the second-layer tunnel. The first tunnel message is decapsulated to obtain the first original message; Loop the first original message back to the second port; Send the first original message to the Layer 3 network device.

7. The method according to claim 6, characterized in that, The method further includes: Receive the second raw message sent by the Layer 3 network device to the user equipment; Loop the second original message back to the second port; The second original message is encapsulated to obtain the second tunnel message; The second tunnel message is sent to the first switching device through the Layer 2 tunnel, so that the first switching device can decapsulate the second tunnel message to obtain the second original message, and send the second original message to the user equipment through the first port.

8. A message forwarding device, characterized in that, The device is applied to a first switching device included in a cross-device link aggregation group (MLAG), the MLAG further including a second switching device, a first port on the first switching device being connected to a user equipment via a physical link, and the first port being connected to a second port on the second switching device via a Layer 2 tunnel, the aggregation member port of the MLAG including the second port, the device including: a first receiving module, used to receive a first raw message sent by the user equipment through the first port; The first encapsulation module is used to encapsulate the first original message to obtain the first tunnel message; The first sending module is configured to send the first tunnel message to the second switching device through the Layer 2 tunnel, so that the second switching device can decapsulate the first tunnel message to obtain the first original message, loop the first original message back to the second port, and send the first original message to the Layer 3 network device.

9. A message forwarding device, characterized in that, An application is made to a second switching device included in a cross-device link aggregation group (MLAG), wherein the MLAG further includes a first switching device, a first port on the first switching device is connected to a user equipment via a physical link, and the first port is connected to a second port on the second switching device via a Layer 2 tunnel; the aggregation member ports of the MLAG include the second port; the device includes: The second receiving module is used to receive the first tunnel message sent by the first switching device through the second-layer tunnel; The first decapsulation module is used to decapsulate the first tunnel packet to obtain the first original packet; The first loopback module is used to loop back the first original message to the second port; The second sending module is used to send the first original message to the Layer 3 network device.

10. An electronic device, characterized in that, The method includes a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor being prompted by the machine-executable instructions to perform the method of any one of claims 1-5 or 6-7.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-5 or 6-7.

Citation Information

Patent Citations

  • Message forwarding method and device

    CN108156066A

  • Cross-device link aggregation message processing method and system, switch and storage medium

    CN115665033A