Message forwarding method and device, electronic equipment and storage medium

By using layer 2 tunneling and loopback processing in MLAG, the physical connection between the user equipment and an MLAG switching device is realized, which solves the problem that the user equipment cannot physically connect with the remote switching device, realizes traffic load sharing, and reduces the group Internet cost.

CN119172303AActive Publication Date: 2024-12-20NEW H3C TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In a cross-device link aggregation group (MLAG), user equipment cannot physically connect with far-reaching switching devices, resulting in the inability to realize traffic load sharing, increasing networking costs.

Method used

By establishing a physical link between the user equipment and a MLAG switching device, and using a layer two tunnel to pass the message to another switching device, performing loopback processing, simulate receiving the original message sent by the user equipment, thereby Realize MLAG aggregation of remote switching devices to achieve the purpose of traffic load sharing.

Benefits of technology

With the lower networking cost, when the user equipment is physically connected to one MLAG switching device, the user equipment does not need to physically connect to another MLAG switching device, which realizes traffic load sharing and solves the problem of being unable to share traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172303A_ABST
    Figure CN119172303A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message forwarding method and device, electronic equipment and a storage medium, relates to the technical field of communication, is applied to first switching equipment and second switching equipment included in MLAG, and is characterized in that a first port is connected with user equipment through a physical link, the first port is connected with a second port through a two-layer tunnel, and the second port is connected with a third port through a second-layer tunnel. The aggregation member port of the MLAG comprises a second port; the first switching equipment receives a first original message sent by the user equipment through the first port, carries out packaging processing on the first original message to obtain a first tunnel message, and sends the first tunnel message to the second switching equipment through a two-layer tunnel; and the second switching equipment decapsulates the first tunnel message to obtain a first original message, loops the first original message back to the second port, and sends the first original message to the three-layer network equipment. By applying the technical scheme provided by the embodiment of the invention, the flow load sharing can be realized under the condition that the user equipment is physically connected with one MLAG switching equipment.
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 message forwarding method, device, electronic device and storage medium. Background Art

[0002] Multi-Chassis Link Aggregation (MLAG) is a cross-device link aggregation technology that aggregates the links of a user device and two switching devices, thereby improving link reliability from the single-board level to the device level, thereby providing device-level redundancy protection and traffic load sharing.

[0003] However, in actual applications, there are situations where the user device is closer to one switching device and farther from another switching device. In this case, considering the networking cost, the user device can only be physically connected to the closer switching device, but not to the farther switching device. If the user device is only physically connected to one switching device, the purpose of traffic load sharing cannot be achieved. Summary of the invention

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

[0005] In a first aspect, an embodiment of the present application provides a message forwarding method, which is applied to a first switching device included in an MLAG, wherein the MLAG also includes a second switching device, wherein a first port on the first switching device is connected to a user device through a physical link, and the first port is connected to a second port on the second switching device through a layer 2 tunnel, and an aggregation member port of the MLAG includes the second port, and the method includes:

[0006] Receiving, through the first port, a first original message sent by the user equipment;

[0007] Encapsulating the first original message to obtain a first tunnel message;

[0008] The first tunnel message is sent to the second switching device through the second layer tunnel, so that the second switching device decapsulates the first tunnel message to obtain the first original message, loops the first original message back to the second port, and sends the first original message to the third layer network device.

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

[0010] receiving, through the layer 2 tunnel, a second tunnel message sent by the second switching device;

[0011] Decapsulating the second tunnel message to obtain a second original message;

[0012] Send the second original message to the user equipment through the first port.

[0013] In some embodiments, the second original message carries an egress port field, and the value of the egress port field 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 egress 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 maintained second original message to the user equipment through the first port.

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

[0016] receiving, through the third port, a third original message sent by the user equipment;

[0017] The third original message is sent to the layer-3 network device.

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

[0019] receiving a fourth original 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] In a second aspect, an embodiment of the present application provides a message forwarding method, which is applied to a second switching device included in an MLAG, wherein the MLAG also includes a first switching device, wherein a first port on the first switching device is connected to a user device through a physical link, and the first port is connected to a second port on the second switching device through a layer 2 tunnel, and an aggregation member port of the MLAG includes the second port; the method includes:

[0022] Receiving, through the layer 2 tunnel, a first tunnel message sent by the first switching device;

[0023] Decapsulating the first tunnel message to obtain a first original message;

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

[0025] The first original message is sent to the layer-3 network device.

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

[0027] Receiving a second original message sent by the layer-3 network device to the user equipment;

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

[0029] Encapsulating the second original message to obtain a 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 decapsulates the second tunnel message to obtain the second original message, and sends the second original message to the user equipment through the first port.

[0031] In a third aspect, an embodiment of the present application provides a message forwarding device, which is applied to a first switching device included in an MLAG, wherein the MLAG also includes a second switching device, wherein a first port on the first switching device is connected to a user device through a physical link, and the first port is connected to a second port on the second switching device through a layer 2 tunnel, and an aggregation member port of the MLAG includes the second port, and the device includes:

[0032] A first receiving module, configured to receive a first original message sent by the user equipment through the first port;

[0033] A first encapsulation module, used to encapsulate the first original message to obtain a first tunnel message;

[0034] The first sending module is used to send the first tunnel message to the second switching device through the second layer tunnel, so that the second switching device decapsulates the first tunnel message to obtain the first original message, loops the first original message back to the second port, and sends the first original message to the third layer network device.

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

[0036] A third receiving module, configured to receive a second tunnel message sent by the second switching device through the layer 2 tunnel;

[0037] A second decapsulation module, configured to decapsulate the second tunnel message to obtain a second original message;

[0038] A 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 egress port field, and the value of the egress port field 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 egress 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 maintained 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, and the third port is connected to the user equipment through a physical link; the apparatus further includes:

[0042] a fourth receiving module, configured to receive, through the third port, a third original message sent by the user equipment;

[0043] The fourth sending module is used to send the third original message to the three-layer network device.

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

[0045] A fifth receiving module, used to receive a fourth original message sent by the three-layer network device to the user equipment;

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

[0047] In a fourth aspect, an embodiment of the present application provides a message forwarding device, which is applied to a second switching device included in an MLAG, wherein the MLAG also includes a first switching device, wherein a first port on the first switching device is connected to a user device through a physical link, and the first port is connected to a second port on the second switching device through a layer 2 tunnel, and an aggregation member port of the MLAG includes the second port; the device includes:

[0048] A second receiving module, used for receiving a first tunnel message sent by the first switching device through the layer 2 tunnel;

[0049] A first decapsulation module, configured to decapsulate the first tunnel message to obtain a first original message;

[0050] A first loopback module, used for looping the first original message back to the second port;

[0051] The second sending module is used to send the first original message to the three-layer network device.

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

[0053] A sixth receiving module, configured to receive a second original message sent by the layer-3 network device to the user equipment;

[0054] A second loopback module, used for looping back the second original message to the second port;

[0055] A second encapsulation module, used to encapsulate the second original message to obtain a second tunnel message;

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

[0057] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement any of the methods described in the first and second aspects above.

[0058] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the first and second aspects above is implemented.

[0059] In a seventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the methods described in the first and second aspects of the above embodiments.

[0060] Beneficial effects of the embodiments of the present application:

[0061] In the technical solution provided in the embodiment of the present application, MLAG includes a first switching device and a second switching device, the user device is connected to the first port on the first switching device through a physical link, and the first port on the first switching device is connected to the second port on the second switching device through a layer 2 tunnel. The user device transparently transmits the message to the second switching device through the first port and the layer 2 tunnel. The second switching device then simulates the reception of the original message sent by the user device with the help of loopback processing, and then the second switching device can use the MLAG technology to process the original message normally. It can be seen that in the embodiment of the present application, the mapping between the second port and the port on the user device is realized through the first port and the layer 2 tunnel on the first switching device, so as to achieve MLAG aggregation of the remote second switching device, and then when the user device is physically connected to one MLAG switching device, there is no need for the user device to be physically connected to another MLAG switching device, and traffic load sharing is achieved at a lower networking cost.

[0062] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

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

[0065] Figure 2a A schematic diagram of an upstream traffic forwarding scenario;

[0066] Figure 2b 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 the present application;

[0068] Figure 4 A first signaling diagram of the message forwarding method provided in an embodiment of the present application;

[0069] Figure 5 A first schematic diagram of Layer 2 tunnel forwarding provided in an embodiment of the present application;

[0070] Figure 6 A second signaling diagram of the message forwarding method provided in an embodiment of the present application;

[0071] Figure 7A second schematic diagram of Layer 2 tunnel forwarding provided in an embodiment of the present application;

[0072] Figure 8a A first schematic diagram of a forwarding scenario provided in an embodiment of the present application;

[0073] Figure 8b A second schematic diagram of a forwarding scenario provided in an embodiment of the present application;

[0074] Fig. 9 A third signaling diagram of the message forwarding method provided in an embodiment of the present application;

[0075] Fig.10 A fourth signaling diagram of the message forwarding method provided in an embodiment of the present application;

[0076] Fig.11a A schematic diagram of an uplink traffic forwarding scenario provided in an embodiment of the present application;

[0077] Fig.11b A schematic diagram of a downlink traffic forwarding scenario provided in an embodiment of the present application;

[0078] Fig.12 A schematic diagram of a configuration port provided in an embodiment of the present application;

[0079] Fig.13 A schematic diagram of establishing a layer 2 tunnel provided in an embodiment of the present application;

[0080] Fig.14 A schematic diagram of a first flow chart of a message forwarding method provided in an embodiment of the present application;

[0081] Fig.15 A second flow chart of the message forwarding method provided in the embodiment of the present application;

[0082] Fig.16 A first structural diagram of a message forwarding device provided in an embodiment of the present application;

[0083] Fig.17 A second structural diagram of the message forwarding device provided in an embodiment of the present application;

[0084] Fig.18 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0085] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0086] MLAG is a cross-device link aggregation technology that aggregates the links of a user device and two switching devices, thereby improving link reliability from the single-board level to the device level, thereby providing device-level redundancy protection and traffic load sharing.

[0087] However, in actual applications, there are situations where the user device is closer to one switching device and farther from another switching device. In this case, considering the networking cost, the user device can only be physically connected to the closer switching device, but not to the farther switching device. If the user device is only physically connected to one switching device, the purpose of traffic load sharing cannot be achieved.

[0088] like Figure 1 In the networking scenario shown, the switching device (MLAG-1) is deployed in the data center (DC)-1, and the switching device (MLAG-2) is deployed in DC-2. MLAG-1 and MLAG-2 can establish an internal control link (Intra-Portal Link, IPL) between the IPPs of MLAG-1 and MLAG-2 through an internal control link port (IntraPortal Port, IPP) to achieve physical connection between MLAG-1 and MLAG-2.

[0089] The user equipment (client) is deployed in DC-1 to which MLAG-1 belongs. The user equipment is 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 achieve physical connection between the user equipment and MLAG-1.

[0090] However, the distance between DC-1 and DC-2 is relatively far. Accordingly, the distance between the user equipment deployed in DC-1 and MLAG-2 deployed in DC-2 is relatively far. The cost of establishing a physical link between the user equipment and MLAG-2 is relatively high, and the user equipment cannot afford the cost. Therefore, the user equipment can only be physically connected to MLAG-1, but not to MLAG-2. In other words, the user equipment is only connected to MLAG.

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

[0092] exist Figure 2a In the upstream traffic forwarding scenario shown, the user equipment sends all upstream traffic messages to MLAG-1. After MLAG-1 receives the upstream traffic messages through ports P2 and P4, it forwards the upstream traffic messages to the three-layer network device L3 through port P6.

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

[0094] It can be seen that when a user device is attached to only MLAG, MLAG-2 cannot share the traffic of the user device and cannot meet the traffic load sharing requirements of the user device.

[0095] In order to solve the above problems, the present application embodiment provides a message forwarding system, such as Figure 3 As shown, it 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 device 33 through a physical link, the third port 312 on the first switching device 31 is connected to the fifth port 332 of the user device 33 through a physical link, the first port 311 is connected to the second port 321 on the second switching device 32 through a Layer 2 tunnel, and the aggregation member ports of the MLAG include the second port 321 and the third port 312.

[0096] In the embodiment of the present application, the first switching device 31 and the second switching device 32 form 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 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, a personal computer, a switching device or a routing device, which is not limited.

[0097] The layer 2 tunnel is a virtual link established based on the IPL between the first switching device and the second switching device. The 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 is no limitation on this.

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

[0099] Based on the above message forwarding system, the present application embodiment provides a message forwarding method, such as Figure 4 The first signaling diagram of the message forwarding method shown may include the following steps:

[0100] Step S41 : the user equipment 33 obtains a first original message corresponding to the second switching device 32 .

[0101] In the embodiment of the present application, the user equipment 33 can generate the original message of the uplink traffic by itself, and can also receive the original message of the uplink traffic sent by other devices.

[0102] After the user equipment 33 obtains the original message of the uplink traffic, it uses a traffic load sharing algorithm such as a hash algorithm to determine the switching device that performs load sharing, that is, determines the switching device that processes the original message. In the embodiment of the present application, the original message of the uplink traffic processed by the second switching device is referred to as the first original message.

[0103] Step S42 : The user equipment 33 determines the fourth port 331 corresponding to the second port 321 according to the pre-recorded correspondence between the aggregation member ports and the egress ports.

[0104] In the embodiment of the present application, the egress port is a port connected to the corresponding aggregation member port on the user device 33. The user device 33 pre-records the correspondence between the aggregation member ports and the egress 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 acquiring the first original message, the user device 33 can learn that the aggregation member port of the second switching device is the second port 321 , and then search for the pre-recorded correspondence between the aggregation member ports and the egress ports to obtain the fourth port 331 corresponding to the second port 321 .

[0106] Step S43 : the user equipment 33 sends the first original message to the first switching device 31 through the fourth port 331 .

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

[0108] Step S44 : the first switching device 31 receives the first original 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] Step S45: The first switching device 31 encapsulates the first original message to obtain a first tunnel message.

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

[0112] After the first switching device 31 receives the first original message through the first port 311, the first original message will not be sent to the CPU of the first switching device 31 for processing, but the forwarding chip of the first switching device 31 will encapsulate the first original message according to the configuration of the layer 2 tunnel, and the first original message after encapsulation 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 (Identity, ID) of the VLAN tunnel is 4000. The first switching device 31 encapsulates the first original message with a VLAN tunnel tag header carrying the VLAN ID 4000 to obtain a first tunnel message.

[0114] Step S46: The first switching device 31 sends the first tunnel message to the second switching device 32 through the layer 2 tunnel.

[0115] After the first tunnel message is obtained, the first tunnel message can be forwarded to the second switching device 32 via the layer 2 tunnel.

[0116] In the embodiment of the present application, the layer 2 tunnel allows all messages of the first port 311 to be directly transparently transmitted to the other end (ie, the second switching device 32).

[0117] Step S47: The second switching device 32 receives the first tunnel message sent by the first switching device 31 through the layer 2 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 through 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 of Layer 2 tunnel forwarding is shown. The first port (P2) on MLAG-1 (the first switching device) and the second port (P1) on MLAG-2 (the second switching device) have the receiving (Rx) function and the transmitting (Tx) function 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 the VLAN tunnel is 4000.

[0120] After MLAG-1 receives the original message 1 through P2, the forwarding chip of MLAG-1 encapsulates the original message 1 with a VLAN tunnel tag header carrying VLANID 4000 to obtain tunnel message 1. The forwarding chip of MLAG-1 transparently transmits tunnel message 1 to MLAG-2 through IPL. The forwarding chip of MLAG-2 receives tunnel message 1 through IPL and forwards tunnel message 1 to P1. At this point, Layer 2 tunnel forwarding is completed.

[0121] Step S48: The second switching device 32 decapsulates the first tunnel message to obtain a first original message.

[0122] After the second switching device 32 receives the first tunnel message through the second port 321, the forwarding chip of the second switching device 32 decapsulates the first tunnel message according to the configuration of the layer 2 tunnel, and the first tunnel message after decapsulation is the first original message. Figure 5 As shown, the forwarding chip of MLAG-2 performs decapsulation processing to obtain the original message 1 for subsequent loopback processing.

[0123] In the embodiment of the present application, the layer 2 tunnel may be a VLAN tunnel. In this case, the decapsulation process may be as follows: the second switching device 32 strips off the VLAN tunnel tag header of the first tunnel message to obtain the first original message.

[0124] Step S49 : The second switching device 32 loops back the first original message 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, and then the second switching device can use the MLAG technology to normally process the first original message.

[0126] Step S410: The second switching device 32 sends a first original message to the layer-3 network device.

[0127] The three-layer network device is a network device that performs three-layer forwarding, and the three-layer 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 three-layer (L3) network device.

[0129] In the technical solution provided in the embodiment of the present application, MLAG includes a first switching device and a second switching device, the user device is connected to the first port on the first switching device through a physical link, and the first port on the first switching device is connected to the second port on the second switching device through a layer 2 tunnel. The user device transparently transmits the message to the second switching device through the first port and the layer 2 tunnel. The second switching device then simulates the reception of the original message sent by the user device with the help of loopback processing, and then the second switching device can use the MLAG technology to process the original message normally. It can be seen that in the embodiment of the present application, the mapping between the second port and the port on the user device is realized through the first port and the layer 2 tunnel on the first switching device, so as to achieve MLAG aggregation of the remote second switching device, and then when the user device is physically connected to one MLAG switching device, there is no need for the user device to be physically connected to another MLAG switching device, and traffic load sharing is achieved at a lower networking cost.

[0130] Based on the above message forwarding system, the present application embodiment provides 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 a second original message sent by the layer-3 network device to the user equipment 33.

[0132] In the embodiment of the present application, the layer 3 network device receives the original message of the downlink traffic sent by the first data center, the second data center, other data centers or servers to the user device 33. The layer 3 network device uses a traffic load sharing algorithm such as a hash algorithm to determine the switching device that performs load sharing, that is, to determine the switching device that processes the original message. In the embodiment of the present application, the original message of the downlink traffic processed by the second switching device is referred to as the second original message.

[0133] When it is determined that the switching device that performs load sharing is the second switching device 32, the layer-3 network device forwards the second original message to the second switching device 32, and then the second switching device 32 receives the second original message.

[0134] Step S62 : The second switching device 32 loops back the second original message 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 (ie, the second port 321 ) to simulate sending the second original message to the user device 33 , so that the forwarding chip of the second switching device 32 can process the second original message normally.

[0136] Step S63: The second switching device 32 encapsulates the second original message to obtain a second tunnel message.

[0137] After the second original message is looped 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, the second original message will not be sent to the CPU of the second switching device 32 for processing, but the forwarding chip of the second switching device 32 will encapsulate the second original message according to the configuration of the layer 2 tunnel, and 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 layer 2 tunnel is a VLAN tunnel, and the VLAN ID of the VLAN tunnel is 4000. The second switching device 32 encapsulates the second original message with a VLAN tunnel tag header carrying the VLAN ID 4000 to obtain a second tunnel message.

[0139] Step S64: The second switching device 32 sends a second tunnel message to the first switching device 31 through the layer 2 tunnel.

[0140] After the second tunnel message is obtained, the second tunnel message may be forwarded to the first switching device 31 via the layer 2 tunnel.

[0141] In the embodiment of the present application, the layer 2 tunnel allows all messages of the second port 321 to be directly transparently transmitted to the other end (ie, the first switching device 31).

[0142] Step S65: The first switching device 31 receives the second tunnel message sent by the second switching device 32 through the layer 2 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 through 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 of Layer 2 tunnel forwarding is shown. The first port (P2) on MLAG-1 (the first switching device) and the second port (P1) on MLAG-2 (the second switching device) have the Rx function and the Tx function 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 the VLAN tunnel is 4000.

[0145] After MLAG-2 receives the original message 2 through the P1 loopback, the forwarding chip of MLAG-2 encapsulates the original message 2 with a VLAN tunnel tag header carrying the VLAN ID 4000 to obtain tunnel message 2. The forwarding chip of MLAG-2 transparently transmits tunnel message 2 to MLAG-1 through IPL. The forwarding chip of MLAG-1 receives tunnel message 2 through IPL and forwards tunnel message 2 to P2. At this point, Layer 2 tunnel forwarding is completed.

[0146] Step S66: The first switching device 31 decapsulates the second tunnel message to obtain a second original message.

[0147] After the first switching device 31 receives the second tunnel message through the first port 311, it will not report the second tunnel message to the CPU of the first switching device 31, but the forwarding chip of the first switching device 31 will decapsulate the second tunnel message according to the configuration of the layer 2 tunnel, and the decapsulated second tunnel message is the second original message. Figure 7 As shown, the forwarding chip of MLAG-1 performs decapsulation processing to obtain the original message 2.

[0148] In the embodiment of the present application, the layer 2 tunnel may be a VLAN tunnel. In this case, the decapsulation process may be as follows: the first switching device 31 strips off the VLAN tunnel tag header of the second tunnel message to obtain the second original message.

[0149] Step S67 : The first switching device 31 sends the second original message to the user equipment 33 through the first port 311 .

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

[0151] In some embodiments, the first switching device 31 may implement different ways so that the user equipment 33 is unaware of the first switching device 31 .

[0152] Mode 1: the second switching device 32 may add an egress port field to the second original message, and the second original message obtained by the first switching device 31 carries the egress port field, and the value of the egress port field 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 device 33 through the first port 311 may be: modifying the source port identifier of the second original message to the value of the egress port field; and sending the modified second original message to the user device through the first port.

[0153] In the embodiment of the present application, before the first switching device 31 sends the second original message to the user device 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 may modify the source port identifier to the identifier of the second port 321, and send the modified second original message to the user device 33. In this way, when the user device 33 receives the modified second original message, the user device 33 may determine that the source port identifier is the identifier of the aggregation member port of the MLAG, and consider that the modified second original message is the original message sent by the second switching device 32, so that the user device 33 is not aware of the specific forwarding method, and traffic load sharing is achieved 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 device 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; and sending the maintained second original message to the user device through the first port.

[0155] In the embodiment of the present application, before the first switching device 31 sends the second original message to the user device 33 through the first port 311, the first switching device 31 suppresses itself from modifying the source port identifier of the second original message to the identifier of the first port 311, but keeps the source port identifier as the identifier of the second port 321, and sends the retained second original message to the user device 33. In this way, when the user device 33 receives the retained second original message, the user device 33 can determine that the source port identifier is the identifier of the aggregation member port of the MLAG, and considers that the modified second original message is the original message sent by the second switching device 32, so that the user device 33 is not aware of the specific forwarding method, and traffic load sharing is achieved at a lower networking cost.

[0156] In the embodiment of the present application, when the user device does not care about the source port of the received message, after the first switching device 31 obtains the second original message, it can directly send the second original message to the user device 33, or it can modify the source port identifier of the second original message to the identifier of the first port 311 and then send it to the user device 33. The first switching device 31 does not limit the processing of the second original message, which can be determined according to the actual forwarding strategy.

[0157] Step S68 : The user equipment 33 receives the second original message sent by the first switching device 31 through the fourth port 331 .

[0158] In the embodiment of the present 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 the 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 the embodiment of the present application, MLAG includes a first switching device and a second switching device, the user device is connected to the first port on the first switching device through a physical link, and the first port on the first switching device is connected to the second port on the second switching device through a layer 2 tunnel. The user device transparently transmits the message to the second switching device through the first port and the layer 2 tunnel. The second switching device then simulates sending the original message to the user device with the help of loopback processing, and then the second switching device processes the original message normally and sends the original message to the user device by using the first switching device. It can be seen that in the embodiment of the present application, the mapping between the second port and the port on the user device is realized through the first port and the layer 2 tunnel on the first switching device, so as to achieve MLAG aggregation of the remote second switching device, and then when the user device is physically connected to one MLAG switching device, there is no need for the user device to be physically connected to another MLAG switching device, and traffic load sharing is achieved at a lower networking cost.

[0160] Based on the above Figure 4 and Figure 6 The embodiment shown in the present application is as follows Figure 8a The first port 311 on the first switching device 31 shown in the figure, 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) messages, so as to implement the following Figure 8b The mapping between the second port and the fourth port 331 on the user equipment is shown to establish a virtual link between the user equipment and the second switching device, thereby achieving non-directly connected MLAG aggregation of the remote second switching device.

[0161] Based on the above message forwarding system, the present application embodiment provides a message forwarding method, such as Fig. 9 The third signaling diagram of the message forwarding method shown may include the following steps:

[0162] Step S91 : The user equipment 33 obtains a third original message corresponding to the first switching device 31 .

[0163] After the user equipment 33 obtains the original message of the uplink traffic, it uses a traffic load sharing algorithm such as a hash algorithm to determine the switching device that performs load sharing, that is, determines the switching device that processes the original message. In the embodiment of the present application, the original message of the uplink traffic processed by the first switching device 31 is referred to as the third original message.

[0164] Step S92: The user equipment 33 determines the fifth port 332 corresponding to the third port 312 according to the pre-recorded correspondence between the aggregation member ports and the egress ports.

[0165] After acquiring the third original message, the user device 33 can learn that the aggregation member port of the first switching device 31 is the third port 312 , and then search for the pre-recorded correspondence between the aggregation member ports and the egress ports to obtain the fifth port 332 corresponding to the third port 312 .

[0166] Step S93 : the user equipment 33 sends the third original message to the first switching device 31 through the 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] Step S94 : The first switching device 31 receives the third original 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 the 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] 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 three-layer (L3) network device.

[0172] Based on the above message forwarding system, the present application embodiment provides a message forwarding method, such as Fig.10 The fourth signaling diagram of the message forwarding method shown may include the following steps:

[0173] Step S101: The first switching device 31 receives a fourth original message sent by a layer-3 network device to a user device 33.

[0174] In the embodiment of the present application, the layer 3 network device receives the original message of the downlink traffic sent by the first data center, the second data center, other data centers or servers to the user device 33. The layer 3 network device uses a traffic load sharing algorithm such as a hash algorithm to determine the switching device that performs load sharing, that is, to determine the switching device that processes the original message. In the embodiment of the present application, the original message of the downlink traffic processed by the first switching device is referred to as the fourth original message.

[0175] When it is determined that the switching device that performs load sharing is the first switching device 31 , 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] Step S102 : The first switching device 31 sends a fourth original 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 (ie, the third port 312 ) and the fifth port 332 of the user equipment 33 .

[0178] Step S103 : The user equipment 33 receives the fourth original message sent by the first switching device 31 through the fifth port 332 .

[0179] In the embodiment of the present application, 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 the 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 , Fig. 9 and Fig.10 The illustrated embodiment implements dual-homing uplink across DCs when a user device is attached to a single MLAG in both the uplink traffic forwarding scenario and the downlink traffic forwarding scenario, thereby achieving load sharing of Layer 2 traffic.

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

[0182] exist Fig.11a In the upstream traffic forwarding scenario shown, the user device sends all upstream traffic packets to MLAG-1. After MLAG-1 receives the upstream traffic packets through port P2, it transparently transmits the packets to MLAG-2 through IPL, and MLAG-2 forwards the upstream traffic packets to the three-layer network device L3 through port P7. After MLAG-1 receives the upstream traffic packets through port P4, MLAG-1 forwards the upstream traffic packets to the three-layer network device L3 through port P6.

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

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

[0185] In the embodiment of the present application, before forwarding the message, the administrator can configure the MLAG information on the first switching device and the second switching device through the management device, so that the first switching device and the second switching device form an MLAG. The administrator can also configure the Layer 2 tunnel between the first switching device and the second switching device and the loopback port on the second switching device. Each configuration process is described in detail below.

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

[0187] 2) The user configures a port (such as port 3) on the first switching device that is connected to the user device through a physical link as an aggregation member port of MLAG. In addition, the user configures an idle port (such as port 2) on the second switching device as an aggregation member port of MLAG, configures port 2 to loop back, and then enables port 2. A Layer 2 tunnel is established between another port (such as port 1) on the first switching device that is connected to the user device through a physical link and port 2. Port 1 and port 2 enable the Layer 2 tunnel respectively, and configure the Layer 2 tunnel to allow the aggregated VLAN to pass, that is, configure the IPL between the first switching device and the second switching device to allow the aggregated VLAN to pass. Port 1, port 2, and port 3 allow the same VLAN to pass. In addition, the user configures port 1 and port 2 to perform encapsulation and decapsulation processing.

[0188] In the embodiment of the present application, a port loopback module can be configured on the second switching device. The port loopback module is used to configure port 2. For details, see Fig.12 As shown, it includes: enabling the loopback function of port 2 and setting the state of the port to UP; adding port 2 to the aggregation group and adding the aggregation group to MLAG, that is, using port 2 as the aggregation member port of MLAG; enabling the layer 2 tunnel corresponding to port 2, and then using the forwarding chip of the second switching device to decapsulate the message from the layer 2 tunnel and encapsulate the message to send it to the layer 2 tunnel for forwarding.

[0189] A layer 2 tunnel module can be configured on the first switching device and the second switching device, and a layer 2 tunnel can be established by using the layer 2 tunnel module to implement message forwarding. For details, see Fig.13 As shown:

[0190] The first switching device enables the VLAN tunnel tag of port 1, such as 4000. The VLAN tunnel tag is used for MLAG data interaction. Therefore, the VLAN tunnel tag can also be called an MLAG tunnel tag. The hardware table item of port 1 is set, such as writing the corresponding relationship between tunnel tag 4000, port 1 and port 2 in the hardware table item of port 1. According to the hardware table item of port 1, the forwarding chip of the first switching device encapsulates the tunnel tag for the message. The forwarding chip of the first switching device forwards the encapsulated message to the IPP of the first switching device, and forwards the encapsulated message to the IPP of the second switching device through the IPL.

[0191] The forwarding chip of the second switching device receives the encapsulated message through IPP, and forwards the encapsulated message to port 2 of the second switching device. The second switching device sets the hardware table item of port 2, such as writing the correspondence between tunnel label 4000, port 1 and port 2, etc. in the hardware table item of port 2. The forwarding chip of the second switching device decapsulates the encapsulated message according to the hardware table item of port 2, and obtains the original message after the decapsulation process. In the embodiment of the present application, the order of setting the hardware table items on port 1 and port 2 is not limited. By setting the hardware table items on port 1 and port 2, the establishment of a layer 2 tunnel between port 1 and port 2 and the corresponding message forwarding can be achieved.

[0192] In the technical solution provided in the embodiment of the present application, a virtual MLAG across devices and ports is established through the Layer 2 VLAN tunnel technology and the port loopback technology, and 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), so as to achieve MLAG aggregation of the remote device (such as the second switching device mentioned above), and realize dual-return upstream and downstream message forwarding across DCI in the MLAG single-hanging scenario, thereby solving the problem of inability to share traffic load, thereby greatly reducing the high-cost link costs across distances and regions.

[0193] Corresponding to the above-mentioned message forwarding system, the embodiment of the present application also provides a message forwarding method, see Fig.14 , applied to a first switching device included in MLAG, MLAG also includes a second switching device, a first port on the first switching device is connected to a user device through a physical link, and the first port is connected to a second port on the second switching device through a Layer 2 tunnel, the aggregation member port of MLAG includes the second port, and the above-mentioned message forwarding method includes the following steps.

[0194] Step S141, receiving a first original message sent by a user equipment through a first port;

[0195] Step S142, encapsulating the first original message to obtain a first tunnel message;

[0196] Step S143, sending the first tunnel message to the second switching device through the Layer 2 tunnel, so that the second switching device decapsulates the first tunnel message to obtain the first original message, loops the first original message back to the second port, and sends the first original message to the Layer 3 network device.

[0197] In the technical solution provided in the embodiment of the present application, MLAG includes a first switching device and a second switching device, the user device is connected to the first port on the first switching device through a physical link, and the first port on the first switching device is connected to the second port on the second switching device through a layer 2 tunnel. The user device transparently transmits the message to the second switching device through the first port and the layer 2 tunnel. The second switching device then simulates the reception of the original message sent by the user device with the help of loopback processing, and then the second switching device can use the MLAG technology to process the original message normally. It can be seen that in the embodiment of the present application, the mapping between the second port and the port on the user device is realized through the first port and the layer 2 tunnel on the first switching device, so as to achieve MLAG aggregation of the remote second switching device, and then when the user device is physically connected to one MLAG switching device, there is no need for the user device to be physically connected to another MLAG switching device, and traffic load sharing is achieved at a lower networking cost.

[0198] In some embodiments, the 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 device through the first port.

[0199] In some embodiments, the second original message carries an outgoing port field, and the value of the outgoing port field 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 above-mentioned second original message is the identifier of the second port; the above-mentioned 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 maintained second original message to the user equipment through the first port.

[0201] In some embodiments, the aggregation member port of the MLAG may also include a third port on the first switching device, and the third port is connected to the user device through a physical link; the above-mentioned message forwarding method may also include the following steps: receiving a third original message sent by the user device through the third port; and sending the third original message to the three-layer network device.

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

[0203] Corresponding to the above-mentioned message forwarding system, the embodiment of the present application also provides a message forwarding method, see Fig.15 , 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 device through a physical link, and the first port is connected to the second port on the second switching device through a Layer 2 tunnel, and the aggregation member port of MLAG includes the second port; the above-mentioned message forwarding method includes the following steps.

[0204] Step S151, receiving a first tunnel message sent by a first switching device through a layer 2 tunnel;

[0205] Step S152, decapsulating the first tunnel message to obtain a first original message;

[0206] Step S153, looping back the first original message to the second port;

[0207] Step S154: Send the first original message to the layer-3 network device.

[0208] In the technical solution provided in the embodiment of the present application, MLAG includes a first switching device and a second switching device, the user device is connected to the first port on the first switching device through a physical link, and the first port on the first switching device is connected to the second port on the second switching device through a layer 2 tunnel. The user device transparently transmits the message to the second switching device through the first port and the layer 2 tunnel. The second switching device then simulates the reception of the original message sent by the user device with the help of loopback processing, and then the second switching device can use the MLAG technology to process the original message normally. It can be seen that in the embodiment of the present application, the mapping between the second port and the port on the user device is realized through the first port and the layer 2 tunnel on the first switching device, so as to achieve MLAG aggregation of the remote second switching device, and then when the user device is physically connected to one MLAG switching device, there is no need for the user device to be physically connected to another MLAG switching device, and traffic load sharing is achieved at a lower networking cost.

[0209] In some embodiments, the above-mentioned message forwarding method may also include the following steps: receiving a second original message sent by a three-layer network device to a user device; looping the second original message back to a second port; encapsulating the second original message to obtain a second tunnel message; sending the second tunnel message to a first switching device through a second-layer tunnel, so that the first switching device decapsulates the second tunnel message to obtain a second original message, and sends the second original message to the user device through the first port.

[0210] Corresponding to the above-mentioned message forwarding system, the embodiment of the present application also provides a message forwarding device, see Fig.16 , applied to a first switching device included in the MLAG, the MLAG also includes a second switching device, a first port on the first switching device is connected to the user device through a physical link, and the first port is connected to the second port on the second switching device through a layer 2 tunnel, the aggregation member port of the MLAG includes the second port, and the above-mentioned message forwarding device includes:

[0211] A first receiving module 161, configured to receive a first original message sent by a user equipment through a first port;

[0212] A first encapsulation module 162, configured to encapsulate the first original message to obtain a first tunnel message;

[0213] The first sending module 163 is used to send the first tunnel message to the second switching device through the second layer tunnel, so that the second switching device decapsulates the first tunnel message to obtain the first original message, loops the first original message back to the second port, and sends the first original message to the third layer network device.

[0214] In the technical solution provided in the embodiment of the present application, MLAG includes a first switching device and a second switching device, the user device is connected to the first port on the first switching device through a physical link, and the first port on the first switching device is connected to the second port on the second switching device through a layer 2 tunnel. The user device transparently transmits the message to the second switching device through the first port and the layer 2 tunnel. The second switching device then simulates the reception of the original message sent by the user device with the help of loopback processing, and then the second switching device can use the MLAG technology to process the original message normally. It can be seen that in the embodiment of the present application, the mapping between the second port and the port on the user device is realized through the first port and the layer 2 tunnel on the first switching device, so as to achieve MLAG aggregation of the remote second switching device, and then when the user device is physically connected to one MLAG switching device, there is no need for the user device to be physically connected to another MLAG switching device, and traffic load sharing is achieved at a lower networking cost.

[0215] In some embodiments, the message forwarding device may further include:

[0216] A third receiving module, used for receiving a second tunnel message sent by a second switching device through a layer 2 tunnel;

[0217] A second decapsulation module, configured to decapsulate the second tunnel message to obtain a second original message;

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

[0219] In some embodiments, the second original message carries an outbound port field, and the value of the outbound port field is an identifier of the second port; the third sending module is specifically used to: modify the source port identifier of the second original message to the value of the outbound 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 retained second original message to the user equipment through the first port.

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

[0222] A fourth receiving module, used for receiving a third original message sent by the user equipment through a third port;

[0223] The fourth sending module is used to send a third original message to the three-layer network device.

[0224] In some embodiments, the message forwarding device may further include:

[0225] A fifth receiving module, used for receiving a fourth original message sent by the layer-3 network device to the user device;

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

[0227] Corresponding to the above-mentioned message forwarding system, the embodiment of the present application also provides a message forwarding device, see Fig.17 , 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 device through a physical link, and the first port is connected to the second port on the second switching device through a layer 2 tunnel, and the aggregation member port of the MLAG includes the second port; the above-mentioned message 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 layer 2 tunnel;

[0229] A first decapsulation module 172, configured to decapsulate the first tunnel message to obtain a first original message;

[0230] A first loopback module 173, configured to loop back the first original message to the second port;

[0231] The second sending module 174 is used to send the first original message to the three-layer network device.

[0232] In the technical solution provided in the embodiment of the present application, MLAG includes a first switching device and a second switching device, the user device is connected to the first port on the first switching device through a physical link, and the first port on the first switching device is connected to the second port on the second switching device through a layer 2 tunnel. The user device transparently transmits the message to the second switching device through the first port and the layer 2 tunnel. The second switching device then simulates the reception of the original message sent by the user device with the help of loopback processing, and then the second switching device can use the MLAG technology to process the original message normally. It can be seen that in the embodiment of the present application, the mapping between the second port and the port on the user device is realized through the first port and the layer 2 tunnel on the first switching device, so as to achieve MLAG aggregation of the remote second switching device, and then when the user device is physically connected to one MLAG switching device, there is no need for the user device to be physically connected to another MLAG switching device, and traffic load sharing is achieved at a lower networking cost.

[0233] In some embodiments, the message forwarding device may further include:

[0234] A sixth receiving module, used to receive a second original message sent by the three-layer network device to the user equipment;

[0235] A second loopback module, used for looping back the second original message to the second port;

[0236] A second encapsulation module, used to encapsulate the second original message to obtain a second tunnel message;

[0237] The sixth sending module is used to send the second tunnel message to the first switching device through the second layer tunnel, so that the first switching device decapsulates the second tunnel message to obtain the second original message, and sends the second original message to the user device through the first port.

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

[0239] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0240] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned message forwarding methods are implemented.

[0241] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any message forwarding method in the above embodiments.

[0242] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part 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, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0243] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0244] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the method, device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the system embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the system embodiment.

[0245] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A message forwarding method, characterized in that: A first switching device included in a cross-device link aggregation group MLAG, the MLAG also includes a second switching device, a first port on the first switching device is connected to a user device through a physical link, and the first port is connected to a second port on the second switching device through a layer 2 tunnel, and an aggregation member port of the MLAG includes the second port, and the method includes: Receiving, through the first port, a first original message sent by the user equipment; Encapsulating the first original message to obtain a first tunnel message; The first tunnel message is sent to the second switching device through the second layer tunnel, so that the second switching device decapsulates the first tunnel message to obtain the first original message, loops the first original message back to the second port, and sends the first original message to the third layer network device.

2. The method according to claim 1, characterized in that The method further comprises: receiving, through the layer 2 tunnel, a second tunnel message sent by the second switching device; Decapsulating the second tunnel message to obtain a second original message; Send the second original message 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, and the value of the outgoing port field 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, 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 maintained second original message to the user equipment through the first port.

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

5. The method according to claim 4, characterized in that The method further comprises: receiving a fourth original 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 is applied to a second switching device included in a cross-device link aggregation group MLAG, wherein the MLAG further includes a first switching device, wherein a first port on the first switching device is connected to a user device via a physical link, and the first port is connected to a second port on the second switching device via a layer 2 tunnel, and an aggregation member port of the MLAG includes the second port; and the method includes: Receiving, through the layer 2 tunnel, a first tunnel message sent by the first switching device; Decapsulating the first tunnel message to obtain a first original message; Looping the first original message back to the second port; The first original message is sent to the layer-3 network device.

7. The method according to claim 6, characterized in that The method further comprises: Receiving a second original message sent by the layer-3 network device to the user equipment; Looping the second original message back to the second port; Encapsulating the second original message to obtain a 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 decapsulates the second tunnel message to obtain the second original message, and sends 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, wherein the MLAG further includes a second switching device, wherein a first port on the first switching device is connected to a user device via a physical link, and the first port is connected to a second port on the second switching device via a layer 2 tunnel, and an aggregation member port of the MLAG includes the second port, and the device includes: a first receiving module, configured to receive a first original message sent by the user device via the first port; A first encapsulation module, used to encapsulate the first original message to obtain a first tunnel message; The first sending module is used to send the first tunnel message to the second switching device through the second layer tunnel, so that the second switching device decapsulates the first tunnel message to obtain the first original message, loops the first original message back to the second port, and sends the first original message to the third layer network device.

9. A message forwarding device, characterized in that: The device is applied to a second switching device included in a cross-device link aggregation group MLAG, wherein the MLAG also includes a first switching device, a first port on the first switching device is connected to a user device through a physical link, and the first port is connected to a second port on the second switching device through a layer 2 tunnel, and an aggregation member port of the MLAG includes the second port; the device includes: A second receiving module, used for receiving a first tunnel message sent by the first switching device through the layer 2 tunnel; A first decapsulation module, configured to decapsulate the first tunnel message to obtain a first original message; A first loopback module, used for looping the first original message back to the second port; The second sending module is used to send the first original message to the three-layer network device.

10. An electronic device, characterized in that: It includes a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method described in 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, and when the computer program is executed by a processor, the method described in any one of claims 1-5 or 6-7 is implemented.

Citation Information

Patent Citations

  • Message forwarding method and device

    CN108156066A

  • Table entry generation method and device

    CN112187609A

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

    CN115665033A

  • Framework for universally specified affinity topologies with partial path invalidation and generalized network flows

    US20180167307A1

  • Multi-Chassis Link Aggregation Learning on Standard Ethernet Links

    US20190007301A1