Network traffic processing method, device, electronic device and storage medium

By determining the attribute information of network traffic and the existence of virtual gateways in the virtual gateway system, using OpenFlow rules and network tunnels to achieve fast and accurate forwarding of network traffic, it solves the problem of network traffic processing efficiency and accuracy in the virtual gateway system, and improves forwarding. Efficiency and accuracy.

CN117014371BActive Publication Date: 2024-10-18DAWNING CLOUD COMPUTING TECH CO LTD

Patent Information

Application Number
CN202310820216.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-05
Publication Date
2024-10-18
Estimated Expiration
2043-07-05

AI Technical Summary

Technical Problem

Existing technologies are difficult to process network traffic quickly and accurately, especially in virtual gateway systems, resulting in limited network traffic forwarding efficiency and accuracy.

Method used

By determining the attribute information of the network traffic to be transmitted, it is determined whether the current computing node contains a virtual gateway, and according to the preset rules, the network traffic is converted into target network traffic that matches the virtual gateway or the target virtual machine, and is forwarded through the virtual gateway, using OpenFlow Rules and network tunnels enable fast and accurate forwarding.

Benefits of technology

It improves the processing accuracy and forwarding efficiency of network traffic, ensures that network traffic can be forwarded to the destination quickly and accurately, and improves the performance of the virtual gateway system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117014371B_ABST
    Figure CN117014371B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method, device, electronic device and storage medium for processing network traffic. Applied to a virtual gateway system; the method includes: determining the attribute information of the network traffic to be transmitted and whether the current computing node contains a virtual gateway; if not, converting the network traffic to be transmitted into target network traffic matching the virtual gateway according to the attribute information and preset rules, forwarding the target network traffic to the target computing node to which the virtual gateway belongs, and forwarding the target network traffic; if contained, converting the network traffic to be transmitted into target network traffic matching the computing node where the target virtual machine is located according to the attribute information and preset rules, and forwarding the target network traffic to the computing node where the target virtual machine is located. The scheme of the embodiment of the present invention can forward and process network traffic in different ways, and can quickly and accurately forward and process network traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, electronic device and storage medium for processing network traffic. Background Art

[0002] With the continuous development of computer Internet and other technologies, the number of network users is increasing, which brings huge challenges to the forwarding and processing of network traffic. How to forward and process these network traffic quickly and accurately is a key research issue in the industry. Summary of the invention

[0003] The embodiments of the present invention provide a method, device, electronic device and storage medium for processing network traffic, so as to quickly and accurately forward the network traffic.

[0004] According to one aspect of an embodiment of the present invention, a method for processing network traffic is provided, which is applied to a virtual gateway system, wherein the virtual gateway system comprises: at least two computing nodes, each of which is connected to each other for communication, and at least one computing node comprises a virtual gateway, wherein the virtual gateway is used to forward network traffic of other computing nodes or local computing nodes, and the method comprises:

[0005] Determine each attribute information of the network traffic to be transmitted, and determine whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information;

[0006] In the case of determining that the current computing node does not include the virtual gateway, the current computing node converts the network traffic to be transmitted into target network traffic matching the virtual gateway according to each of the attribute information and the preset rule, forwards the target network traffic to the target computing node to which the virtual gateway belongs through a preset network tunnel, and forwards the target network traffic through the virtual gateway;

[0007] When it is determined that the current computing node includes the virtual gateway, the current computing node converts the network traffic to be transmitted into target network traffic matching the computing node where the target virtual machine is located according to each of the attribute information and preset rules.

[0008] Optionally, each of the attribute information of the network traffic to be transmitted includes at least one of the following:

[0009] The source IP, destination IP, source port, destination port, destination Mac address and source Mac address of the network traffic to be transmitted.

[0010] Optionally, determining whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each of the attribute information includes:

[0011] Determine the source of the network traffic to be transmitted according to the source IP, source port and source Mac address in each of the attribute information;

[0012] Determining a current computing node to which the network traffic to be transmitted belongs according to a source of the network traffic to be transmitted;

[0013] Determining whether the current computing node includes the virtual gateway according to the configuration information of the virtual gateway system;

[0014] The source of the network traffic to be transmitted includes: a network card matching any virtual machine of any computing node of the virtual gateway system, or a public network.

[0015] By adopting the above technical solution, it is possible to quickly determine whether the current computing node to which the network traffic to be transmitted belongs contains the virtual gateway, providing a basis for subsequently determining the transmission path of the network traffic to be transmitted, and improving the accuracy of network traffic processing.

[0016] Optionally, each of the computing nodes in the virtual gateway system further includes a bridge;

[0017] The current computing node converts the network traffic to be transmitted into target network traffic matching the virtual gateway according to each of the attribute information and the preset rule, including:

[0018] The network bridge in the current computing node determines the network tag of the network traffic to be transmitted according to each of the attribute information of the network traffic to be transmitted;

[0019] The network traffic to be transmitted is converted into target network traffic matching the virtual gateway based on OpenFlow rules.

[0020] By adopting the above technical solution, the network traffic to be transmitted can be quickly converted into the target network traffic matching the virtual gateway, providing a basis for the subsequent forwarding of the network traffic.

[0021] Optionally, the current computing node converts the network traffic to be transmitted into target network traffic matching the target virtual machine according to each of the attribute information and a preset rule, including:

[0022] The network bridge in the current computing node determines the network tag of the network traffic to be transmitted according to each of the attribute information of the network traffic to be transmitted;

[0023] The network traffic to be transmitted is converted into target network traffic matching the computing node where the target virtual machine is located based on OpenFlow rules.

[0024] By adopting the above technical solution, the network traffic to be transmitted can be quickly converted into the target network traffic that matches the computing node where the target virtual machine is located, providing a basis for the subsequent forwarding of the network traffic.

[0025] Optionally, before forwarding the target network traffic through the virtual gateway, the method further includes:

[0026] The target network traffic is converted into final network traffic matching the destination Mac address of the network traffic to be transmitted based on the OpenFlow rule by a bridge in the target computing node;

[0027] Correspondingly, after forwarding the target network traffic to the computing node where the target virtual machine is located through the virtual gateway, it also includes:

[0028] The target network traffic is converted into final network traffic matching the destination Mac address of the network traffic to be transmitted based on the OpenFlow rule by the computing node where the target virtual machine is located.

[0029] The above technical solution can ensure that the virtual gateway can forward network traffic to the final destination Mac address, thereby achieving accurate processing of the network traffic to be transmitted.

[0030] Optionally, after determining that the current computing node includes the virtual gateway, the method further includes:

[0031] The current computing node converts the network traffic to be transmitted according to each of the attribute information and preset rules to obtain the target network traffic;

[0032] The target network traffic is forwarded through the virtual gateway.

[0033] By adopting the above technical solution, it is possible to realize rapid forwarding processing of the network traffic to be transmitted, thereby improving the forwarding efficiency of the network traffic to be transmitted.

[0034] According to another aspect of an embodiment of the present invention, a network traffic processing device is provided, which is applied to a virtual gateway system, the virtual gateway system comprising: at least two computing nodes, each of the computing nodes is connected to each other for communication, and at least one computing node comprises a virtual gateway, the virtual gateway is used to forward network traffic of other computing nodes or local computing nodes, the device comprising:

[0035] An attribute information determination module, used to determine each attribute information of the network traffic to be transmitted, and determine whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information;

[0036] A first processing module, configured to, when it is determined that the current computing node does not include the virtual gateway, convert the network traffic to be transmitted into target network traffic matching the virtual gateway according to each of the attribute information and a preset rule, forward the target network traffic to a target computing node to which the virtual gateway belongs through a preset network tunnel, and forward the target network traffic through the virtual gateway;

[0037] The second processing module is used to, when it is determined that the current computing node includes the virtual gateway, convert the network traffic to be transmitted into target network traffic that matches the computing node where the target virtual machine is located according to each of the attribute information and preset rules, and forward the target network traffic to the computing node where the target virtual machine is located through the virtual gateway.

[0038] According to another aspect of an embodiment of the present invention, an electronic device is provided, the electronic device comprising:

[0039] at least one processor; and

[0040] a memory communicatively connected to the at least one processor; wherein,

[0041] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the network traffic processing method described in any embodiment of the present invention.

[0042] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the network traffic processing method described in any embodiment of the present invention when executed.

[0043] The technical solution of the embodiment of the present invention can be applied to a virtual gateway system, which includes: at least two computing nodes, each of which is connected to each other in communication, and at least one computing node includes a virtual gateway, and the virtual gateway is used to forward network traffic of other computing nodes or local computing nodes. Specifically, it can be determined by determining each attribute information of the network traffic to be transmitted, and determining whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information; when it is determined that the current computing node does not include the virtual gateway, the current computing node converts the network traffic to be transmitted into a virtual gateway according to each attribute information and preset rules. For target network traffic matching the virtual gateway, the target network traffic is forwarded to the target computing node to which the virtual gateway belongs through a preset network tunnel, and the target network traffic is forwarded through the virtual gateway; when it is determined that the current computing node contains the virtual gateway, the current computing node converts the network traffic to be transmitted into target network traffic matching the computing node where the target virtual machine is located according to each of the attribute information and preset rules, and forwards the target network traffic to the computing node where the target virtual machine is located through the virtual gateway. The network traffic can be forwarded and processed in different ways, and the network traffic can be forwarded and processed quickly and accurately.

[0044] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the embodiments of the present invention. Other features of the embodiments of the present invention will become easy to understand through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0046] Figure 1 is a flow chart of a method for processing network traffic provided according to Embodiment 1 of the present invention;

[0047] Figure 2 is a structural diagram of a virtual gateway system provided according to Embodiment 1 of the present invention;

[0048] Figure 3 is a flow chart of another method for processing network traffic provided according to Embodiment 2 of the present invention;

[0049] Figure 4is a flow chart of another method for processing network traffic provided according to Embodiment 3 of the present invention;

[0050] Figure 5 It is a schematic diagram of a processing flow of network traffic from a virtual machine to a virtual gateway provided according to Embodiment 3 of the present invention;

[0051] Figure 6 It is a schematic diagram of a processing flow of network traffic from a virtual gateway to a virtual machine provided according to Embodiment 3 of the present invention;

[0052] Figure 7 It is a schematic diagram of a processing flow of network traffic from a virtual gateway to a virtual machine on the same computing node according to Embodiment 3 of the present invention;

[0053] Figure 8 is a schematic diagram of the structure of a network traffic processing device provided according to Embodiment 3 of the present invention;

[0054] Fig. 9 It is a structural schematic diagram of an electronic device for implementing the network traffic processing method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0055] In order to enable those skilled in the art to better understand the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only embodiments of a part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments in the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the embodiments of the present invention.

[0056] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0057] Embodiment 1

[0058] Figure 1This is a flowchart of a method for processing network traffic provided according to Embodiment 1 of the present invention. This embodiment is applicable to situations where network traffic is forwarded quickly and accurately. The method can be executed by a network traffic processing device, which can be implemented in the form of hardware and / or software. The network traffic processing device can be configured in electronic devices such as computers, servers, or tablet computers.

[0059] It should be noted that Figure 2 is a schematic diagram of the structure of a virtual gateway system provided according to Embodiment 2 of the present invention. The network traffic processing method involved in this embodiment can be applied to Figure 2 In the virtual gateway system shown; the virtual gateway system includes: at least two computing nodes, each of the computing nodes is communicatively connected to each other, and at least one computing node includes a virtual gateway, and the virtual gateway is used to forward network traffic of other computing nodes or local computing nodes. Figure 2 In the embodiment, the virtual gateway system includes two computing nodes (only as an example, not a limitation of this embodiment), one of which includes a virtual gateway, and each computing node also includes a bridge, each bridge is connected to a software defined network (SDN) controller, and each computing node can include multiple virtual machines and network cards corresponding to each virtual machine. The virtual machines can be virtual machines of different tenants' private networks, and each virtual machine has a private Internet Protocol (IP) address.

[0060] In this embodiment, the virtual gateway can be a NAPT gateway; a virtual gateway can be bound to a public IP address and a private IP address at the same time, and the computing node where it is located can be any computing node. Among them, the private IP address is used to direct the traffic of other computing node virtual machines to the computing node where the virtual gateway is located, and the traffic here is the communication between private networks; the public IP address is the IP address used when the NAPT gateway communicates with the public network.

[0061] It should also be noted that the bridge involved in this embodiment may be an OpenvSwitch bridge; in this embodiment, the network card corresponding to each virtual machine may be inserted into this bridge, so that the traffic of each virtual machine may be processed through OpenFlow in the bridge.

[0062] It should also be noted that, in this embodiment, a NAPT mapping rule in the form of OpenFlow can be issued to the bridge by a software defined network (Software Defined Network, SDN) controller.

[0063] Specifically, refer to Figure 1 , the method specifically comprises the following steps:

[0064] Step 110: determine each attribute information of the network traffic to be transmitted, and determine whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information.

[0065] Among them, the network traffic to be transmitted can be the outbound network traffic of the virtual machine, that is, the network traffic forwarded from the virtual machine to the public network; it can also be the inbound traffic of the virtual machine gateway, that is, the network traffic forwarded from the public network to the network card of the target virtual machine, which is not limited in this embodiment.

[0066] In this embodiment, the attribute information of the network traffic to be transmitted may include at least one of the following: the source IP, source port, destination physical (Media Access Control Address, Mac) address and source Mac address of the network traffic to be transmitted, which are not limited in this embodiment.

[0067] For example, the network traffic to be transmitted can be the traffic coming out of the virtual machine network card, with the source IP address of 10.0.0.10, the source port of 80, and the destination Mac address of the private network A gateway Mac address. The destination IP address and port are the address and port on the public network; the network traffic to be transmitted can also be the traffic coming in from the public network: the destination IP address is 172.22.9.101, the destination port is 8080, and the destination Mac address is the public network Mac address of the virtual gateway.

[0068] In an optional implementation of this embodiment, after determining and obtaining various attribute information of the network traffic to be transmitted, it can be further determined whether the current computing node to which the network traffic to be transmitted belongs includes a virtual gateway according to the various attribute information of the network traffic to be transmitted.

[0069] Optionally, in this embodiment, determining whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each of the attribute information may include: determining the source of the network traffic to be transmitted according to the source IP, source port and source Mac address in each of the attribute information; determining the current computing node to which the network traffic to be transmitted belongs according to the source of the network traffic to be transmitted; determining whether the current computing node includes the virtual gateway according to the configuration information of the virtual gateway system; wherein the source of the network traffic to be transmitted includes: a network card matching any virtual machine of any computing node of the virtual gateway system, or a public network.

[0070] The advantage of such a setting is that it can quickly determine whether the current computing node to which the network traffic to be transmitted belongs contains the virtual gateway, providing a basis for subsequently determining the transmission path of the network traffic to be transmitted, thereby improving the accuracy of network traffic processing.

[0071] Exemplarily, in this embodiment, after obtaining various attribute information of the network traffic to be transmitted, each attribute information can be analyzed, for example, the source of the network traffic to be transmitted can be determined based on the source IP, source port and source Mac address, and the computing node to which the network traffic to be transmitted belongs can be determined based on the source of the network traffic to be transmitted; further, the system information of the virtual gateway system can be queried to determine whether the computing node to which the network traffic to be transmitted belongs includes a virtual gateway.

[0072] Step 120: When it is determined that the current computing node does not include the virtual gateway, the current computing node converts the network traffic to be transmitted into target network traffic matching the virtual gateway according to the attribute information and preset rules, forwards the target network traffic to the target computing node to which the virtual gateway belongs through a preset network tunnel, and forwards the target network traffic through the virtual gateway.

[0073] Among them, the preset rule may be an OpenFlow rule; the preset network tunnel may be a private network tunnel from the current computing node to the computing node including the virtual gateway, which is not limited in this embodiment.

[0074] In an optional implementation of the present embodiment, if it is determined through the above steps that the current computing node to which the network traffic to be transmitted belongs does not include a virtual gateway, the current computing node can convert the network traffic to be transmitted according to the attribute information of the network traffic to be transmitted and the preset rules, that is, convert the network traffic to be transmitted into the target network traffic matching the virtual gateway; further, the converted target network traffic can be forwarded to the target computing node where the virtual gateway is located through a preset network tunnel, and the target network traffic can be forwarded through the virtual gateway in the target computing node, for example, the target network traffic is forwarded to the public network.

[0075] It should be noted that, in this embodiment, before forwarding the target network traffic through the virtual gateway, the target computing node can also convert the network traffic to be transmitted according to the attribute information of the target network traffic and preset rules to obtain the network traffic to be forwarded, and forward the network traffic to be forwarded through the virtual gateway in the target computing node.

[0076] Step 130: When it is determined that the current computing node includes the virtual gateway, the current computing node converts the network traffic to be transmitted into target network traffic that matches the computing node where the target virtual machine is located according to the attribute information and preset rules, and forwards the target network traffic to the computing node where the target virtual machine is located through the virtual gateway.

[0077] In an optional implementation of the present embodiment, if it is determined through the above step 110 that the current computing node includes the virtual gateway, the first transmission network traffic can be converted through the current computing node, that is, the current computing node can convert the network traffic to be transmitted into target network traffic that matches the computing node where the target virtual machine is located according to the attribute information and preset rules; further, the target network traffic can be forwarded to the computing node where the target virtual machine is located through the virtual gateway.

[0078] Optionally, after receiving the target network traffic, the computing node where the target virtual machine is located can further convert the target network traffic through the computing node, that is, convert the target network traffic into network traffic that matches the target virtual machine; further, the converted network traffic can be forwarded to the network card that matches the target virtual machine.

[0079] The solution of this embodiment can be applied to a virtual gateway system, which includes: at least two computing nodes, each of which is connected to each other in communication, and at least one computing node includes a virtual gateway, and the virtual gateway is used to forward network traffic of other computing nodes or local computing nodes. The solution of this embodiment determines each attribute information of the network traffic to be transmitted, and determines whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information; when it is determined that the current computing node does not include the virtual gateway, the current computing node converts the network traffic to be transmitted into a virtual gateway according to each attribute information and a preset rule. The target network traffic matching the virtual gateway is forwarded to the target computing node to which the virtual gateway belongs through a preset network tunnel, and the target network traffic is forwarded through the virtual gateway; when it is determined that the current computing node contains the virtual gateway, the current computing node converts the network traffic to be transmitted into the target network traffic matching the computing node where the target virtual machine is located according to each of the attribute information and preset rules, and forwards the target network traffic to the computing node where the target virtual machine is located through the virtual gateway. The network traffic can be forwarded and processed in different ways, and the network traffic can be forwarded and processed quickly and accurately.

[0080] Embodiment 2

[0081] Figure 3 1 is a flowchart of another method for processing network traffic according to Embodiment 2 of the present invention. This embodiment is a further refinement of the above-mentioned technical solutions. The technical solution in this embodiment can be combined with various optional solutions in one or more of the above-mentioned embodiments. Figure 3 As shown, the method for processing network traffic may include the following steps:

[0082] Step 310: determine each attribute information of the network traffic to be transmitted, and determine whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information.

[0083] Step 320: The network bridge in the current computing node determines the network tag of the network traffic to be transmitted according to the attribute information of the network traffic to be transmitted; and converts the network traffic to be transmitted into target network traffic matching the virtual gateway based on OpenFlow rules.

[0084] In an optional implementation of this embodiment, when it is determined that the current computing node to which the network traffic to be transmitted belongs does not include a virtual gateway, the network traffic to be transmitted can be first converted into target network traffic matching the virtual gateway through the current computing node according to the attribute information and preset rules.

[0085] Optionally, in this embodiment, the current computing node converts the network traffic to be transmitted into target network traffic that matches the virtual gateway according to each of the attribute information and preset rules, which may include: the bridge in the current computing node determines the network tag of the network traffic to be transmitted according to each of the attribute information of the network traffic to be transmitted; and converts the network traffic to be transmitted into target network traffic that matches the virtual gateway based on OpenFlow rules.

[0086] The advantage of such a setting is that the network traffic to be transmitted can be quickly converted into the target network traffic matching the virtual gateway, providing a basis for the subsequent forwarding of the network traffic.

[0087] Exemplarily, in a specific example of the present embodiment, the traffic coming out of the virtual machine network card has a source IP of 10.0.0.10, a source port of 80, a destination Mac address of the private network A gateway Mac address, and a destination IP address and port of the public network address and port; during the transmission of the traffic, the traffic first reaches the bridge (for example, the br-int bridge), and the OpenFlow rule marks it with a network tag Metadata of A; further, the OpenFlow rule matches the traffic with Metadata A, a source IP of 10.0.0.10, a source port of 80, and a destination Mac address of the private network A gateway Mac address; then the destination mac is modified to the private network Mac address of the virtual gateway (for example, the NAPT gateway) (the mac of IP 100.125.0.10), and the traffic network tag Metadata is modified to C, and the traffic of the virtual machine is changed from the tenant's private network A traffic to the virtual gateway's private network C traffic.

[0088] Step 321: forward the target network traffic to the target computing node to which the virtual gateway belongs through a preset network tunnel.

[0089] In the above example, the OpenFlow rule matches the traffic whose destination Mac address is the private Mac address of the virtual gateway and whose network tag Metadata is C. After the traffic is encapsulated by VXLAN, it is sent to the computing node where the virtual gateway is located through the private network tunnel network. Furthermore, the private network tunnel network transmits the network traffic to the computing node where the virtual gateway is located.

[0090] Step 322: The target network traffic is converted into final network traffic matching the destination Mac address of the network traffic to be transmitted based on OpenFlow rules through a bridge in the target computing node.

[0091] In an optional implementation of this embodiment, after receiving the target network traffic through the private network tunnel, the computing node where the virtual gateway is located can further convert the target network traffic into final network traffic that matches the destination Mac address of the network traffic to be transmitted based on OpenFlow rules through a bridge in the target computing node.

[0092] This ensures that the virtual gateway can forward network traffic to the final destination Mac address, achieving accurate processing of the transmitted network traffic.

[0093] In the above example, the computing node where the virtual gateway is located decapsulates the target network traffic coming from the tunnel; further, the OpenFlow rule matches the traffic whose destination Mac address is the private network Mac address of the virtual gateway and whose network tag Metadata is C; the source IP of the traffic is modified to 172.22.9.101, the source port to 8080, the source Mac address to the public network Mac address of the virtual gateway (Mac address c of IP 172.22.9.101), and the destination Mac address to the gateway Mac address of the public network (gateway Mac address of the 172.22.9.0 / 24 network segment); it can be understood that the target network traffic is converted into public network traffic at this step.

[0094] Step 323: forward the target network traffic through the virtual gateway.

[0095] Step 330: The bridge in the current computing node determines the network tag of the network traffic to be transmitted according to the attribute information of the network traffic to be transmitted; and converts the network traffic to be transmitted into target network traffic that matches the computing node where the target virtual machine is located based on OpenFlow rules.

[0096] In an optional implementation of this embodiment, when it is determined that the current computing node to which the network traffic to be transmitted belongs includes a virtual gateway, the network traffic to be transmitted can be first converted into target network traffic that matches the computing node where the target virtual machine is located through the current computing node according to the attribute information and preset rules.

[0097] Optionally, in this embodiment, the current computing node converts the network traffic to be transmitted into target network traffic that matches the computing node where the target virtual machine is located according to the attribute information and preset rules, which may include: a bridge in the current computing node determines the network tag of the network traffic to be transmitted according to the attribute information of the network traffic to be transmitted; and converts the network traffic to be transmitted into target network traffic that matches the computing node where the target virtual machine is located based on OpenFlow rules.

[0098] The advantage of this setting is that the network traffic to be transmitted can be quickly converted into the target network traffic that matches the computing node where the target virtual machine is located, providing a basis for the subsequent forwarding of network traffic.

[0099] Exemplarily, in a specific example of this embodiment, the traffic coming from the public network: the destination IP is 172.22.9.101, the destination port is 8080, and the destination Mac address is the public Mac address of the virtual gateway (Mac address c of IP172.22.9.101); further, the network traffic reaches the br-int bridge; further, the OpenFlow rule matches the traffic with the destination IP being 172.22.9.101, the destination port being 8080, and the destination Mac address being the public Mac address of the virtual gateway; the destination IP is modified to 10.0.0.10, the destination port is 80, the destination Mac address is the Mac address of the virtual machine (Mac address of IP10.0.0.10), the source Mac address is the Mac address of the private network A gateway, and the network tag Metadata of the traffic is modified to A. In this process, the network traffic is changed from public network traffic to private network traffic of the virtual machine.

[0100] Step 331: forward the target network traffic to the computing node where the target virtual machine is located through the virtual gateway.

[0101] Exemplarily, in the above example, the OpenFlow rule matches the traffic whose destination Mac address is the virtual machine Mac address and whose network tag Metadata is A; after the traffic is encapsulated by VXLAN, it is delivered to the computing node where the virtual machine is located through the private tunnel network; further, the private tunnel network transmits the traffic to the computing node where the virtual machine is located.

[0102] Step 332: The target network traffic is converted into final network traffic that matches the destination Mac address of the network traffic to be transmitted based on OpenFlow rules through the computing node where the target virtual machine is located.

[0103] In an optional implementation of this embodiment, after the target network traffic is forwarded to the computing node where the target virtual machine is located through the virtual gateway, the computing node where the target virtual machine is located can also convert the target network traffic into final network traffic that matches the destination Mac address of the network traffic to be transmitted based on OpenFlow rules.

[0104] This ensures that the virtual gateway can forward network traffic to the final destination Mac address, achieving accurate processing of the transmitted network traffic.

[0105] Illustratively, in the above example, the computing node where the virtual machine is located decapsulates the received VXLAN tunnel traffic; further, the OpenFlow rule can be used to match the traffic whose destination Mac address is the Mac address of the virtual machine; the traffic is sent to the network card that needs to reach the virtual machine; further, the network traffic goes to the network card of the virtual machine and enters the virtual machine.

[0106] The solution of this embodiment can achieve different processing of the network traffic to be transmitted by determining whether the current computing node to which the network traffic to be transmitted belongs includes a virtual gateway, thereby achieving fast and accurate forwarding processing of the network traffic.

[0107] Embodiment 3

[0108] Figure 4 1 is a flowchart of another method for processing network traffic according to Embodiment 3 of the present invention. This embodiment is a further refinement of the above-mentioned technical solutions. The technical solution in this embodiment can be combined with various optional solutions in one or more of the above-mentioned embodiments. Figure 4 As shown, the method for processing network traffic may include the following steps:

[0109] Step 410: determine each attribute information of the network traffic to be transmitted, and determine whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information.

[0110] Step 420: Determine that the current computing node includes the virtual gateway.

[0111] Step 430: The current computing node converts the network traffic to be transmitted according to each of the attribute information and preset rules to obtain target network traffic; and forwards the target network traffic through the virtual gateway.

[0112] In an optional implementation of this embodiment, after determining that the current computing node to which the network traffic to be transmitted belongs includes a virtual gateway, the network traffic to be transmitted can also be converted by the current computing node according to the attribute information of the network traffic to be transmitted and the preset rules, that is, the network traffic to be transmitted is converted into the target network traffic matching the computing node where the target virtual machine is located, or the network traffic to be transmitted is converted into the target network traffic matching the public network, which is not limited in this embodiment. It should be noted that the computing node where the target virtual machine involved in this embodiment is located can be the current computing node or other computing nodes, which is not limited in this embodiment; further, the converted target network traffic can be forwarded to the network card matching the target virtual machine through the virtual gateway.

[0113] For example, in an example of this embodiment, the traffic coming out of the virtual machine network card has a source IP of 10.0.0.11, a source port of 80, and a destination Mac address of the gateway of private network A. The destination IP address and port are the address and port on the public network, indicating that the traffic needs to communicate with the public network; further, when the traffic reaches the br-int bridge, the OpenFlow rule marks it with a network tag Metadata of A;

[0114] OpenFlow rules match traffic with metadata A, source IP 10.0.0.11, source port 80, and destination Mac address Mac address of private network A gateway; modify the traffic source IP to 172.22.9.101, source port 8081, source Mac address to the public network Mac address of the virtual gateway (Mac address of IP address 172.22.9.101), and destination Mac address to the Mac address of the public network gateway (Mac address of the gateway in the 172.22.9.0 / 24 network segment). The traffic becomes public network traffic at this step; further, when the network traffic to be transmitted is converted by the virtual gateway, it can reach the gateway of the public network and go to the external network.

[0115] The solution of this embodiment, after determining that the current computing node includes the virtual gateway, may also include: the current computing node converts the network traffic to be transmitted according to each of the attribute information and preset rules to obtain the target network traffic; forwarding the target network traffic through the virtual gateway, thereby realizing fast forwarding processing of the network traffic to be transmitted and improving the forwarding efficiency of the network traffic to be transmitted.

[0116] In order to better understand the method for processing network traffic involved in the embodiments of the present invention, three specific examples are used below to illustrate the method:

[0117] Figure 5 Schematic diagram of a processing flow of network traffic from a virtual machine to a virtual gateway according to Embodiment 3 of the present invention. Figure 5 , which mainly includes the following processes:

[0118] 1. The traffic coming out of the virtual machine network card has a source IP of 10.0.0.10, a source port of 80, and a destination Mac address of the gateway of private network A. The destination IP address and port are the addresses and ports on the public network, which means that it is communicating with the public network.

[0119] 2. When the traffic reaches the br-int bridge, the OpenFlow rule marks it with a network tag Metadata of A.

[0120] 3. The OpenFlow rule matches the traffic with Metadata A, source IP 10.0.0.10, source port 80, and destination Mac address as the Mac address of the private network A gateway; then change the destination Mac address to the private network Mac address of the NAPT gateway (Mac address of IP100.125.0.10), and change the traffic network tag Metadata to C. The virtual machine traffic changes from the tenant's private network A traffic to the NAPT gateway's private network C traffic.

[0121] 4. The OpenFlow rule matches the traffic whose destination Mac address is the private network Mac address of the NAPT gateway and whose network tag Metadata is C; after the traffic is encapsulated by VXLAN, it is delivered to the computing node where the NAPT gateway is located through the private network tunnel network.

[0122] 5. The private tunnel network transmits traffic to the computing node where the NAPT gateway is located.

[0123] 6. The NAPT gateway node decapsulates the VXLAN traffic coming from the tunnel.

[0124] 7. OpenFlow rules match the traffic whose destination Mac address is the private Mac address of the NAPT gateway and whose network tag Metadata is C; modify the source IP of the traffic to 172.22.9.101, the source port to 8080, the source Mac address to the public Mac address of the NAPT gateway (the Mac address of IP 172.22.9.101), and the destination Mac address to the gateway Mac address of the public network (the gateway Mac address of the 172.22.9.0 / 24 network segment). The traffic becomes public network traffic in this step.

[0125] 8. After NAPT conversion, the traffic reaches the gateway of the public network and goes to the external network.

[0126] 9. If it is the virtual machine traffic 20.0.0.10:80 of private network B, it can be mapped to 172.22.9.101:7070 of the NATP gateway in the same way, so that the NAPT gateway can provide services for the virtual machines of the multi-tenant network at the same time.

[0127] Figure 6 Schematic diagram of a processing flow of network traffic from a virtual gateway to a virtual machine according to Embodiment 3 of the present invention; specifically, refer to Figure 6 , which mainly includes the following processes:

[0128] 1. Traffic coming from the public network: the destination IP is 172.22.9.101, the destination port is 8080, and the destination Mac address is the public Mac address of the NAPT gateway (the Mac address of IP 172.22.9.101).

[0129] 2. Traffic reaches the bridge.

[0130] 3. OpenFlow rules match traffic with destination IP 172.22.9.101, destination port 8080, and destination Mac address as the public Mac address of the NAPT gateway; change the destination IP to 10.0.0.10, destination port 80, destination Mac address to the virtual machine Mac address (Mac address of IP 10.0.0.10), source Mac address to the private network A gateway Mac address, and change the network tag Metadata of the traffic to A. The traffic changes from public network traffic to private network traffic of the virtual machine.

[0131] 4. The OpenFlow rule matches the traffic whose destination Mac address is the virtual machine Mac address and whose network tag Metadata is A; after the traffic is encapsulated by VXLAN, it is delivered to the computing node where the virtual machine is located through the private network tunnel.

[0132] 5. The private tunnel network transmits traffic to the node where the virtual machine is located.

[0133] 6. The node where the virtual machine is located decapsulates and receives the VXLAN tunnel traffic.

[0134] 7. The OpenFlow rule matches the traffic whose destination Mac address is the virtual machine's Mac address; the traffic is sent to the network card that needs to reach the virtual machine.

[0135] 8. The traffic goes to the network card of the virtual machine and enters the virtual machine.

[0136] Figure 7 Schematic diagram of a processing flow of network traffic from a virtual gateway to a virtual machine on the same computing node according to Embodiment 3 of the present invention; specifically, refer to Figure 7 , which mainly includes the following processes:

[0137] 1. The traffic coming out of the virtual machine network card has a source IP of 10.0.0.11, a source port of 80, and a destination Mac address of the gateway of private network A. The destination IP address and port are the addresses and ports on the public network, indicating that it is communicating with the public network.

[0138] 2. When the traffic reaches the br-int bridge, the OpenFlow rule marks it with a network tag Metadata of A.

[0139] 3. OpenFlow rule matches the traffic with metadata A, source IP 10.0.0.11, source port 80, and destination Mac address Mac address of private network A gateway; modify the traffic source IP to 172.22.9.101, source port 8081, source Mac address to the public network Mac address of the NAPT gateway (Mac address of IP address 172.22.9.101), and destination Mac address to the Mac address of the public network gateway (Mac address of the gateway in the 172.22.9.0 / 24 network segment). The traffic becomes public network traffic in this step.

[0140] 4. After NAPT conversion, the traffic can reach the gateway of the public network and go to the public network.

[0141] It should be noted that Figure 7 The direction of the arrow in the figure represents the flow going to the public network, and in fact, it can also be the reverse direction to the virtual machine. This embodiment will not be described in detail here, and it is not a limitation of this embodiment.

[0142] The solution of the embodiment of the present invention realizes providing NAT service for virtual machines of multiple tenant private networks simultaneously through one NAPT gateway.

[0143] In the technical solution of the embodiment of the present invention, the acquisition, storage and application of user personal information (such as facial information, voice information, etc.) are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0144] Embodiment 4

[0145] Figure 8 1 is a schematic diagram of the structure of a network traffic processing device provided according to Embodiment 3 of the present invention. The device can be applied to a virtual gateway system, the virtual gateway system comprising: at least two computing nodes, each of which is connected to each other for communication, and at least one computing node includes a virtual gateway, the virtual gateway is used to forward the network traffic of other computing nodes or local computing nodes. Figure 8 As shown, the device includes: an attribute information determination module 810, a first processing module 820 and a second processing module 830.

[0146] The attribute information determination module 810 is used to determine each attribute information of the network traffic to be transmitted, and determine whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information;

[0147] A first processing module 820 is configured to, when it is determined that the current computing node does not include the virtual gateway, convert the network traffic to be transmitted into target network traffic matching the virtual gateway according to each of the attribute information and a preset rule, forward the target network traffic to a target computing node to which the virtual gateway belongs through a preset network tunnel, and forward the target network traffic through the virtual gateway;

[0148] The second processing module 830 is used to, when it is determined that the current computing node includes the virtual gateway, convert the network traffic to be transmitted into target network traffic matching the computing node where the target virtual machine is located according to each of the attribute information and preset rules, and forward the target network traffic to the computing node where the target virtual machine is located through the virtual gateway.

[0149] In the solution of this embodiment, the attribute information of the network traffic to be transmitted is determined by the attribute information determination module, and whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway is determined according to the attribute information; when the first processing module determines that the current computing node does not include the virtual gateway, the current computing node converts the network traffic to be transmitted into target network traffic matching the virtual gateway according to the attribute information and preset rules, forwards the target network traffic to the target computing node to which the virtual gateway belongs through a preset network tunnel, and forwards the target network traffic through the virtual gateway; when the second processing module determines that the current computing node includes the virtual gateway, the current computing node converts the network traffic to be transmitted into target network traffic matching the computing node where the target virtual machine is located according to the attribute information and preset rules, and forwards the target network traffic to the computing node where the target virtual machine is located through the virtual gateway. The network traffic can be forwarded and processed in different ways, and the network traffic can be forwarded and processed quickly and accurately.

[0150] In an optional implementation of this embodiment, each of the attribute information of the network traffic to be transmitted includes at least one of the following:

[0151] The IP, source port, destination Mac address and source Mac address of the network traffic to be transmitted.

[0152] In an optional implementation of this embodiment, the attribute information determination module 810 is specifically used to determine the source of the network traffic to be transmitted according to the source IP, source port and source Mac address in each of the attribute information;

[0153] Determining a current computing node to which the network traffic to be transmitted belongs according to a source of the network traffic to be transmitted;

[0154] Determining whether the current computing node includes the virtual gateway according to the configuration information of the virtual gateway system;

[0155] The source of the network traffic to be transmitted includes: a network card matching any virtual machine of any computing node of the virtual gateway system, or a public network.

[0156] In an optional implementation of this embodiment, each of the computing nodes in the virtual gateway system further includes a bridge;

[0157] A first processing module 820, specifically configured for the network bridge in the current computing node to determine the network tag of the network traffic to be transmitted according to each of the attribute information of the network traffic to be transmitted;

[0158] The network traffic to be transmitted is converted into target network traffic matching the virtual gateway based on OpenFlow rules.

[0159] In an optional implementation of this embodiment, the second processing module 830 is specifically configured for the network bridge in the current computing node to determine the network tag of the network traffic to be transmitted according to each of the attribute information of the network traffic to be transmitted;

[0160] The network traffic to be transmitted is converted into target network traffic matching the computing node where the target virtual machine is located based on OpenFlow rules.

[0161] In an optional implementation of this embodiment, the first processing module 820 is further specifically configured to convert the target network traffic into final network traffic matching the destination Mac address of the network traffic to be transmitted based on the OpenFlow rule through the bridge in the target computing node;

[0162] Correspondingly, the second processing module 830 is further specifically used to convert the target network traffic into final network traffic that matches the destination Mac address of the network traffic to be transmitted based on the OpenFlow rule through the computing node where the target virtual machine is located.

[0163] In an optional implementation of this embodiment, the network traffic processing device further includes a third processing module, which is used for the current computing node to convert the network traffic to be transmitted according to each of the attribute information and the preset rule to obtain the target network traffic;

[0164] The target network traffic is forwarded through the virtual gateway.

[0165] The network traffic processing device provided in the embodiment of the present invention can execute the network traffic processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0166] Embodiment 5

[0167] Fig. 9 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present invention described and / or required herein.

[0168] like Fig. 9 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0169] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0170] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for processing network traffic.

[0171] In some embodiments, the method for processing network traffic may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for processing network traffic described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the method for processing network traffic in any other appropriate manner (e.g., by means of firmware).

[0172] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0173] The computer programs for implementing the methods of the embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0174] In the context of an embodiment of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0175] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0176] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0177] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0178] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in the embodiments of the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions of the embodiments of the present invention can be achieved, and this document does not limit this.

[0179] The above specific implementations do not constitute a limitation on the protection scope of the embodiments of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims

1. A method for processing network traffic, applied to a virtual gateway system, the virtual gateway system comprising: At least two computing nodes, each of which is connected to each other for communication, and at least one computing node includes a virtual gateway, and the virtual gateway is used to forward network traffic of other computing nodes or local computing nodes, characterized in that the method includes: Determine each attribute information of the network traffic to be transmitted, and determine whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information; each attribute information of the network traffic to be transmitted includes at least one of the following: the source Internet protocol IP, destination IP, source port, destination port, destination physical Mac address and source Mac address of the network traffic to be transmitted; In the case of determining that the current computing node does not include the virtual gateway, the current computing node converts the network traffic to be transmitted into target network traffic matching the virtual gateway according to each of the attribute information and the preset rule, forwards the target network traffic to the target computing node to which the virtual gateway belongs through a preset network tunnel, and forwards the target network traffic through the virtual gateway; When it is determined that the current computing node includes the virtual gateway, the current computing node converts the network traffic to be transmitted into target network traffic that matches the computing node where the target virtual machine is located according to the attribute information and preset rules, and forwards the target network traffic to the computing node where the target virtual machine is located through the virtual gateway.

2. The method according to claim 1, characterized in that The determining, according to each of the attribute information, whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway comprises: Determine the source of the network traffic to be transmitted according to the source IP, source port and source Mac address in each of the attribute information; Determining a current computing node to which the network traffic to be transmitted belongs according to a source of the network traffic to be transmitted; Determining whether the current computing node includes the virtual gateway according to the configuration information of the virtual gateway system; The source of the network traffic to be transmitted includes: a network card matching any virtual machine of any computing node of the virtual gateway system, or a public network.

3. The method according to claim 1, characterized in that Each of the computing nodes in the virtual gateway system also includes a bridge; The current computing node converts the network traffic to be transmitted into target network traffic matching the virtual gateway according to each of the attribute information and the preset rule, including: The network bridge in the current computing node determines the network tag of the network traffic to be transmitted according to each of the attribute information of the network traffic to be transmitted; The network traffic to be transmitted is converted into target network traffic matching the virtual gateway based on OpenFlow rules.

4. The method according to claim 3, characterized in that The current computing node converts the network traffic to be transmitted into target network traffic matching the target virtual machine according to each of the attribute information and the preset rule, including: The network bridge in the current computing node determines the network tag of the network traffic to be transmitted according to each of the attribute information of the network traffic to be transmitted; The network traffic to be transmitted is converted into target network traffic matching the computing node where the target virtual machine is located based on OpenFlow rules.

5. The method according to claim 3, characterized in that: Before forwarding the target network traffic through the virtual gateway, the method further includes: The target network traffic is converted into final network traffic matching the destination Mac address of the network traffic to be transmitted based on the OpenFlow rule by a bridge in the target computing node; Correspondingly, after forwarding the target network traffic to the computing node where the target virtual machine is located through the virtual gateway, it also includes: The target network traffic is converted into final network traffic matching the destination Mac address of the network traffic to be transmitted based on the OpenFlow rule by the computing node where the target virtual machine is located.

6. The method according to claim 1, characterized in that After determining that the current computing node includes the virtual gateway, the method further includes: The current computing node converts the network traffic to be transmitted according to each of the attribute information and preset rules to obtain the target network traffic; The target network traffic is forwarded through the virtual gateway.

7. A network traffic processing device, applied to a virtual gateway system, the virtual gateway system comprising: At least two computing nodes, each of which is connected to each other for communication, and at least one computing node includes a virtual gateway, and the virtual gateway is used to forward network traffic of other computing nodes or local computing nodes, characterized in that the device includes: An attribute information determination module is used to determine each attribute information of the network traffic to be transmitted, and determine whether the current computing node to which the network traffic to be transmitted belongs includes the virtual gateway according to each attribute information; each attribute information of the network traffic to be transmitted includes at least one of the following: the source Internet protocol IP, destination IP, source port, destination port, destination physical Mac address and source Mac address of the network traffic to be transmitted; A first processing module, configured to, when it is determined that the current computing node does not include the virtual gateway, convert the network traffic to be transmitted into target network traffic matching the virtual gateway according to each of the attribute information and a preset rule, forward the target network traffic to a target computing node to which the virtual gateway belongs through a preset network tunnel, and forward the target network traffic through the virtual gateway; The second processing module is used to, when it is determined that the current computing node includes the virtual gateway, convert the network traffic to be transmitted into target network traffic that matches the computing node where the target virtual machine is located according to each of the attribute information and preset rules, and forward the target network traffic to the computing node where the target virtual machine is located through the virtual gateway.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the network traffic processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the network traffic processing method according to any one of claims 1 to 6 when executed.

Citation Information

Patent Citations

  • Method and system for scheduling network resources based on virtual machine migration

    CN102929715A

  • Data processing method and device, equipment and storage medium

    CN113300985A

Cited By

  • Communication apparatus, communication system, communication method, and program

    US20250158930A1