A message forwarding method and network device

By using the virtual network identifier to directly forward packets in the VXLAN network, the routing loop problem caused by the shared IP address of virtual machines is solved, and normal forwarding and load balancing of packets are achieved.

CN113660164BActive Publication Date: 2024-08-23HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010400993.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-12
Publication Date
2024-08-23
Estimated Expiration
2040-05-12

AI Technical Summary

Technical Problem

In a VXLAN network, when multiple virtual machines share the same IP address, routing loops are prone to occur, causing packets to fail to be sent correctly to the virtual machines.

Method used

By sending virtual network identifiers between network devices, packets can be forwarded directly to the target virtual machine to prevent routing loops from being forwarded based on the VRF table.

Benefits of technology

This ensures the normal forwarding of packets, avoids routing loops, and achieves load balancing of virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113660164B
    Figure CN113660164B
Patent Text Reader

Abstract

A message forwarding method and network device, the method specifically comprising: a first network device sends first routing information to a second network device, the first routing information is used to announce the route to the first address of a first virtual machine, and the first routing information includes the first virtual network identifier of the first virtual machine; the first network device receives a first message sent by the second network device, the first message carries the first virtual network identifier, and the destination address of the first message is the first address; the first network device forwards the first message to the first virtual machine according to the first virtual network identifier. The first network device forwards the first message to the corresponding local virtual machine according to the virtual network identifier in the first message, without forwarding the message based on the virtual routing forwarding VRF table, thereby avoiding the message being forwarded to other network devices again and ensuring the normal forwarding of the message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a message forwarding method and network equipment. Background Art

[0002] With the rapid development of cloud computing, the virtualization level of data centers is getting higher and higher. In order to meet the increasing user needs, data centers usually use scalable virtual local area network (VXLAN) technology to expand network virtualization to obtain a sufficient number of virtual networks to meet user needs.

[0003] The VXLAN in a data center usually includes core devices, multiple peer VXLAN tunnel endpoints (VTEP) devices, and virtual machines (VMs) connected to the VTEP devices. Generally, VMs can be deployed on servers connected to VTEP devices. Virtual network function (VNF) network elements can be distributed on multiple VMs, which can implement the same network functions and share the same service Internet Protocol (IP) address.

[0004] Currently, in a VXLAN network, when multiple VMs under the same VNF network element are connected to different VXLAN tunnel endpoint devices, routing loops are likely to occur when the VXLAN tunnel endpoint devices receive messages from the network side and forward the messages, resulting in the inability to correctly send messages to the VM. Summary of the invention

[0005] An embodiment of the present application provides a message forwarding method and a network device, in which a first network device receives a message sent by a second network device, the message carrying a virtual network identifier corresponding to a local virtual machine of the first network device, and the first network device can forward the first message to the corresponding local virtual machine according to the virtual network identifier in the message, without forwarding the message based on a virtual routing forwarding (Virtual Routing Forwarding, VRF) table, thereby avoiding the message being forwarded to other network devices again and ensuring the normal forwarding of the message.

[0006] The first aspect of the present application provides a message forwarding method, including: a first network device sends first routing information to a second network device, the first routing information is used to announce the route to the first address of a first virtual machine, the first routing information includes the first virtual network identifier of the first virtual machine, and the first virtual machine is a local virtual machine of the first network device; the first network device receives a first message sent by the second network device, the first message carries the first virtual network identifier, and the destination address of the first message is the first address; the first network device forwards the first message to the first virtual machine according to the first virtual network identifier. The first address of the first virtual machine can be a service IP address shared by the first virtual machine and one or more other virtual machines. Virtual machines sharing the same service IP address can be used to process the same service. Exemplarily, the first address of the first virtual machine can be a loopback IP address.

[0007] In this solution, the first network device determines to forward the first message to the first virtual machine corresponding to the first virtual network identifier based on the first virtual network identifier in the first message, and there is no need to forward the first message based on the VRF table in the first network device, thereby avoiding the first message being forwarded to other network devices again, causing routing loops and other problems, and ensuring the normal forwarding of the first message.

[0008] Optionally, in a possible implementation, before the first network device sends the first routing information to the second network device, the method further includes: the first network device assigns the first virtual network identifier to the first virtual machine according to the first virtual machine being a local virtual machine of the first network device. Wherein, in the case where a VXLAN tunnel is deployed between the first network device and the second network device, the first virtual network identifier assigned by the first network device to the first virtual machine can specifically be a VXLAN Network Identifier (VNI), which can be used to identify the first virtual machine under the VXLAN network.

[0009] Optionally, in a possible implementation, the method further includes: after the second virtual machine mounted on the first network device comes online, the first network device may send second routing information to the second network device, the second routing information being used to announce the route to the first address of the second virtual machine, the second routing information including a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

[0010] Optionally, in a possible implementation, the method further includes: the first network device receives a second message sent by the second network device, the second message carries the second virtual network identifier, and the destination address of the second message is the first address; the first network device forwards the second message to the second virtual machine according to the second virtual network identifier. That is, when the second network device receives the second message, it can select a second virtual machine as a virtual machine for processing the second message according to the destination address of the second message being the first address, and carry the second virtual network identifier corresponding to the second virtual machine in the second message sent to the first network device, so that the first network device forwards the second message to the second virtual machine according to the second virtual network identifier. Exemplarily, when the second network device receives the second message, it can select a route including the second virtual network identifier in the VRF table as a route for forwarding the second message, and carry the second virtual network identifier in the second message sent to the first network device.

[0011] In this solution, the second network device can, for example, determine one of the routes in the VRF table including multiple routes as the route for forwarding the message based on the load balancing strategy, and carry the virtual network identifier in the determined route in the message forwarded to the first network device, so that the first network device can forward the message to the corresponding virtual machine based on the virtual network identifier in the message, ensuring that the message can be forwarded normally to the virtual machine selected by the second network device, avoiding the occurrence of routing loops, and realizing load balancing of the virtual machines.

[0012] Optionally, in a possible implementation, the first routing information also includes the IP address of the first virtual machine, and the method also includes: the first network device saves the correspondence between the first virtual network identifier and the IP address of the first virtual machine, so that the first network device can determine the IP address of the first virtual machine based on the first virtual network identifier.

[0013] Optionally, in a possible implementation, when the first network device saves the correspondence between the first virtual network identifier and the IP address of the first virtual machine, the first network device forwards the first message to the first virtual machine according to the first virtual network identifier, including: the first network device determines the IP address of the first virtual machine corresponding to the first virtual network identifier according to the first virtual network identifier in the first message; and the first network device forwards the first message to the first virtual machine via a local output interface according to the IP address of the first virtual machine.

[0014] Optionally, in a possible implementation, the second network device may perform tunnel encapsulation on a first message sent to the first network device. After the first network device receives the first message sent by the second network device, the first network device performs tunnel decapsulation on the first message and obtains the first virtual network identifier to forward the first message to the first virtual machine according to the first virtual network identifier.

[0015] Optionally, in a possible implementation manner, the first address of the first virtual machine is a loopback address.

[0016] Optionally, in a possible implementation manner, an extensible virtual local area network VXLAN tunnel is deployed between the first network device and the second network device.

[0017] A second aspect of the present application provides a message forwarding method, the method comprising: a second network device receives first routing information sent by a first network device, the first routing information is used to announce the route to a first address of a first virtual machine, the first routing information includes a first virtual network identifier of the first virtual machine, and the first virtual machine is a local virtual machine of the first network device; the second network device sends a first message to the first network device, the destination address of the first message is the first address, and the first message carries the first virtual network identifier of the first virtual machine.

[0018] Optionally, in a possible implementation manner, the first virtual network identifier in the first message is used to instruct the first network device to forward the first message to the first virtual machine according to the first virtual network identifier.

[0019] Optionally, in a possible implementation manner, the method further includes:

[0020] The second network device generates a virtual routing forwarding VRF table according to the first routing information, wherein the VRF table includes a correspondence between the first address of the first virtual machine and the first virtual network identifier.

[0021] Optionally, in a possible implementation manner, the second network device sending a first message to the first network device according to the first address includes:

[0022] The second network device determines, in the VRF table, the first virtual network identifier corresponding to the first address according to the destination address of the first message being the first address;

[0023] The second network device sends the first message to the first network device, where the first message carries the first virtual network identifier.

[0024] Optionally, in a possible implementation, the method also includes: the second network device receives second routing information sent by the first network device, the second routing information is used to announce the route to the first address of the second virtual machine, the second routing information includes a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

[0025] Optionally, in a possible implementation, the method also includes: the second network device sends a second message to the first network device, the second message carries the second virtual network identifier, the destination address of the second message is the first address, and the second virtual network identifier is used to instruct the first network device to forward the second message to the second virtual machine according to the second virtual network identifier.

[0026] Optionally, in a possible implementation, the first routing information also includes the IP address of the first virtual machine. Before the second network device sends the first message to the first network device, the method also includes: the second network device performs tunnel encapsulation on the first message according to the IP address of the first virtual machine to send the first message to the first network device through the tunnel.

[0027] A third aspect of the present application provides a network device, which includes: a sending unit, used to send first routing information to a second network device, the first routing information is used to announce the route to a first address of a first virtual machine, the first routing information includes a first virtual network identifier of the first virtual machine, and the first virtual machine is a local virtual machine of the first network device; a receiving unit, used to receive a first message sent by the second network device, the first message carries the first virtual network identifier, and the destination address of the first message is the first address; the sending unit is also used to forward the first message to the first virtual machine according to the first virtual network identifier.

[0028] Optionally, in a possible implementation manner, the network device further includes: a processing unit, configured to allocate the first virtual network identifier to the first virtual machine according to that the first virtual machine is a local virtual machine of the first network device.

[0029] Optionally, in a possible implementation, the sending unit is also used to: send second routing information to the second network device, the second routing information being used to announce the route to the first address of the second virtual machine, the second routing information including a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

[0030] Optionally, in a possible implementation, the receiving unit is also used to receive a second message sent by the second network device, the second message carries the second virtual network identifier, and the destination address of the second message is the first address; the sending unit is also used to forward the second message to the second virtual machine according to the second virtual network identifier.

[0031] Optionally, in a possible implementation manner, the first routing information also includes the IP address of the first virtual machine, and the processing unit is further configured to save a correspondence between the first virtual network identifier and the IP address of the first virtual machine.

[0032] Optionally, in a possible implementation manner, the processing unit is further configured to determine, according to the first virtual network identifier in the first message, an IP address of the first virtual machine corresponding to the first virtual network identifier;

[0033] The sending unit is further configured to forward the first message to the first virtual machine via a local outbound interface according to the IP address of the first virtual machine.

[0034] Optionally, in a possible implementation, the processing unit is further used to perform tunnel decapsulation on the first message, obtain the first virtual network identifier, and forward the first message to the first virtual machine according to the first virtual network identifier.

[0035] Optionally, in a possible implementation manner, the first address of the first virtual machine is a loopback address.

[0036] Optionally, in a possible implementation manner, a VXLAN tunnel is deployed between the network device and the second network device.

[0037] In a fourth aspect of the present application, a network device is provided, the network device comprising: a receiving unit, used to receive first routing information sent by a first network device, the first routing information being used to announce a route to a first address of a first virtual machine, the first routing information comprising a first virtual network identifier of the first virtual machine, the first virtual machine being a local virtual machine of the first network device; a sending unit, used to send a first message to the first network device, the destination address of the first message being the first address, the first message carrying the first virtual network identifier of the first virtual machine.

[0038] Optionally, in a possible implementation manner, the first virtual network identifier in the first message is used to instruct the first network device to forward the first message to the first virtual machine according to the first virtual network identifier.

[0039] Optionally, in a possible implementation, the network device further includes: a processing unit, configured to generate a VRF table according to the first routing information, wherein the VRF table includes a correspondence between the first address of the first virtual machine and the first virtual network identifier.

[0040] Optionally, in a possible implementation, the processing unit is further used to determine the first virtual network identifier corresponding to the first address in the VRF table based on the destination address of the first message being the first address; the sending unit is further used to send the first message to the first network device, and the first message carries the first virtual network identifier.

[0041] Optionally, in a possible implementation, the receiving unit is further used to receive second routing information sent by the first network device, the second routing information being used to announce the route to the first address of the second virtual machine, the second routing information including a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

[0042] Optionally, in a possible implementation, the sending unit is also used to send a second message to the first network device, the second message carries the second virtual network identifier, the destination address of the second message is the first address, and the second virtual network identifier is used to instruct the first network device to forward the second message to the second virtual machine according to the second virtual network identifier.

[0043] Optionally, in a possible implementation, the first routing information also includes the IP address of the first virtual machine; the processing unit is also used to perform tunnel encapsulation on the first message according to the IP address of the first virtual machine to send the first message to the first network device through the tunnel.

[0044] The fifth aspect of the present application provides a network device, which includes: a processor and a memory; the memory is used to store instructions; the processor is used to execute the instructions in the memory, so that the network device executes the method as described in any one of the first or second aspects above.

[0045] In a sixth aspect, the present application provides a network device, comprising: a processor; the processor is coupled to a memory, and the processor is used to execute instructions in the memory, so that the network device executes a method as described in any one of the first or second aspects above.

[0046] The seventh aspect of the present application provides a computer storage medium, which may be non-volatile; the computer storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the method in any design of the first aspect or the second aspect is implemented.

[0047] An eighth aspect of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute a method as in any one of the designs of the first aspect or the second aspect.

[0048] In a ninth aspect of the present application, a chip system is provided, which includes a processor for supporting a network device to implement the functions involved in the above aspects, for example, sending or processing the data and / or information involved in the above methods. In one possible design, the chip system also includes a memory, which is used to store program instructions and data necessary for the network device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.

[0049] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0050] An embodiment of the present application provides a message forwarding method and a network device, in which a first network device receives a message sent by a second network device, the message carrying a virtual network identifier corresponding to a local virtual machine of the first network device, and the first network device can forward the first message to the corresponding local virtual machine according to the virtual network identifier in the message, without forwarding the message based on a VRF table, thereby avoiding the message being forwarded to other network devices again and ensuring normal forwarding of the message. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1A schematic diagram of a data center network provided in an embodiment of the present application;

[0052] Figure 2a A schematic diagram of north-south traffic provided for an embodiment of the present application;

[0053] Figure 2b A schematic diagram of east-west traffic provided by an embodiment of the present application;

[0054] Figure 3 A schematic diagram of a business scenario provided for an embodiment of the present application;

[0055] Figure 4 Another scenario schematic diagram provided for an embodiment of the present application;

[0056] Figure 5 A flowchart of a message forwarding method 500 provided in an embodiment of the present application;

[0057] Figure 6 A schematic diagram of encapsulation of a VXLAN tunnel message provided in an embodiment of the present application;

[0058] Figure 7 A flowchart of a message forwarding method 700 provided in an embodiment of the present application;

[0059] Figure 8 A schematic diagram of a message forwarding method provided in an embodiment of the present application;

[0060] Fig. 9 A schematic diagram of the structure of a network device 90 provided in an embodiment of the present application;

[0061] Fig.10 A schematic diagram of the structure of a network device 100 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solutions and advantages of the present application more clear, the embodiments of the present application are described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of 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 the present application are also applicable to similar technical problems.

[0063] 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 here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" and "having" and any of their variations 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 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 change 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. There may be other division methods when it is implemented in actual applications. For example, multiple units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection 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. In addition, 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 in multiple circuit units, and some or all of the units may be selected according to actual needs to achieve the purpose of the present application.

[0064] In traditional mobile communication networks, such as the second generation (2G) communication network, the third generation (3G) communication network and the fourth generation (4G) communication network, most telecommunication equipment adopts a proprietary platform structure, that is, the software and hardware between different telecommunication equipment are independent of each other. For example, in the 4G network system, the mobility management entity (MME), the serving gateway (S-GW) and the packet data network gateway (P-GW) are respectively carried by independent frame-type or box-type devices, and these devices have no intersection at the software level and the hardware level. In other words, if the MME load is low in a machine room, the MME board cannot be pulled out and plugged into the S-GW network element that is about to be overloaded.

[0065] With the integration and scale of data centers, as well as the continuous maturity of fifth-generation (5G) communication technology, network functions virtualization (NFV) technology, and cloud technology, telecom network elements have gradually migrated from dedicated hardware platforms to general-purpose hardware platforms in data centers, and are deployed on the VMs of data center servers in the form of VNF network elements, forming a telecom cloud data center network.

[0066] At present, the data center has the characteristics of centralized exchange data and increased east-west traffic, which further increases the requirements for data center networks. Therefore, in order to adapt to the above changes, the data center network has transformed from the traditional virtual local area network (VLAN) network to the VXLAN network and the software defined network (SDN) to achieve the adaptation and linkage between the network and the business, and improve the efficiency of resource utilization and business issuance. Among them, VXLAN is a network virtualization technology that encapsulates the data packet sent by the original host in the User Datagram Protocol (UDP), and uses the IP and MAC of the physical network as the outer header for encapsulation, and then transmits it on the network. After arriving at the destination, the tunnel endpoint decapsulates the data and sends it to the target host. Through VXLAN technology, it is possible to build a virtual Layer 2 network on the existing Layer 3 network and realize Layer 2 intercommunication between VMs.

[0067] Specifically, see Figure 1 , Figure 1 A schematic diagram of a data center network provided for an embodiment of the present application. In a data center, a typical VXLAN network may include: a data center gateway (DCGW), a spine switch, a leaf switch, and a VM; a DCGW may be connected to one or more spine switches, a spine switch may be connected to one or more leaf switches, and a leaf switch may be connected to one or more VMs. A VXLAN tunnel may be established between a DCGW and a leaf switch, and a VXLAN tunnel may also be established between leaf switches.

[0068] To facilitate understanding, the following explains the professional terms involved in the VXLAN network.

[0069] VTEP device, a network device that can encapsulate and decapsulate VXLAN messages. The source IP address in the VXLAN message is the IP address of the source VTEP device, and the destination IP address is the IP address of the destination VTEP device. A pair of VTEP addresses corresponds to a VXLAN tunnel. After the source VTEP device encapsulates the message, it sends the encapsulated message to the destination VTEP device through the tunnel, and the destination VTEP device then decapsulates the received encapsulated message. Figure 1 The leaf switch device in the VXLAN can have the ability to encapsulate and decapsulate VXLAN packets, that is, a VTEP device.

[0070] Network Virtualization Edge (NVE) devices are network entities that implement network virtualization functions. After the message is encapsulated and converted by the NVE device, a Layer 2 virtualized network can be established between NVE devices based on the Layer 3 basic network. Figure 1 The leaf switch device in the example is an NVE device. The VTEP device is a type of NVE device.

[0071] Layer 2 Gateway (L2GW): L2GW is similar to the Layer 2 access device of the traditional network. In the VXLAN network, L2GW can be used to solve the problem of tenant access to the VXLAN virtual network, and can also be used for subnet communication in the same VXLAN network.

[0072] Layer 3 Gateway (L3GW). In order to enable communication between VXLAN networks and between VXLAN networks and non-VXLAN networks, the concept of L3GW is introduced. L3GW can be used for cross-subnet communication of VXLAN networks and access to external networks. Figure 1 The leaf switch in the example can serve as L2GW or L3GW, or as both L2GW and L3GW at the same time, that is, the leaf switch can be L2GW / L3GW.

[0073] Generally, traffic in a data center network can be divided into north-south traffic and east-west traffic. North-south traffic refers to traffic that enters the data center network from the external network and traffic that flows out of the data center network from the external network. When north-south traffic is transmitted within the data center, one endpoint of the VXLAN tunnel is on the DCGW and the other endpoint is on the leaf switch, that is, the traffic is from the DCGW to the leaf switch, or from the leaf switch to the DCGW. East-west traffic refers to traffic between VMs within the data center. When east-west traffic is transmitted within the data center, both endpoints of the VXLAN tunnel are on the leaf switch, that is, the traffic is usually from one leaf switch to another leaf switch. When traffic flows from the DCGW to the leaf switch, or from another leaf switch to the leaf switch, the traffic is considered to be traffic flowing in from the network side. When the traffic flows into the leaf switch from the user-side device or user network, such as from the VM mounted on the leaf switch to the leaf switch, the traffic is considered to be traffic flowing in from the user side.

[0074] Specifically, see Figure 2a , Figure 2a A schematic diagram of north-south traffic provided in an embodiment of the present application. Figure 2a As shown in the figure, the packets entering the data center from the external network are forwarded by DCGW to leaf switch 1 through spine switch 1, and finally forwarded by leaf switch 1 to VM1 connected to leaf switch 1; similarly, VM1 sends the packets it generates to leaf 1, which are forwarded by leaf switch 1 to DCGW through spine switch 1, and finally sent by DCGW to the external network. The traffic from DCGW to VM1 and the traffic from VM1 to DCGW can both be called north-south traffic.

[0075] See also Figure 2b , Figure 2b Schematic diagram of east-west traffic provided by the embodiment of the present application. Figure 2a As shown, VM1 sends the message it generates to leaf switch 1, which is forwarded to leaf switch 2 via spine switch 1, and finally sent to VM3 by leaf switch 2. The traffic from VM1 to VM3 can be called east-west traffic.

[0076] Generally, when SDN is deployed in a VXLAN network, for east-west traffic between two VMs across subnets, the leaf switch can implement local forwarding and forward the traffic to another VM through the spine switch, thus avoiding the traffic bottleneck caused by the cross-subnet traffic bypassing the DCGW.

[0077] In a data center network, VMs can be deployed arbitrarily; under certain conditions, VMs can even be dynamically migrated. In this way, when VNF network elements are distributed on multiple VMs, multiple VMs share the same IP address, and the multiple VMs may be deployed on different racks, that is, multiple VMs are connected to different leaf switches. Figure 3 As shown, Figure 3 A business scenario diagram provided for an embodiment of the present application, VNF network elements are distributed on VM1 to VM4, and VM1 to VM4 can share the same IP address (the IP address can be, for example, 1.1.1.1). Among them, VM1 and VM2 are connected to leaf switch 1, and VM3 and VM4 are connected to leaf switch 2. In this way, when leaf switch 1 or leaf switch 1 forwards a message with an IP address of 1.1.1.1, the corresponding next hop may be a local VM, or the next hop may be a remote VM. Here, the route whose next hop is a local VM of leaf switch 1 is referred to as a local route, and the route whose next hop is a remote VM is referred to as a remote route. A remote VM is, for example, a VM mounted under a leaf switch other than leaf switch 1.

[0078] Specifically, for Figure 3 In the leaf switch 1 shown in FIG, the VRF table of the leaf switch 1 may specifically be:

[0079] prefix: 1.1.1.1nexthop: VM1 (local)

[0080] (--prefix: 1.1.1.1 next hop: VM1 (local))

[0081] prefix: 1.1.1.1nexthop: VM2 (local)

[0082] (--prefix: 1.1.1.1 next hop: VM2 (local))

[0083] prefix: 1.1.1.1nexthop: VM3 (remote)

[0084] (--prefix: 1.1.1.1 next hop: VM3 (remote))

[0085] prefix: 1.1.1.1nexthop: VM4 (remote)

[0086] (--prefix: 1.1.1.1 next hop: VM4 (remote))

[0087] That is, when the prefix (ie, the destination address) is 1.1.1.1, the next-hop routes corresponding to leaf switch 1 include two local routes (the next hops are VM1 and VM2) and two remote routes (the next hops are VM3 and VM4).

[0088] for Figure 3 In the leaf switch 2 shown in FIG, the VRF table of the leaf switch 2 may specifically be:

[0089] prefix: 1.1.1.1nexthop: VM1 (remote)

[0090] (--prefix: 1.1.1.1 next hop: VM1 (remote))

[0091] prefix: 1.1.1.1nexthop: VM2 (remote)

[0092] (--prefix: 1.1.1.1 next hop: VM2 (remote))

[0093] prefix: 1.1.1.1nexthop: VM3 (local)

[0094] (--prefix: 1.1.1.1 next hop: VM3 (local))

[0095] prefix: 1.1.1.1nexthop: VM4 (local)

[0096] (--prefix: 1.1.1.1 next hop: VM4 (local))

[0097] Similarly, when the prefix (ie, the destination address) is 1.1.1.1, the next-hop routes corresponding to leaf switch 2 include two remote routes (the next hops are VM1 and VM2) and two local routes (the next hops are VM3 and VM4).

[0098] Generally, in order to achieve VM-based load balancing of VNF network elements, that is, to evenly share the services of VNF network elements by multiple VMs, the local route and remote route are equal on the leaf switch. That is, when the leaf switch forwards a message under a certain IP address, the leaf switch can equally select one of the multiple local routes and / or remote routes corresponding to the IP address, and forward the message based on the selected route.

[0099] In this way, when multiple VMs sharing the same IP address are connected to different leaf switches, routing loops are prone to occur. Specifically, when leaf switch 1 receives a message with a destination address of 1.1.1.1, leaf switch 1 selects VM3 or VM4 as the next hop from VM1 to VM4. Since VM3 and VM4 are connected to leaf switch 2, leaf switch 1 forwards the message to leaf switch 2 through spine switch 1. When leaf switch 2 receives the message forwarded by spine switch 1, leaf switch 2 may select VM1 or VM2 as the next hop, so leaf switch 2 forwards the message to leaf switch 1 through spine switch 2. In other words, the message will always be forwarded between leaf switch 1 and leaf switch 2, and cannot reach the destination address, resulting in a routing loop.

[0100] In addition, if the leaf switch gives priority to local routing when forwarding messages, although the loop problem can be solved, the message forwarding pressure will be concentrated on the local VM, making it difficult to achieve load balancing for the entire network. Figure 4 As shown, Figure 4 Another scenario diagram provided for an embodiment of the present application, wherein VNF network element 1 is distributed on VM1 and VM2, VM1 and VM2 share IP address 1.1.1.1; VNF network element 2 is distributed on VM3 and VM4, VM3 and VM4 share IP address 2.2.2.2, and VM1 to VM3 are connected to leaf switch 1, and VM4 is connected to leaf switch 2.

[0101] At this time, for Figure 4 In the leaf switch 1 shown in FIG, the VRF table of the leaf switch 1 may specifically be:

[0102] prefix: 1.1.1.1nexthop: VM1 (local)

[0103] (--prefix: 1.1.1.1 next hop: VM1 (local))

[0104] prefix: 1.1.1.1nexthop: VM2 (local)

[0105] (--prefix: 1.1.1.1 next hop: VM2 (local))

[0106] prefix: 2.2.2.2nexthop: VM3 (local)

[0107] (--prefix: 2.2.2.2 next hop: VM3 (local))

[0108] prefix: 2.2.2.2nexthop: VM4 (remote)

[0109] (--prefix: 2.2.2.2 next hop: VM4 (remote))

[0110] for Figure 4 In the leaf switch 2 shown in FIG, the VRF table of the leaf switch 2 may specifically be:

[0111] prefix: 1.1.1.1nexthop: VM1 (remote)

[0112] (--prefix: 1.1.1.1 next hop: VM1 (remote))

[0113] prefix: 1.1.1.1nexthop: VM2 (remote)

[0114] (--prefix: 1.1.1.1 next hop: VM2 (remote))

[0115] prefix: 2.2.2.2nexthop: VM3 (remote)

[0116] (--prefix: 2.2.2.2 next hop: VM3 (remote))

[0117] prefix:2.2.2.2nexthop:VM4(local)

[0118] (--prefix: 2.2.2.2 next hop: VM4 (local))

[0119] The information in the VRF table in this embodiment is intended to more clearly illustrate the application scenario of this embodiment. It can be understood that the information content and style presented in the VRF table in actual applications can be specifically designed as needed. Figure 4 In the scenario shown, if the leaf switch gives priority to local routes when forwarding messages, then when leaf switch 1 receives a message sent by VM1 or VM2, and the destination address of the message is 2.2.2.2, leaf switch 1 will always choose to forward the message to the local VM3 according to the rule of giving priority to local routes, resulting in VM3 being always in a high-load state, while VM4 is always in an idle state, and load balancing cannot be achieved.

[0120] Above Figure 1Taking the network structure shown as an example, it is understandable that the possible structure of the data center network is not limited to this. For example, the data center network may not include a spine switch, or a layer 2 leaf switch may be connected under the leaf switch, and then the layer 2 leaf switch may mount the VM user device, etc. The layer 2 leaf switch may also be understood as a user-side device. However, the above-described problems may still exist in various different network structures.

[0121] In view of this, an embodiment of the present application provides a message forwarding method, in which a first network device receives a message sent by a second network device, the message carrying a virtual network identifier corresponding to a local virtual machine of the first network device, and the first network device can forward the first message to the corresponding local virtual machine according to the virtual network identifier in the first message, thereby avoiding the message from being forwarded to other network devices again and ensuring the normal forwarding of the message.

[0122] The message forwarding method provided in the embodiment of the present application can be applied to Figure 3 or Figure 4 The network architecture shown in which a VXLAN tunnel is deployed can also be applied to a network architecture in which other transmission tunnels are deployed, and is not limited here.

[0123] It can be understood that the first network device described in this embodiment can be a network device with a virtual machine mounted on it, for example, Figure 1 The leaf switch 1 in the network structure shown in the figure; the second network device described in this embodiment can be a network device that establishes a transmission tunnel with the first network device, for example, Figure 1 The DCGW or leaf switch 2 in the network structure shown in the figure does not specifically limit the first network device and the second network device in this embodiment.

[0124] See also Figure 5 , Figure 5 A schematic diagram of a message forwarding method 500 provided in an embodiment of the present application. Figure 5 As shown, the message forwarding method 500 provided in the embodiment of the present application includes:

[0125] 501. A first network device sends first routing information to a second network device, where the first routing information is used to announce a route to a first address of a first virtual machine, and the first routing information includes a first virtual network identifier of the first virtual machine, where the first virtual machine is a local virtual machine of the first network device.

[0126] In this embodiment, the first network device notifies the second network device of the route to the first address of the first virtual machine by sending the first routing information to the second network device, so that the second network device can determine the first address of the first virtual machine. The first address of the first virtual machine can be a service IP address shared by the first virtual machine and one or more other virtual machines, and virtual machines sharing the same service IP address can be used to process the same service. Exemplarily, the first address of the first virtual machine can be a loopback IP address, and the loopback IP address can be, for example, 1.1.1.1. The first virtual machine and one or more other virtual machines sharing the same loopback IP address 1.1.1.1 can all be used to process messages sent to the loopback IP address 1.1.1.1.

[0127] The first routing information sent by the first network device also includes a first virtual network identifier of the first virtual machine, which has a corresponding relationship with the first virtual machine and is used to identify the first virtual machine; the first network device can determine the first virtual machine corresponding to the first virtual network identifier based on the first virtual network identifier. Exemplarily, in the case where a VXLAN tunnel is deployed between the first network device and the second network device, the first virtual network identifier can specifically be a VXLAN network identifier (VXLAN Network Identifier, VNI), which can be used to identify the first virtual machine under the VXLAN network. The first virtual network identifier can also be other types of identifiers, as long as the first network device can uniquely determine the first virtual machine mounted on it based on the identifier.

[0128] In one possible implementation, when a VXLAN tunnel is deployed between the first network device and the second network device, the first routing information sent by the first network device to the second network device may be a border gateway protocol (BGP) Ethernet Virtual Private Network (EVPN) route published by the first network device. That is, the first network device may carry the first address of the first virtual machine and the first virtual network identifier of the first virtual machine in the BGP EVPN route, and transmit the address of the first virtual machine and the first virtual network identifier of the first virtual machine by publishing the BGP EVPN route to the second network device. In addition, the first network device may also announce the first address of the first virtual machine and the first virtual network identifier of the first virtual machine by publishing the BGP EVPN route to other VTEP devices.

[0129] Exemplarily, the first network device may publish a BGP EVPN route carrying an extended group attribute to the second network device to announce the address of the first virtual machine and the first virtual network identifier of the first virtual machine. The BGP EVPN route carries an extended group attribute, and the extended group attribute carries a specific field that can be used to carry the first virtual network identifier. The BGP EVPN route can indicate the corresponding relationship between the address of the first virtual machine and the first virtual network identifier of the first virtual machine.

[0130] In a possible implementation, before the first network device sends the first routing information to the second network device, the first network device may allocate the first virtual network identifier to the first virtual machine according to the first virtual machine being a local virtual machine of the first network device.

[0131] It is understandable that when the virtual machine mounted by the first network device (i.e., the local virtual machine of the first network device) goes online, the first network device can obtain the service IP address corresponding to the virtual machine, and the first network device can dynamically allocate the corresponding IP address for the online virtual machine according to the service IP address corresponding to the virtual machine. For example, when virtual machine 1 and virtual machine 2 are mounted under the first network device, and virtual machine 1 and virtual machine 2 share the service IP address 1.1.1.1, after virtual machine 1 and virtual machine 2 mounted by the first network device go online, the first network device can obtain the service IP address 1.1.1.1 shared by virtual machine 1 and virtual machine 2. The first network device can also obtain the IP addresses of virtual machine 1 and virtual machine 2, so as to send a message to virtual machine 1 or virtual machine 2 according to the IP address of virtual machine 1 or virtual machine 2. It is understandable that the IP address of the virtual machine can be allocated by a Dynamic Host Configuration Protocol (DHCP) server. Exemplarily, the first network device can obtain the IP address 192.168.1.1 of virtual machine 1 and the IP address 192.168.1.2 of virtual machine 2. In this way, when the first network device needs to send a message to virtual machine 1 or virtual machine 2, the message can be sent to virtual machine 1 or virtual machine 2 according to the IP address 192.168.1.1 of virtual machine 1 or the IP address 192.168.1.2 of virtual machine 2.

[0132] In this embodiment, after the first virtual machine comes online, the first network device can obtain the first address of the first virtual machine and the IP address of the first virtual machine, and allocate the first virtual network identifier to the first virtual machine.

[0133] Optionally, after the first network device obtains the IP address of the first virtual machine and assigns a corresponding first virtual network identifier to the first virtual machine, the first network device can save the correspondence between the first virtual network identifier and the IP address of the first virtual machine, so that the first network device can determine the IP address of the first virtual machine based on the first virtual network identifier.

[0134] Exemplarily, a correspondence between the virtual network identifier stored by the first network device and the IP address of the virtual machine is shown in Table 1:

[0135] Table 1 Virtual network identifier correspondence

[0136] Virtual network ID Virtual machine IP address 1001 192.168.1.1 1002 192.168.1.2 1003 192.168.1.3

[0137] As shown in Table 1, the first network device may store a correspondence between a virtual network identifier and a virtual machine IP address. In the correspondence table of virtual network identifiers and virtual machine IP addresses, the virtual network identifiers correspond to the virtual machine IP addresses one by one, and the first network device may find the IP address of the first virtual machine corresponding to the first virtual network identifier in the correspondence table based on the first virtual network identifier. In other possible ways, the first network device may also determine the IP address of the first virtual machine based on the tunnel information carried in the received message.

[0138] 502. The first network device receives a first message sent by the second network device, where the first message carries the first virtual network identifier, and the destination address of the first message is the first address.

[0139] In this embodiment, after the first network device sends the first routing information to the second network device, the second network device can determine the first virtual machine corresponding to the first address and the first virtual network identifier of the first virtual machine. In this way, when the second network device obtains the first message with the destination address being the first address, the second network device can determine the first virtual machine as the virtual machine for processing the first message according to the destination address of the first message; then, the second network device can carry the first virtual network identifier in the first message sent to the first network device, so that the first network device can forward the first message to the first virtual machine based on the first virtual network identifier carried in the first message.

[0140] 503. The first network device forwards the first message to the first virtual machine according to the first virtual network identifier.

[0141] In this embodiment, after receiving the first message carrying the first virtual network identifier, the first network device may determine the first virtual machine corresponding to the first virtual network identifier according to the first virtual network identifier, thereby forwarding the first message to the first virtual machine.

[0142] In a possible implementation, when the first network device stores the correspondence between the first virtual network identifier and the IP address of the first virtual machine, the first network device can determine the IP address of the first virtual machine according to the first virtual network identifier in the first message. Then, the first network device forwards the first message to the first virtual machine via the local outbound interface according to the IP address of the first virtual machine.

[0143] It can be understood that in this embodiment, the first network device determines to forward the first message to the first virtual machine corresponding to the first virtual network identifier based on the first virtual network identifier in the first message, and there is no need to forward the first message based on the VRF table in the first network device, thereby avoiding the first message from being forwarded to other network devices again, and ensuring the normal forwarding of the first message.

[0144] In a possible implementation, in the above method 500, after the second network device receives the first routing information sent by the first network device, the second network device may generate a VRF table based on the first routing information, and the VRF table includes the correspondence between the first address of the first virtual machine and the first virtual network identifier. In the process of forwarding the first message, the second network device may determine the first virtual network identifier corresponding to the first address in the VRF table based on the destination address of the first message being the first address; then the second network device sends the first message to the first network device, and the first message carries the first virtual network identifier.

[0145] The VRF table generated by the second network device may include one or more virtual network identifiers corresponding to the first address, that is, the second network device can find one or more virtual network identifiers corresponding to the first address in the VRF table based on the first address.

[0146] It is understandable that, in the case where the second network device only receives the first routing information sent by the first network device, the VRF table generated by the second network device only includes the first virtual network identifier corresponding to the first address, and the first virtual network identifier can be located in the tunnel output interface information in the generated VRF table. In the case where the second network device also receives routing information sent by other network devices, or the second network device also receives other routing information sent by the first network device, and these routing information carry the virtual network identifier corresponding to the first address, the VRF table generated by the second network device includes multiple virtual network identifiers corresponding to the first address, and the multiple virtual network identifiers corresponding to the first address can also be located in the tunnel output interface information in the generated VRF table.

[0147] For example, Figure 3 Taking the network structure shown as an example, VM1 to VM4 share the service IP address 1.1.1.1. After VM1 and VM2 go online, leaf switch 1 can allocate virtual network identifiers 1001 and 1002 to VM1 and VM2 respectively; after VM3 and VM4 go online, leaf switch 2 can allocate virtual network identifiers 1003 and 1004 to VM3 and VM4 respectively; and leaf switch 1 can send routing information to DCGW to notify the service IP addresses and virtual network identifiers corresponding to VM1 and VM2, and leaf switch 2 can also send routing information to DCGW to notify the service IP addresses and virtual network identifiers corresponding to VM3 and VM4. In this way, DCGW generates the corresponding VRF table by receiving the routing information sent by leaf switch 1 and leaf switch 2. The VRF table is schematically shown as follows:

[0148] prefix: 1.1.1.1 VNI: 1001

[0149] (--prefix: 1.1.1.1 virtual network ID: 1001)

[0150] prefix: 1.1.1.1 VNI: 1002

[0151] (--prefix: 1.1.1.1 virtual network ID: 1002)

[0152] prefix: 1.1.1.1 VNI: 1003

[0153] (--prefix: 1.1.1.1 virtual network ID: 1003)

[0154] prefix: 1.1.1.1 VNI: 1004

[0155] (--prefix: 1.1.1.1 virtual network ID: 1004)

[0156] It can be seen from the VRF table generated by the DCGW that the virtual network identifiers corresponding to the IP address 1.1.1.1 include 1001, 1002, 1003 and 1004. When the DCGW obtains the message with the destination address 1.1.1.1, it can find the corresponding virtual network identifiers 1001, 1002, 1003 and 1004 in the VRF table based on the destination address 1.1.1.1. The virtual network identifiers 1001, 1002, 1003 and 1004 can be located in the tunnel outbound interface information of the VRF table.

[0157] In a possible implementation, the first routing information sent by the first network device to the second network device also includes the IP address of the first virtual machine, and the VRF table generated by the second network device also includes the IP address of the first virtual machine; the second network device can determine the corresponding IP address of the first virtual machine and the first virtual network identifier in the VRF table based on the first address.

[0158] In the case where a VXLAN tunnel is deployed between the first network device and the second network device, the manner in which the second network device forwards the first message carrying the first virtual network identifier to the first network device may specifically be: after receiving the first message, the second network device may search the local VRF table according to the destination address of the first message (i.e., the first address). When the VRF table includes multiple equal-cost multi-path routes (ECMPs) corresponding to the first address, the second network device may search for multiple ECMPs, each of which includes an IP address of a next-hop virtual machine and corresponding tunnel outbound interface information (i.e., the corresponding virtual network identifier). The second network device may determine one of the routes based on the multiple ECMPs found, the route including the IP address of the first virtual machine and the first virtual network identifier. When the VRF table includes only one route corresponding to the first address, the second network device may search for a route based on the first address, the route including the IP address of the first virtual machine and the first virtual network identifier.

[0159] Then, the second network device performs VXLAN tunnel encapsulation on the first message, and sends the encapsulated first message to the first network device through the VXLAN tunnel. The encapsulated first message carries the IP address of the first virtual machine and the first virtual network identifier.

[0160] In this way, after the first network device receives the first message sent by the second network device, the first network device can perform tunnel decapsulation on the first message to obtain the first virtual network identifier, thereby forwarding the first message to the first virtual machine according to the first virtual network identifier.

[0161] That is to say, when the second network device finds that the VRF table includes multiple routes corresponding to the destination address of the message, the second network device can determine one of the routes based on the load balancing strategy, and determine the IP address and virtual network identifier of the virtual machine included in the route, so as to tunnel encapsulate the message according to the IP address and virtual network identifier of the virtual machine in the route.

[0162] Specifically, taking the case where a VXLAN tunnel is deployed between the first network device and the second network device as an example, Figure 6 , Figure 6 A schematic diagram of encapsulation of a VXLAN tunnel message provided in an embodiment of the present application. Figure 6 As shown, the original message includes a payload, an inner IP header, and an inner Ethernet header. After the message is encapsulated by the VXALN tunnel, a VXLAN header is added to the message, and the VXLAN header is preceded by a standard UDP header, that is, an outer Ethernet header, an outer IP header, and an outer User Datagram Protocol header (outer UDP header). The VXLAN header specifically includes a VXLAN flag, a reserved bit, a VXLAN network identifier (VNI), and a reserved field. The second network device can insert the virtual network identifier of the first virtual machine (i.e., the VNI of the first virtual machine) at the position corresponding to the VNI in the VXLAN header, thereby carrying the virtual network identifier of the first virtual machine in the first message. As a more specific implementation method, the VXLAN message format can refer to the standard RFC7348, and the entire content of the standard is introduced into the embodiment of the present application.

[0163] The above is a detailed description of the message forwarding method 500 provided in the embodiment of the present application. Figure 5 Based on the corresponding embodiments, the present application further provides a possible embodiment.

[0164] See also Figure 7 , Figure 7A schematic diagram of a flow chart of a message forwarding method 700 provided in an embodiment of the present application. Figure 7 As shown, the message forwarding method 700 provided in the embodiment of the present application includes:

[0165] 701. A first network device allocates a second virtual network identifier to a second virtual machine.

[0166] In this embodiment, in addition to the first virtual machine, a second virtual machine is mounted under the first network device, and the second virtual machine is a local virtual machine of the first network device. When the second virtual machine is online, the first network device can obtain the service IP address corresponding to the second virtual machine and the IP address of the second virtual machine, and the first network device assigns the corresponding second virtual network identifier to the second virtual machine according to the service IP address corresponding to the second virtual machine. Among them, the service IP address of the second virtual machine is the same as the service IP address of the first virtual machine, both of which are the first address; the second virtual network identifier of the second virtual machine is inconsistent with the first virtual network identifier of the first virtual machine. For example, the first address corresponding to the first virtual machine and the second virtual machine is 1.1.1.1, the first virtual network identifier of the first virtual machine is 1001, and the second virtual network identifier of the second virtual machine is 1002.

[0167] Optionally, after the first network device assigns a corresponding second virtual network identifier to the second virtual machine, the first network device may save the correspondence between the second virtual network identifier and the IP address of the second virtual machine, so that the first network device may determine the IP address of the second virtual machine based on the second virtual network identifier.

[0168] 702. The first network device sends second routing information to the second network device.

[0169] The second routing information is used to announce the route to the first address of the second virtual machine, and the second routing information includes the second virtual network identifier of the second virtual machine. Optionally, the second routing information may also include the IP address of the second virtual machine, that is, the second network device may obtain the first address, IP address and second virtual network identifier corresponding to the second virtual machine based on the second routing information.

[0170] In a possible implementation, when a VXLAN tunnel is deployed between the first network device and the second network device, the second routing information sent by the first network device to the second network device may also be a BGP EVPN route published by the first network device. That is, the first network device may carry the address of the second virtual machine and the second virtual network identifier of the second virtual machine in the BGP EVPN route, and transmit the address of the second virtual machine and the second virtual network identifier of the second virtual machine by publishing the BGP EVPN route to the second network device.

[0171] In this embodiment, the first routing information and the second routing information may be carried in the same route or in different routes. For example, when multiple virtual machines mounted on the first network device are online at the same time or multiple virtual machines are online at similar times, the first network device may, after allocating corresponding virtual network identifiers to the multiple virtual machines, notify the corresponding service IP addresses and virtual network identifiers of the multiple virtual machines through the same route.

[0172] 703. The second network device generates a VRF table according to the second routing information.

[0173] The VRF table generated by the second network device according to the second routing information includes a correspondence between the second virtual network identifier and the first address, so that the second network device can find the corresponding second virtual network identifier in the VRF table based on the first address.

[0174] In a possible implementation, the VRF table generated by the second network device according to the second routing information may be updated based on the original VRF table in the second network device. Exemplarily, after the second network device generates the VRF table according to the first routing information, the second network device may update the generated VRF table according to the received second routing information to obtain an updated VRF table, wherein the updated VRF table includes the first virtual network identifier and the second virtual network identifier corresponding to the first address.

[0175] 704. The second network device obtains a second message to be forwarded, where the destination address of the second message is the first address.

[0176] That is, the destination address of the second message is the same as the destination address of the first message, and the second message and the first message may belong to the same service flow.

[0177] 705. The second network device determines, in the VRF table according to the first address, a second virtual network identifier corresponding to the first address.

[0178] The VRF table generated by the second network device includes a first route and a second route corresponding to the first address, the first route includes the IP address of the first virtual machine and the first virtual network identifier, and the second route includes the IP address and the second virtual network identifier of the second virtual machine, that is, the first virtual machine corresponding to the first virtual network identifier and the second virtual machine corresponding to the second virtual network identifier can both be used to process messages with the destination address being the first address. The second network device can find the first route and the second route in the VRF table according to the first address, and the second network device selects the second route from the first route and the second route, thereby obtaining the second virtual network identifier in the second route.

[0179] 706. The second network device sends a second message to the first network device.

[0180] The second message carries the second virtual network identifier, and the destination address of the second message is the first address.

[0181] In one possible implementation, when a VXLAN tunnel is deployed between the first network device and the second network device, after the second network device obtains the second message to be forwarded, it searches the local VRF table according to the destination address of the second message. The VRF table includes a first route and a second route, and the first route includes the IP address of the first virtual machine and the first virtual route identifier, and the second route includes the IP address and the second virtual route identifier of the second virtual machine. The second network device can determine that the second route is the route for forwarding the second message in the first route and the second route. Then, the second network device performs VXLAN tunnel encapsulation on the second message, and sends the encapsulated second message to the first network device through the VXLAN tunnel, and the encapsulated second message carries the IP address and the second virtual network identifier of the second virtual machine. In this way, after the first network device receives the second message sent by the second network device, the first network device can perform tunnel decapsulation on the second message to obtain the second virtual network identifier.

[0182] 707. The first network device forwards the second message to the second virtual machine according to the second virtual network identifier.

[0183] After receiving the second message sent by the second network device, the first network device can obtain the second virtual network identifier carried in the second message. For example, the first network device can obtain the second virtual network identifier in the header of the second message by tunnel decapsulating the second message.

[0184] Since the correspondence between the second virtual network identifier and the IP address of the second virtual machine is stored in the first network device, the second network device can determine the IP address of the second virtual machine according to the second virtual network identifier in the second message. Then, the second network device forwards the first message to the second virtual machine via the local outbound interface according to the IP address of the second virtual machine.

[0185] It can be understood that in this embodiment, when the VRF table includes multiple routes corresponding to the first address, the second network device can determine one of the routes in the VRF table, and implement forwarding of the message based on the virtual network identifier included in the route, so that the first network device can forward the message to the corresponding virtual machine based on the virtual network identifier in the message, ensuring that the message can be forwarded to the corresponding virtual machine normally, avoiding the occurrence of routing loops, and realizing load balancing of the virtual machines.

[0186] For ease of understanding, the message forwarding method provided by the embodiment of the present application will be described in detail below in conjunction with specific application scenarios. Figure 8 , Figure 8 A schematic diagram of a message forwarding method provided for an embodiment of the present application, wherein, for the sake of ease of description, the spine switch between the leaf switch and the DCGW is not shown, VM1 and VM2 are mounted on leaf switch 1, VM3 and VM4 are mounted on leaf switch 2, and a VXLAN tunnel is deployed between leaf switch 1 and DCGW, and a VXLAN tunnel is also deployed between leaf switch 1 and leaf switch 2. Figure 8 The leaf switch 1 in the embodiment may be the first network device described in the foregoing embodiment. Figure 8 The DCGW in the example may be the second network device described in the foregoing embodiment.

[0187] like Figure 8 As shown, Figure 8 The message forwarding method shown includes:

[0188] 801, VM1, and VM2 are online.

[0189] Among them, VM1 and VM2 are mounted on leaf switch 1, and VM1 and VM2 share the same service IP address 1.1.1.1.

[0190] 802. Leaf switch 1 allocates virtual network identifiers to VM1 and VM2.

[0191] Exemplarily, after leaf switch 1 learns that VM1 and VM2 are online, leaf switch 1 can obtain the service IP address 1.1.1.1 shared by VM1 and VM2, VM1's IP address 192.168.1.1, and VM2's IP address 192.168.1.2; leaf switch 1 can also assign a virtual network identifier 1001 to VM1 and a virtual network identifier 1002 to VM2, where virtual network identifier 1001 and virtual network identifier 1002 can be VNIs.

[0192] In addition, leaf switch 1 may also store the correspondence between IP address 192.168.1.1 of VM1 and virtual network identifier 1001 , and the correspondence between IP address 192.168.1.2 of VM2 and virtual network identifier 1002 .

[0193] 803. Leaf switch 1 advertises the BGP EVPN route.

[0194] Among them, leaf switch 1 can carry the service IP address, IP address and virtual network identifier corresponding to VM1 and VM2 in the BGP EVPN route, and then leaf switch 1 publishes the BGPEVPN route to the DCGW and leaf switch 2 in the VXLAN network to announce the service IP address, IP address and virtual network identifier corresponding to VM1 and VM2.

[0195] 804. DCGW and leaf switch 2 generate a VRF table.

[0196] Specifically, after receiving the BGP EVPN route published by leaf switch 1, DCGW and leaf switch 2 can generate a VRF table based on the BGP EVPN route, and the generated VRF table includes the correspondence between the service IP address of VM1 and the virtual network identifier, and the correspondence between the service IP address of VM2 and the virtual network identifier. Exemplarily, the VRF table generated by DCGW and leaf switch 2 is as follows:

[0197] prefix: 1.1.1.1 VNI: 1001

[0198] (--prefix: 1.1.1.1 virtual network ID: 1001)

[0199] prefix: 1.1.1.1 VNI: 1002

[0200] (--prefix: 1.1.1.1 virtual network ID: 1002)

[0201] The above VRF table is used as an illustration. In actual applications, the virtual network identifier may be specifically located in the tunnel output interface information.

[0202] 805. DCGW sends message 1 to leaf switch 1.

[0203] Specifically, DCGW can obtain message 1 sent by the external network, and the destination address of message 1 is 1.1.1.1. DCGW can find the corresponding route in the VRF table according to the destination address of message 1, for example, it finds route 1 including the IP address of VM1 and the virtual network identifier 1001 and route 2 including the IP address of VM2 and the virtual network identifier 1002. Then, DCGW can determine one of the routes found in route 1 and route 2 as the route for forwarding message 1, for example, select route 1 as the route for forwarding message 1, and determine the virtual network identifier 1001 in route 1. Finally, DCGW carries the virtual network identifier 1001 in message 1, and sends message 1 carrying the virtual network identifier 1001 to leaf switch 1.

[0204] 806. The leaf switch forwards packet 1 to VM1.

[0205] After receiving message 1 sent by DCGW, leaf switch 1 can obtain the virtual network identifier 1001 carried in message 1, for example, by tunnel decapsulating message 1 to obtain the virtual network identifier 1001 in the header of message 1. In the case where the correspondence between the virtual network identifier and the IP address of the virtual machine is stored in leaf switch 1, leaf switch 1 can determine the IP address 192.168.1.1 of VM1 corresponding to the virtual network identifier 1001 based on the virtual network identifier 1001. Alternatively, leaf switch 1 can also directly determine the IP address of VM1 based on the information in the VXLAN header of the message. Then, leaf switch 1 forwards message 1 to VM1 via the local outbound interface based on VM1's IP address 192.168.1.1.

[0206] 807. VM3 sends packet 2 to leaf switch 2.

[0207] The destination address of message 2 is 1.1.1.1. Message 2 and message 1 may belong to the same service flow.

[0208] 808. Leaf switch 2 sends message 2 to leaf switch 1.

[0209] Specifically, leaf switch 2 can also search for the corresponding route in the VRF table according to the destination address of message 2, for example, find the above-mentioned route 1 and route 2. Then, leaf switch 2 can determine one of the routes found in route 1 and route 2 as the route for forwarding message 2, for example, select route 2 as the route for forwarding message 2, and determine the virtual network identifier 1002 in route 2. Finally, leaf switch 2 carries the virtual network identifier 1002 in message 2, and sends message 2 carrying the virtual network identifier 1002 to leaf switch 1.

[0210] 809. Leaf switch 1 forwards packet 2 to VM2.

[0211] After receiving message 2 sent by leaf switch 2, leaf switch 1 can obtain virtual network identifier 1002 carried in message 2, for example, by tunnel decapsulating message 2 to obtain virtual network identifier 1002 in the header of message 2. Leaf switch 1 can determine the IP address 192.168.1.2 of VM2 corresponding to virtual network identifier 1002 based on virtual network identifier 1002. Then, leaf switch 2 forwards message 2 to VM2 via the local outbound interface based on VM2's IP address 192.168.1.2.

[0212] Fig. 9 A structural diagram of a network device 90 provided in an embodiment of the present application, the network device 90 provided in an embodiment of the present application, for example, may be leaf switch 1 or leaf switch 2 in the above-mentioned method embodiments. The network device 90 may include, for example: a sending unit 901, used to send first routing information to a second network device, the first routing information being used to announce a route to a first address of a first virtual machine, the first routing information including a first virtual network identifier of the first virtual machine, the first virtual machine being a local virtual machine of the first network device; a receiving unit 902, used to receive a first message sent by the second network device, the first message carrying the first virtual network identifier, the destination address of the first message being the first address; the sending unit 901, further used to forward the first message to the first virtual machine according to the first virtual network identifier.

[0213] Optionally, in a possible implementation, the network device 90 further includes: a processing unit 903, configured to allocate the first virtual network identifier to the first virtual machine according to that the first virtual machine is a local virtual machine of the first network device.

[0214] Optionally, in a possible implementation, the sending unit 901 is also used to: send second routing information to the second network device, the second routing information being used to announce the route to the first address of the second virtual machine, the second routing information including a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

[0215] Optionally, in a possible implementation, the receiving unit 902 is also used to receive a second message sent by the second network device, the second message carries the second virtual network identifier, and the destination address of the second message is the first address; the sending unit 901 is also used to forward the second message to the second virtual machine according to the second virtual network identifier.

[0216] Optionally, in a possible implementation, the first routing information also includes the IP address of the first virtual machine, and the processing unit 903 is further configured to save a correspondence between the first virtual network identifier and the IP address of the first virtual machine.

[0217] Optionally, in a possible implementation manner, the processing unit 903 is further configured to determine, according to the first virtual network identifier in the first message, an IP address of the first virtual machine corresponding to the first virtual network identifier;

[0218] The sending unit 901 is further configured to forward the first message to the first virtual machine via a local outbound interface according to the IP address of the first virtual machine.

[0219] Optionally, in a possible implementation, the processing unit 903 is further configured to perform tunnel decapsulation on the first message, obtain the first virtual network identifier, and forward the first message to the first virtual machine according to the first virtual network identifier.

[0220] Optionally, in a possible implementation manner, the first address of the first virtual machine is a loopback address.

[0221] Optionally, in a possible implementation, a VXLAN tunnel is deployed between the network device 90 and the second network device.

[0222] In another embodiment, the network device 90 includes: a receiving unit 902, used to receive first routing information sent by a first network device, the first routing information is used to announce the route to the first address of the first virtual machine, the first routing information includes a first virtual network identifier of the first virtual machine, and the first virtual machine is a local virtual machine of the first network device; a sending unit 901, used to send a first message to the first network device, the destination address of the first message is the first address, and the first message carries the first virtual network identifier of the first virtual machine.

[0223] Optionally, in a possible implementation manner, the first virtual network identifier in the first message is used to instruct the first network device to forward the first message to the first virtual machine according to the first virtual network identifier.

[0224] Optionally, in a possible implementation, the network device 90 further includes: a processing unit 903, configured to generate a VRF table according to the first routing information, wherein the VRF table includes a correspondence between the first address of the first virtual machine and the first virtual network identifier.

[0225] Optionally, in a possible implementation, the processing unit 903 is further used to determine the first virtual network identifier corresponding to the first address in the VRF table based on the destination address of the first message being the first address; the sending unit 901 is further used to send the first message to the first network device, and the first message carries the first virtual network identifier.

[0226] Optionally, in a possible implementation, the receiving unit 902 is further used to receive second routing information sent by the first network device, the second routing information being used to announce the route to the first address of the second virtual machine, the second routing information including a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

[0227] Optionally, in a possible implementation, the sending unit 901 is also used to send a second message to the first network device, the second message carries the second virtual network identifier, the destination address of the second message is the first address, and the second virtual network identifier is used to instruct the first network device to forward the second message to the second virtual machine according to the second virtual network identifier.

[0228] Optionally, in a possible implementation, the first routing information also includes the IP address of the first virtual machine; the processing unit 903 is also used to perform tunnel encapsulation on the first message according to the IP address of the first virtual machine so as to send the first message to the first network device through the tunnel.

[0229] Fig.10 A schematic diagram of the structure of a network device 100 provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, a network device 100 is provided. The network device 100 may be, for example, the first network device or the second network device in the aforementioned method embodiment, or may be the network device 90, and may be used to execute the functions executed by the corresponding network devices in the aforementioned embodiments. The network device 100 includes: a processor 1001. The processor 1001 is coupled to a memory 1002. The memory 1002 may be independent of the processor 1001 or independent of the network device 100, such as memory (Memory) #3, or may be within the processor 1001 or the network device 100 (Memory #1 and Memory #2). The memory 1002 may be a physically independent unit, or may be a storage space on a cloud server or a network hard disk, etc. Optionally, the memory 1002 may be one or more. When the number of memories 1002 is multiple, they may be located in the same or different locations, and may be used independently or in combination.

[0230] The memory 1002 is used to store computer-readable instructions (or computer programs).

[0231] The processor 1001 is used to read computer-readable instructions to implement the aforementioned aspects related to the network device and the methods provided by any implementation thereof.

[0232] Optionally, the network device 100 further includes a transceiver 1003 for receiving and sending data.

[0233] In addition, the processor 1001 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. In addition, the memory 1002 may include: volatile memory (volatile memory), such as random-access memory (random-access memory, RAM); the memory may also include non-volatile memory (non-volatile memory), such as flash memory (flash memory), hard disk (hard disk drive, HDD) or solid-state drive (solid-state drive, SSD), cloud storage (cloud storage), network attached storage (network attached storage), network disk (network drive), etc.; the memory may also include a combination of the above-mentioned types of memory or any other medium or product with storage function in any form.

[0234] Those skilled in the art can 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.

[0235] In the several embodiments provided in the present 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 only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

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

[0237] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0238] 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 is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment 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 forwarding method, characterized in that: The method comprises: The first network device sends first routing information to the second network device through a transmission tunnel between the first network device and the second network device, where the first routing information is used to notify a route to a first address of a first virtual machine, where the first routing information includes a first virtual network identifier of the first virtual machine, where the first virtual machine is a local virtual machine of the first network device, and where the first address of the first virtual machine is a service IP address shared by the first virtual machine and one or more other virtual machines; The first network device receives a first message sent by the second network device through the transmission tunnel, where the first message carries the first virtual network identifier, and the destination address of the first message is the first address; The first network device forwards the first message to the first virtual machine according to the first virtual network identifier; The first routing information also includes an Internet Protocol IP address of the first virtual machine, and the method further includes: the first network device storing a one-to-one correspondence between the first virtual network identifier and the IP address of the first virtual machine; The first network device forwards the first message to the first virtual machine according to the first virtual network identifier, including: the first network device determines the IP address of the first virtual machine corresponding to the first virtual network identifier according to the first virtual network identifier in the first message; the first network device forwards the first message to the first virtual machine via the local output interface according to the IP address of the first virtual machine.

2. The method according to claim 1, characterized in that Before the first network device sends the first routing information to the second network device through the transmission tunnel between the first network device and the second network device, the method further includes: The first network device allocates the first virtual network identifier to the first virtual machine according to the first virtual machine being a local virtual machine of the first network device.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: The first network device sends second routing information to the second network device through the transmission tunnel, the second routing information is used to announce the route to the first address of the second virtual machine, the second routing information includes a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

4. The method according to claim 3, characterized in that The method further comprises: The first network device receives a second message sent by the second network device through the transmission tunnel, where the second message carries the second virtual network identifier, and the destination address of the second message is the first address; The first network device forwards the second message to the second virtual machine according to the second virtual network identifier.

5. The method according to any one of claims 1 to 2, characterized in that: After the first network device receives the first message sent by the second network device through the transmission tunnel, the method includes: The first network device performs tunnel decapsulation on the first message, obtains the first virtual network identifier, and forwards the first message to the first virtual machine according to the first virtual network identifier.

6. The method according to any one of claims 1 to 2, characterized in that: The first address of the first virtual machine is a loopback address.

7. The method according to any one of claims 1 to 2, characterized in that: An extensible virtual local area network VXLAN tunnel is deployed between the first network device and the second network device.

8. A message forwarding method, characterized in that: The method comprises: The second network device receives first routing information sent by the first network device through a transmission tunnel between the first network device and the second network device, where the first routing information is used to announce a route to a first address of a first virtual machine, where the first routing information includes a first virtual network identifier of the first virtual machine, where the first virtual machine is a local virtual machine of the first network device, and where the first address of the first virtual machine is a service IP address shared by the first virtual machine and one or more other virtual machines; The second network device sends a first message to the first network device through the transmission tunnel, the destination address of the first message is the first address, and the first message carries the first virtual network identifier of the first virtual machine; The first routing information also includes an IP address of the first virtual machine, and there is a one-to-one correspondence between the first virtual network identifier and the IP address of the first virtual machine; Before the second network device sends the first message to the first network device through the transmission tunnel, the method further includes: The second network device performs tunnel encapsulation on the first message according to the IP address of the first virtual machine, so as to send the first message to the first network device through the transmission tunnel.

9. The method according to claim 8, characterized in that The first virtual network identifier in the first message is used to instruct the first network device to forward the first message to the first virtual machine according to the first virtual network identifier.

10. The method according to any one of claims 8 or 9, characterized in that: The method further comprises: The second network device generates a virtual routing forwarding VRF table according to the first routing information, wherein the VRF table includes a correspondence between the first address of the first virtual machine and the first virtual network identifier.

11. The method according to claim 10, characterized in that The second network device sending a first message to the first network device through the transmission tunnel according to the first address, comprising: The second network device determines, in the VRF table, the first virtual network identifier corresponding to the first address according to the destination address of the first message being the first address; The second network device sends the first message to the first network device through the transmission tunnel, and the first message carries the first virtual network identifier.

12. The method according to any one of claims 8 to 9, characterized in that: The method further comprises: The second network device receives second routing information sent by the first network device through the transmission tunnel, the second routing information is used to announce the route to the first address of the second virtual machine, the second routing information includes a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

13. The method according to claim 12, characterized in that The method further comprises: The second network device sends a second message to the first network device through the transmission tunnel, the second message carries the second virtual network identifier, the destination address of the second message is the first address, and the second virtual network identifier is used to instruct the first network device to forward the second message to the second virtual machine according to the second virtual network identifier.

14. A network device, characterized in that: The network device is a first network device, and the first network device includes: a sending unit, a receiving unit and a processing unit, wherein: The sending unit is configured to send first routing information to the second network device through a transmission tunnel between the first network device and the second network device, where the first routing information is used to notify a route to a first address of a first virtual machine, where the first routing information includes a first virtual network identifier of the first virtual machine, where the first virtual machine is a local virtual machine of the first network device, and where the first address of the first virtual machine is a service IP address shared by the first virtual machine and one or more other virtual machines; The receiving unit is configured to receive, through the transmission tunnel, a first message sent by the second network device, wherein the first message carries the first virtual network identifier, and a destination address of the first message is the first address; The sending unit is further configured to forward the first message to the first virtual machine according to the first virtual network identifier; The first routing information also includes the IP address of the first virtual machine, and the processing unit is used to save a one-to-one correspondence between the first virtual network identifier and the IP address of the first virtual machine; The processing unit is further configured to determine, according to the first virtual network identifier in the first message, an IP address of the first virtual machine corresponding to the first virtual network identifier; The sending unit is further configured to forward the first message to the first virtual machine via a local outbound interface according to the IP address of the first virtual machine.

15. The network device according to claim 14, characterized in that: The processing unit is further configured to allocate the first virtual network identifier to the first virtual machine according to the first virtual machine being a local virtual machine of the first network device.

16. The network device according to claim 15, characterized in that: The sending unit is also used for: Second routing information is sent to the second network device through the transmission tunnel, the second routing information is used to announce the route to the first address of the second virtual machine, the second routing information includes a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

17. The network device according to claim 16, characterized in that: The receiving unit is further configured to receive, through the transmission tunnel, a second message sent by the second network device, wherein the second message carries the second virtual network identifier, and the destination address of the second message is the first address; The sending unit is further used to forward the second message to the second virtual machine according to the second virtual network identifier.

18. The network device according to claim 15, characterized in that: The processing unit is further configured to perform tunnel decapsulation on the first message, obtain the first virtual network identifier, and forward the first message to the first virtual machine according to the first virtual network identifier.

19. The network device according to any one of claims 14 to 15, characterized in that: The first address of the first virtual machine is a loopback address.

20. The network device according to claim 15, characterized in that: A VXLAN tunnel is deployed between the network device and the second network device.

21. A network device, characterized in that: The network device is a second network device, and the second network device includes: a sending unit, a receiving unit and a processing unit, wherein: The receiving unit is configured to receive first routing information sent by the first network device through a transmission tunnel between the first network device and the second network device, the first routing information being used to notify a route to a first address of a first virtual machine, the first routing information including a first virtual network identifier of the first virtual machine, the first virtual machine being a local virtual machine of the first network device, and the first address of the first virtual machine being a service IP address shared by the first virtual machine and one or more other virtual machines; The sending unit is configured to send a first message to the first network device through the transmission tunnel, the destination address of the first message being the first address, and the first message carrying the first virtual network identifier of the first virtual machine; The first routing information also includes an IP address of the first virtual machine, and the processing unit is used to store a one-to-one correspondence between the first virtual network identifier and the IP address of the first virtual machine; The processing unit is further configured to perform tunnel encapsulation on the first message according to the IP address of the first virtual machine, so as to send the first message to the first network device through the transmission tunnel.

22. The network device according to claim 21, characterized in that: The first virtual network identifier in the first message is used to instruct the first network device to forward the first message to the first virtual machine according to the first virtual network identifier.

23. The network device according to any one of claims 21 or 22, characterized in that: The processing unit is further configured to generate a VRF table according to the first routing information, wherein the VRF table includes a correspondence between the first address of the first virtual machine and the first virtual network identifier.

24. The network device according to claim 23, characterized in that: The processing unit is further configured to determine, in the VRF table, the first virtual network identifier corresponding to the first address based on the destination address of the first message being the first address; The sending unit is further used to send the first message to the first network device through the transmission tunnel, and the first message carries the first virtual network identifier.

25. The network device according to any one of claims 21 to 22, characterized in that: The receiving unit is further used to receive second routing information sent by the first network device through the transmission tunnel, the second routing information is used to announce the route to the first address of the second virtual machine, the second routing information includes a second virtual network identifier of the second virtual machine, wherein the first address is a common address of the first virtual machine and the second virtual machine, the second virtual network identifier is different from the first virtual network identifier, and the second virtual machine is a local virtual machine of the first network device.

26. The network device according to claim 25, characterized in that: The sending unit is also used to send a second message to the first network device through the transmission tunnel, the second message carries the second virtual network identifier, the destination address of the second message is the first address, and the second virtual network identifier is used to instruct the first network device to forward the second message to the second virtual machine according to the second virtual network identifier.

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

28. A chip, characterized in that: The chip is applied to a network device, and the chip comprises: a processor; the processor is configured to execute the operation of the network device in the method described in any one of claims 1 to 13.

29. A computer 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 13.