An intelligent network card, cloud server and traffic forwarding method
By using a symmetric hash module and a data stream forwarding queue in the smart network interface card, the data stream of the same session is processed centrally, which solves the performance loss problem caused by locking and inter-core communication in the virtual switch and improves the performance of the network virtualization component.
Patent Information
- Application Number
- CN202310299632.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-03-20
AI Technical Summary
In existing technologies, virtual switches suffer from performance loss due to locking and system resource waste caused by inter-core communication when handling network traffic between virtual machines, especially in scenarios using smart network interface cards.
By employing the symmetric hash module and data stream forwarding queue in the smart network interface card, the forward and reverse data streams of the same session are sent to the corresponding data stream forwarding queues through symmetric hash operations, and are processed by a single software CPU, avoiding cross-CPU processing and inter-core communication.
It enables lock-free session creation and deletion, improves the performance of network virtualization components, avoids waste of system resources, and ensures correct data flow forwarding.
Smart Images

Figure CN116455836B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network technology, and in particular to a smart network interface card, a cloud server, and a method for traffic forwarding. Background Technology
[0002] A virtual switch (vswitch) is a software-implemented virtual switch used to forward traffic between virtual machines (VMs). It is a core component for network virtualization of virtual machines in the cloud and is responsible for forwarding network traffic between VMs.
[0003] Reference Figure 1 The diagram shown illustrates the data flow forwarding process. On one hand, vswitch needs to forward the data traffic from the virtual machine's virtual network card queue to the physical network card according to the forwarding rules. On the other hand, it needs to receive data traffic from the physical network card and then send it from the virtual machine's virtual network card to the virtual machine.
[0004] To improve forwarding performance, a common approach is to bind each CPU in the vswitch process to a corresponding virtual network interface card (NIC) and physical NIC queue, with each CPU handling only specific NIC and physical NIC queues. However, this mechanism can lead to different CPUs processing the same data flow (i.e., a flow with identical source and destination ports, source and destination IPs, and protocol number 5-tuples) for both forward and reverse packets. This results in different CPUs needing to share the same session information. Consequently, session creation and deletion inevitably require locking to prevent concurrency, leading to performance penalties.
[0005] To address the performance penalty caused by locking, some current implementations restrict session processing to a single CPU. The process flow forwarding can be found in [reference needed]. Figure 2 As shown, after each flow arrives at the CPU corresponding to the queue from the corresponding queue, the CPU forwards it to the selected CPU to process the session through inter-core communication. The reverse data flow is similarly forwarded to the selected CPU for processing through inter-core communication. In this way, it can be ensured that both forward and reverse data flows are processed on a single CPU, which solves the performance loss problem caused by locking. However, inter-core communication also consumes system resources and reduces overall performance.
[0006] With the development of cloud computing, cloud vendors provide computing virtualization, network virtualization, and storage virtualization for cloud hosts (virtual machines), resulting in increasingly higher overhead. To address the various problems caused by these virtualization overheads, cloud vendors have generally adopted smart network interface card (NIC) solutions. This contrasts with scenarios using non-smart NICs (such as those mentioned above). Figure 1 and Figure 2Similar to the situation in the case of using smart network cards, there is also the problem of locking to reduce system resources or causing system resource consumption due to inter-core communication. Summary of the Invention
[0007] In view of the above problems, the present invention is proposed to provide a smart network interface card, cloud server and traffic forwarding method that overcomes or at least partially solves the above problems.
[0008] In a first aspect, embodiments of the present invention provide a smart network interface card (NIC), comprising: a network virtualization component and a physical NIC, a symmetric hash module and multiple sets of data stream forwarding queues connected to the symmetric hash module; the network virtualization component has multiple software CPUs running on its side;
[0009] The data stream forwarding queue is configured to correspond to a single software CPU;
[0010] The symmetric hash module is used to communicate with the physical network card and the virtual machine respectively. It performs symmetric hash operations on the five-tuple information of the forward data stream sent by the virtual machine and the five-tuple information of the reverse data stream sent by the physical network card. Based on the symmetric hash operation result, the forward data stream and the reverse data stream belonging to the same session are sent to the data stream forwarding queue corresponding to the symmetric hash operation result, so that the forward data stream and the reverse data stream belonging to the same session are forwarded by the software CPU corresponding to the data stream forwarding queue.
[0011] In one embodiment, each data stream forwarding queue includes: a first forwarding queue and a second forwarding queue; wherein:
[0012] The symmetric hash module is specifically used to perform a symmetric hash operation on the five-tuple information of the forward data stream, and send the forward data stream to the first forwarding queue corresponding to the hash value based on the hash value obtained by the symmetric hash operation; and to perform a symmetric hash operation on the five-tuple information of the reverse data stream, and send the reverse data stream to the second forwarding queue corresponding to the hash value based on the hash value obtained by the symmetric hash operation.
[0013] In one embodiment, the network virtualization component is further configured to forward the forwarding data stream to a second forwarding queue via the software CPU corresponding to the first forwarding queue, so that the physical network interface card connected to the second forwarding queue can obtain the forwarding data stream from the second forwarding queue and send it outward.
[0014] In one embodiment, the network virtualization component is further configured to forward the reverse data stream to the first forwarding queue via the software CPU corresponding to the second forwarding queue, so that the virtual network interface card of the virtual machine connected to the second forwarding queue can obtain the reverse data stream from the first forwarding queue and send it to the virtual machine.
[0015] In one embodiment, the smart network interface card (NIC) further includes: a virtual NIC queue and a physical NIC queue;
[0016] The symmetric hash module is specifically used to obtain the forward data stream sent by the virtual machine from the virtual network card queue, and to obtain the reverse data stream sent by the physical network card from the physical network card queue.
[0017] In one embodiment, the symmetric hash module is implemented via a hardware module on a smart network interface card.
[0018] In one embodiment, the data stream forwarding queue is a hardware forwarding queue, which is connected to the symmetric hash module via a hardware path.
[0019] Secondly, embodiments of the present invention provide a cloud server, at least one virtual machine running on the cloud server; and a smart network interface card as described above that is communicatively connected to the at least one virtual machine;
[0020] The smart network card is communicatively connected to the at least one virtual machine.
[0021] Thirdly, embodiments of the present invention provide a method for traffic forwarding using a smart network interface card as described above, comprising:
[0022] Perform symmetric hash operations on the forward data stream sent by the virtual machine and the reverse data stream sent by the physical network card respectively;
[0023] Based on the result of the symmetric hash operation, the forward and reverse data streams belonging to the same session are sent to the data stream forwarding queue corresponding to the result of the symmetric hash operation, so that the forward and reverse data streams belonging to the same session are forwarded by the software CPU corresponding to the data stream forwarding queue.
[0024] In one embodiment, sending forward and reverse data streams belonging to the same session to the data stream forwarding queue corresponding to the symmetric hash operation result, based on the symmetric hash operation result, includes:
[0025] A symmetric hash operation is performed on the five-tuple information of the forward data stream, and the forward data stream is sent to the first forwarding queue corresponding to the hash value obtained from the symmetric hash operation; and a symmetric hash operation is performed on the five-tuple information of the reverse data stream, and the reverse data stream is sent to the second forwarding queue corresponding to the hash value obtained from the symmetric hash operation.
[0026] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:
[0027] In this embodiment of the invention, forward data streams from the virtual machine or reverse data streams from the physical network card first enter the symmetric hash module for symmetric hashing, and then enter the corresponding data stream forwarding queue according to the hash value. Since the data stream forwarding queue has a unique correspondence with the software CPU on the vswitch side, on the one hand, forward and reverse data streams belonging to the same session processed by the symmetric hash module will be sent to the same set of data stream forwarding queues according to the hash result of the symmetric hash. The same session will not be processed across CPUs, which can realize the lock-free creation and deletion of sessions, greatly improve the performance of new connection creation of network virtualization components, and can effectively solve the system performance loss problem caused by locking in the existing technology. On the other hand, since the symmetric hash module processes the data first, and then the forward or reverse data stream is handed over to the software CPU for processing, the system overhead problem caused by inter-core communication can be avoided while ensuring correct forwarding.
[0028] Furthermore, the aforementioned symmetric hash module and data stream forwarding queue are implemented in hardware rather than software. On the one hand, hardware forwarding has higher reliability; on the other hand, the hardware implementation can also avoid the problem of system performance degradation caused by CPU resource consumption.
[0029] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.
[0030] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0031] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0032] Figure 1 , 2 and Figure 3 This is a schematic diagram illustrating an example of traffic forwarding in existing technologies.
[0033] Figure 4 and 5 This is a schematic diagram of a common architecture for smart network interface cards (NICs).
[0034] Figure 6 This is a schematic diagram of the structure of the smart network card in an embodiment of the present invention;
[0035] Figure 7 This is a schematic diagram illustrating an example of traffic forwarding performed by a smart network interface card in an embodiment of the present invention;
[0036] Figure 8 This is a schematic diagram of the cloud server structure in an embodiment of the present invention;
[0037] Figure 9 This is a flowchart illustrating a method for traffic forwarding using a smart network interface card provided in an embodiment of the present invention. Detailed Implementation
[0038] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0039] To facilitate understanding, before discussing the prior art and the embodiments of the present invention, a brief explanation of several technical terms involved will be provided first:
[0040] Host: The physical server.
[0041] Virtual Machine (VM): A virtual server created on a physical server using virtualization technology.
[0042] Smart NiC / DPU: A hardware-programmable network card that can offload some operations performed by the host from the CPU, such as traffic forwarding and network processing, to the network card hardware.
[0043] Virtual switch (vswitch): A virtual switch implemented in software used to forward traffic between VMs.
[0044] Data flow: A data flow in which the five-tuples (source and destination ports, source and destination IPs, and protocol number) are identical;
[0045] A session consists of two flows, one forward and one reverse, storing data flow information from the client to the server and from the server's response to the client.
[0046] Symmetric hash: A hash algorithm that produces the same hash result as the original 5-tuple when the 5-tuple (i.e., source and destination ports, source and destination IPs, and protocol number) is reversed.
[0047] Hardware offload: This involves handing over some operations performed by the CPU to the network card hardware.
[0048] DPDK: A Data Plane Development Kit (DPDK) is a collection of function libraries and drivers for fast packet processing, which can greatly improve data processing performance and throughput, and increase the efficiency of data plane applications.
[0049] The inventors of this invention discovered that, in the prior art, a virtual switch is typically a process on a host machine (e.g., a physical server) responsible for forwarding network traffic between virtual machines, for example... Figure 1 While the vswitch in the context of network traffic forwarding is mentioned earlier, as well as other related technical solutions, there are usually issues such as locking to reduce system resources or system resource consumption caused by inter-core communication.
[0050] To facilitate understanding of the technical solutions of the embodiments of the present invention, we will first explain and describe several existing schemes for using virtual switches to manage network traffic and the problems they present.
[0051] Reference Figure 1 As shown, vswitch needs to forward traffic from the virtual machine's virtual network interface card (VNIC) queue to the physical network interface card (NIC) according to forwarding rules. Simultaneously, it needs to receive traffic from the physical NIC and then forward it from the virtual machine's VNIC. To improve forwarding performance, each CPU in the vswitch process is typically bound to a corresponding virtual and physical NIC queue, with each CPU handling only specific virtual and physical NIC queues. However, this mechanism can lead to the same data flow from the virtual machine (VM) (i.e., a flow with the same source, destination port, source, destination IP, and protocol number 5-tuple) having its forward and reverse packets processed by different CPUs. Figure 1Using the dashed line as an example, when the VM sends data, the queue from which the data stream originates is determined by the VM's internal processes and kernel. Let's assume the first queue is selected. The response data stream generated by this data stream enters from the physical network interface card (NIC). The specific NIC queue it enters from is determined by the NIC's RSS (Receive Side Scaling) hash policy; let's assume it enters from queue three. This results in different CPUs needing to share the same session information. Consequently, session creation and deletion inevitably require locking to prevent concurrency, but this also leads to performance degradation.
[0052] To address the performance issues caused by locks, refer to... Figure 2 As shown, some current implementations restrict sessions to each CPU, meaning each CPU has its own session information, such as... Figure 2 As shown, after each flow arrives at its corresponding CPU from the appropriate queue, a symmetric hash is first calculated. Based on the calculated hash value, a CPU is selected, and the data flow is directed to the selected CPU via inter-core communication. Then, session information is created on the corresponding CPU. Since the reverse flow performs a symmetric hash regardless of which queue it enters from, it is processed on the same CPU as the forward flow, thus retrieving the corresponding session information. This scheme concentrates the processing of both forward and reverse flows on a single CPU, solving the locking problem, but inter-core communication still incurs some overhead.
[0053] With the development of Smart NiC / DPU technology, virtualization-related components such as network virtualization, compute virtualization, and storage virtualization have been integrated into the Smart NiC. The structure of a typical Smart NiC can be found by referring to... Figure 4 and Figure 5 As shown, smart network interface cards (NICs) can realize network virtualization, computing virtualization, and storage virtualization.
[0054] Smart network interface cards (NICs) typically consist of two parts: a software CPU and a hardware component. The CPU runs network virtualization components (such as vswitch) as well as storage and computing virtualization components. The hardware component is usually implemented using a programmable logic device (FPGA, Field Programmable Gate Array) or an application-specific integrated circuit (ASIC) or a network processor (NP) to accelerate or offload the relevant component logic from the software CPU.
[0055] For a typical application in network virtualization, vswitch, regardless of the implementation, CPU involvement is always required for forwarding. To improve the forwarding performance of the CPU, current technologies typically employ a user-space implementation based on DPDK, using a polling method to send and receive packets from the network interface card queue.
[0056] like Figure 3 As shown, the virtual network interface card (NIC) of the virtual machine on the host machine passes packets to the smart NIC through multiple hardware queues. The vswitch process on the smart NIC collects packets from each queue sequentially using polling and then sends them out from the MAC queue of the physical NIC. However, similar to the scenario under non-smart NICs, the two flows of a session are still processed on different CPUs, causing the creation and deletion of sessions to require locking or inter-core communication overhead.
[0057] To address the aforementioned problems in the prior art, embodiments of the present invention provide a smart network interface card (NIC), referring to... Figure 6 As shown, the smart network interface card includes: a network virtualization component and a physical network interface card, a symmetric hash module and multiple sets of data stream forwarding queues connected to the symmetric hash module; multiple software CPUs run on the network virtualization component side;
[0058] Each data stream forwarding queue is configured to correspond to a unique software CPU;
[0059] The symmetric hash module is used to communicate with the physical network card and the virtual machine respectively. It performs symmetric hash operations on the forward data stream sent by the virtual machine and the reverse data stream sent by the physical network card. Based on the symmetric hash operation results, the forward and reverse data streams belonging to the same session are sent to the data stream forwarding queue corresponding to the symmetric hash operation results, so that the forward and reverse data streams belonging to the same session are forwarded by the software CPU corresponding to the data stream forwarding queue.
[0060] In this embodiment of the invention, no single data stream forwarding queue can correspond to multiple software CPUs, but one CPU can correspond to multiple different data stream forwarding queues. Specifically, each data stream forwarding queue is set to correspond to a unique software CPU, which can include various scenarios:
[0061] 1. The data stream forwarding queue and the software CPU are set to have a one-to-one correspondence;
[0062] 2. Situations where two or more data stream forwarding queues correspond to the same CPU;
[0063] 3. A mixed situation where both Situation 1 and Situation 2 exist simultaneously.
[0064] The network virtual component in the aforementioned smart network card can be, for example, a virtual switch (vswitch). The network virtual component runs multiple software CPUs (vswitch CPUs). The number of multiple data flow forwarding queues can be set according to actual needs. For example, it can be preset to be consistent with the number of vswitch CPUs, and there is a unique binding relationship.
[0065] The smart network card has multiple software CPUs, and vswitch only uses a portion of them. In this embodiment of the invention, the resources of this portion of the software CPU are referred to as the vswitch CPU.
[0066] For ease of explanation, in this embodiment of the invention, the data stream sent out by the virtual machine on the host is called the forward data stream, and the data stream returned to the virtual machine is called the reverse data stream. Forward and reverse simply indicate the relative direction of the data stream and do not constitute a limitation on their meaning.
[0067] Compared with existing technologies (e.g.) Figure 2 or Figure 3 Unlike traditional methods where each flow arrives at the CPU from the corresponding queue of the virtual network interface card (NIC) and undergoes symmetric hashing before being transferred to the CPU selected by the hash value, in this embodiment of the invention, flows coming from the virtual machine (e.g., from the virtual NIC) or entering from the physical NIC directly enter the symmetric hashing module for symmetric hashing, and then enter the corresponding data flow forwarding queue according to the hash value. Since a set of data flow forwarding queues corresponds to a unique vswitch-side software CPU, on the one hand, forward and reverse data flows belonging to the same session, processed by the symmetric hashing module, will be sent to the same set of data flow forwarding queues according to the hash result of the symmetric hash, and then processed by the same software CPU. This can effectively solve the system performance loss problem caused by locking. On the other hand, since the symmetric hashing module processes the data flow first, and then the forward or reverse data flow is transferred to the software CPU for processing, the system overhead problem caused by inter-core communication can be avoided while ensuring correct forwarding.
[0068] In one embodiment, the aforementioned symmetric hash module can be implemented, for example, through a hardware module on a smart network interface card (NIC). This could be implemented as a module on hardware such as an FPGA, ASIC, or NP of the smart NIC.
[0069] In one embodiment, the data stream forwarding queue is a hardware forwarding queue that communicates with the symmetric hash module via a hardware path.
[0070] The symmetric hash module and data stream forwarding queue are implemented in hardware modules rather than software. On the one hand, hardware forwarding has higher reliability, and on the other hand, the hardware implementation can also avoid the system performance degradation caused by the occupation of CPU resources.
[0071] In one embodiment, the above-mentioned smart network interface card (NIC) refers to Figure 6 As shown, each data stream forwarding queue includes: a first forwarding queue and a second forwarding queue;
[0072] Correspondingly, the aforementioned symmetric hash module is specifically used to perform symmetric hash operation on the five-tuple information of the forward data stream, and send the forward data stream to the first forwarding queue corresponding to the hash value based on the hash value obtained from the symmetric hash operation; and to perform symmetric hash operation on the five-tuple information of the reverse data stream, and send the reverse data stream to the second forwarding queue corresponding to the hash value based on the hash value obtained from the symmetric hash operation.
[0073] Symmetric hash calculation can ensure that the hash values calculated from data streams in a 5-tuple where the sender and receiver information are exactly opposite remain consistent. The specific process of symmetric hash calculation will not be elaborated here.
[0074] In this embodiment of the invention, the first forwarding queue is as follows: Figure 6 As shown in the white box, the second forwarding queue is as follows: Figure 6 As shown in the gray box, a first forwarding queue and a second forwarding queue can form a set of data stream forwarding queues, such as... Figure 6 As shown, there can be multiple groups, the number of which is the same as the number of software CPUs on the vswitch side, and each group of data stream forwarding queues is bound to a software CPU in a pre-binding manner.
[0075] Furthermore, the aforementioned network virtualization component is further used to forward the forwarding data stream to the second forwarding queue through the software CPU corresponding to the first forwarding queue, so that the physical network card connected to the second forwarding queue can obtain the forwarding data stream from the second forwarding queue and send it outward.
[0076] When the software CPU forwards the forward data stream, since the final destination of the forward data stream may be another host machine, it needs to be forwarded to the second forwarding queue. At this time, it no longer goes through the symmetric hash module, but is directly obtained by the physical network card from the second queue and continues to be sent out.
[0077] Furthermore, the aforementioned network virtualization component is further used to forward the reverse data stream to the first forwarding queue through the software CPU corresponding to the second forwarding queue, so that the virtual network card of the virtual machine connected to the second forwarding queue can obtain the reverse data stream from the first forwarding queue and send it to the virtual machine.
[0078] For the reverse data stream, since its final destination is the VM, it needs to be forwarded by the software CPU to the first forwarding queue, so that the virtual network interface card can obtain the reverse data stream from the first forwarding queue and send it to the virtual machine. At this point, no further processing by the symmetric hash module is required.
[0079] In one embodiment, the above-mentioned smart network interface card, referring to Figure 6 As shown, it may also include: virtual network interface card queues and physical network interface card queues;
[0080] The aforementioned symmetric hash module is specifically used to obtain the forward data stream sent by the virtual machine from the virtual network card queue, and to obtain the reverse data stream sent by the physical network card from the physical network card queue.
[0081] The structure and operation of the smart network card provided in the embodiments of the present invention are illustrated using a practical example of network communication.
[0082] Reference Figure 7 As shown, the physical server (Host) has VM1 and VM2. VM1 and VM2 are connected to the symmetric hash module of the smart network card through virtual network card queues. The symmetric hash module connects two types of queues: one is the aggregation queue, and the other is the queue from the physical network card after symmetric hash operation. All virtual network card queues on the VM side no longer correspond one-to-one with the queues on the smart network card CPU side, but are connected to the symmetric hash module. The forward data stream from the VM virtual network card queue is processed by the symmetric hash module and then sent to the CPU on the smart network card side from different aggregation queues according to the obtained hash value.
[0083] The reverse data stream from the physical network card is also directly connected to the symmetric hash module. By performing symmetric hash calculation on the five-tuple information in the packet information, it is sent to different CPU-side queues according to the hash value. The number of CPU-side queues is the same as the number of CPUs used by vswitch.
[0084] In this way, each CPU on the vswitch side takes over the processing of two queues: one is the aggregation queue from the VM direction, and the other is the queue from the physical network card after hashing.
[0085] Since two flows in the same session will have the same hash value after symmetric hashing, regardless of whether it is the VM sending direction or the physical network card receiving direction (VM receiving direction), they will be assigned to the same group of queues (one aggregation queue and one physical network card side queue constitute a group) for processing.
[0086] For example, Figure 7As shown by the dashed line, the forward data stream sent from VM1 undergoes symmetric hash calculation by the symmetric hash module. Based on the hash value, it is sent to the aggregation queue 1, and then reaches CPU2 on the vswitch side. After processing by CPU2, it reaches the physical network card via queue 1' (which is in the same group as aggregation queue 1), and is then sent out by the physical network card.
[0087] For a reverse data stream belonging to the same session, whose source and destination ports and source and destination IPs are exactly opposite to the aforementioned forward data stream, after being received by the physical network card, it is sent to queue 1' through the symmetric hash module and is also processed by CPU1 on the queue 1' side. Then, it is forwarded by CPU2 to the aggregation queue 1 so that the reverse data stream can eventually reach VM1.
[0088] During the data flow forwarding process described above, since a group of queues is processed by the same CPU, i.e., CPU2, the inbound and outbound directions are processed on the same vswitch CPU. This ensures that the same session will not be processed across CPUs, enabling lock-free session creation and deletion, and greatly improving the performance of creating new connections in vswitch.
[0089] This invention also provides a cloud server, see below. Figure 8 As shown, at least one virtual machine running on the cloud server; and a smart network interface card as described above that is communicatively connected to the at least one virtual machine;
[0090] The smart network interface card (NIC) communicates with at least one virtual machine.
[0091] Based on the same inventive concept, this embodiment of the invention also provides a method for traffic forwarding using the aforementioned smart network card. Since the principle of solving the problem by these methods is similar to that of the aforementioned device, the implementation of this method can refer to the implementation of the aforementioned smart network card, and the repeated parts will not be described again.
[0092] This invention provides a method for traffic forwarding using a smart network interface card as described in the foregoing embodiments, referring to... Figure 9 As shown, it includes:
[0093] S91. Perform symmetric hash operations on the forward data stream sent by the virtual machine and the reverse data stream sent by the physical network card respectively;
[0094] S92. Based on the result of the symmetric hash operation, the forward data stream and the reverse data stream belonging to the same session are sent to the data stream forwarding queue corresponding to the result of the symmetric hash operation, so that the forward data stream and the reverse data stream belonging to the same session are forwarded by the software CPU corresponding to the data stream forwarding queue.
[0095] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0096] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0097] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0098] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0099] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A smart network interface card (NIC), comprising: A network virtualization component and a physical network interface card (NIC), characterized in that it further includes: a symmetric hash module and multiple sets of data flow forwarding queues connected to the symmetric hash module; multiple software CPUs run on the network virtualization component side; the data flow forwarding queues are configured to correspond to a single software CPU; The symmetric hash module is implemented through a hardware module on the smart network card. It is used to communicate with the physical network card and the virtual machine respectively. It performs symmetric hash operations on the five-tuple information of the forward data stream sent by the virtual machine and the five-tuple information of the reverse data stream sent by the physical network card. Based on the symmetric hash operation result, the forward data stream and the reverse data stream belonging to the same session are sent to the data stream forwarding queue corresponding to the symmetric hash operation result, so that the forward data stream and the reverse data stream belonging to the same session are forwarded by the software CPU corresponding to the data stream forwarding queue. The data stream forwarding queue is a hardware forwarding queue, which communicates with the symmetric hash module through a hardware path.
2. The smart network interface card as described in claim 1, characterized in that, Each data stream forwarding queue includes: a first forwarding queue and a second forwarding queue; wherein: The symmetric hash module is specifically used to perform a symmetric hash operation on the five-tuple information of the forward data stream, and send the forward data stream to the first forwarding queue corresponding to the hash value based on the hash value obtained by the symmetric hash operation; and to perform a symmetric hash operation on the five-tuple information of the reverse data stream, and send the reverse data stream to the second forwarding queue corresponding to the hash value based on the hash value obtained by the symmetric hash operation.
3. The smart network interface card as described in claim 2, characterized in that, The network virtualization component is further configured to forward the forwarding data stream to the second forwarding queue via the software CPU corresponding to the first forwarding queue, so that the physical network card connected to the second forwarding queue can obtain the forwarding data stream from the second forwarding queue and send it outward.
4. The smart network interface card as described in claim 2, characterized in that, The network virtualization component is further configured to forward the reverse data stream to the first forwarding queue via the software CPU corresponding to the second forwarding queue, so that the virtual network card of the virtual machine connected to the second forwarding queue can obtain the reverse data stream from the first forwarding queue and send it to the virtual machine.
5. The smart network interface card as described in claim 2, characterized in that, Also includes: Virtual network interface card (NIC) queues and physical NIC queues; The symmetric hash module is specifically used to obtain the forward data stream sent by the virtual machine from the virtual network card queue, and to obtain the reverse data stream sent by the physical network card from the physical network card queue.
6. A cloud server, characterized in that, At least one virtual machine running on the cloud server; and a smart network interface card as described in any one of claims 1-5 that is communicatively connected to the at least one virtual machine; The smart network card is communicatively connected to the at least one virtual machine.
7. A method for traffic forwarding using a smart network interface card as described in any one of claims 1-5, characterized in that, include: Perform symmetric hash operations on the forward data stream sent by the virtual machine and the reverse data stream sent by the physical network card respectively; Based on the result of the symmetric hash operation, the forward and reverse data streams belonging to the same session are sent to the data stream forwarding queue corresponding to the result of the symmetric hash operation, so that the forward and reverse data streams belonging to the same session are forwarded by the software CPU corresponding to the data stream forwarding queue.
8. The method as described in claim 7, characterized in that, The step of sending forward and reverse data streams belonging to the same session to the data stream forwarding queue corresponding to the symmetric hash operation result, based on the symmetric hash operation result, includes: A symmetric hash operation is performed on the five-tuple information of the forward data stream, and the forward data stream is sent to the first forwarding queue corresponding to the hash value obtained from the symmetric hash operation; and a symmetric hash operation is performed on the five-tuple information of the reverse data stream, and the reverse data stream is sent to the second forwarding queue corresponding to the hash value obtained from the symmetric hash operation.
Citation Information
Patent Citations
Access capability network element high-speed data processing method based on DPDK under NFV architecture
CN113553137A