A message processing method and related device

By adding physical MAC addresses to the M-LAG network for forwarding protocol messages, the problem of protocol messages that cannot be forwarded under dual active access of the server is solved, and simplified configuration and efficient forwarding are achieved.

CN114827027BActive Publication Date: 2025-08-15HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110071068.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-19
Publication Date
2025-08-15
Estimated Expiration
2041-01-19

AI Technical Summary

Technical Problem

In data center networking, when the server adopts dual active access mode, the protocol packet cannot be forwarded correctly due to the survival time (TTL) of 1. The prior art requires configuring the server one by one to adjust the TTL, which leads to cumbersome configuration process.

Method used

In the M-LAG networking, by adding the physical MAC address of the destination network device to the protocol message, the network device forwards based on the MAC address, avoiding verification of TTL, and realizing normal forwarding of the protocol message.

Benefits of technology

There is no need to configure the server specifically, which simplifies the configuration process and improves the forwarding efficiency of protocol packets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114827027B_ABST
    Figure CN114827027B_ABST
Patent Text Reader

Abstract

A message processing method and network device, the method being applied to a network system comprising a first network device, a second network device, and a third network device, wherein the third network device is multi-homed to the first and second network devices, the first network device being configured with a first physical MAC address and a virtual MAC address, the second network device being configured with a second physical MAC address and a virtual MAC address, the virtual MAC address being used to forward user data messages to the network side. The method comprises: the first network device receiving a protocol message from the third network device, the protocol message including a second physical MAC address; and the first network device forwarding the protocol message to the second network device based on the second physical MAC address. Based on the solution of the present application, normal forwarding of protocol messages can be achieved without special configuration of the server, thus avoiding a cumbersome configuration process.
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 processing method and related devices. Background Art

[0002] In data center networking, servers are typically dual-homed to two switches using an active-active configuration. These switches then share the server load. This networking configuration is often referred to as a multi-chassis link aggregation group (M-LAG). M-LAG is a networking method that enables cross-chassis link aggregation, enabling link aggregation between multiple devices to improve link reliability.

[0003] In an M-LAG networking configuration, the two switches connected to the server are configured with the same Media Access Control (MAC) address (often called a virtual MAC address). The packets sent by the server are randomly hashed and routed to any of the switches. In this case, if the server needs to send a protocol packet to Switch 1, such as a Border Gateway Protocol (BGP) packet used to establish a neighbor relationship, and the protocol packet is hashed and routed to Switch 2, the protocol packet cannot be correctly forwarded to Switch 1 because the time to live (TTL) in the protocol packet is 1 and the switch's forwarding chip generally does not support forwarding packets with a TTL of 1.

[0004] Based on this, related technologies configure servers so that when sending protocol packets, the server adjusts the TTL to a value greater than 1, thereby ensuring that subsequent protocol packets can be forwarded to the corresponding switch. However, since data centers typically include a large number of servers, related technologies require configuring each server in the data center one by one, which is a cumbersome configuration process. Summary of the Invention

[0005] This application provides a message processing method that adds the unique physical MAC address of the destination network device to the protocol sent to network devices in an M-LAG, rather than using a virtual MAC address. This allows the network devices in the M-LAG to perform Layer 2 forwarding of protocol messages containing the physical MAC addresses of other network devices in the M-LAG based on the MAC addresses, without verifying whether the TTL in the protocol message is greater than 1. This method allows the protocol message to be forwarded to the destination network device. This solution does not require special server configuration, avoiding a tedious configuration process.

[0006] In a first aspect, the present application provides a message processing method, which is applied to a network system, wherein the network system includes a first network device, a second network device, and a third network device, and the third network device is multi-homed and connected to the first network device and the second network device. The third network device can be connected to the gateway interface on the first network device and the gateway interface on the second network device. Exemplarily, the networking method between the first network device, the second network device, and the third network device can be the above-mentioned M-LAG. The first network device is configured with a first physical MAC address and a virtual MAC address, and the second network device is configured with a second physical MAC address and the virtual MAC address, and the virtual MAC address is used to forward user data packets to the network side. The physical MAC address can also be called a real MAC address.

[0007] In addition, the third network device may include the first physical MAC address configured by the first network device, the second physical MAC address configured by the second network device, and the virtual MAC address.

[0008] The message processing method includes: the first network device receives a protocol message from the third network device, the protocol message including the second physical MAC address. The first network device forwards the protocol message to the second network device based on the second physical MAC address. In simple terms, when the first network device and the second network device are configured to load balance messages sent by the third network device, the protocol message sent by the third network device is randomly hashed and routed to either the first network device or the second network device. Without distinguishing between protocol messages and user data messages, the protocol message sent by the third network device to the second network device is randomly hashed and routed to the first network device based on the load sharing mode between the first and second network devices. This means that the first network device receives the protocol message from the third network device, and the destination of the protocol message is the second network device. In this case, the third network device can carry the second physical MAC address in the protocol message to instruct the first network device receiving the protocol message to forward the protocol message to the second network device based on the fact that the second physical MAC address included in the protocol message is not its own physical MAC address. In addition, when the message type forwarded by the third network device is a user data message, the virtual MAC address of the second network device can be carried in the user data message. After receiving the user data message, the second network device performs Layer 2 termination on the forwarding plane and forwards the user data message to the network-side device using the routing information on the control plane.

[0009] Optionally, the protocol message received by the first network device from the third network device includes TTL, and the TTL in the protocol message forwarded by the first network device to the second network device is not reduced by 1, that is, the TTL in the protocol message forwarded by the first network device is still 1.

[0010] In the present application, by carrying the physical MAC address of the destination network device in the protocol message sent by the third network device, a network device other than the destination network device and connected to the third network device can forward the protocol message to the destination network device based on the physical MAC address, and the TTL does not decrease by 1 during the forwarding process. The solution of the present application eliminates the need for special configuration of the server, avoiding a tedious configuration process.

[0011] Optionally, the method further includes: the first network device receives a request message from the third network device, the request message including the first physical Internet Protocol IP address. The first network device sends a response message to the third network device, the response message including the first physical MAC address, and the first physical MAC address corresponds to the physical IP address of the first network device. In other words, the third network device is configured with the first physical IP address on the first network device and the second physical IP address on the second network device. The third network device can obtain the first virtual MAC address corresponding to the first physical IP address in the first network device and the second physical MAC address corresponding to the second physical IP address in the second network device by sending request messages to the first network device and the second network device.

[0012] In this application, the third network device obtains the physical MAC address corresponding to the physical IP address by sending a request message including the physical IP address to the first network device, so that the third network device can add the physical MAC address to the protocol message when sending the protocol message to the first network device later, thereby realizing normal forwarding of the protocol message and avoiding cumbersome configuration.

[0013] Optionally, when the network in which the first network device and the third network device are located runs Internet Protocol version 4 (IPv4), the first request message sent by the third network device may be an Address Resolution Protocol (ARP) request message. When the network in which the first network device and the third network device are located runs Internet Protocol version 6 (IPv6), the first request message sent by the third network device may be a Neighbor Discovery (ND) request message. The third network device requests the physical MAC address through an ARP request message or an ND request message.

[0014] Optionally, there are multiple ways for the first network device to forward the protocol message to the second network device.

[0015] In one possible implementation, a MAC forwarding table entry is stored in a first network device. The first network device forwards a protocol message to a second network device based on the MAC forwarding table entry. Specifically, the first network device searches the MAC forwarding table entry based on the second physical MAC address in the protocol message and obtains the first outbound interface corresponding to the protocol message. The first outbound interface is the interface connecting the first network device and the second network device. The first network device then forwards the protocol message to the second network device based on the first outbound interface.

[0016] In another possible implementation, the first network device forwards the protocol message to the second network device by broadcasting according to the second physical MAC address.

[0017] In the present application, the first network device forwards the protocol message to the second network device in a variety of ways, which can improve the flexibility of the solution.

[0018] Optionally, the protocol message received by the first network device may be a Border Gateway Protocol (BGP) message, a Bidirectional Forwarding Detection (BFD) message, an Open Shortest Path First (OSPF) message, or an Intermediate System to Intermediate System (IS-IS) message. That is, one or more of the above-mentioned BGP, BFD, OSPF, and IS-IS protocols may be run between the first network device and the third network device.

[0019] Optionally, the next hop address of the route published by the first network device to the third network device is the virtual IP address of the first network device.

[0020] In one possible implementation, when the first network device, as a route publisher, publishes a route to a third network device, the first network device generates a target route. For example, when the first network device needs to publish a route to another network device, the first network device can generate a target route based on a virtual IP address, wherein the next hop address of the target route is the virtual IP address of the first network device, and the destination address of the target route can be the loopback address of the first network device.

[0021] In another possible implementation, the first network device obtains a first route from a neighboring device, the first route including a next hop address. The first network device updates the next hop address in the first route with the virtual IP address of the first network device to obtain a second route. The first network device sends the second route to the third network device.

[0022] Optionally, the method further includes: the first network device receiving a user data packet from the third network device; the first network device searching a routing table entry to obtain a second outbound interface based on the virtual MAC address included in the user data packet; and the first network device forwarding the user data packet through the second outbound interface.

[0023] Optionally, the first network device searches for a routing table entry to obtain a second outgoing interface based on the virtual MAC address included in the user data packet, including: the first network device terminates the user data packet on the forwarding plane based on the virtual MAC address included in the user data packet. The first network device searches for the routing table entry on the control plane to obtain the second outgoing interface, and forwards the user data packet through the second outgoing interface. Specifically, the first network device terminates the user data packet on the forwarding plane means that the first network device strips off the Ethernet header in the user data packet and sends the user data packet to the control plane to achieve forwarding of the user data packet. The routing table entry in the first network device can be generated by the first network device when it obtains the above-mentioned route. Exemplarily, after receiving the first route sent by the neighboring device, the first network device can search the routing table according to the next hop address in the first route (that is, the loopback address of the neighboring device of the first network device) to obtain the outgoing interface corresponding to the first route (that is, the above-mentioned second outgoing interface). Then, the first network device generates a routing table entry according to the destination address of the first route (ie, the destination address of the user mentioned above) and the second outbound interface. The routing table entry includes the destination address of the user and the second outbound interface.

[0024] A second aspect of the present application provides a message processing method, which is applied to a network system, wherein the network system includes a first network device, a second network device, and a third network device, wherein the third network device is multi-homed to the first network device and the second network device. The message processing method includes: the third network device sends a request message, wherein the request message includes the physical IP address of the first network device; the third network device receives a response message, wherein the response message includes the physical MAC address of the first network device, and the physical IP address of the first network device corresponds to the physical MAC address of the first network device; and the third network device sends a protocol message, wherein the protocol message includes the physical MAC address, and the physical MAC address is used to instruct the first network device to forward the protocol message to the second network device.

[0025] Optionally, the method further includes: the third network device receiving a route sent by the first network device, the route including a destination address and a next-hop address of the user, and the next-hop address being a virtual IP address of the first network device.

[0026] Optionally, the method also includes: the third network device generates a user data packet, the user data packet includes the destination address of the user; the third network device searches for a routing table entry based on the destination address of the user, and determines that the next hop address of the user data packet is the virtual IP address of the first network device; the third network device obtains a virtual MAC address corresponding to the virtual IP address of the first network device; the third network device updates the user data packet based on the virtual MAC address to obtain an updated user data packet, and the updated user data packet includes the virtual MAC address.

[0027] Optionally, the request information is Address Resolution Protocol ARP request information or neighbor discovery information.

[0028] Optionally, the protocol message includes a BGP message, a BFD protocol message, an OSPF protocol message or an IS-IS protocol message.

[0029] A third aspect of the present application provides a network device, wherein the network device is a first network device in a network system. The network system includes a first network device, a second network device, and a third network device, wherein the third network device is multi-homed to the first network device and the second network device. The network device includes a transceiver unit, an acquisition unit, and a processing unit; the transceiver unit is configured to receive a protocol message from the third network device, the protocol message including the second physical MAC address; and the transceiver unit is further configured to forward the protocol message to the second network device based on the second physical MAC address.

[0030] Optionally, the transceiver unit is also used to receive a request message from the third network device, the request message including the first physical Internet Protocol IP address; the transceiver unit is also used to send a response message to the third network device, the response message including the first physical MAC address, and the first physical MAC address has a corresponding relationship with the physical IP address of the first network device.

[0031] Optionally, the request message is an Address Resolution Protocol ARP request message or a neighbor discovery message.

[0032] Optionally, the protocol message received by the network device from the third network device includes a time to live (TTL), and the TTL in the protocol message forwarded by the network device to the second network device does not decrease by 1.

[0033] Optionally, the processing unit is used to search the MAC forwarding table entry according to the second physical MAC address to obtain the first output interface corresponding to the protocol message; the transceiver unit is also used for the first network device to forward the protocol message to the second network device according to the first output interface.

[0034] Optionally, the transceiver unit is further configured to forward the protocol message to the second network device by broadcasting according to the second physical MAC address.

[0035] Optionally, the protocol message includes a BGP message, a BFD protocol message, an OSPF protocol message or an IS-IS protocol message.

[0036] Optionally, the acquisition unit is used to obtain a first route, which includes a next hop address; the processing unit is also used to update the next hop address in the first route to the virtual IP address of the first network device to obtain a second route; the transceiver unit is also used to send the second route to the third network device.

[0037] Optionally, the transceiver unit is also used to receive user data packets from the third network device; the processing unit is also used to search the routing table entry to obtain the second output interface based on the virtual MAC address included in the user data packet; the transceiver unit is also used to forward the user data packet through the second output interface.

[0038] Optionally, the processing unit is further configured to terminate the user data packet on the forwarding plane based on the user data packet including the virtual MAC address. The processing unit is further configured to search the routing table entry on the control plane to obtain the second outbound interface, and forward the user data packet through the second outbound interface by the transceiver unit.

[0039] The fourth aspect of the present application provides a network device, which is a third network device in a network system. The network system includes a first network device, a second network device and a third network device, and the third network device is multi-homed and connected to the first network device and the second network device. The network device includes a transceiver unit, an acquisition unit and a processing unit. The transceiver unit is used to send a request message, and the request message includes the physical IP address of the first network device; the transceiver unit is also used to receive a response message, and the response message includes the physical MAC address of the first network device, and the physical IP address of the first network device has a corresponding relationship with the physical MAC address of the first network device; the transceiver unit is also used to send a protocol message, and the protocol message includes the physical MAC address, and the physical MAC address is used to instruct the first network device to forward the protocol message to the second network device.

[0040] Optionally, the transceiver unit is further configured to receive a route sent by the first network device, where the route includes a destination address and a next-hop address of the user, and the next-hop address is a virtual IP address of the first network device.

[0041] Optionally, the processing unit is used to generate a user data packet, which includes the destination address of the user; the processing unit is also used to search the routing table entry according to the destination address of the user, and determine that the next hop address of the user data packet is the virtual IP address of the first network device; the acquisition unit is used to obtain the virtual MAC address corresponding to the virtual IP address of the first network device; the processing unit is also used to update the user data packet according to the virtual MAC address to obtain an updated user data packet, and the updated user data packet includes the virtual MAC address.

[0042] Optionally, the request information is Address Resolution Protocol ARP request information or neighbor discovery information.

[0043] Optionally, the protocol message includes a BGP message, a BFD protocol message, an OSPF protocol message or an IS-IS protocol message.

[0044] In a fifth aspect, the present application provides a network device, comprising: a processor configured to cause the network device to implement the method described in any possible implementation of the first or second aspects. The device may also include a memory coupled to the processor, and when the processor executes instructions stored in the memory, the network device may implement the method described in any possible implementation of the first or second aspects. The device may also include a communication interface configured to enable the device to communicate with other devices. Exemplarily, the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface.

[0045] The instructions in the memory of this application can be pre-stored or downloaded from the Internet when using the network device. This application does not specifically limit the source of the instructions in the memory. Coupling in this application refers to an indirect coupling or connection between devices, units or modules, which can be electrical, mechanical or other forms, for information exchange between devices, units or modules.

[0046] In a sixth aspect, the present application provides a computer storage medium, which may be non-volatile; the computer storage medium stores computer-readable instructions, which, when executed by a processor, implement the method described in any possible implementation of the first aspect or the second aspect.

[0047] In a seventh aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in any possible implementation of the first aspect or the second aspect.

[0048] In an eighth aspect, the present application provides a network system, which includes a network device as described in any implementation of the first aspect and multiple network devices connected to the network device as described in any implementation of the first aspect or the second aspect.

[0049] The solutions provided in the second to sixth aspects are used to implement or cooperate with the method provided in the first aspect, and therefore can achieve the same or corresponding beneficial effects as the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is a diagram of an M-LAG network in a data center.

[0051] Figure 2 A flowchart of a message processing method provided in an embodiment of the present application;

[0052] Figure 3a A schematic diagram of the format of a protocol message provided in an embodiment of the present application;

[0053] Figure 3b A schematic diagram of the format of an IP header provided in an embodiment of the present application;

[0054] Figure 3c A schematic diagram of the format of an Ethernet header provided in an embodiment of the present application;

[0055] Figure 4 A flowchart of a message processing method provided in an embodiment of the present application;

[0056] Figure 5 A flowchart of a method for processing user data messages provided in an embodiment of the present application;

[0057] Figure 6a A schematic diagram of a process for establishing a protocol connection between a server and a leaf switch provided in an embodiment of the present application;

[0058] Figure 6b A schematic diagram of a process for routing publication and user data message forwarding provided in an embodiment of the present application;

[0059] Figure 7 A schematic diagram of the architecture of a network system provided in an embodiment of the present application;

[0060] Figure 8A schematic diagram of the structure of a network device 800 provided in an embodiment of the present application;

[0061] Figure 9 A schematic diagram of the structure of a network device 900 provided in an embodiment of the present application;

[0062] Figure 10 A schematic diagram of the structure of a network device 1000 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the following describes the embodiments of this application in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this application, rather than all the embodiments. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0064] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or that are inherent to these processes, methods, products or devices. The naming or numbering of steps in this application does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The process steps that have been named or numbered can be changed in the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved. The division of units in this application is a logical division. In actual application, there may be other division methods. For example, multiple units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, and the indirect coupling or communication connection between units can be electrical or other similar forms, which are not limited in this application. Moreover, the units or sub-units described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed into multiple circuit units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this application.

[0065] In data center networking, servers are typically dual-homed to two switches using an active-active configuration. These two switches then share the server load. This networking configuration is often referred to as a multi-chassis link aggregation group (M-LAG), or MC-LAG. The basic concept of M-LAG technology is to have two switches negotiate link aggregation with connected devices in the same state. From the perspective of the connected devices, this creates a link aggregation relationship with a single device. This mechanism for implementing multi-chassis link aggregation enables link aggregation between multiple devices. As a logical link aggregation group, M-LAG requires consistent table entries on both ends of the peer devices (i.e., the two switches mentioned above). Therefore, table entries are typically synchronized across the M-LAG via the peerlink between the peer devices. Simply put, M-LAG is a networking configuration that implements multi-chassis link aggregation, enabling link aggregation between multiple devices and improving link reliability.

[0066] See Figure 1 , Figure 1 The following is a diagram of an M-LAG network in a data center. Figure 1 As shown, for servers 1 through 4, each server is dual-homed to two leaf switches. For example, server 1 is dual-homed to leaf switches 1 and 2, and data packets sent from server 1 to the outside are load-balanced by leaf switches 1 and 2.

[0067] In the M-LAG networking mode, the two leaf switches connected to server 1 are configured with the same Media Access Control (MAC) address (usually called a virtual MAC address), and the messages sent by the server will be randomly hashed and sent to any switch. In this case, if the server needs to send a protocol message to leaf switch 1, for example, the server needs to send a Border Gateway Protocol (BGP) connection message to leaf switch 1, and the protocol message is hashed and sent to leaf switch 2. Since server 1 is directly connected to leaf switch 1, the time to live (TTL) in the protocol message sent by server 1 is 1. However, since the forwarding chip of the switch usually does not support forwarding messages with a TTL of 1, the protocol message cannot be correctly forwarded to leaf switch 1.

[0068] Based on this, related technologies configure servers so that when sending protocol packets, the server can adjust the TTL to a value greater than 1, thereby ensuring that subsequent protocol packets can be forwarded to the corresponding switch. However, since data centers typically include a large number of servers, related technologies require configuring each server in the data center one by one, which is a cumbersome configuration process.

[0069] In view of this, embodiments of the present application provide a message processing method. By adding the unique physical MAC address of the destination network device to the protocol sent to network devices in an M-LAG, when the network devices in the M-LAG receive protocol messages containing the physical MAC addresses of other network devices in the M-LAG, they perform Layer 2 forwarding of the protocol messages based on the MAC addresses without checking whether the TTL in the protocol messages is greater than 1, thereby forwarding the protocol messages to the destination network device. This solution does not require special server configuration, avoiding a cumbersome configuration process.

[0070] Although the above description uses the M-LAG networking scenario as an example to illustrate the scenario in which the message processing method provided in the embodiment of the present application is applied, it is understandable that the message processing method provided in the embodiment of the present application can also be applied to other service scenarios with dual-homing access or multi-homing access, and is not intended to be limited to the service scenarios in which the embodiment of the present application is applied.

[0071] See Figure 2 , Figure 2 A flow chart of a message processing method provided in an embodiment of the present application. The message processing method provided in an embodiment of the present application is applied to a network system, wherein the network system includes a first network device, a second network device, and a third network device, and the third network device is multi-homed and connected to the first network device and the second network device. The third network device can be connected to a gateway interface on the first network device and a gateway interface on the second network device. Exemplarily, the networking method between the first network device, the second network device, and the third network device can be the above-mentioned M-LAG.

[0072] The first network device is configured with a first physical MAC address and a virtual MAC address, and the second network device is configured with a second physical MAC address and the virtual MAC address, where the virtual MAC address is used to forward user data packets to the network side. In other words, the first network device and the second network device are configured with different physical MAC addresses, and the first network device and the second network device are configured with the same virtual MAC address, where the virtual MAC address is used by the first network device and the second network device to forward user data packets to the network side.

[0073] Among them, the first physical MAC address configured by the first network device may refer to the MAC address of the gateway interface on the first network device connected to the third network device, and the first physical MAC address can be used to uniquely identify the gateway interface on the first network device connected to the third network device. Similarly, the second physical MAC address configured by the second network device may refer to the MAC address of the gateway interface on the second network device connected to the third network device, and the second physical MAC address can be used to uniquely identify the gateway interface on the second network device connected to the third network device. As the unique identifier of the gateway interface in the network device, the first physical MAC address and the second physical MAC address can be respectively configured in the first network device and the second network device before the first network device and the second network device leave the factory. The above takes the first physical MAC address and the second physical MAC address as the addresses of the gateway interface as an example. In other possible application scenarios, the first physical MAC address and the second physical MAC address may also point to other objects.

[0074] In addition, the above-mentioned virtual MAC address can be configured on the first network device and the second network device in a variety of ways. For example, the network administrator can statically configure the same virtual MAC address on the first network device and the second network device through manual configuration. For another example, the controller can dynamically assign virtual MAC addresses to network devices in the network system. After assigning the same virtual MAC address to the first network device and the second network device, the controller sends the assigned virtual MAC address to the first network device and the second network device, so that the first network device and the second network device can configure the virtual MAC address. For another example, the first network device dynamically assigns a virtual MAC address and sends the assigned virtual MAC address to the second network device, so that the first network device and the second network device are configured with the same virtual MAC address.

[0075] In this embodiment, the multi-homing of the third network device to the first network device and the second network device may include: the third network device dual-homing to the first network device and the second network device, or the third network device multi-homing to the first network device, the second network device, and other network devices, for example, the third network device triple-homing to the first network device, the second network device, and the fourth network device. For ease of introduction, the message processing method provided in the embodiment of the present application will be introduced below using the example of the third network device dual-homing to the first network device and the second network device.

[0076] In this embodiment, the first network device and the second network device in the network system may be, for example, physical devices such as routers, switches, or gateways, or may be virtual devices that support packet forwarding. This embodiment does not limit the specific types of the first network device and the second network device. The third network device may be, for example, a server or other user-side device.

[0077] like Figure 2 As shown, the message processing method at least includes the following steps 201-202.

[0078] Step 201: The first network device receives a protocol message from the third network device, where the protocol message includes the second physical MAC address.

[0079] Because the third network device is multi-homed to the first and second network devices, when the first and second network devices are configured to load-share packets sent by the third network device, protocol packets sent by the third network device are randomly hashed and routed to either the first or second network devices. In this embodiment, protocol packets sent by the third network device to the second network device are randomly hashed and routed to the first network device, meaning that the first network device receives protocol packets from the third network device, and the destination of the protocol packets is the second network device.

[0080] The third network device can store the second physical MAC address (i.e., the physical MAC address of the second network device) and the second physical IP address (i.e., the physical IP address of the second network device), and a correspondence between the second physical MAC address and the second physical IP address is established in the third network device. The third network device can find the corresponding second physical MAC address based on the second physical IP address. In this way, when the third network device needs to send a protocol message to the second network device, it can find the corresponding second physical MAC address based on the second physical IP address of the second network device and carry the second physical MAC address in the message.

[0081] Optionally, the third network device can obtain the second physical MAC address and the second physical IP address through a variety of methods. For example, the network administrator can statically configure the second physical MAC address and the second physical IP address corresponding to the second network device on the third network device through manual configuration; or, the controller can send the second physical MAC address and the second physical IP address to the third network device, thereby enabling the third network device to implement the configuration of the second physical MAC address and the second physical IP address. For another example, the third network device obtains the second physical IP address corresponding to the second network device through manual configuration by the network administrator or through issuance by the controller. The third network device then sends a request message to the second network device based on the second physical IP address, and receives a response message including the second physical MAC address returned by the second network device, thereby obtaining the second physical MAC address and the second physical IP address. Similarly, the third network device can obtain the physical IP address (i.e., the first physical IP address) and physical MAC address (i.e., the first physical MAC address) of the first network device through the above-mentioned methods, which will not be repeated here.

[0082] Optionally, the protocol message received by the first network device may be a Border Gateway Protocol (BGP) message, a Bidirectional Forwarding Detection (BFD) protocol message, an Open Shortest Path First (OSPF) protocol message, or an Intermediate System to Intermediate System (IS-IS) protocol message. That is, one or more of the above-mentioned BGP, BFD protocol, OSPF protocol, and IS-IS protocol may be run between the first network device and the third network device. For example, BGP is run between the first network device and the third network device, or BGP and BFD protocols are run simultaneously between the first network device and the third network device, and the BFD protocol is used to improve the convergence speed of routing when a link fails. Exemplarily, when BGP is run between the first network device and the third network device, the protocol message received by the first network device may be a message requesting to establish a BGP connection, that is, the protocol message is a message used by the third network device to request to establish a BGP connection with the second network device.

[0083] Step 202: The first network device forwards the protocol message to the second network device according to the second physical MAC address.

[0084] In this embodiment, after the first network device receives the protocol message, the first network device forwards the protocol message to the second network device because the second physical MAC address included in the protocol message is not the physical MAC address corresponding to the first network device.

[0085] There are multiple ways for the first network device to forward the protocol message to the second network device.

[0086] In one possible implementation, a MAC forwarding table entry is stored in a first network device. The first network device forwards a protocol message to a second network device based on the MAC forwarding table entry. Specifically, the first network device searches the MAC forwarding table entry based on the second physical MAC address in the protocol message and obtains the first outbound interface corresponding to the protocol message. The first outbound interface is the interface connecting the first network device and the second network device. The first network device then forwards the protocol message to the second network device based on the first outbound interface.

[0087] Optionally, a peer link may be established between the first network device and the second network device. The peer link may be a physical link or a logical link simulated by a tunnel, for implementing message communication between the first network device and the second network device. The first network device may send protocol messages to the second network device via the peer link.

[0088] Among them, the MAC forwarding table entry in the first network device can be manually configured in the first network device by the network administrator; the MAC forwarding table entry can also be sent to the first network device by the controller; the MAC forwarding table entry can also be generated by the first network device after receiving the second physical MAC address sent by the second network device.

[0089] In another possible implementation, the first network device forwards the protocol message to the second network device by broadcasting according to the second physical MAC address. In simple terms, the first network device may forward the protocol message to other network devices that implement load sharing with the first network device according to the second physical MAC address. For example, in the case where the third network device is triple-homed to the first network device, the second network device and the fourth network device, a peer link is established between the first network device and the second network device, and a peer link is also established between the first network device and the fourth network device. The first network device may broadcast the protocol message to the second network device and the fourth network device through the peer link between the first network device and the second network device and the peer link between the first network device and the fourth network device.

[0090] In one possible scenario, the protocol message received by the first network device from the third network device includes a TTL, and the TTL is 1. The TTL in the protocol message forwarded by the first network device to the second network device is not reduced by 1, that is, the TTL in the protocol message forwarded by the first network device remains 1.

[0091] It is understandable that during the data communication process, the device that initiates the message can encapsulate a layer of header based on the data payload according to each layer of protocol it follows; after the data reaches the destination network device, the destination network device then strips off the corresponding header according to each layer of protocol it follows. Figure 3a , Figure 3a A schematic diagram of the format of a protocol message provided in an embodiment of the present application. Figure 3a As shown, the protocol message sent by the third network device includes a data payload, an IP header, and an Ethernet header. The data payload includes the data content of the third network device requesting to establish a connection. Figure 3b , Figure 3b This is a schematic diagram of the format of an IP header provided in an embodiment of the present application. Figure 3b As shown in the figure, the IP header includes the survival time (TTL), source IP address, destination IP address, etc. The TTL in the IP message is 1. Figure 3c , Figure 3c This is a schematic diagram of the format of an Ethernet header provided in an embodiment of the present application. Figure 3c As shown, the Ethernet header includes contents such as the destination address, source address and type. Specifically, the destination address in the Ethernet header can be the above-mentioned second physical MAC address. After receiving the protocol message, the first network device forwards the protocol message according to the second physical MAC address in the Ethernet header. The first network device does not strip off the Ethernet header in the protocol message, that is, the first network device does not perform Layer 2 termination, and the protocol message will not be uploaded to the third layer for processing. Therefore, the first network device does not check the TTL in the IP header, so that the protocol message can be forwarded to the second network device. Since the first network device does not perform Layer 2 termination, the first network device will not modify the IP header, that is, the TTL in the IP header will not be reduced by 1, and the TTL in the protocol message forwarded by the first network device is still 1.

[0092] Optionally, when a first network device forwards a protocol message to a second network device, the first network device may transparently transmit the protocol message to the second network device, i.e., the first network device does not modify any content in the protocol message. Alternatively, the first network device may perform certain updates on the protocol message and then forward the updated protocol message to the second network device. For example, the first network device may modify information in one or more fields in the header of the protocol message and then forward the modified protocol message to the second network device. In actual applications, the first network device may choose to transparently transmit the protocol message to the second network device or send the updated protocol message, depending on the type of the protocol message.

[0093] After the second network device receives the protocol message forwarded by the first network device, the second network device determines that the protocol message includes the second physical MAC address. Therefore, the second network device performs Layer 2 termination, specifically, stripping off the Ethernet header in the protocol message and verifying the IP header. Because the destination IP address in the IP header is the physical IP address of the second network device, and the TTL in the IP header is 1, the second network device can perform a response operation to the third network device based on the protocol message. For example, if the protocol message is a message requesting the establishment of a BGP connection, the second network device sends a response message to the third network device requesting the establishment of a BGP connection, thereby establishing the BGP connection.

[0094] Therefore, in the embodiment of the present application, by carrying the physical MAC address of the destination network device in the protocol message sent by the third network device, a network device other than the destination network device and connected to the third network device can forward the protocol message to the destination network device based on the physical MAC address, and the TTL does not decrease by 1 during the forwarding process. The solution of the embodiment of the present application eliminates the need for special configuration of the server, avoiding a tedious configuration process.

[0095] See Figure 4 , Figure 4 A flow chart of a message processing method provided in an embodiment of the present application. Figure 4 As shown, the message processing method includes steps 401-408.

[0096] 401. A third network device sends a first request message to a first network device, where the first request message includes a first physical IP address.

[0097] In this embodiment, the third network device is configured with the first physical IP address on the first network device and the second physical IP address on the second network device. The third network device can obtain the first physical MAC address corresponding to the first physical IP address in the first network device and the second physical MAC address corresponding to the second physical IP address in the second network device by sending request messages to the first network device and the second network device.

[0098] Optionally, when the network in which the first network device and the third network device are located runs Internet Protocol version 4 (IPv4), the first request message sent by the third network device may be an Address Resolution Protocol (ARP) request message. When the network in which the first network device and the third network device are located runs Internet Protocol version 6 (IPv6), the first request message sent by the third network device may be a Neighbor Discovery (ND) request message.

[0099] 402. The first network device sends a first response message to the third network device, where the first response message includes the first physical MAC address, and the first physical MAC address corresponds to the physical IP address of the first network device.

[0100] Since a correspondence between the first physical MAC address and the first physical IP address is established in the first network device, that is, the first physical MAC address is associated with the first physical IP address, the first network device can send a first response message including the first physical MAC address to the third network device based on the first physical IP address in the first request message.

[0101] Optionally, when the network in which the first network device and the third network device are located runs IPv4, the first response message sent by the first network device may be an ARP response message. When the network in which the first network device and the third network device are located runs IPv6, the first response message sent by the first network device may be an ND response message.

[0102] 403. The third network device sends a second request message to the second network device, where the second request message includes the second physical IP address.

[0103] 404. The second network device sends a second response message to the third network device, where the second response message includes the second physical MAC address, and the second physical MAC address corresponds to the physical IP address of the second network device.

[0104] In this embodiment, steps 403-404 are similar to the above-mentioned steps 401-402. For details, please refer to steps 401-402 and will not be repeated here.

[0105] It is worth noting that there is no order restriction between steps 401-402 and steps 403-404. Steps 401-402 may be executed first, or steps 403-404 may be executed first, or they may be executed simultaneously.

[0106] 405. The third network device establishes a correspondence between the first physical IP address and the first physical MAC address according to the first response message, and establishes a correspondence between the second physical IP address and the second physical MAC address according to the second response message.

[0107] After the third network device receives the first response message, the third network device may establish a correspondence between the first physical IP address and the first physical MAC address based on the first physical MAC address in the first response message. Similarly, after the third network device receives the second response message, the third network device may establish a correspondence between the second physical IP address and the second physical MAC address based on the second physical MAC address in the second response message.

[0108] Exemplarily, the third network device may establish an association table (eg, an ARP table) that records associated IP addresses and MAC addresses, namely, the first physical IP address and the first physical MAC address, and the second physical IP address and the second physical MAC address.

[0109] 406. The third network device sends a protocol message to the first network device, where the protocol message includes the second physical MAC address.

[0110] After the third network obtains the second physical MAC address corresponding to the second physical IP address of the second network device, when the third network device needs to send a protocol message to the second network device, the third network device can search the above-mentioned association table based on the second physical IP address of the second network device to determine the second physical MAC address. The third network device can then encapsulate the second physical IP address and the second physical MAC address in the protocol message and send the protocol message. The protocol message sent by the third network device is randomly hashed and routed to the first network device, that is, the first network device receives the protocol message from the third network device, and the destination of the protocol message is the second network device.

[0111] 407. The first network device forwards the protocol message to the second network device according to the second physical MAC address.

[0112] 408. The second network device sends a response message to the third network device according to the protocol message.

[0113] In this embodiment, steps 407-408 are similar to the above step 202. For details, please refer to the above introduction to step 202, which will not be repeated here.

[0114] The above describes the process of the third network device sending a protocol message to the second network device. The following describes the process of the third network device sending a user data message. After the third network device establishes a BGP session with the first network device and the second network device through protocol messages, such as BGP messages, the first network device and the second network device can be used to forward the user data message sent by the third network device. Figure 5 , Figure 5 A flow chart of a method for processing user data messages provided in an embodiment of the present application. Figure 5 As shown, the user data message processing method includes steps 501-507.

[0115] Step 501: A first network device obtains a target route, where the next hop address of the target route is a virtual IP address of the first network device.

[0116] In this embodiment, there are multiple ways for the first network device to obtain the target route.

[0117] In one possible implementation, the first network device obtains a route from a neighboring device and obtains a target route by modifying the next hop address of the route. For example, when other network devices in the network publish routes, the first network device obtains a first route from a neighboring device, and the first route includes a next hop address. The next hop address in the first route is the IP address of the neighboring device of the first network device. After obtaining the first route, the first network device updates the next hop address in the first route to the virtual IP address of the first network device to obtain a second route. The virtual IP address can be, for example, the gateway IP address of the first network device. The next hop address of the second route is the virtual IP address of the first network device, and the virtual IP address of the first network device is the same as the virtual IP address of the second network device; the destination address of the second route can be the loopback address of the route publisher, and the second route is the above-mentioned target route.

[0118] In another possible implementation, when the first network device, as a route publisher, publishes routes to other network devices in the network, the first network device generates a target route. For example, when the first network device needs to publish routes to other network devices in the network, the first network device may generate a target route based on a virtual IP address, where the next hop address of the target route is the virtual IP address of the first network device, and the destination address of the target route may be the loopback address of the first network device.

[0119] Step 502: The first network device sends the target route to the third network device.

[0120] After obtaining the target route, the first network device may send the target route to a third network device that is a neighbor device of the first network device, so as to achieve propagation of the target route in the network.

[0121] Step 503: The third network device generates a routing table entry according to the target route. The routing table entry includes the destination address of the target route and the virtual IP address of the first network device.

[0122] After obtaining the target route, the third network device can generate a routing table entry based on the destination address and next hop address in the target route to enable the subsequent transmission of user data packets related to the target route. The routing table entry generated by the third network device includes the destination address of the target route and the virtual IP address of the first network device.

[0123] Step 504: The third network device generates a user data packet, where the user data packet includes the destination address of the user and the virtual MAC address.

[0124] In this embodiment, the third network device may be the aforementioned server. The third network device may interact with user devices or other servers based on service requirements. Specifically, when the third network device determines that a user data packet needs to be sent to a destination network device, the third network device generates a user data packet. The user data packet includes the destination address corresponding to the destination network device, i.e., the aforementioned user destination address. The user destination address may be located in the IP header of the user data packet. The third network device then searches the routing table entry in the third network device based on the user destination address and determines that the next hop address of the user data packet is the virtual IP address of the first network device. Because the third network device stores the correspondence between the virtual IP address of the first network device and the virtual MAC address of the first network device, the third network device can obtain the virtual MAC address corresponding to the virtual IP address of the first network device. Finally, the third network device updates the user data packet based on the virtual MAC address to obtain an updated user data packet. The updated user data packet includes the user destination address and the virtual MAC address. The virtual MAC address may be located in the Ethernet header of the updated user data packet.

[0125] It should be noted that the third network device stores the correspondence between the virtual IP address of the first network device and the virtual MAC address of the first network device. The correspondence between the virtual IP address of the first network device and the virtual MAC address of the first network device can be statically configured in the third network device, or generated by the third network device based on the obtained virtual IP address and virtual MAC address. Specifically, the method by which the third network device obtains the virtual IP address and virtual MAC address is similar to steps 401-404 described above. For details, please refer to steps 401-404 described above and will not be repeated here.

[0126] Step 505: The third network device sends the user data message to the first network device.

[0127] After generating a user data packet including the user's destination address and the virtual MAC address, the third network device sends the user data packet to the first network device, so that the first network device further forwards the user data packet, thereby forwarding the user data packet to the destination network device.

[0128] In this embodiment, the first network device and the second network device can be used to load share packets sent by the third network device. User data packets sent by the third network device can be randomly hashed and routed between the first and second network devices. Because the first and second network devices include the same virtual MAC address and virtual IP address, both the first and second network devices can forward user data packets sent by the third network device. For ease of description, the following describes the user data packet forwarding process using the example of hashing and routing user data packets sent by the third network device to the first network device.

[0129] Step 506: The first network device searches for a routing table entry to obtain a second outgoing interface based on the virtual MAC address included in the user data packet.

[0130] In this embodiment, after receiving the user data packet, the first network device terminates the user data packet on the forwarding plane based on the virtual MAC address included in the user data packet, that is, the first network device terminates the user data packet on the forwarding plane based on the virtual MAC address in the user data packet being the same as its own virtual MAC address. Specifically, the first network device terminating the user data packet on the forwarding plane means that the first network device strips off the Ethernet header in the user data packet and sends the user data packet to the control plane to achieve forwarding of the user data packet. After the first network device strips off the Ethernet header in the user data packet, the first network device searches the routing table entry of the control plane to obtain the second output interface based on the destination address of the user included in the user data packet, and forwards the user data packet through the second output interface.

[0131] Specifically, the routing table entry in the first network device can be generated by the first network device when it obtains the above-mentioned target route. For example, after receiving the first route sent by the neighboring device, the first network device can search the routing table based on the next hop address in the first route (for example, the loopback address of the neighboring device of the first network device) to obtain the output interface corresponding to the first route (that is, the above-mentioned second output interface). Then, the first network device generates a routing table entry based on the destination address of the first route (that is, the destination address of the user mentioned above) and the second output interface. The routing table entry includes the user's destination address and the second output interface.

[0132] Step 507: The first network device forwards the user data message through the second outbound interface.

[0133] After finding the second output interface, the first network device forwards the user data message through the second output interface, thereby forwarding the user data message to the network side neighbor device of the first network device, and the network side neighbor device of the first network device performs the next step of forwarding the user data message, and finally forwards the user data message to the destination network device.

[0134] The above describes the process of the first network device executing route advertisement and user data message forwarding. For ease of understanding, the following describes the process of route advertisement and user data message forwarding in conjunction with specific scenarios.

[0135] See Figure 6a , Figure 6a The present invention provides a flow chart of establishing a protocol connection between a server and a leaf switch. Figure 6a As shown, the process of establishing a protocol connection between the server and the leaf switch includes steps S1-S6.

[0136] S1. The server sends a request message to leaf switch 1.

[0137] The server is configured with the physical IP address of the leaf switch 1 . The server can obtain the physical MAC address corresponding to the physical IP address in the leaf switch 1 by sending a request message to the leaf switch 1 .

[0138] Specifically, the physical IP address of the leaf switch 1 configured in the server is, for example, 2.1.1.4, and the request message sent by the server to the leaf switch 1 carries the physical IP address 2.1.1.4. The request message may be an ARP request message or an ND request message.

[0139] S2, leaf switch 1 sends a response message to the server.

[0140] After Leaf Switch 1 receives the request message from the server, it determines that the MAC address included in the request message is its own physical MAC address. Therefore, Leaf Switch 1 sends a response message to the server based on the physical MAC address corresponding to the physical MAC address. This response message includes Leaf Switch 1's physical MAC address. For example, the physical MAC address included in the response message might be acb3-b586-a370.

[0141] It is understood that the server can also be configured with the physical IP address of leaf switch 2. The server sends a request message through leaf switch 2 to obtain the physical MAC address of leaf switch 2. For example, if the physical IP address of leaf switch 2 configured in the server is 2.1.1.5, the server receives a response message from leaf switch 2 and obtains the physical MAC address of leaf switch 2 as acb3-b586-a371.

[0142] S3. The server establishes a correspondence between the IP address and the MAC address.

[0143] After the server receives the response message sent by leaf switch 1, the server can establish a correspondence between the physical IP address 2.1.1.4 and the physical MAC address acb3-b586-a370 according to the physical MAC address in the response message.

[0144] S4. The server sends a protocol message to leaf switch 2.

[0145] When the server needs to send a protocol message to Leaf Switch 1, it searches the association table based on Leaf Switch 1's physical IP address to determine its MAC address. The server then encapsulates Leaf Switch 1's physical IP address 2.1.1.4 and physical MAC address acb3-b586-a370 in the protocol message and sends the message. The protocol message sent by the server is randomly hashed and routed to Leaf Switch 2, indicating that Leaf Switch 2 has received the protocol message from the server, and that the destination of the protocol message is Leaf Switch 1.

[0146] For example, the protocol message sent by the server to the leaf switch 2 is, for example, a BGP connection message, which is used to request to establish a BGP connection with the leaf switch 2 .

[0147] S5. Leaf switch 2 forwards the protocol packet to leaf switch 1.

[0148] After Leaf Switch 2 receives the protocol message sent by the server, it can determine that the MAC address in the protocol message is not its own physical MAC address. Therefore, Leaf Switch 2 forwards the protocol message to Leaf Switch 1 based on the physical MAC address acb3-b586-a370 in the protocol message.

[0149] S6. Leaf switch 1 sends a response message to the server.

[0150] After leaf switch 1 receives the protocol message forwarded by leaf switch 2, since the protocol message includes its own physical MAC address and physical IP address, leaf switch 1 can determine that the destination of the protocol message is itself, and thus sends a response message to the server.

[0151] For example, when the protocol message is a message requesting to establish a BGP connection, leaf switch 1 sends a response message for establishing a BGP connection to the server, thereby establishing the BGP connection.

[0152] It is understandable that the server can send a protocol message to the leaf switch 2 in a similar manner to establish a BGP connection with the leaf switch 2. For details, please refer to the above steps S1-S6, which will not be repeated here.

[0153] See Figure 6b , Figure 6b A schematic diagram of a process of routing publication and user data message forwarding provided in an embodiment of the present application. Figure 6b As shown, the process of route publishing and user data message forwarding includes steps S7-S13.

[0154] S7 and the spine switch send routes to leaf switches 1 and 2.

[0155] In this embodiment, the spine switch obtains the routes published by the route publisher from other leaf switches, and after the spine switch modifies the next-hop address of the obtained route to its own interface address, it sends the route with the modified next-hop address to leaf switch 1 and leaf switch 2. For example, assuming that the destination address of the route obtained by the spine switch is 1.1.1.1, the next-hop address of the route sent by the spine switch to leaf switch 1 is 192.168.1.1 (i.e., the address of the interface connecting the spine switch to leaf switch 1), and the next-hop address of the route sent by the spine switch to leaf switch 2 is 192.168.1.2 (i.e., the address of the interface connecting the spine switch to leaf switch 2).

[0156] S8. Leaf switch 1 generates a routing table entry based on the received route and modifies the next hop address of the route to the virtual IP address.

[0157] Based on the route received from the spine switch, Leaf Switch 1 searches the routing table to obtain the outgoing interface corresponding to the next hop address in the route (assuming the outgoing interface is Interface 1). Leaf Switch 1 then generates a routing table entry based on the received route. This routing table entry includes the destination address (1.1.1.1), the next hop address (192.168.1.1), and the outgoing interface (Interface 2). Leaf Switch 1 also modifies the next hop address of the received route to its virtual IP address, so that the route with the modified next hop address can be sent to the server. For example, the next hop address of Leaf Switch 1's route is modified to 2.1.1.1.

[0158] Similarly, after receiving the route sent by the spine switch, leaf switch 2 can also generate a routing table entry based on the route and modify the next hop address of the route to the virtual IP address of leaf switch 2.

[0159] S9. Leaf switch 1 sends the route with the modified next-hop address to the server.

[0160] S10. The server generates user data packets A and B including virtual MAC addresses.

[0161] After receiving the route sent by leaf switch 1, the server can generate a routing table entry based on the destination address and next-hop address in the route to enable the subsequent transmission of user data packets related to the route. The routing table entry generated by the server includes the destination address (1.1.1.1) and the virtual IP address (2.1.1.1) of the first network device.

[0162] When a server needs to send user data to a network device with an address of 1.1.1.1, it generates two packets, User Data Message A and User Data Message B, both with a destination address of 1.1.1.1. These packets belong to the same user traffic. The server then searches the routing table of a third network device based on the destination address 1.1.1.1 and determines that the next-hop address for User Data Message A and User Data Message B is the virtual IP address 2.1.1.1. Based on the virtual IP address 2.1.1.1, the server obtains the virtual MAC address 0000-5e00-0100 corresponding to the virtual IP address 2.1.1.1. Finally, the server updates User Data Message A and User Data Message B based on the virtual MAC address to obtain updated User Data Message A and User Data Message B. These updated packets, User Data Message A and User Data Message B, both include the destination address 1.1.1.1 and the virtual MAC address 0000-5e00-0100.

[0163] S11. The server sends user data packet A and user data packet B belonging to the same user flow to leaf switch 1 and leaf switch 2 respectively.

[0164] After receiving user data packets A and B with destination address 1.1.1.1 and virtual MAC address 0000-5e00-0100, the server sends these packets. When leaf switches 1 and 2 load balance the packets sent by the server, user data packet A is hash-routed to leaf switch 1, and user data packet B is hash-routed to leaf switch 2. In other words, the server sends user data packet A to leaf switch 1 and user data packet B to leaf switch 2.

[0165] S12, leaf switch 1 sends user data packet A to the spine switch.

[0166] After leaf switch 1 receives user data packet A sent by the server, leaf switch 1 searches for the outgoing interface, ie, the interface connecting leaf switch 1 and the spine switch, based on the destination address of user data packet A.

[0167] After finding the outbound interface corresponding to user data packet A, leaf switch 1 can send user data packet A to the spine switch according to the found outbound interface, so that the spine switch continues to forward the user data packet.

[0168] S13. Leaf switch 2 sends user data packet B to the spine switch.

[0169] Similarly, after receiving user data packet B, leaf switch 2 can also send user data packet B to the spine switch by searching for the outbound interface.

[0170] The above describes a process in which the third network device sends protocol packets and user data packets based on the physical MAC address and the virtual MAC address. The following describes a process in which the third network device obtains the physical MAC address and the virtual MAC address.

[0171] See Figure 7 , Figure 7 This is a schematic diagram of the architecture of a network system provided in an embodiment of the present application. Figure 7 As shown, the first network device mentioned above can be Figure 7 The leaf switch 1 in the above-mentioned second network device can be Figure 7 The leaf switch 2 in the above-mentioned third network device can be Figure 7 The leaf switch 1 and the leaf switch 2 both store the physical IP address, virtual IP address, real MAC address, and virtual MAC address.

[0172] In leaf switch 1, the physical IP address is 2.1.1.4, the virtual IP address is 2.1.1.1, the real MAC address is acb3-b586-a370, and the virtual MAC address is 0000-5e00-0100. The physical IP address and the real MAC address correspond to each other, and the virtual IP address and the virtual MAC address correspond to each other.

[0173] On leaf switch 2, the physical IP address is 2.1.1.5, the virtual IP address is 2.1.1.1, the real MAC address is acb3-b586-a371, and the virtual MAC address is 0000-5e00-0100. The physical IP address and real MAC address correspond to each other, and the virtual IP address and virtual MAC address correspond to each other. The virtual IP address and virtual MAC address are the same on leaf switch 1 and leaf switch 2.

[0174] The server is configured with the physical IP address of leaf switch 1, the physical IP address of leaf switch 2, and the virtual IP address shared by leaf switch 1 and leaf switch 2. The server can obtain the physical MAC address of leaf switch 1 by sending a request message including the physical IP address of leaf switch 1 to leaf switch 1. The server can obtain the physical MAC address of leaf switch 2 by sending a request message including the physical IP address of leaf switch 2 to leaf switch 2. Furthermore, the server can obtain the virtual MAC addresses corresponding to leaf switch 1 and leaf switch 2 by sending a request message including the virtual IP address to leaf switch 1 or leaf switch 2. In this way, after obtaining the corresponding MAC address, the server can establish a correspondence between the IP address and the MAC address, that is, the physical IP address 2.1.1.4 corresponds to the physical MAC address acb3-b586-a370, the physical IP address 2.1.1.5 corresponds to the physical MAC address acb3-b586-a371, and the virtual IP address 2.1.1.1 corresponds to the virtual MAC address 0000-5e00-0100.

[0175] In order to implement the above embodiment, the present application also provides a network device. Figure 8 , Figure 8 This is a schematic diagram of the structure of a network device 800 provided in an embodiment of the present application. Figure 8As shown, the network device 800 may be, for example, the first network device or the second network device mentioned above.

[0176] As a possible example, the control plane of network device 800 may include a BGP processing module, an ARP processing module, a gateway interface configuration module, a bridge domain, and an M-LAG module. The BGP processing module is used to establish a BGP session with the server using the physical IP address of the gateway interface, configure routing policies, and set the next-hop address of routes sent to the server to a virtual IP address. The ARP processing module is used to process ARP requests. For example, upon receiving an ARP request message including a physical IP address, it responds with an ARP response message including a virtual MAC address. The gateway interface configuration module is used to configure the IP address and MAC address corresponding to the gateway interface, including the configuration of the physical IP address, virtual IP address, physical MAC address, and virtual MAC address. The M-LAG module is responsible for M-LAG-related configuration and protocol processing to enable cross-device LAG binding relationships between the access ports of leaf switches. The bridge domain is used to connect M-LAG member ports to the corresponding bridge domain and configure peerlinks to join the bridge domain where the M-LAG member ports are located. The configured peerlink enables Layer 2 communication between M-LAG member leaf switches 1 and 2. In addition, a bridge domain can be used to configure packet split horizon between the peerlink and the M-LAG local access port, preventing packet loops caused by leaf switches forwarding packets received from the peerlink to the M-LAG local port.

[0177] The forwarding plane of the network device 800 may include a protocol message sending module, a layer 2 message forwarding module, and a layer 3 message forwarding module. The protocol message sending module is used to send protocol messages to the control plane. For example, after the network device 800 receives a message from a physical port, the protocol message sending module identifies the message as a protocol message such as an ARP message or a BGP message, and then sends the message to the control plane. The layer 2 message forwarding module is used to implement layer 2 forwarding of messages. For example, after the network device 800 receives a message from a physical port, if the MAC address in the message is a broadcast & unknown unicast & multicast (BUM) address, that is, the MAC address of the message is unknown, the layer 2 message forwarding module performs layer 2 broadcast processing within the corresponding bridge domain; if the MAC address of the message is known, the MAC forwarding table entry is searched to forward the message. The Layer 3 message forwarding module is used to implement Layer 2 forwarding of messages. For example, when network device 800 receives a user data message from a physical port, if the MAC address of the user data message is the virtual MAC address of the gateway interface, Layer 2 termination is performed, and the Layer 3 message forwarding module searches the routing table for Layer 3 forwarding, that is, sending the user data message to the upstream network through the upstream interface.

[0178] See Figure 9 , Figure 9 A schematic diagram of the structure of a network device 900 provided in an embodiment of the present application. Figure 9 Although the network device 900 shown shows certain specific features, those skilled in the art will appreciate from the embodiments of the present application that for the sake of brevity, Figure 9 Various other features are not shown to avoid obscuring more relevant aspects of the embodiments disclosed in the embodiments of this application. To this end, as an example, in some implementations, the network device 900 includes one or more processing units (CPUs) 901, a network interface 902, a programming interface 903, a memory 904, and one or more communication buses 905 for interconnecting the various components. In other implementations, the network device 900 may also omit or add some functional components or units based on the above examples.

[0179] In some implementations, the network interface 902 is used, among other things, to connect to one or more other network devices / servers in the network system. In some implementations, the communication bus 905 includes circuits for interconnecting and controlling communications between system components. The memory 904 may include non-volatile memory, such as read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The memory 904 may also include volatile memory, which may be random access memory (RAM), which is used as an external cache.

[0180] In some implementations, the memory 904 or the non-transitory computer-readable storage medium of the memory 904 stores the following programs, modules, and data structures, or a subset thereof, including, for example, a transceiver unit (not shown), an acquisition unit 9041 , and a processing unit 9042 .

[0181] In a possible embodiment, the network device 900 may have any functions implemented by the first network device, the second network device, or the third network device in the above-mentioned method embodiments.

[0182] It should be understood that the network device 900 corresponds to the first network device, the second network device or the third network device in the above-mentioned method embodiment, and the various modules in the network device 900 and the above-mentioned other operations and / or functions are respectively for implementing the various steps and methods implemented by each network device in the above-mentioned method embodiment. For specific details, please refer to the above-mentioned description of each method embodiment. For the sake of brevity, they will not be repeated here.

[0183] It should be understood that the functions of the above transceiver units can be implemented by the processor calling the program code in the memory and cooperating with the network interface 902 when necessary; or the network interface 902 on the network device 900 can complete the data sending and receiving operations.

[0184] In various implementations, the network device 900 is used to execute the message processing method provided in each embodiment of the present application, for example, to execute the above Figure 2 The message processing method corresponding to the embodiment shown.

[0185] Corresponding to the method embodiment and virtual device embodiment provided in the present application, the embodiment of the present application further provides a network device, and the hardware structure of the network device is introduced below.

[0186] See Figure 10 , Figure 10 This is a structural diagram of a network device 1000 provided in an embodiment of the present application. The network device 1000 can be configured as the first network device, the second network device or the third network device in the above method embodiment.

[0187] For example, network device 1000 may correspond to the first network device in the above-described method embodiment. The various hardware, modules, and other operations and / or functions in network device 1000 are respectively for implementing the various steps and methods implemented by the first network device in the method embodiment. For detailed information on how network device 1000 forwards messages, please refer to the above-described method embodiment. For the sake of brevity, these details are not repeated here. The steps in the above-described method embodiments are implemented by hardware integrated logic circuits or software instructions in the processor of network device 1000. The steps of the methods disclosed in the embodiments of the present application can be directly implemented by a hardware processor or by a combination of hardware and software modules in the processor. The software modules can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in a memory, and the processor reads information in the memory and, in conjunction with its hardware, completes the steps of the above-described method. To avoid repetition, these steps are not described in detail here.

[0188] The network device 1000 may also correspond to the network device 900 in the aforementioned virtual device embodiment, and each functional module in the network device 900 is implemented using the software and hardware of the network device 1000. As a possible implementation, the functional modules included in the network device 900 are generated by the processor of the network device 1000 reading the program code stored in the memory, or are implemented by the processor of the network device 1000 reading the program code stored in the memory and cooperating with the communication interface.

[0189] The network device 1000 includes a main control board 1010 and an interface board 1030 .

[0190] Main control board 1010, also known as the main processing unit (MPU) or route processor card, controls and manages various components in network device 1000, including routing calculations, device management, device maintenance, and protocol processing. Main control board 1010 includes a central processing unit (CPU) 1011 and memory 1012.

[0191] Interface board 1030 is also known as a line processing unit (LPU), line card, or service board. It provides various service interfaces and implements data packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces and POS (Packet over SONET / SDH) interfaces. Ethernet interfaces, for example, are Flexible Ethernet Clients (FlexE Clients). Interface board 1030 includes a central processing unit (CPU) 1031, a network processor (NPU) 1032, a forwarding table memory 1034, and a physical interface card (PIC) 1033.

[0192] The central processing unit 1031 on the interface board 1030 is used to control and manage the interface board 1030 and communicate with the central processing unit 1011 on the main control board 1010 .

[0193] The network processor 1032 is used to implement packet forwarding processing. The network processor 1032 can be in the form of a forwarding chip. Specifically, the processing of uplink packets includes: packet inbound interface processing, forwarding table lookup; downlink packet processing: forwarding table lookup, etc.

[0194] The physical interface card 1033 is used to implement the physical layer docking function. The original traffic enters the interface board 1030 from this, and the processed message is sent from the physical interface card 1033. The physical interface card 1033 includes at least one physical interface, which is also called a physical port. The physical interface card 1033 corresponds to the FlexE physical interface in the system architecture. The physical interface card 1033, also known as a daughter card, can be installed on the interface board 1030. It is responsible for converting the optical and electrical signals into messages and performing a validity check on the messages before forwarding them to the network processor 1032 for processing. In some embodiments, the central processing unit 1031 of the interface board 1003 can also perform the functions of the network processor 1032, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 1032 is not required in the physical interface card 1033.

[0195] Optionally, the network device 1000 includes multiple interface boards. For example, the network device 1000 further includes an interface board 1040 . The interface board 1040 includes a central processing unit 1041 , a network processor 1042 , a forwarding table entry memory 1044 , and a physical interface card 1043 .

[0196] Optionally, the network device 1000 further includes a switching fabric board 1020. The switching fabric board 1020 may also be referred to as a switch fabric unit (SFU). If the network device has multiple interface boards 1030, the switching fabric board 1020 is used to exchange data between the interface boards. For example, the interface board 1030 and the interface board 1040 can communicate via the switching fabric board 1020.

[0197] The main control board 1010 is coupled to the interface board 1030. For example, the main control board 1010, the interface board 1030, the interface board 1040, and the switching network board 1020 are connected to the system backplane via a system bus to achieve intercommunication. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 1010 and the interface board 1030, and the main control board 1010 and the interface board 1030 communicate through the IPC channel.

[0198] Logically, network device 1000 includes a control plane and a forwarding plane. The control plane includes a main control board 1010 and a central processing unit 1031. The forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 1034, physical interface cards 1033, and a network processor 1032. The control plane performs routing functions, generates forwarding tables, processes signaling and protocol messages, and configures and maintains device status. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 1032 forwards messages received by the physical interface card 1033 based on the forwarding tables sent by the control plane. The forwarding tables sent by the control plane can be stored in the forwarding table entry memory 1034. In some embodiments, the control plane and forwarding plane can be completely separate and not located on the same device.

[0199] It should be understood that the transceiver unit in the network device 900 can be equivalent to the physical interface card 1033 or the physical interface card 1043 in the network device 1000; the acquisition unit 11041 and the processing unit 11042 in the network device 900 can be equivalent to the central processor 1011 or the central processor 1031 in the network device 1000.

[0200] It should be understood that the operations on the interface board 1040 in the embodiment of the present application are consistent with the operations on the interface board 1030. For the sake of brevity, detailed description is omitted. It should be understood that the network device 1000 in this embodiment may correspond to the first network device in each of the above-mentioned method embodiments. The main control board 1010, interface board 1030, and / or interface board 1040 in the network device 1000 may implement the functions and / or various steps of the first network device, the second network device, or the third network device in each of the above-mentioned method embodiments. For the sake of brevity, detailed description is omitted here.

[0201] It's worth noting that there may be one or more main control boards (SPUs), which can include both active and standby SPUs. There may be one or more interface boards. The higher the network device's data processing capabilities, the more interface boards it provides. Interface boards can also have one or more physical interface cards. There may be no SPUs, one or more SPUs, and multiple SPUs can be used to achieve load balancing and redundant backup. In a centralized forwarding architecture, network devices may not require SPUs; the interface boards handle the entire system's service data processing. In a distributed forwarding architecture, network devices may have at least one SPU, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, network devices with distributed architectures have greater data access and processing capabilities than those with centralized architectures. Alternatively, a network device can consist of a single card, without a switching fabric board (SFB), integrating the functions of the interface board and the main control board. In this case, the CPUs on the interface board and the main control board can be combined into a single CPU, performing the combined functions. This type of device has lower data exchange and processing capabilities (for example, low-end network devices such as switches or routers). The specific architecture used depends on the specific network deployment scenario and is not a single limitation here.

[0202] In some possible embodiments, each of the above-mentioned network devices can be implemented as a virtualized device. For example, the virtualized device can be a virtual machine (English: Virtual Machine, VM) running a program for sending message functions, and the virtual machine is deployed on a hardware device (for example, a physical server). A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. The virtual machine can be configured as a first network device. For example, the first network device can be implemented based on a general physical server in combination with Network Function Virtualization (NFV) technology. The first network device is a virtual host, a virtual router or a virtual switch. Those skilled in the art can virtualize a first network device with the above-mentioned functions on a general physical server in combination with NFV technology by reading this application. No further details will be given here.

[0203] It should be understood that the various network devices in the above-mentioned product forms respectively have any functions implemented by the network devices in the above-mentioned method embodiments, which will not be described in detail here.

[0204] The embodiment of the present application provides a computer program product, which, when executed on a network device, enables the network device to execute the above Figure 2 The method executed by the first network device in the corresponding method embodiment.

[0205] The present application also provides a chip including a processor and an interface circuit, wherein the interface circuit is configured to receive instructions and transmit them to the processor. The processor is coupled to a memory configured to store programs or instructions. When the programs or instructions are executed by the processor, the chip system implements any of the above-described method embodiments.

[0206] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0207] Optionally, the memory in the chip system may be one or more memories. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in this application. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or provided on different chips. This application does not specifically limit the type of memory or the configuration of the memory and the processor.

[0208] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0209] The above describes the embodiments of the present application in detail. The steps in the method of the embodiments of the present application can be scheduled sequentially, merged or deleted according to actual needs; the modules in the device of the embodiments of the present application can be divided, merged or deleted according to actual needs.

[0210] It should be understood that “one embodiment” or “an embodiment” mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, “in one embodiment” or “in an embodiment” appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0211] The term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Additionally, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0212] It should be understood that in the embodiments of the present application, "B corresponding to A" means that B is associated with A and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B based solely on A, but B can also be determined based on A and / or other information.

[0213] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0214] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0215] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

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

[0217] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0218] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device / server, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.

Claims

1. A message processing method, characterized in that: The method is applied to a network system, the network system including a first network device, a second network device, and a third network device, the third network device being multi-homed to the first network device and the second network device, the first network device and the second network device being configured to load share packets sent by the third network device, the first network device being configured with a first physical MAC address and a virtual MAC address, the second network device being configured with a second physical MAC address and the virtual MAC address, the virtual MAC address being used to forward user data packets to a network side; The method comprises: The first network device receives a protocol message from the third network device, where the protocol message includes the second physical MAC address; The first network device forwards the protocol message to the second network device according to the second physical MAC address; The first network device receives a user data message from the third network device; The first network device searches for a routing table entry based on a destination address in the user data packet and forwards the user data packet according to the virtual MAC address included in the user data packet.

2. The method according to claim 1, characterized in that The method further comprises: The first network device receives a request message from the third network device, where the request message includes a physical Internet Protocol (IP) address of the first network device; The first network device sends a response message to the third network device, where the response message includes the first physical MAC address, and the first physical MAC address corresponds to the physical IP address of the first network device.

3. The method according to claim 2, characterized in that The request message is an Address Resolution Protocol ARP request message or a neighbor discovery message.

4. The method according to any one of claims 1 to 3, characterized in that The protocol message received by the first network device from the third network device includes a time to live (TTL), and the TTL in the protocol message forwarded by the first network device to the second network device does not decrease by 1.

5. The method according to any one of claims 1 to 3, characterized in that The first network device forwarding the protocol message to the second network device according to the second physical MAC address includes: The first network device searches a MAC forwarding table entry according to the second physical MAC address to obtain a first outbound interface corresponding to the protocol message; The first network device forwards the protocol message to the second network device according to the first outbound interface.

6. The method according to any one of claims 1 to 3, characterized in that The first network device forwarding the protocol message to the second network device according to the second physical MAC address includes: The first network device forwards the protocol message to the second network device by broadcasting according to the second physical MAC address.

7. The method according to any one of claims 1 to 3, characterized in that The protocol message includes a Border Gateway Protocol BGP message, a Bidirectional Forwarding Detection BFD protocol message, an Open Shortest Path First OSPF protocol message or an Intermediate System to Intermediate System IS-IS protocol message.

8. The method according to any one of claims 1 to 3, characterized in that The first network device searches for a routing table entry based on a destination address in the user data packet and forwards the user data packet according to the virtual MAC address included in the user data packet, including: The first network device searches a routing table entry based on a destination address in the user data packet to obtain a second outgoing interface according to the virtual MAC address included in the user data packet; The first network device forwards the user data message through the second outbound interface.

9. The method according to claim 8, characterized in that The first network device searches a routing table entry to obtain a second outgoing interface according to the user data packet including the virtual MAC address, including: The first network device terminates the user data packet on a forwarding plane according to the user data packet including the virtual MAC address; The first network device searches the routing table entry of the control plane to obtain the second outbound interface, and forwards the user data packet through the second outbound interface.

10. A message processing method, characterized in that: The method is applied to a network system, the network system including a first network device, a second network device, and a third network device, the third network device being multi-homed to the first network device and the second network device, the first network device and the second network device being configured to load share packets sent by the third network device, the first network device and the second network device being configured with virtual MAC addresses, the virtual MAC addresses being used to forward user data packets to a network side, the method comprising: The third network device sends a first request message, where the first request message includes the physical IP address of the first network device; The third network device receives a first response message, where the first response message includes a physical MAC address of the first network device, and the physical IP address of the first network device corresponds to the physical MAC address of the first network device; The third network device sends a second request message, where the second request message includes the physical IP address of the second network device; The third network device receives a second response message, where the second response message includes a physical MAC address of the second network device, and the physical IP address of the second network device corresponds to the physical MAC address of the second network device; The third network device sends a protocol message to the first network device, where the protocol message includes the physical MAC address of the second network device, and the physical MAC address of the second network device is used to instruct the first network device to forward the protocol message to the second network device; The third network device sends a user data message to the first network device, where the user data message includes the virtual MAC address and a destination address, and the virtual MAC address is used to instruct to search for a routing table entry according to the destination address in the user data message and forward the user data message.

11. The method according to claim 10, characterized in that The method further comprises: The third network device receives the route sent by the first network device, where the route includes a destination address and a next-hop address of a user, and the next-hop address is the virtual IP address of the first network device.

12. The method according to claim 11, characterized in that The method further comprises: The third network device generates a user data message, where the user data message includes a destination address of the user; The third network device searches for a routing table entry according to the destination address of the user, and determines that the next hop address of the user data packet is the virtual IP address of the first network device; The third network device obtains a virtual MAC address corresponding to the virtual IP address of the first network device; The third network device updates the user data packet according to the virtual MAC address to obtain an updated user data packet, where the updated user data packet includes the virtual MAC address.

13. The method according to any one of claims 10 to 12, characterized in that: The request information is Address Resolution Protocol ARP request information or neighbor discovery information.

14. The method according to any one of claims 10 to 12, characterized in that: The protocol message includes a BGP message, a BFD protocol message, an OSPF protocol message or an IS-IS protocol message.

15. The method according to claim 13, characterized in that The protocol message includes a BGP message, a BFD protocol message, an OSPF protocol message or an IS-IS protocol message.

16. A network device, characterized in that: include: Processor, memory; Memory is used to store instructions; The processor is configured to execute instructions in the memory, so that the network device executes the method according to any one of claims 1 to 9.

17. A network device, characterized in that: include: Processor, memory; Memory is used to store instructions; The processor is configured to execute instructions in the memory, so that the network device executes the method according to any one of claims 10 to 15.

18. A network system, characterized in that: include: The network device according to claim 16 and the network device according to claim 17.

19. A computer-readable storage medium, characterized in that The computer storage medium stores computer-readable instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 15.

20. A computer program product, characterized in that The computer program product stores computer-readable instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Control plane messaging in all-active multi-homed ethernet virtual private networks

    US9178816B1