Traffic forwarding across VPCs

By introducing a VPC peer gateway cluster into the cloud network and modifying the MAC address information, cross-VPC traffic forwarding is realized, which solves the problem of insufficient cross-VPC communication capabilities in the existing technology and expands the interoperability between virtual machines.

CN115499434BActive Publication Date: 2024-10-01CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210911121.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2024-10-01
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

Existing cloud network technology does not yet support virtual machine (VM) interoperability across virtual private clouds (VPCs), which limits the ability to forward traffic across VPCs.

Method used

By introducing the VPC peering gateway cluster in the VPC peering connection network, the MAC address information of the peering connection traffic is modified so that it can be forwarded between VPCs to achieve cross-VPC traffic forwarding. Specific steps include modifying MAC address information when receiving and sending traffic so that traffic is routed correctly between VPCs.

Benefits of technology

It realizes traffic forwarding across VPCs, expands the interoperability of cloud networks, and supports VM communication between VPCs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115499434B_ABST
    Figure CN115499434B_ABST
Patent Text Reader

Abstract

The present application is about a method for traffic forwarding across VPCs, and specifically relates to the field of cloud network technology. In the present application, a VPC peering gateway cluster is introduced for the VPC peering connection between the first VPC and the second VPC. The first VPC can send the peering connection traffic to the VPC peering gateway cluster after generating the peering connection traffic. After receiving the peering connection traffic, the VPC peering gateway cluster modifies the MAC address information of the peering connection traffic from the first MAC address information related to the first VPC to the second MAC address information related to the second VPC, so as to send the peering connection traffic to the second VPC based on the modified second MAC address information, thereby realizing traffic forwarding across VPCs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud network technology, and in particular to a cross-VPC traffic forwarding method. Background Art

[0002] In the field of cloud network technology, Virtual Private Cloud (VPC) refers to an isolated and private virtual network environment on the cloud.

[0003] In the related technology, the intercommunication of virtual machines (VMs) in the same VPC is supported. For example, a VPC can include multiple different subnets, and the intercommunication of virtual machines (VMs) in the same subnet in the same VPC is supported, and the intercommunication of VMs in different subnets in the same VPC is supported. However, the intercommunication of VMs across VPCs is not supported yet. Summary of the invention

[0004] The present application provides a method for forwarding traffic across VPCs, and the technical solution is as follows.

[0005] In one aspect, a method for cross-VPC traffic forwarding is provided, the method being performed by a VPC peer gateway cluster in a VPC peer connection network, the VPC peer connection network further comprising a first VPC and a second VPC, the method comprising:

[0006] Receive peer connection traffic sent by the first VPC, where media access control (MAC) address information of the peer connection traffic is first MAC address information, and the first MAC address information is related to a MAC address of a first distributed virtual router (DVR) in the first VPC and a MAC address of a first peer port reserved by a first subnet in the first VPC;

[0007] Modify the MAC address information of the peer connection traffic from the first MAC address information to second MAC address information, where the second MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second peer port reserved by the second subnet in the second VPC;

[0008] The peer connection traffic with modified address information is sent to the second VPC.

[0009] In one aspect, a method for traffic forwarding across VPCs is provided, the method being performed by a first VPC in a VPC peering network, the VPC peering network further comprising a VPC peering gateway cluster and a second VPC, the method comprising:

[0010] Generate peer connection traffic, wherein MAC address information of the peer connection traffic is third MAC address information, and the third MAC address information is related to a MAC address of a first DVR in the first VPC and a MAC address of a first VM in the first VPC;

[0011] Modify the MAC address information of the peer connection traffic from the third MAC address information to first MAC address information, where the first MAC address information is related to the MAC address of the first DVR in the first VPC and the MAC address of the first peer port reserved by the first subnet in the first VPC;

[0012] The peer connection traffic with modified address information is sent to the VPC peer gateway cluster, so that the VPC peer gateway cluster forwards the peer connection traffic to the second VPC.

[0013] In a possible implementation, the MAC address of the first peer port corresponds to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding traffic during a flow table matching process of the traffic.

[0014] In one aspect, a method for traffic forwarding across VPCs is provided, the method being performed by a second VPC in a VPC peering network, the VPC peering network further comprising a VPC peering gateway cluster and a first VPC, the method comprising:

[0015] Receive peer connection traffic sent by the VPC peer gateway cluster, where the peer connection traffic is received by the VPC peer gateway cluster from the first VPC, and MAC address information of the peer connection traffic is second MAC address information, where the second MAC address information is related to a MAC address of a second DVR in the second VPC and a MAC address of a second peer port reserved by a second subnet in the second VPC;

[0016] Modify the MAC address information of the peer connection traffic from the second MAC address information to fourth MAC address information, where the fourth MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second VM in the second VPC;

[0017] The peer connection traffic with modified address information is sent to the second VM.

[0018] In a possible implementation, the MAC address of the second peer port corresponds to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding traffic during a flow table matching process of the traffic.

[0019] In another aspect, a cross-VPC traffic forwarding device is provided, the device being executed by a VPC peer gateway cluster in a VPC peer connection network, the VPC peer connection network further comprising a first VPC and a second VPC, the device comprising: a traffic receiving module, an address information modifying module, and a traffic sending module;

[0020] The traffic receiving module is configured to receive peer connection traffic sent by the first VPC, wherein the MAC address information of the peer connection traffic is first MAC address information, and the first MAC address information is related to the MAC address of the first DVR in the first VPC and the MAC address of the first peer port reserved by the first subnet in the first VPC;

[0021] The address information modification module is used to modify the MAC address information of the peer connection traffic from the first MAC address information to second MAC address information, where the second MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second peer port reserved by the second subnet in the second VPC;

[0022] The traffic sending module is used to send the peer connection traffic with modified address information to the second VPC.

[0023] In a possible implementation, the gateway nodes in the VPC peer gateway cluster include: br-conjoin and br-south, an interface for communicating with the VPC is created on the br-south, and a Veth Pair is established between the br-conjoin and the br-south for each VPC;

[0024] The address information modification module is used to:

[0025] After receiving the peer connection traffic sent by the first VPC, the br-south sends the peer connection traffic from the first Veth Pair corresponding to the first VPC to the br-conjoin;

[0026] The br-conjoin modifies the source MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of the second peer port reserved by the second subnet in the second VPC, and modifies the destination MAC address of the peer connection traffic from the MAC address of the first peer port reserved by the first subnet in the first VPC to the MAC address of the second DVR in the second VPC;

[0027] The traffic sending module is used to:

[0028] The br-conjoin sends the peer connection traffic after the address information is modified from the second Veth Pair corresponding to the second VPC to the br-south;

[0029] The br-south sends the peer connection traffic with modified address information to the second VPC.

[0030] In a possible implementation, the br-conjoin includes a subnet selection group flow table corresponding to the second VPC, and the subnet selection group flow table is used to perform load balancing selection on the subnet in the second VPC;

[0031] The address information modification module is used for, before the br-conjoin modifies the source MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of the second peer port reserved for the second subnet in the second VPC, the br-conjoin uses the subnet selection group flow table to select the second subnet in the second VPC.

[0032] In a possible implementation, the br-south includes a DVR instance selection group flow table corresponding to the second DVR, and the DVR instance selection group flow table is used to perform load balancing selection on the DVR instance of the second DVR;

[0033] The traffic sending module is used to:

[0034] The br-south selects the target DVR instance of the second DVR using the DVR instance selection group flow table;

[0035] The br-south sends the peer connection traffic with the address information modified to the target DVR instance of the second DVR.

[0036] In a possible implementation, the MAC address of the first peer port and the MAC address of the second peer port correspond to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding during the flow table matching process of the traffic.

[0037] In yet another aspect, a cross-VPC traffic forwarding device is provided, the device being executed by a first VPC in a VPC peer connection network, the VPC peer connection network further comprising a VPC peer gateway cluster and a second VPC, the device comprising: a traffic generation module, an address information modification module, and a traffic sending module;

[0038] The traffic generation module is configured to generate peer connection traffic, wherein the MAC address information of the peer connection traffic is third MAC address information, and the third MAC address information is related to the MAC address of the first DVR in the first VPC and the MAC address of the first VM in the first VPC;

[0039] The address information modification module is used to modify the MAC address information of the peer connection traffic from the third MAC address information to the first MAC address information, where the first MAC address information is related to the MAC address of the first DVR in the first VPC and the MAC address of the first peer port reserved by the first subnet in the first VPC;

[0040] The traffic sending module is used to send the peer connection traffic with modified address information to the VPC peer gateway cluster, so that the VPC peer gateway cluster forwards the peer connection traffic to the second VPC.

[0041] In a possible implementation, the first DVR in the first VPC includes a peer connection routing rule, and the peer connection routing rule includes: when the destination IP address of the traffic belongs to the destination network segment of another VPC, the next hop is the IP address of the peer port reserved for the subnet from which the traffic comes;

[0042] The address information modification module is used to:

[0043] After receiving the peer connection traffic sent by the first VM, the first DVR modifies, based on the peer connection routing rule, a source MAC address of the peer connection traffic from the MAC address of the first VM in the first VPC to the MAC address of the first DVR in the first VPC, and modifies a destination MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of a first peer port reserved for a first subnet in the first VPC.

[0044] In a possible implementation, the VPC peer gateway cluster includes at least one group of gateway node groups, each group of the gateway node groups includes at least one gateway node, and the peer connection between the first VPC and the second VPC is carried by a target gateway node group in the at least one group of gateway node groups;

[0045] The traffic sending module is used to:

[0046] The first DVR sends the peer connection traffic after the address information is modified to br-tun in the first VPC, wherein the br-tun includes a gateway node selection group flow table corresponding to the target gateway node group, and the gateway node selection group flow table is used to perform load balancing selection on the gateway nodes in the target gateway node group;

[0047] The br-tun selects a target gateway node in the target gateway node group using the gateway node selection group flow table;

[0048] The br-tun sends the peer connection traffic with modified address information to the target gateway node.

[0049] In a possible implementation, the MAC address of the first peer port corresponds to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding traffic during a flow table matching process of the traffic.

[0050] In another aspect, a cross-VPC traffic forwarding device is provided, the device is executed by a second VPC in a VPC peer connection network, the VPC peer connection network also includes a VPC peer gateway cluster and a first VPC, the device includes: a traffic receiving module, an address information modification module and a traffic sending module;

[0051] The traffic receiving module is configured to receive peer connection traffic sent by the VPC peer gateway cluster, the peer connection traffic is received by the VPC peer gateway cluster from the first VPC, the MAC address information of the peer connection traffic is second MAC address information, and the second MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second peer port reserved by the second subnet in the second VPC;

[0052] The address information modification module is used to modify the MAC address information of the peer connection traffic from the second MAC address information to fourth MAC address information, where the fourth MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second VM in the second VPC;

[0053] The traffic sending module is used to send the peer connection traffic with modified address information to the second VM.

[0054] In a possible implementation, the second DVR in the second VPC includes a direct routing rule, and the direct routing rule includes: when the destination IP address of the traffic belongs to the destination network segment of the second VPC, the next hop is a direct network card corresponding to the subnet to which the second VM belongs;

[0055] The address information modification module is used to:

[0056] After receiving the peer connection traffic sent by the VPC peer gateway cluster, the second DVR, based on the direct routing rule, modifies the source MAC address of the peer connection traffic from the MAC address of the second peer port reserved by the second subnet in the second VPC to the MAC address of the second DVR in the second VPC, and modifies the destination MAC address of the peer connection traffic from the MAC address of the second DVR in the second VPC to the MAC address of the second VM in the second VPC.

[0057] In a possible implementation, the MAC address of the second peer port corresponds to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding traffic during a flow table matching process of the traffic.

[0058] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the above-mentioned cross-VPC traffic forwarding method.

[0059] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned cross-VPC traffic forwarding method.

[0060] In another aspect, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned cross-VPC traffic forwarding method.

[0061] The technical solution provided by this application may have the following beneficial effects:

[0062] A VPC peer gateway cluster is introduced for the VPC peer connection between the first VPC and the second VPC. The first VPC can modify the MAC address of the peer connection traffic from the third MAC address information to the first MAC address information after generating the peer connection traffic, so as to send the peer connection traffic to the VPC peer gateway cluster based on the modified first MAC address. After receiving the peer connection traffic, the VPC peer gateway cluster modifies the MAC address information of the peer connection traffic from the first MAC address information related to the first VPC to the second MAC address information related to the second VPC, so as to send the peer connection traffic to the second VPC based on the modified second MAC address information. After receiving the peer connection traffic, the second VPC modifies the MAC address of the peer connection traffic from the second MAC address information to the fourth MAC address information, so as to send the peer connection traffic to the destination VM, thereby realizing traffic forwarding across VPCs. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0064] Figure 1 The diagram is a schematic diagram of a virtual network inside a computing node according to an exemplary embodiment.

[0065] Figure 2 The diagram is a schematic diagram of a virtual network inside a network node according to an exemplary embodiment.

[0066] Figure 3 The figure is a schematic diagram of east-west traffic in the same VPC and the same subnet according to an exemplary embodiment.

[0067] Figure 4 The figure is a schematic diagram showing east-west traffic in different subnets of the same VPC according to an exemplary embodiment.

[0068] Figure 5 The diagram is a schematic diagram of north-south traffic when accessing the Internet according to an exemplary embodiment.

[0069] Figure 6 The figure is a schematic diagram of an existing VPC network implementation model according to an exemplary embodiment.

[0070] Figure 7 It is a schematic diagram of an improved VPC peering connection network model according to an exemplary embodiment.

[0071] Figure 8 The present invention is a flowchart of a method for forwarding traffic across VPCs according to an exemplary embodiment.

[0072] Fig. 9 The diagram is a schematic diagram showing that gateway nodes in a VPC peer gateway cluster are grouped according to an exemplary embodiment.

[0073] Fig.10 is a schematic diagram of a network model of a gateway node according to an exemplary embodiment.

[0074] Fig.11 The present invention is a flowchart of a method for forwarding traffic across VPCs according to an exemplary embodiment.

[0075] Fig.12 The figure is a schematic diagram showing flow table matching in br-tun according to an exemplary embodiment.

[0076] Fig.13 The figure is a schematic diagram showing flow table matching in br-south according to an exemplary embodiment.

[0077] Fig.14 The figure is a schematic diagram showing flow table matching in br-conjoin according to an exemplary embodiment.

[0078] Fig.15 The diagram is a schematic diagram of a cross-VPC traffic forwarding process according to an exemplary embodiment.

[0079] Fig.16 The present invention is a structural block diagram of a cross-VPC traffic forwarding device according to an exemplary embodiment.

[0080] Fig.17 The present invention is a structural block diagram of a cross-VPC traffic forwarding device according to an exemplary embodiment.

[0081] Fig.18 The present invention is a structural block diagram of a cross-VPC traffic forwarding device according to an exemplary embodiment.

[0082] Fig.19 It is a schematic diagram of a computer device provided according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0083] The technical solution of the present application will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0084] It should be understood that the "indication" mentioned in the embodiments of the present application can be a direct indication, an indirect indication, or an indication of an association relationship. For example, A indicates B, which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association relationship between A and B.

[0085] In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship between indication and being indicated, configuration and being configured, and the like.

[0086] In an embodiment of the present application, "predefinition" can be achieved by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in a device (for example, including a terminal device and a network device). The present application does not limit its specific implementation method.

[0087] Before describing the various embodiments shown in the present application, the concepts involved in the present application are first introduced.

[0088] Virtual Private Cloud (VPC)

[0089] VPC is introduced from the perspectives of computing nodes and network nodes.

[0090] Figure 1 It shows the virtual network inside the computing node, which mainly includes the following elements:

[0091] VM: Virtual Machine, including cloud desktop, cloud host and some virtual network function (VNF) network elements (such as vFW, virtual private network (VPN), vCPE, etc.).

[0092] qbrxxx: LinuxBridge, used to provide security group functions for VMs.

[0093] DHCP: Dynamic Host Configuration Protocol. Usually, a VPC corresponds to multiple DHCP instances (clusters), which automatically allocate IP addresses, DNS addresses, and other addresses to VMs to provide network services. DHCP will be evenly distributed to each computing node by the control node according to a certain scheduling strategy.

[0094] ·DVR: Distributed Virtual Router. One VPC corresponds to one DVR. When a VM instance of this VPC exists on a computing node, a DVR will be created on the computing node accordingly. DVR is the default gateway for the VM private network. Traffic involving VM cross-segment access (including east-west and north-south traffic) needs to pass through DVR for three-layer forwarding. At the same time, DVR also provides a flexible and customizable routing rule interface to facilitate the traction of different business traffic, which will be introduced in detail below.

[0095] FIP: File Transfer Protocol, which can be regarded as a local gateway. There is only one FIP on a computing node, which is shared by all tenants on the node. It is mainly used to support VMs on the computing node to directly access the external network (including the Internet) from the node. For example, a VM on the computing node is bound to an elastic IP separately.

[0096] br-int: OpenVswitch, which uses an internal virtual local area network (VLAN) to achieve logical isolation between different VPCs within a node and implements Layer 2 forwarding through flow tables.

[0097] br-tun: OpenVswitch, mainly used to implement conversion between local VLAN and global Virtual eXtensible Local Area Network (VXLAN). VXLAN logical sub-interfaces are bound to the br-tun bridge, and VXLAN tunnels are established with other computing nodes, network nodes, and virtual gateway nodes, and cross-node VPC network inter-access is achieved through flow tables.

[0098] br-ex: OpenVswitch, bound to a VLAN logical sub-interface, providing a channel for VMs on this node to access the external network.

[0099] Business network card: Two 10G network cards are logically bundled to provide underlay bearer for cross-node inter-tenant network access.

[0100] Figure 2 The figure shows the virtual network inside the network node. Except for the Network Address Translation (NAT) gateway, the remaining elements are the same as those described for the compute node:

[0101] ·NAT Gateway: One VPC corresponds to one NAT instance. Considering high availability, two instances will be deployed, one active and one standby, on different network nodes. When the active node fails, the standby node will be switched to the active node to continue to carry traffic. NAT Gateway mainly provides two service forms: Source Network Address Translation (SNAT) and Destination Network Address Translation (DNAT). It mainly provides network services for address translation for VMs to access the Internet or be accessed by the Internet.

[0102] Business traffic traction

[0103] This article mainly describes east-west traffic and north-south traffic, and only introduces cross-node scenarios.

[0104] East-West Traffic

[0105] In the case of the same VPC and subnet, such as Figure 3 As shown in the figure, no Layer 3 forwarding is involved and the datagram is sent to the target computing node through the VXLAN tunnel.

[0106] In the case of different subnets in the same VPC, such as Figure 4 As shown in the figure, it involves three-layer forwarding, so it needs to pass through the DVR, match the routing rules on the DVR, forward to another subnet, and then send to the target computing node through the VXLAN tunnel.

[0107] North-South traffic

[0108] When accessing the Internet, there are many ways to achieve this kind of business traffic, mainly: NAT gateway method, vFW method, dedicated line method, IPsec VPN method, vCPE method. And these are mainly achieved by the custom policy routing framework provided by DVR. The traffic of VM accessing the Internet is first delivered to DVR, and then the DVR's policy routing determines which method to use. Figure 5 The NAT gateway method is shown, and other methods are similar.

[0109] When accessing the client's intranet, there are also many ways to achieve this kind of business traffic, mainly: dedicated line, IPsec VPN, vCPE. And these are mainly achieved by the custom policy routing framework provided by DVR. The traffic of VM accessing the client's intranet is first delivered to DVR, and then the DVR's policy routing determines which method to use.

[0110] Related technologies do not yet support interoperability across VPCs. Figure 6 The existing VPC network implementation model is as follows Figure 6 Some technical details are as follows:

[0111] The DVR instance only has direct routing rules and the default routing rule with the next hop being the NAT gateway.

[0112] Within a VPC, Layer 2 forwarding is sufficient for intra-subnet communication, while Layer 3 forwarding is performed through DVR matching routes for inter-subnet communication.

[0113] Within a VPC, for north-south traffic (for example, accessing the public network or the client side), the DVR matches the default routing rule with the next hop being a NAT gateway or the custom routing rule with the next hop being a VPN or virtual gateway.

[0114] In order to support intercommunication across VPCs, the present application provides a method for forwarding traffic across VPCs, and introduces a VPC peer gateway cluster for a VPC peer connection between a first VPC and a second VPC. The first VPC can modify the MAC address of the peer connection traffic after generating the peer connection traffic, from the third MAC address information to the first MAC address information, so as to send the peer connection traffic to the VPC peer gateway cluster based on the modified first MAC address. After receiving the peer connection traffic, the VPC peer gateway cluster modifies the MAC address information of the peer connection traffic from the first MAC address information related to the first VPC to the second MAC address information related to the second VPC, so as to send the peer connection traffic to the second VPC based on the modified second MAC address information. After receiving the peer connection traffic, the second VPC modifies the MAC address of the peer connection traffic from the second MAC address information to the fourth MAC address information, so as to send the peer connection traffic to the destination VM, thereby realizing traffic forwarding across VPCs.

[0115] For example, combined with reference Figure 7 , VPC1 and VPC2 are peered through the VPC peer gateway cluster, and the VMs in VPC1 can send traffic to the VMs in VPC2.

[0116] The technical solution provided by this application is described below in conjunction with the following embodiments.

[0117] Figure 8 1 is a method flow chart of a method for forwarding traffic across VPCs according to an exemplary embodiment. The method is applied to a VPC peering network, which includes: a first VPC, a VPC peering gateway cluster, and a second VPC. Figure 8 As shown, the cross-VPC traffic forwarding method may include the following steps:

[0118] Step 801: The first VPC generates peer connection traffic, the MAC address information of the peer connection traffic is third MAC address information, and the third MAC address information is related to the MAC address of the first DVR in the first VPC and the MAC address of the first VM in the first VPC.

[0119] The peer connection traffic is traffic across VPCs. In an embodiment of the present application, the peer connection traffic is generated by a first VM in a first VPC and is expected to reach a second VM in a second VPC.

[0120] When forwarding traffic across VPCs, Layer 3 forwarding is involved and needs to pass through the DVR in the VPC. Therefore, when the peer connection traffic is generated, it corresponds to the third MAC address information, in which the source MAC address of the peer connection traffic is the MAC address of the first VM in the first VPC, and the destination MAC address of the peer connection traffic is the MAC address of the first DVR in the first VPC.

[0121] Step 802: The first VPC modifies the MAC address information of the peer connection traffic from the third MAC address information to the first MAC address information, where the first MAC address information is related to the MAC address of the first DVR in the first VPC and the MAC address of the first peer port reserved by the first subnet in the first VPC.

[0122] In the embodiment of the present application, a corresponding peer port is created for each subnet, and the peer port corresponds to a pair of IP / MAC addresses. After the peer connection traffic is forwarded within the first VPC based on the initial third MAC address information and reaches the first DVR in the first VPC, the first DVR modifies the MAC address information of the peer connection traffic from the third MAC address information to the first MAC address information to achieve the next step of forwarding the traffic.

[0123] Among them, in the first MAC address information, it is indicated that the source MAC address of the peer connection traffic is the MAC address of the first DVR in the first VPC, and the destination MAC address of the peer connection traffic is the MAC address of the first peer port reserved by the first subnet in the first VPC.

[0124] Step 803: The first VPC sends the peer connection traffic with modified address information to the VPC peer gateway cluster.

[0125] Correspondingly, the VPC peer gateway cluster receives the peer connection traffic sent by the first VPC, and the MAC address information of the peer connection traffic is the first MAC address information, which is related to the MAC address of the first DVR in the first VPC and the MAC address of the first peer port reserved by the first subnet in the first VPC.

[0126] Because the first DVR in the first VPC modifies the MAC address information of the peer connection traffic from the third MAC address information to the first MAC address information, the first VPC can subsequently direct the peer connection traffic to the VPC peer gateway cluster based on the first MAC address information.

[0127] Step 804: The VPC peer gateway cluster modifies the MAC address information of the peer connection traffic from the first MAC address information to the second MAC address information, where the second MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second peer port reserved by the second subnet in the second VPC.

[0128] In order to send the peer connection traffic to the second VPC, the VPC peer gateway cluster modifies the MAC address information of the peer connection traffic from the first MAC address information associated with the first VPC to the second MAC address information associated with the second VPC.

[0129] Among them, in the second MAC address information, it is indicated that the source MAC address of the peer connection traffic is the MAC address of the second peer port reserved by the second subnet in the second VPC, and the destination MAC address of the peer connection traffic is the MAC address of the second DVR in the second VPC.

[0130] Step 805: The VPC peer gateway cluster sends the peer connection traffic with modified address information to the second VPC.

[0131] Correspondingly, the second VPC receives the peer connection traffic sent by the VPC peer gateway cluster, and the MAC address information of the peer connection traffic is the second MAC address information, which is related to the MAC address of the second DVR in the second VPC and the MAC address of the second peer port reserved by the second subnet in the second VPC.

[0132] Step 806: The second VPC modifies the MAC address information of the peer connection traffic from the second MAC address information to the fourth MAC address information, where the fourth MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second VM in the second VPC.

[0133] After the peer connection traffic reaches the second DVR in the second VPC, the second DVR modifies the MAC address information of the peer connection traffic from the second MAC address information to the fourth MAC address information to achieve the next step of forwarding the traffic.

[0134] Among them, in the fourth MAC address information, it is indicated that the source MAC address of the peer connection traffic is the MAC address of the second DVR in the second VPC, and the destination MAC address of the peer connection traffic is the MAC address of the second VM in the second VPC.

[0135] Step 807: The second VPC sends the peer connection traffic with modified address information to the second VM.

[0136] In summary, the cross-VPC traffic forwarding method provided in this embodiment introduces a VPC peer gateway cluster for the VPC peer connection between the first VPC and the second VPC. The first VPC can modify the MAC address of the peer connection traffic after generating the peer connection traffic, and modify it from the third MAC address information to the first MAC address information, so as to send the peer connection traffic to the VPC peer gateway cluster based on the modified first MAC address. After receiving the peer connection traffic, the VPC peer gateway cluster modifies the MAC address information of the peer connection traffic from the first MAC address information related to the first VPC to the second MAC address information related to the second VPC, so as to send the peer connection traffic to the second VPC based on the modified second MAC address information. After receiving the peer connection traffic, the second VPC modifies the MAC address of the peer connection traffic from the second MAC address information to the fourth MAC address information, so as to send the peer connection traffic to the destination VM, thereby realizing cross-VPC traffic forwarding.

[0137] Next, the above peer port is further explained.

[0138] In a possible implementation, the MAC address of the first peer port and the MAC address of the second peer port correspond to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding during the flow table matching process of the traffic.

[0139] For the VPCs that establish peer connections, create a Neutron Port from each subnet, and set its device_owner to "network:peering", referred to as peer port. Modify the mechanism of allocating MAC addresses for the native Neutron Port, and for peer ports (by matching device_owner to "network:peering"), customize the fixed preset MAC address prefix such as fa:17:02:00:00:00.

[0140] Among them, the peer port has the following functions:

[0141] The peer port will be assigned an IP address, which will be used to configure the peer connection routing rules in the DVR instance, and its next hop is this reserved IP.

[0142] The peer port will be assigned a MAC address, such as fa:17:02:00:00:00 as a fixed preset MAC address prefix. The purpose is to match this preset MAC address prefix by arranging flow tables on the ovs bridge to achieve accurate identification of peer connection traffic. At the same time, using a fixed preset MAC address prefix for flow table matching can also greatly reduce the number of flow table configurations.

[0143] Next, the VPC peer gateway cluster described above is further described.

[0144] In one possible implementation, the gateway nodes in the VPC peer gateway cluster are grouped, the VPC peer gateway cluster includes at least one gateway node group, each gateway node group includes at least one gateway node, and the peer connection between the first VPC and the second VPC is carried by the target gateway node group in the at least one gateway node group.

[0145] Exemplary, with reference to Fig. 9 , the VPC peer gateway cluster includes three gateway node groups: Group1, Groop2, and Group3. Group1 includes one gateway node, Group2 includes two gateway nodes, and Group3 includes three gateway nodes.

[0146] Among them, a gateway node group can carry multiple peer connections. When creating a peer connection, the most idle group (i.e., the group carrying the least number of peer connections) will be selected as the gateway node group for this peer connection. The gateway node group and the number of peer connections it carries will be recorded in the database.

[0147] The gateway nodes in each gateway node group can be flexibly expanded or reduced according to changes in business volume.

[0148] Among them, by monitoring the working status of the gateway members in the gateway node group, if a member is found to be faulty, it can be automatically set to the "disabled" state. At the same time, the administrator can also force a member in the group to be set to the "disabled" state through the command line. Members in the "disabled" state will no longer participate in the forwarding of peer connection traffic, and will continue to carry traffic forwarding after returning to the "available" state.

[0149] The gateway node group itself also has a status, which is "available" by default when it is created. Groups in the "available" state will participate in allocation and scheduling. Administrators can set it to "disabled" through the command line. Groups in the "disabled" state will not participate in allocation and scheduling.

[0150] Among them, a certain peer connection can be migrated from one group to another group at the granularity of the group.

[0151] In a possible implementation, the gateway nodes in the VPC peer gateway cluster include: br-conjoin and br-south, an interface for communicating with the VPC is created on br-south, and a Veth Pair is established between br-conjoin and br-south for each VPC.

[0152] Combined with reference Fig.10 , which shows the abstract virtual network model in the gateway node, divided into several parts:

[0153] Two OVS bridges, br-conjoin and br-south.

[0154] A VXLAN subinterface is created on br-south, and a VXLAN tunnel is established with the compute node where the VM is located.

[0155] A Veth Pair will be established between br-south and br-conjoin for each VPC in the peer connection, and will be bridged to two OVS bridges respectively.

[0156] The design of the above virtual network model is based on the following considerations:

[0157] The reason for using two OVS bridges instead of just one is to avoid the situation where traffic enters from a VXLAN sub-interface, is processed by the flow table, and then exits from the same VXLAN sub-interface, that is, the source port enters and the source port exits, which eventually leads to OVS packet loss.

[0158] The reason for establishing a Veth Pair for each VPC between the two OVS bridges: When the br-south bridge receives peer connection traffic, it can extract the VXLAN tunnel ID value, and then distinguish the peer connection traffic of different VPCs by matching the VXLAN tunnel ID value. However, the VXLAN tunnel ID will not be passed to the br-conjoin bridge, that is, the br-conjoin bridge cannot see the VXLAN tunnel ID value. Therefore, by establishing a Veth Pair, the corresponding input port (IN_PORT) is directly matched to distinguish the peer connection traffic of different VPCs.

[0159] Next, the DVR described above is further described.

[0160] In a possible implementation, in a DVR instance, a peer connection routing rule is added to an existing policy routing table, wherein the next hop is the IP address of a reserved peer port.

[0161] For example, refer to the following table, which lists the policy routing tables and routing rules contained in the current DVR instance. In order to achieve peer-to-peer connection, configure peer connection routing rules in the policy routing table of the local subnet table, and its next hop is the IP address of the reserved peer port corresponding to the subnet. According to the configured peer connection routing rules, the VM can complete the three-layer routing forwarding of peer connection traffic in the local computing node.

[0162]

[0163] Fig.11 1 is a method flow chart of a method for forwarding traffic across VPCs according to an exemplary embodiment. The method is applied to a VPC peering network, which includes: a first VPC, a VPC peering gateway cluster, and a second VPC. Fig.11 As shown, the cross-VPC traffic forwarding method may include the following steps:

[0164] Step 1101: A first VM in a first VPC generates peer connection traffic, a source MAC address of the peer connection traffic is a MAC address of the first VM in the first VPC, and a destination MAC address of the peer connection traffic is a MAC address of a first DVR in the first VPC.

[0165] Step 1102: A first VM in a first VPC sends peer connection traffic to a first DVR in the first VPC.

[0166] Correspondingly, the first DVR in the first VPC receives the peer connection traffic sent by the first VM in the first VPC, the source MAC address of the peer connection traffic is the MAC address of the first VM in the first VPC, and the destination MAC address of the peer connection traffic is the MAC address of the first DVR in the first VPC.

[0167] Step 1103: Based on the peer connection routing rule, the first DVR in the first VPC modifies the source MAC address of the peer connection traffic from the MAC address of the first VM in the first VPC to the MAC address of the first DVR in the first VPC, and modifies the destination MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of the first peer port reserved for the first subnet in the first VPC.

[0168] The first DVR in the first VPC includes a peer connection routing rule, and the peer connection routing rule includes: when the destination IP address of the traffic belongs to the destination network segment of another VPC, the next hop is the IP address of the peer port reserved for the subnet from which the traffic comes.

[0169] Step 1104: The first DVR in the first VPC sends the peer connection traffic with the modified address information to the target gateway in the VPC peer gateway cluster.

[0170] Correspondingly, the target gateway in the VPC peer gateway cluster receives the peer connection traffic sent by the first DVR in the first VPC, and the source MAC address of the peer connection traffic is the MAC address of the first DVR in the first VPC, and the destination MAC address of the peer connection traffic is the MAC address of the first peer port reserved for the first subnet in the first VPC.

[0171] In a possible implementation, the VPC peer gateway cluster includes at least one group of gateway node groups, each group of gateway node groups includes at least one gateway node, and the peer connection between the first VPC and the second VPC is carried by the target gateway node group in the at least one group of gateway node groups; the first DVR sends the peer connection traffic with modified address information to the br-tun in the first VPC, br-tun includes a gateway node selection group flow table corresponding to the target gateway node group, and the gateway node selection group flow table is used to load balance the gateway nodes in the target gateway node group; br-tun uses the gateway node selection group flow table to select the target gateway node in the target gateway node group; br-tun sends the peer connection traffic with modified address information to the target gateway node.

[0172] That is, a gateway node selection group flow table that accurately identifies peer connection traffic is added to the br-tun bridge of the computing node where the VM is located, and the peer connection traffic is directed to the VPC peer gateway cluster in a load balancing manner.

[0173] Exemplary, with reference to Fig.12 , the peer connection traffic is forwarded to br-tun for processing after DVR routing matching. In order to pull the peer connection traffic to the associated gateway node, accurate identification of peer connection traffic is added in table=20: by matching the MAC prefix of the peer port (Peering Port in the figure) and the target network segment of its peer route, after hitting, it goes to the target gateway node group associated with this peer connection. In the Group flow table corresponding to the target gateway node group, a gateway node in the target gateway node group can be randomly selected by calculating the hash value of the message, and the traffic is forwarded to it (through the VXLAN tunnel).

[0174] It is understandable that when the gateway node group is expanded or reduced, the corresponding Group flow table will be updated here to take effect in time. If the gateway node member in the gateway node group fails and is unavailable or disabled by the administrator, the corresponding Group flow table will also be updated to take effect in time. When the peer connection migrates from one group to another, you only need to modify the redirected Group flow table here to take effect in time.

[0175] Step 1105: After receiving the peer connection traffic sent by the first VPC, br-south in the target gateway sends the peer connection traffic from the first Veth Pair corresponding to the first VPC to br-conjoin in the target gateway.

[0176] Correspondingly, br-conjoin in the target gateway receives the peer connection traffic sent by br-south in the target gateway through the first Veth Pair, and the source MAC address of the peer connection traffic is the MAC address of the first DVR in the first VPC, and the destination MAC address of the peer connection traffic is the MAC address of the first peer port reserved for the first subnet in the first VPC.

[0177] Exemplary, with reference to Fig.13 The peer connection traffic enters from the vxlan sub-interface, so it goes to table=4 and continues to match the flow table. Since the destination MAC address of the peer connection traffic hits the MAC prefix of the peer port, the traffic is sent from the veth pair port of VPC1 that generates the traffic to the br-conjoin bridge.

[0178] Step 1106: br-conjoin in the target gateway changes the source MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of the second peer port reserved for the second subnet in the second VPC, and changes the destination MAC address of the peer connection traffic from the MAC address of the first peer port reserved for the first subnet in the first VPC to the MAC address of the second DVR in the second VPC.

[0179] In one possible implementation, br-conjoin includes a subnet selection group flow table corresponding to the second VPC, and the subnet selection group flow table is used to perform load balancing selection on the subnet in the second VPC; before br-conjoin modifies the source MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of the second peer port reserved for the second subnet in the second VPC, br-conjoin uses the subnet selection group flow table to select the second subnet in the second VPC.

[0180] That is, add a subnet selection group flow table in br-conjoin to direct the peer connection traffic to a subnet in the second VPC of the peer in a load-balanced manner.

[0181] Exemplary, with reference to Fig.14 , the peer connection traffic enters from the veth pair port, and the destination MAC address of the peer connection traffic hits the MAC prefix of the peer port, so it goes to table=1, matches the veth pair port and matches the destination network segment, and accurately identifies which VPC in which peer connection the peer connection traffic belongs to. After table=1 is processed, it turns to the Group flow table corresponding to the identified peer VPC, where the Group ID of the Group flow table is the VXLAN tunnel ID value of the peer VPC. In the Group flow table, there will be the same number of buckets as the number of subnets of the peer VPC. In the specific bucket, the MAC address conversion and VXLAN tunnel ID value conversion (export change) will be performed. When modifying the MAC address, modify the destination MAC address to the MAC address of the DVR in the peer VPC. The purpose of this is to pull the traffic to the DVR instance for processing.

[0182] Step 1107: br-conjoin in the target gateway sends the peer connection traffic with modified address information from the second Veth Pair corresponding to the second VPC to br-south in the target gateway.

[0183] Correspondingly, br-south in the target gateway receives the peer connection traffic sent by br-conjoin in the target gateway through the second Veth Pair, and the source MAC address of the peer connection traffic is the MAC address of the second peer port reserved for the second subnet in the second VPC, and the destination MAC address of the peer connection traffic is the MAC address of the second DVR in the second VPC.

[0184] Step 1108: br-south in the target gateway sends the peer connection traffic with the modified address information to the second DVR in the second VPC.

[0185] Correspondingly, the second DVR in the second VPC receives the peer connection traffic sent by br-south in the target gateway, and the source MAC address of the peer connection traffic is the MAC address of the second peer port reserved for the second subnet in the second VPC, and the destination MAC address of the peer connection traffic is the MAC address of the second DVR in the second VPC.

[0186] In a possible implementation, br-south includes a DVR instance selection group flow table corresponding to the second DVR, and the DVR instance selection group flow table is used to perform load balancing selection on the DVR instance of the second DVR; br-south uses the DVR instance selection group flow table to select the target DVR instance of the second DVR; br-south sends the peer connection traffic with modified address information to the target DVR instance of the second DVR.

[0187] That is, add a DVR instance selection group flow table in br-south to direct the peer connection traffic to a DVR instance in the second VPC on the other end in a load-balanced manner, thereby improving throughput and avoiding single point failures.

[0188] Exemplary, with reference to Fig.13 , matches the VXLAN tunnel ID value (i.e. vni in the figure), destination MAC = DVRMAC, then turns to the Group flow table, and its Group ID is the VXLAN tunnel ID value of the corresponding VPC. In the Group flow table, the actual calculation configuration will be based on the distributed computing nodes of the DVR of this VPC. For example: if the DVR of the VPC is distributed on 2 computing nodes, 2 buckets will be configured, and the export is the vxlan sub-interface established with these 2 computing nodes. The purpose of this implementation is to fully utilize the advantages of the VPC DVR distributed cluster, send traffic to these distributed instances in a load-balanced manner, improve throughput, and avoid single points of failure.

[0189] Step 1109: After receiving the peer connection traffic sent by the VPC peer gateway cluster, the second DVR, based on the direct routing rule, changes the source MAC address of the peer connection traffic from the MAC address of the second peer port reserved by the second subnet in the second VPC to the MAC address of the second DVR in the second VPC, and changes the destination MAC address of the peer connection traffic from the MAC address of the second DVR in the second VPC to the MAC address of the second VM in the second VPC.

[0190] The second DVR in the second VPC includes a direct routing rule, and the direct routing rule includes: when the destination IP address of the traffic belongs to the destination network segment of the second VPC, the next hop is the direct network card corresponding to the subnet to which the second VM belongs.

[0191] Step 1110: The second DVR sends the peer connection traffic with modified address information to the second VM.

[0192] In summary, the cross-VPC traffic forwarding method provided in this embodiment customizes the MAC address prefix of the peer port corresponding to the reserved subnet to a preset MAC address prefix, which can greatly reduce the number of flow table configurations used to identify peer connection traffic.

[0193] At the same time, add peer connection routing rules to the DVR's subnet policy routing table to enable the VM to complete the three-layer routing forwarding of peer connection traffic on the local computing node.

[0194] At the same time, multiple gateway nodes are divided into a gateway node group, and gateway nodes are allocated to peer connections at the granularity of "group", and peer connection migration is implemented at the granularity of "group". At the same time, the gateway nodes can be flexibly expanded or reduced according to the business volume.

[0195] At the same time, after associating peer connections with groups as the granularity, the traffic of this peer connection will be directed to all gateway nodes in the group in a load-balanced manner. When scaling gateway nodes, or enabling or disabling gateway nodes, you only need to update the corresponding group flow table separately to make it take effect quickly.

[0196] At the same time, when designing the network model of the gateway node, two OVS bridges are created to avoid the problem of VXLAN traffic entering and exiting the source port. At the same time, a Veth Pair is created for each VPC and bridged to the two OVS bridges. The peer connection traffic of different VPCs can be distinguished by matching the VethPair port.

[0197] At the same time, on the gateway node, the group flow table is used to change the destination MAC address of the peer connection traffic to the MAC address of the DVR of the peer VPC. The group flow table is also used to load balance the peer connection traffic to multiple DVR instances of the peer VPC, thereby improving throughput and avoiding single point failures.

[0198] Below, an example is used to illustrate the cross-VPC traffic forwarding method provided by the present application.

[0199] like Fig.15 As shown in the figure, there are two VPCs that need to communicate with each other. After establishing a peer connection, VM1 in VPC1 and VM2 in VPC2 can achieve network communication. In order to facilitate the description of details, the specific IP and MAC addresses are given in the figure, as shown in the following table:

[0200] IP address MAC Address VM1 10.10.1.10 fa:16:3e:11:22:33 VM2 10.10.2.10 fa:16:3e:44:55:66 DVR1 10.10.1.1 fa:16:3e:00:01:01 DVR2 10.10.2.1 fa:16:3e:00:02:01 Business network card 1 192.168.1.11 0a:16:3f:00:00:01 Business network card 2 192.168.1.12 0a:16:3f:00:00:02 Business network card 3 192.168.1.13 0a:16:3f:00:00:03

[0201] The following 12 steps describe the details of data flow forwarding:

[0202] 1) VM1 sends traffic.

[0203] Among them, the message information of the traffic is as follows: source IP = 10.10.1.10, source MAC = fa:16:3e:11:22:33 (i.e., the MAC address of VM1), destination IP = 10.10.2.10, destination MAC = fa:16:3e:00:01:01 (i.e., the MAC address of DVR1).

[0204] 2) The traffic is sent to the ovs bridge br-int, which matches the flow table. After hitting the flow table, the traffic is sent to DVR1.

[0205] The matching flow table at br-int can be implemented by referring to the existing technology, and the details are not elaborated here, and the following text does not elaborate on this bridge.

[0206] 3) After the traffic enters DVR1, it matches the peer connection routing rule and forwards the traffic.

[0207] Peer connection routing rules in DVR1: destination = 10.10.2.0 / 24, next hop = 10.10.1.100.

[0208] The IP address of the peer port reserved for the subnet to which VM1 belongs = 10.10.1.100, and its MAC address is = fa:16:3d:a0:a0:01 (the MAC prefix of the peer port is fa:16:3d:00:00:00 / ff:ff:ff:00:00:00).

[0209] At this time, since the traffic matches the peer connection routing rules, DVR1 continues to forward the traffic. The message information of the traffic is: source IP = 10.10.1.10, source MAC = fa:16:3e:00:01:01 (that is, the MAC address of DVR1), destination IP = 10.10.2.10, destination MAC = fa:16:3d:a0:a0:01 (that is, the MAC address of the peer port reserved by the VPC1 subnet), that is, the source / destination MAC is changed in DVR1.

[0210] 4) Traffic comes out of DVR1 and reaches the OVS bridge br-int, continues to match the flow table, and after hitting the flow table, forwards the traffic to the OVS bridge br-tun.

[0211] 5) The traffic reaches the ovs bridge br-tun, matches the flow table, and then goes to the group flow table. The group flow table is mainly used to load balance multiple peer gateways, select one of the peer gateways, and send the traffic to the peer gateway.

[0212] Combined with reference Fig.12 The matching process is as follows: first, match the flow table of table=0, then go to table=1. After table=1 is hit, go to table=2. Since the traffic is a unicast message, it continues to flow to table=20. In table=20, accurately match the peer connection flow table: by matching the MAC prefix of the peer port (ie: fa:17:02:00:00:00) and the target network segment of its peer route, after hitting, go to the group flow table.

[0213] This group flow table is mainly used to load balance multiple peer gateways. Finally, one of the peer gateways will be selected and the traffic will be sent to it.

[0214] The traffic encapsulated VXLAN message is sent from service NIC 1. At this time, the message information is: source IP = 192.168.1.11 (i.e., the IP address of service NIC 1), source MAC = 0a:16:3f:00:00:01 (i.e., the MAC address of service NIC 1), destination IP = 192.168.1.13 (i.e., the IP address of service NIC 2), destination MAC = 0a:16:3f:00:00:03 (i.e., the MAC address of service NIC 2). At this time, due to the encapsulation of the VXLAN message, the inner message information of the VM is hidden.

[0215] 6) The VXLAN message is sent from service NIC 1 to service NIC 3 of the peer gateway. br-south removes the VXLAN message encapsulation, then matches the br-south flow table and sends the traffic from the vpcveth pair port to the br-conjoin bridge.

[0216] Among them, the message information after decapsulation is: source IP=10.10.1.10, source MAC=fa:16:3e:00:01:01, destination IP=10.10.2.10, destination MAC=fa:16:3d:a0:a0:01.

[0217] Combined with reference Fig.13 The process of matching the br-south flow table is as follows: first match the flow table in table=0. Because it enters from the vxlan sub-interface, it goes to table=4 and continues to match the flow table. Because the destination MAC is fa:16:3d:a0:a0:01, it hits the MAC prefix of the peer port, so the traffic is sent from the veth pair port of VPC1 to the br-conjoin bridge.

[0218] 7) After the traffic reaches the br-conjoin bridge, it continues to match the flow table and then goes to the group flow table. The group flow table is mainly used to load balance multiple subnets of the peer VPC2, select one of the subnets, modify the source / destination MAC address, and send the traffic back to the br-south bridge from the veth pair port of VPC2.

[0219] Combined with reference Fig.14 The matching process is as follows: first match the flow table in table=0, go to table=1, match the flow table, and go to the group flow table (each VPC that establishes a peer connection has a corresponding group flow table, and the group flow table hit here is the one corresponding to the peer VPC). This group flow table is mainly used to randomly select multiple subnets of the peer VPC. After a subnet is selected, the source MAC and destination MAC addresses are modified.

[0220] In this example, only one subnet is involved, so after the execution is completed, the message information is: source IP = 10.10.1.10, source MAC = fa:16:3d:a0:a0:02 (i.e. the MAC address of the peer port reserved by the VPC2 subnet), destination IP = 10.10.2.10, destination MAC = fa:16:3e:00:02:01 (i.e. the MAC address of DVR2). After the message is processed, it is sent back to the br-south bridge from the veth pair port of the peer VPC.

[0221] 8) Continue matching the flow table on the br-south bridge and then switch to the group flow table. The group flow table is mainly used to load balance multiple DVR instances. Select one of the DVR instances and send the traffic to the computing node where the DVR instance is located.

[0222] Combined with reference Fig.13The matching process is as follows: first, match the flow table in table = 0, enter from the veth pair port of the vpc bridge, so go to table = 1, because the destination MAC is DVR MAC at this time, so go to the group flow table.

[0223] This group flow table is mainly used to perform load balancing scheduling on multiple DVR instances in VPC. It will eventually select a DVR instance of one of the computing nodes and encapsulate the traffic into VXLAN packets and send them to the target computing node.

[0224] At this time, the VXLAN message from service NIC 3 is: source IP = 192.168.1.13, source MAC = 0a:16:3f:00:00:03, destination IP = 192.168.1.12, destination MAC = 0a:16:3f:00:00:02. Similarly, due to VXLAN encapsulation, the inner message information of the VM is hidden.

[0225] 9) The VXLAN message is sent from business NIC 3 to business NIC 2 of the target computing node. The br-tun bridge removes the encapsulation of the vxlan message, matches the flow table, and after hitting the flow table, sends the traffic to the br-int bridge.

[0226] Among them, the message information after decapsulation is: source IP = 10.10.1.10, source MAC = fa:16:3d:a0:a0:02 (that is, the MAC address of the peer port reserved by the VPC2 subnet), destination IP = 10.10.2.10, destination MAC = fa:16:3e:00:02:01 (that is, the MAC address of DVR2).

[0227] Combined with reference Fig.12 The matching process is as follows: first, match the flow table in table=0 and enter from the VXLAN port, so go to table=4 and continue to match the flow table. Finally, send the traffic from the patch-int port to the br-int bridge.

[0228] 10) The br-int bridge continues to match the flow table and sends the traffic to the DVR2 instance.

[0229] 11) In DVR2, match the direct routing rule and forward the traffic.

[0230] The message information received by DVR2 is: source IP = 10.10.1.10, source MAC = fa:16:3d:a0:a0:02 (i.e., the MAC address of the peer port reserved by the VPC2 subnet), destination IP = 10.10.2.10, destination MAC = fa:16:3e:00:02:01 (i.e., the MAC address of DVR2).

[0231] Direct connection routing rules in DVR2: destination = 10.10.2.0 / 24, next hop = direct connection network card.

[0232] At this time, since the traffic matches the direct routing rule, three-layer forwarding is performed in DVR2. The message information is: source IP = 10.10.1.10, source MAC = fa:16:3e:00:02:01 (i.e., the MAC address of DVR2), destination IP = 10.10.2.10, destination MAC = fa:16:3e:44:55:66 (i.e., the MAC address of VM2).

[0233] 12) The traffic is sent to the br-int bridge, matches the flow table, and is finally forwarded to VM2.

[0234] The reverse traffic forwarding process is similar and will not be described here.

[0235] It should be noted that the above method embodiments may be implemented individually or in combination, and this application does not impose any limitation on this.

[0236] Fig.16 This is a structural block diagram of a cross-VPC traffic forwarding device according to an exemplary embodiment. The device is executed by a VPC peer gateway cluster in a VPC peer connection network, and the VPC peer connection network also includes a first VPC and a second VPC. The device includes: a traffic receiving module 1601, an address information modification module 1602, and a traffic sending module 1603;

[0237] The traffic receiving module 1601 is configured to receive peer connection traffic sent by the first VPC, where the media access control MAC address information of the peer connection traffic is first MAC address information, and the first MAC address information is related to the MAC address of the first distributed virtual router DVR in the first VPC and the MAC address of the first peer port reserved by the first subnet in the first VPC;

[0238] The address information modification module 1602 is used to modify the MAC address information of the peer connection traffic from the first MAC address information to second MAC address information, where the second MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second peer port reserved by the second subnet in the second VPC;

[0239] The traffic sending module 1603 is used to send the peer connection traffic with modified address information to the second VPC.

[0240] In a possible implementation, the gateway nodes in the VPC peer gateway cluster include: br-conjoin and br-south, an interface for communicating with the VPC is created on the br-south, and a Veth Pair is established between the br-conjoin and the br-south for each VPC;

[0241] The address information modification module 1602 is used to:

[0242] After receiving the peer connection traffic sent by the first VPC, the br-south sends the peer connection traffic from the first Veth Pair corresponding to the first VPC to the br-conjoin;

[0243] The br-conjoin modifies the source MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of the second peer port reserved by the second subnet in the second VPC, and modifies the destination MAC address of the peer connection traffic from the MAC address of the first peer port reserved by the first subnet in the first VPC to the MAC address of the second DVR in the second VPC;

[0244] The traffic sending module 1603 is used to:

[0245] The br-conjoin sends the peer connection traffic after the address information is modified from the second Veth Pair corresponding to the second VPC to the br-south;

[0246] The br-south sends the peer connection traffic with modified address information to the second VPC.

[0247] In a possible implementation, the br-conjoin includes a subnet selection group flow table corresponding to the second VPC, and the subnet selection group flow table is used to perform load balancing selection on the subnet in the second VPC;

[0248] The address information modification module 1602 is used for selecting the second subnet in the second VPC by using the subnet selection group flow table before the br-conjoin modifies the source MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of the second peer port reserved for the second subnet in the second VPC.

[0249] In a possible implementation, the br-south includes a DVR instance selection group flow table corresponding to the second DVR, and the DVR instance selection group flow table is used to perform load balancing selection on the DVR instance of the second DVR;

[0250] The traffic sending module 1603 is used to:

[0251] The br-south selects the target DVR instance of the second DVR using the DVR instance selection group flow table;

[0252] The br-south sends the peer connection traffic with the address information modified to the target DVR instance of the second DVR.

[0253] In a possible implementation, the MAC address of the first peer port and the MAC address of the second peer port correspond to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding during the flow table matching process of the traffic.

[0254] Fig.17 This is a structural block diagram of a cross-VPC traffic forwarding device according to an exemplary embodiment. The device is executed by a first VPC in a VPC peer connection network, and the VPC peer connection network also includes a VPC peer gateway cluster and a second VPC. The device includes: a traffic generation module 1701, an address information modification module 1702, and a traffic sending module 1703;

[0255] The traffic generation module 1701 is used to generate peer connection traffic, where the media access control MAC address information of the peer connection traffic is third MAC address information, and the third MAC address information is related to the MAC address of the first distributed virtual router DVR in the first VPC and the MAC address of the first virtual machine VM in the first VPC;

[0256] The address information modification module 1702 is used to modify the MAC address information of the peer connection traffic from the third MAC address information to the first MAC address information, where the first MAC address information is related to the MAC address of the first DVR in the first VPC and the MAC address of the first peer port reserved by the first subnet in the first VPC;

[0257] The traffic sending module 1703 is used to send the peer connection traffic with modified address information to the VPC peer gateway cluster, so that the VPC peer gateway cluster forwards the peer connection traffic to the second VPC.

[0258] In a possible implementation, the first DVR in the first VPC includes a peer connection routing rule, and the peer connection routing rule includes: when the destination IP address of the traffic belongs to the destination network segment of another VPC, the next hop is the IP address of the peer port reserved for the subnet from which the traffic comes;

[0259] The address information modification module 1702 is used to:

[0260] After receiving the peer connection traffic sent by the first VM, the first DVR modifies, based on the peer connection routing rule, a source MAC address of the peer connection traffic from the MAC address of the first VM in the first VPC to the MAC address of the first DVR in the first VPC, and modifies a destination MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of a first peer port reserved for a first subnet in the first VPC.

[0261] In a possible implementation, the VPC peer gateway cluster includes at least one group of gateway node groups, each group of the gateway node groups includes at least one gateway node, and the peer connection between the first VPC and the second VPC is carried by a target gateway node group in the at least one group of gateway node groups;

[0262] The traffic sending module 1703 is used to:

[0263] The first DVR sends the peer connection traffic after the address information is modified to br-tun in the first VPC, wherein the br-tun includes a gateway node selection group flow table corresponding to the target gateway node group, and the gateway node selection group flow table is used to perform load balancing selection on the gateway nodes in the target gateway node group;

[0264] The br-tun selects a target gateway node in the target gateway node group using the gateway node selection group flow table;

[0265] The br-tun sends the peer connection traffic with modified address information to the target gateway node.

[0266] In a possible implementation, the MAC address of the first peer port corresponds to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding traffic during a flow table matching process of the traffic.

[0267] Fig.18This is a structural block diagram of a cross-VPC traffic forwarding device according to an exemplary embodiment. The device is executed by a second VPC in a VPC peer connection network, and the VPC peer connection network also includes a VPC peer gateway cluster and a first VPC. The device includes: a traffic receiving module 1801, an address information modification module 1802, and a traffic sending module 1803;

[0268] The traffic receiving module 1801 is used to receive peer connection traffic sent by the VPC peer gateway cluster, where the peer connection traffic is received by the VPC peer gateway cluster from the first VPC, and the media access control MAC address information of the peer connection traffic is second MAC address information, where the second MAC address information is related to the MAC address of the second distributed virtual routing DVR in the second VPC and the MAC address of the second peer port reserved by the second subnet in the second VPC;

[0269] The address information modification module 1802 is used to modify the MAC address information of the peer connection traffic from the second MAC address information to fourth MAC address information, where the fourth MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second virtual machine VM in the second VPC;

[0270] The traffic sending module 1803 is used to send the peer connection traffic with modified address information to the second VM.

[0271] In a possible implementation, the second DVR in the second VPC includes a direct routing rule, and the direct routing rule includes: when the destination IP address of the traffic belongs to the destination network segment of the second VPC, the next hop is a direct network card corresponding to the subnet to which the second VM belongs;

[0272] The address information modification module 1802 is used to:

[0273] After receiving the peer connection traffic sent by the VPC peer gateway cluster, the second DVR, based on the direct routing rule, modifies the source MAC address of the peer connection traffic from the MAC address of the second peer port reserved by the second subnet in the second VPC to the MAC address of the second DVR in the second VPC, and modifies the destination MAC address of the peer connection traffic from the MAC address of the second DVR in the second VPC to the MAC address of the second VM in the second VPC.

[0274] In a possible implementation, the MAC address of the second peer port corresponds to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding traffic during a flow table matching process of the traffic.

[0275] It should be noted that the cross-VPC traffic forwarding device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0276] See also Fig.19 , which is a schematic diagram of a computer device provided according to an exemplary embodiment of the present application, the computer device includes a memory and a processor, the memory is used to store a computer program, and when the computer program is executed by the processor, the above-mentioned cross-VPC traffic forwarding method is implemented.

[0277] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0278] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiment.

[0279] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0280] In an exemplary embodiment, a computer-readable storage medium is also provided, which is used to store at least one computer program, and the at least one computer program is loaded and executed by a processor to implement all or part of the steps in the above method. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0281] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0282] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for forwarding traffic across virtual private clouds (VPCs), characterized in that: The method is performed by a VPC peer gateway cluster in a VPC peer connection network, wherein the VPC peer connection network further includes a first VPC and a second VPC, and the method includes: Receive peer connection traffic sent by the first VPC, where media access control MAC address information of the peer connection traffic is first MAC address information, and the first MAC address information is related to a MAC address of a first distributed virtual router DVR in the first VPC and a MAC address of a first peer port reserved by a first subnet in the first VPC; Modify the MAC address information of the peer connection traffic from the first MAC address information to second MAC address information, where the second MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second peer port reserved by the second subnet in the second VPC; Sending the peer connection traffic with modified address information to the second VPC; The gateway nodes in the VPC peer gateway cluster include: br-conjoin and br-south, an interface for communicating with the VPC is created on the br-south, and a Veth Pair is established between the br-conjoin and the br-south for each VPC.

2. The method according to claim 1, characterized in that The modifying the MAC address information of the peer connection traffic from the first MAC address information to the second MAC address information includes: After receiving the peer connection traffic sent by the first VPC, the br-south sends the peer connection traffic from the first Veth Pair corresponding to the first VPC to the br-conjoin; The br-conjoin modifies the source MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of the second peer port reserved by the second subnet in the second VPC, and modifies the destination MAC address of the peer connection traffic from the MAC address of the first peer port reserved by the first subnet in the first VPC to the MAC address of the second DVR in the second VPC; The step of sending the peer connection traffic after the address information is modified to the second VPC includes: The br-conjoin sends the peer connection traffic after the address information is modified from the second Veth Pair corresponding to the second VPC to the br-south; The br-south sends the peer connection traffic with modified address information to the second VPC.

3. The method according to claim 2, characterized in that The br-conjoin includes a subnet selection group flow table corresponding to the second VPC, where the subnet selection group flow table is used to perform load balancing selection on the subnets in the second VPC; Before the br-conjoin modifies the source MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of the second peer port reserved by the second subnet in the second VPC, the method further includes: The br-conjoin selects the second subnet in the second VPC using the subnet selection group flow table.

4. The method according to claim 2, characterized in that: The br-south includes a DVR instance selection group flow table corresponding to the second DVR, and the DVR instance selection group flow table is used to perform load balancing selection on the DVR instance of the second DVR; The br-south sends the peer connection traffic with the modified address information to the second VPC, including: The br-south selects the target DVR instance of the second DVR using the DVR instance selection group flow table; The br-south sends the peer connection traffic with the address information modified to the target DVR instance of the second DVR.

5. The method according to claim 1, characterized in that The MAC address of the first peer port and the MAC address of the second peer port correspond to a preset MAC address prefix, and the preset MAC address prefix is ​​used to identify that the traffic belongs to cross-VPC forwarding during the flow table matching process of the traffic.

6. A method for forwarding traffic across virtual private clouds (VPCs), characterized in that: The method is performed by a first VPC in a VPC peer connection network, wherein the VPC peer connection network further includes a VPC peer gateway cluster and a second VPC, and the method includes: Generate peer connection traffic, where media access control MAC address information of the peer connection traffic is third MAC address information, and the third MAC address information is related to a MAC address of a first distributed virtual router DVR in the first VPC and a MAC address of a first virtual machine VM in the first VPC; Modify the MAC address information of the peer connection traffic from the third MAC address information to first MAC address information, where the first MAC address information is related to the MAC address of the first DVR in the first VPC and the MAC address of the first peer port reserved by the first subnet in the first VPC; Sending the peer connection traffic with modified address information to the VPC peer gateway cluster, so that the VPC peer gateway cluster forwards the peer connection traffic to the second VPC; The gateway nodes in the VPC peer gateway cluster include: br-conjoin and br-south, an interface for communicating with the VPC is created on the br-south, and a Veth Pair is established between the br-conjoin and the br-south for each VPC.

7. The method according to claim 6, characterized in that The first DVR in the first VPC includes a peer connection routing rule, and the peer connection routing rule includes: when the destination IP address of the traffic belongs to the destination network segment of another VPC, the next hop is the IP address of the peer port reserved for the subnet from which the traffic comes; The modifying the MAC address information of the peer connection traffic from the third MAC address information to the first MAC address information includes: After receiving the peer connection traffic sent by the first VM, the first DVR modifies, based on the peer connection routing rule, a source MAC address of the peer connection traffic from the MAC address of the first VM in the first VPC to the MAC address of the first DVR in the first VPC, and modifies a destination MAC address of the peer connection traffic from the MAC address of the first DVR in the first VPC to the MAC address of a first peer port reserved for a first subnet in the first VPC.

8. The method according to claim 7, characterized in that The VPC peer gateway cluster includes at least one group of gateway node groups, each group of the gateway node groups includes at least one gateway node, and the peer connection between the first VPC and the second VPC is carried by a target gateway node group in the at least one group of gateway node groups; The step of sending the peer connection traffic after modifying the address information to the VPC peer gateway cluster includes: The first DVR sends the peer connection traffic after the address information is modified to br-tun in the first VPC, wherein the br-tun includes a gateway node selection group flow table corresponding to the target gateway node group, and the gateway node selection group flow table is used to perform load balancing selection on the gateway nodes in the target gateway node group; The br-tun selects a target gateway node in the target gateway node group using the gateway node selection group flow table; The br-tun sends the peer connection traffic with modified address information to the target gateway node.

9. A method for forwarding traffic across virtual private clouds (VPCs), characterized in that: The method is performed by a second VPC in a VPC peer connection network, wherein the VPC peer connection network further includes a VPC peer gateway cluster and a first VPC, and the method includes: Receive peer connection traffic sent by the VPC peer gateway cluster, where the peer connection traffic is received by the VPC peer gateway cluster from the first VPC, and media access control MAC address information of the peer connection traffic is second MAC address information, where the second MAC address information is related to a MAC address of a second distributed virtual router DVR in the second VPC and a MAC address of a second peer port reserved by a second subnet in the second VPC; Modify the MAC address information of the peer connection traffic from the second MAC address information to fourth MAC address information, where the fourth MAC address information is related to the MAC address of the second DVR in the second VPC and the MAC address of the second virtual machine VM in the second VPC; Sending the peer connection traffic with modified address information to the second VM; The gateway nodes in the VPC peer gateway cluster include: br-conjoin and br-south, an interface for communicating with the VPC is created on the br-south, and a Veth Pair is established between the br-conjoin and the br-south for each VPC.

10. The method according to claim 9, characterized in that The second DVR in the second VPC includes a direct routing rule, wherein the direct routing rule includes: when the destination IP address of the traffic belongs to the destination network segment of the second VPC, the next hop is a direct network card corresponding to the subnet to which the second VM belongs; The modifying the MAC address information of the peer connection traffic from the second MAC address information to the fourth MAC address information includes: After receiving the peer connection traffic sent by the VPC peer gateway cluster, the second DVR, based on the direct routing rule, modifies the source MAC address of the peer connection traffic from the MAC address of the second peer port reserved by the second subnet in the second VPC to the MAC address of the second DVR in the second VPC, and modifies the destination MAC address of the peer connection traffic from the MAC address of the second DVR in the second VPC to the MAC address of the second VM in the second VPC.