CN116132369A - Flow distribution method of multiple network ports in cloud gateway server and related equipment - Google Patents

Flow distribution method of multiple network ports in cloud gateway server and related equipment Download PDF

Info

Publication number
CN116132369A
CN116132369A CN202310123824.7A CN202310123824A CN116132369A CN 116132369 A CN116132369 A CN 116132369A CN 202310123824 A CN202310123824 A CN 202310123824A CN 116132369 A CN116132369 A CN 116132369A
Authority
CN
China
Prior art keywords
target
packet receiving
traffic
queue
network traffic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310123824.7A
Other languages
Chinese (zh)
Inventor
黄察夫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Greenet Information Service Co Ltd
Original Assignee
Wuhan Greenet Information Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Greenet Information Service Co Ltd filed Critical Wuhan Greenet Information Service Co Ltd
Priority to CN202310123824.7A priority Critical patent/CN116132369A/en
Publication of CN116132369A publication Critical patent/CN116132369A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/622Queue service order
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The application provides a traffic distribution method of multiple network ports in a cloud gateway server and related equipment, wherein each packet receiving buffer zone is provided with a packet receiving queue, the total number of the multiple packet receiving buffer zones is matched with the total number of multiple processor cores, and the method comprises the following steps: obtaining target network traffic received by any network port; determining a target queue to which target network traffic is allocated from a plurality of packet receiving queues; the target network traffic is buffered to a target queue for processing by a processor core associated with the target queue. According to the method and the device, the packet receiving queues are arranged in each packet receiving buffer area, the total number of the packet receiving buffer areas is matched with the total number of the processor cores, so that when the target network traffic of any network port is obtained, the target queues can be directly determined in the packet receiving queues, the large increase of the total number of the packet receiving queues caused by the arrangement of the packet receiving buffer areas for each network port is avoided, and the memory occupation of the packet receiving queues is reduced.

Description

Flow distribution method of multiple network ports in cloud gateway server and related equipment
Technical Field
The application relates to the technical field of cloud gateways, in particular to a flow distribution method of multiple network ports in a cloud gateway server and related equipment.
Background
The cloud gateway is a device for efficiently forwarding network traffic, and a multi-core server is generally adopted. In the cloud gateway server, network traffic received by the network card is distributed to a packet collecting queue for buffering, so that a plurality of CPU cores in the cloud gateway server process the network traffic in parallel. In the flow distribution process, the bidirectional flow requiring the same network connection is distributed to the same packet receiving queue, so that the normal and efficient forwarding of the network flow in the cloud gateway can be effectively ensured.
At present, a packet receiving buffer area is generally set for each network port in the network card, and a plurality of packet receiving queues are set in the packet receiving buffer area of each network port and are in proportional relation with the number of CPU core threads. For example, 2 network ports and 16 CPU core threads are provided, and then 2 packet receiving buffer areas are provided, each packet receiving buffer area is provided with 16 queues, and each thread is responsible for processing the corresponding packet receiving queues, for example, the thread of the CPU1 core processes the Q1 queue in the packet receiving buffer area of the network port eth1 and the Q1 queue in the packet receiving buffer area of the network port eth 2. The bidirectional traffic of the same network connection can be distributed to the same numbered packet receiving queue (such as the queue numbered Q1) by using the load balancing of the RSS (Receive Side Scaling) rule of the network card.
When the packet receiving queues are set according to the number of network ports and the number of CPU core threads, as the number of network ports increases, the total number of the packet receiving queues in the cloud gateway increases greatly, for example, there are 8 network ports and 32 CPU core threads, and then the total number of the packet receiving queues in the cloud gateway is 8×32=256, which results in excessive memory resources occupied by the packet receiving queues.
It can be seen that the existing traffic distribution method has the technical problem of excessive memory resource occupation.
Disclosure of Invention
The application provides a flow distribution method of multiple network ports in a cloud gateway server and related equipment, aiming at reducing memory occupation of a packet receiving queue.
In one aspect, the present application provides a traffic distribution method for multiple interfaces in a cloud gateway server, where the cloud gateway server includes a processor, multiple packet receiving buffers and a network card, the processor includes multiple processor cores, each packet receiving buffer is provided with a packet receiving queue, the total number of the multiple packet receiving buffers is matched with the total number of the multiple processor cores, and the network card includes multiple interfaces, where the method includes:
obtaining target network traffic received by any network port;
determining a target queue to which the target network traffic is allocated from a plurality of packet receiving queues;
and caching the target network traffic to the target queue for the processor core associated with the target queue to process the target network traffic.
In some embodiments, the total number of the packet-receiving buffers is equal to the total number of the plurality of the processor cores, and the plurality of the packet-receiving queues are associated with the plurality of the processor cores one by one.
In some embodiments, the determining, among the plurality of packet receiving queues, a target queue to which the target network traffic should be allocated includes:
determining a hash value corresponding to the target network flow by adopting a hash algorithm;
determining a target redirection value of the hash value in a preset redirection table, wherein the redirection table comprises redirection values of a plurality of preset hash values;
and among the plurality of packet receiving queues, determining the packet receiving queue numbered as the target redirection value as a target queue to which the target network traffic is allocated.
In some embodiments, the determining, by using a hash algorithm, a hash value corresponding to the target network traffic includes:
if the target network traffic is the network traffic without tunnel encapsulation, acquiring a QinQ label and an IP header in the target network traffic;
and carrying out hash processing on the QinQ label and the IP header to obtain a hash value corresponding to the target network flow.
In some embodiments, the determining, by using a hash algorithm, a hash value corresponding to the target network traffic includes:
if the target network traffic is the network traffic packaged by the tunnel, acquiring a QinQ label and an inner layer IP header in the target network traffic;
and carrying out hash processing on the QinQ label and the inner layer IP header to obtain a hash value corresponding to the target network flow.
In some embodiments, the hash process is a symmetric hash process.
In some embodiments, the caching the target network traffic to the target queue includes:
and caching the target network traffic to the target queue by using a direct memory access engine.
On the other hand, the application provides a cloud gateway server, including treater, a plurality of receipts package buffer memory district and network card in the cloud gateway server, include a plurality of processor cores in the treater, every be provided with in the receipts package buffer memory district and receive packet queue, a plurality of the total number of receipts package buffer memory district and a plurality of the total number phase-match of processor core, include a plurality of net gapes in the network card, cloud gateway server still includes:
the acquisition module is used for acquiring the target network flow received by any network port;
the determining module is used for determining a target queue to which the target network flow is allocated from a plurality of packet receiving queues;
and the distribution module is used for caching the target network traffic to the target queue so as to enable the processor core associated with the target queue to process the target network traffic.
In another aspect, the present application also provides a computer device, including:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the method of traffic distribution for multiple portals in the cloud gateway server.
In another aspect, the present application further provides a computer readable storage medium, on which a computer program is stored, where the computer program is loaded by a processor to execute the steps in the method for distributing traffic of multiple ports in the cloud gateway server.
According to the traffic distribution method of the multiple network ports in the cloud gateway server and the related equipment, the cloud gateway server comprises a processor, a plurality of packet receiving buffer areas and a network card, the processor comprises a plurality of processor cores, a packet receiving queue is arranged in each packet receiving buffer area, the total number of the plurality of packet receiving buffer areas is matched with the total number of the plurality of processor cores, and the network card comprises the multiple network ports, and the method comprises the following steps: obtaining target network traffic received by any network port; determining a target queue to which target network traffic is allocated from a plurality of packet receiving queues; the target network traffic is buffered to a target queue for processing by a processor core associated with the target queue. According to the method and the device, the packet receiving queues are arranged in each packet receiving buffer area, the total number of the packet receiving buffer areas is matched with the total number of the processor cores, so that when the target network traffic received by any network port is acquired, the target queues can be directly determined in the packet receiving queues, the large increase of the total number of the packet receiving queues caused by the arrangement of the packet receiving buffer areas for each network port is avoided, and the memory occupation of the packet receiving queues is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of a scenario in which a general method of traffic distribution for multiple portals in a cloud gateway server;
fig. 2 is a schematic diagram of a scenario of a traffic distribution system with multiple network ports in a cloud gateway server according to an embodiment of the present application;
fig. 3 is a schematic view of a scenario of a method for distributing traffic of multiple network ports in a cloud gateway server according to an embodiment of the present application;
fig. 4 is a flow chart of an embodiment of a method for distributing traffic of multiple network ports in a cloud gateway server according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a structure of request traffic and response traffic in an embodiment of the present application;
FIG. 6 is another architectural diagram of request traffic and response traffic in an embodiment of the present application;
FIG. 7 is a schematic structural diagram of one embodiment of a cloud gateway server provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of one embodiment of a computer device provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise. In this application, the term "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known techniques and procedures have not been described in detail so as not to obscure the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
First, a general method for traffic distribution of multiple network ports in a cloud gateway server will be described with reference to fig. 1, specifically as follows:
in fig. 1, a cloud gateway server includes a processor and a network card. The processor is typically a multi-core processor, such as a multi-core CPU (central processing unit ). The multi-core processor includes a plurality of processor cores, and for example, the plurality of processor cores may be 16 processor cores of CPU1, CPU2, CPU3, and CPU16 in fig. 1.
The network card of the cloud gateway server includes a plurality of network ports, for example, the plurality of network ports may be 2 network ports, i.e., eth1 (No. 1 network port) and eth2 (No. 2 network port) in fig. 1, where eth refers to ethernet. Each network port includes 2 terminals of RX-FIFO (receive-first in, first out) and TX-FIFO (Transmit-first in, first out). Each portal may be configured to receive either a request traffic or a response traffic to the request traffic.
Generally, a packet receiving buffer area is set for each network port in the network card, a plurality of packet receiving queues are set in the packet receiving buffer area of each network port, and in proportion to the number of CPU core threads, taking one thread set in each CPU core as an example, 16 CPU cores have 16 CPU core threads in total, for example, 16 packet receiving queues can be set in the packet receiving buffer area of each network port, for example, the 16 packet receiving queues with the numbers of Q1, Q2, Q3 and Q16 are set in the packet receiving buffer area of the eth1 network port in fig. 1, and the 16 packet receiving queues with the numbers of Q1, Q2, Q3 and Q16 are also set in the packet receiving buffer area of the eth2 network port. The DMA (Direct Memory Access ) engine utilizes the load balancing of the RSS (Receive Side Scaling ) rule of the network card to distribute the bidirectional traffic (including the request traffic and the response traffic of the request traffic) of the same network connection to the same numbered packet receiving queue (such as the packet receiving queue numbered Q1), where RSS is a network card driving technology capable of efficiently distributing the received network traffic among multiple CPU cores under the multi-core processor system. As can be seen from fig. 1, the CPU1 is responsible for processing the network traffic in the packet receiving queue with the number Q1, the CPU2 is responsible for processing the network traffic in the packet receiving queue with the number Q2, the CPU3 is responsible for processing the network traffic in the packet receiving queue with the number Q3, and so on, the CPU16 is responsible for processing the network traffic in the packet receiving queue with the number Q16, thereby ensuring that the CPU core threads can be concurrent and do not interfere with each other when processing the network traffic, and effectively ensuring the normal and efficient forwarding of the network traffic in the cloud gateway.
When the packet receiving queues are set according to the number of network ports and the number of CPU core threads, as the number of network ports increases, the total number of packet receiving queues in the cloud gateway increases greatly, for example, 8 network ports and 32 CPU core threads are provided, the total number of packet receiving queues in the cloud gateway is 8×32=256, and if each packet receiving queue occupies 1GB (Gigabyte) of memory resources, 256 packet receiving queues occupy 256GB of memory resources, and the inventor finds that only 16GB of memory resources are actually needed for 8 network ports through test, so the utilization rate of the memory resources occupied by the packet receiving queues is less than 5%. It can be seen that the packet receiving queue occupies too much memory resources.
Furthermore, the inventors have found that, since one CPU core thread needs to process the packet receiving queues in multiple interfaces, for example, CPU1 in fig. 1 needs to process the packet receiving queue numbered Q1 in the eth1 interface and the packet receiving queue numbered Q1 in the eth2 interface, the CPU core thread needs to perform memory space addressing access across multiple queues, and for a CPU with a smaller cache (cache), its access efficiency is greatly reduced, thereby affecting the network forwarding performance of the cloud gateway server.
In view of the foregoing, embodiments of the present application provide a method for distributing traffic of multiple network ports in a cloud gateway server and related devices, which are described in detail below.
As shown in fig. 2, fig. 2 is a schematic view of a scenario of a multi-portal traffic distribution system in a cloud gateway server according to an embodiment of the present application, where the multi-portal traffic distribution system in the cloud gateway server may include a cloud gateway server 100, a client 200, and a target server 300. The client 200 sends a request traffic to the cloud gateway server 100 to request data from the target server 300. After obtaining the response traffic of the request traffic, the target server 300 feeds back the response traffic to the cloud gateway server 100, so that the cloud gateway server 100 transmits the response traffic to the client 200.
In this embodiment of the present application, the cloud gateway server 100 may be an independent server, or may be a server network or a server cluster formed by servers, for example, the cloud gateway server 100 described in the embodiments of the present application includes, but is not limited to, a computer, a network host, a single network server, a plurality of network server sets, or a plurality of servers to construct a cloud server. Wherein the Cloud server is built from a large number of computers or web servers based on Cloud Computing (Cloud Computing).
Those skilled in the art will appreciate that the application environment shown in fig. 2 is merely an application scenario of the present application, and is not intended to limit the application scenario of the present application, and other application environments may further include more or fewer computer devices than those shown in fig. 2, for example, only 3 computer devices are shown in fig. 2, and it will be understood that the traffic distribution system with multiple interfaces in the cloud gateway server may further include one or more other computer devices, which is not limited herein in particular.
As can be known by those skilled in the art, with the evolution of the multi-network-port traffic distribution system in the cloud gateway server and the appearance of new service scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
Referring to fig. 3, fig. 3 is a schematic view of a scenario of a method for distributing traffic of multiple network ports in a cloud gateway server according to an embodiment of the present application. In fig. 3, the cloud gateway server includes a processor, a plurality of packet receiving buffers and a network card, the processor includes a plurality of processor cores (for example, 16 processor cores of CPU1, CPU2, CPU3, and/or CPU16 in fig. 3), one packet receiving queue is disposed in each packet receiving buffer (for example, in fig. 3, only the packet receiving queue with the number Q1 is disposed in the first packet receiving buffer, only the packet receiving queue with the number Q2 is disposed in the second packet receiving buffer, only the packet receiving queue with the number Q3 is disposed in the third packet receiving buffer, and so on), the total number of the plurality of packet receiving buffers matches the total number of the plurality of processor cores (for example, 16 processor cores in fig. 3 match 16 packet receiving buffers), and the network card includes a plurality of ports (for example, the 2 ports such as eth1 and eth2 in fig. 3). It can be seen that the number of packet receiving queues in the cloud gateway server in fig. 3 is smaller than that in fig. 1. For example, in fig. 3, there are only 16 packet receiving queues, and the occupied memory resources are 16GB, which is greatly reduced compared to the 32GB memory resources occupied by the packet receiving queues in fig. 1. It should be noted that, in the cloud gateway server provided in this embodiment of the present application, the total number of the packet receiving queues is only related to the total number of processor cores in the processor, and is irrelevant to the number of network ports in the network card, that is, no matter how many network ports are available, the total number of the packet receiving queues and the size of the memory resources occupied by the packet receiving queues are not affected, so that the occupation of the packet receiving queues to the memory resources can be greatly reduced, and the utilization rate of the memory resources is improved.
In some embodiments of the present application, the total number of packet-receiving buffers is equal to the total number of the plurality of processor cores, and the plurality of packet-receiving queues are associated with the plurality of processor cores one by one. For example, the cloud gateway server in fig. 3 includes 16 packet receiving buffers and 16 processor cores. Each packet receiving buffer area is provided with a packet receiving queue, so that a plurality of packet receiving queues can be associated with a plurality of processor cores one by one, for example, in fig. 3, a packet receiving queue with the number of Q1 is associated with CPU1, a packet receiving queue with the number of Q2 is associated with CPU2, a packet receiving queue with the number of Q3 is associated with CPU3, and so on. It can be seen that, because each CPU core thread processes only one packet receiving queue, in the cloud gateway server of the CPU with a smaller cache, the CPU core thread does not need to perform memory space addressing access across multiple queues, so that the data access efficiency of the CPU core thread can be improved, and the network traffic processing efficiency and forwarding performance of the cloud gateway server can be improved.
Next, a flow distribution method of multiple network ports in the cloud gateway server provided by the embodiment of the present application is described.
In the embodiment of the method for distributing traffic of multiple network ports in the cloud gateway server according to the embodiment of the present application, the cloud gateway server in fig. 3 is used as an execution body, and in order to simplify and facilitate the description, the execution body will be omitted in the subsequent method embodiments.
Referring to fig. 4, fig. 4 is a flow chart of an embodiment of a method for distributing traffic of multiple network ports in a cloud gateway server according to an embodiment of the present application, where the method for distributing traffic of multiple network ports in the cloud gateway server includes:
401. obtaining target network traffic received by any network port;
taking fig. 3 as an example, any one of the ports may be any one of the 2 ports eth1 and eth2 in fig. 3. The target network traffic may be request traffic or response traffic to the request traffic.
402. Determining a target queue to which the target network traffic is allocated from a plurality of packet receiving queues;
taking fig. 3 as an example, the plurality of packet receiving queues may be the 16 packet receiving queues of which numbers are Q1, Q2, Q3, Q16 in order shown in fig. 3, and the target queue is one of the 16 packet receiving queues.
In some embodiments of the present application, in order to ensure that bidirectional data (request traffic and response traffic) of the same network connection can enter the same queue, so as to ensure that CPU core threads can be processed concurrently without interfering with each other, an RSS technique is used to determine the target queue. Specifically, determining, from among the plurality of packet receiving queues, a target queue to which the target network traffic should be allocated may include: a hash (hash) algorithm is adopted to determine a hash value corresponding to the target network flow; determining a target redirection value of the hash value in a preset redirection table (redirection table, RETA), wherein the redirection table comprises redirection values of a plurality of preset hash values, the redirection values of the plurality of preset hash values are all numbers of a packet receiving queue, and dynamic load balancing can be realized through modification of the redirection table; among the plurality of packet receiving queues, the packet receiving queue numbered as the target redirection value is determined as a target queue to which the target network traffic should be allocated.
Further, the determining, by using a hash algorithm, a hash value corresponding to the target network traffic may include: if the target network traffic is a network traffic without tunnel encapsulation, acquiring a QinQ tag and an IP header in the target network traffic, wherein the QinQ tag refers to 802.1Q in 802.1Q, also called VLAN (Virtual Local Area Network ) nesting, specifically, stacking two 802.1Q headers in an ethernet frame, so as to effectively expand the number of VLANs, the IP header refers to IP header information, for example, fig. 5 shows a structure of the network traffic without tunnel encapsulation, if the network traffic without tunnel encapsulation is a request traffic, the request traffic includes an eth header, a QinQ tag, an IP header and a payload (payload), and if the network traffic without tunnel encapsulation is a response traffic, the response traffic includes an eth header, a QinQ tag, PPPoE (Point-to-Point Protocol Over Ethernet, point protocol over ethernet header, IP header and payload (payload), and analyzing the target network traffic without tunnel encapsulation to obtain the QinQ tag and the IP header in the target network traffic; and carrying out hash processing on the QinQ label and the IP header to obtain a hash value corresponding to the target network flow.
Further, the determining, by using a hash algorithm, a hash value corresponding to the target network traffic may include: if the target network traffic is the network traffic of the tunnel encapsulation, a QinQ label and an inner layer IP header in the target network traffic are obtained, wherein the original message is encapsulated with the tunnel header due to the tunnel encapsulation, so the network traffic of the tunnel encapsulation is different from the network traffic without the tunnel encapsulation, for example, fig. 6 shows the structure of the network traffic of the tunnel encapsulation, if the network traffic of the tunnel encapsulation is the request traffic, the request traffic comprises the tunnel header (outer layer eth header, VLAN label, outer layer IP header), the inner layer eth header, the QinQ label, the inner layer IP header and the payload (payload), if the network traffic of the tunnel encapsulation is the response traffic, the response traffic comprises the tunnel header (outer layer eth header, VLAN label, outer layer IP header), the inner layer eth header, the QinQ label and PPPoE (Point-to-Point Protocol Over Ethernet), the inner layer IP header and the payload (payload) on the Ethernet network are analyzed, and the QinQ label and the payload (payload) in the target network traffic can be obtained by analyzing the target network traffic of the tunnel encapsulation, and the QinQ label can be accurately found in the different areas when the QinQ label and the IP header are not arranged in the encapsulation area; and carrying out hash processing on the QinQ label and the inner layer IP header to obtain a hash value corresponding to the target network flow.
In other embodiments of the present application, the hash process is a symmetric hash process. Symmetric hash processing is typically implemented based on a toplitz (toplitz) hash, which has two inputs: when the default hash key is used, the hash value calculated by the bidirectional data of the same network connection by using the toplitz Ha Xiji is different, so that the bidirectional data of the same network connection can be distributed to different packet receiving queues, and therefore, the hash value of the bidirectional data of the same network connection is identical and distributed to the same packet receiving queue by replacing the default hash key by the other hash key of the symmetrical hash.
403. And caching the target network traffic to the target queue for the processor core associated with the target queue to process the target network traffic.
In the embodiment of the application, a DMA (Direct Memory Access ) engine is provided in the network card, which can enable data to be directly sent from an additional device (such as a network port) to a packet receiving queue in the memory of the cloud gateway server motherboard. Therefore, after the target queue is determined, the target network traffic can be cached to the target queue by using the DMA engine so that the processor core thread associated with the target queue can process the target network traffic, and normal and efficient forwarding of the target network traffic can be completed.
According to the traffic distribution method of the multiple network ports in the cloud gateway server, one packet receiving queue is arranged in each packet receiving buffer zone, and the total number of the multiple packet receiving buffer zones is matched with the total number of the multiple processor cores, so that when the target network traffic received by any network port is acquired, the target queue can be directly determined in the multiple packet receiving queues, the large increase of the total number of the packet receiving queues caused by the arrangement of one packet receiving buffer zone for each network port is avoided, and under the condition of multiple CPU cores of the cloud gateway server, the occupation of memory resources is reduced while the concurrent processing of multiple cores is ensured.
In order to better implement the method for distributing the traffic of the multiple network ports in the cloud gateway server in the embodiment of the present application, based on the method for distributing the traffic of the multiple network ports in the cloud gateway server, in this embodiment of the present application, a cloud gateway server is further provided, as shown in fig. 7, where a cloud gateway server 700 includes:
an obtaining module 701, configured to obtain a target network traffic received by any network port;
a determining module 702, configured to determine, from a plurality of packet receiving queues, a target queue to which a target network traffic should be allocated;
the distribution module 703 is configured to buffer the target network traffic to the target queue, so that the processor core associated with the target queue processes the target network traffic.
According to the cloud gateway server 700 provided by the embodiment of the invention, the packet receiving queues are arranged in each packet receiving buffer area, and the total number of the packet receiving buffer areas is matched with the total number of the processor cores, so that when the target network traffic received by any network port is acquired, the target queues can be directly determined in the packet receiving queues, the large increase of the total number of the packet receiving queues caused by the arrangement of the packet receiving buffer areas for each network port is avoided, and the memory occupation of the packet receiving queues is reduced.
In some embodiments of the present application, the determining module 702 is specifically configured to:
determining a hash value corresponding to the target network flow by adopting a hash algorithm;
determining a target redirection value of the hash value in a preset redirection table, wherein the redirection table comprises redirection values of a plurality of preset hash values;
and among the plurality of packet receiving queues, determining the packet receiving queue numbered as the target redirection value as a target queue to which the target network traffic is allocated.
In some embodiments of the present application, the determining module 702 is specifically configured to:
if the target network traffic is the network traffic without tunnel encapsulation, acquiring a QinQ label and an IP header in the target network traffic;
and carrying out hash processing on the QinQ label and the IP header to obtain a hash value corresponding to the target network flow.
In some embodiments of the present application, the determining module 702 is specifically configured to:
if the target network traffic is the network traffic packaged by the tunnel, acquiring a QinQ label and an inner layer IP header in the target network traffic;
and carrying out hash processing on the QinQ label and the inner layer IP header to obtain a hash value corresponding to the target network flow.
In some embodiments of the present application, the distribution module 703 is specifically configured to:
and caching the target network traffic to the target queue by using a direct memory access engine.
In addition to the above description of the method for distributing traffic for multiple interfaces in a cloud gateway server and the cloud gateway server, embodiments of the present application further provide a computer device, which integrates any one of the cloud gateway servers provided in the embodiments of the present application, where the computer device includes:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in memory and configured to be executed by the processor to perform any of the steps of any of the embodiments of the method of traffic distribution for multiple portals in a cloud gateway server described above.
The embodiment of the application also provides computer equipment which integrates any cloud gateway server provided by the embodiment of the application. As shown in fig. 8, a schematic structural diagram of a computer device according to an embodiment of the present application is shown, specifically:
the computer device may include one or more processors 801 of a processing core, a storage unit 802 of one or more computer readable storage media, a power supply 803, and an input unit 804, among other components. Those skilled in the art will appreciate that the computer device structure shown in FIG. 8 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components. Wherein:
the processor 801 is a control center of the computer device, connects respective parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the storage unit 802 and calling data stored in the storage unit 802, thereby performing overall monitoring of the computer device. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 801.
The storage unit 802 may be used to store software programs and modules, and the processor 801 performs various functional applications and data processing by running the software programs and modules stored in the storage unit 802. The storage unit 802 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, the storage unit 802 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory unit 802 may also include a memory controller to provide the processor 801 with access to the memory unit 802.
The computer device also includes a power supply 803 for powering the various components, preferably, the power supply 803 can be logically coupled to the processor 801 via a power management system such that functions such as managing charge, discharge, and power consumption can be performed by the power management system. The power supply 803 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may further comprise an input unit 804, which input unit 804 may be used for receiving input digital or character information and for generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in the embodiment of the present application, the processor 801 in the computer device loads executable files corresponding to the processes of one or more application programs into the storage unit 802 according to the following instructions, and the processor 801 executes the application programs stored in the storage unit 802, so as to implement various functions as follows:
obtaining target network traffic received by any network port; determining a target queue to which target network traffic is allocated from a plurality of packet receiving queues; the target network traffic is buffered to a target queue for processing by a processor core associated with the target queue.
To this end, embodiments of the present application provide a computer-readable storage medium, which may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like. The computer readable storage medium stores a plurality of instructions that can be loaded by a processor to execute steps in any method for distributing traffic of multiple interfaces in a cloud gateway server provided in an embodiment of the present application. For example, the instructions may perform the steps of:
obtaining target network traffic received by any network port; determining a target queue to which target network traffic is allocated from a plurality of packet receiving queues; the target network traffic is buffered to a target queue for processing by a processor core associated with the target queue.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
The foregoing describes in detail a method for distributing traffic of multiple network ports in a cloud gateway server and related devices, and specific examples are applied to describe principles and implementations of the present application, where the description of the foregoing embodiments is only for helping to understand the method and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. The utility model provides a flow distribution method of many net gapes in cloud gateway server, its characterized in that includes processor, a plurality of receipts packet buffer memory district and network card in the cloud gateway server, including a plurality of processor cores in the processor, every receipts packet buffer memory district is provided with a receipts packet queue, a plurality of receipts packet buffer memory district total number and a plurality of the total number of processor cores match, including a plurality of net gapes in the network card, the method includes:
obtaining target network traffic received by any network port;
determining a target queue to which the target network traffic is allocated from a plurality of packet receiving queues;
and caching the target network traffic to the target queue for the processor core associated with the target queue to process the target network traffic.
2. The method for distributing traffic of multiple network ports in a cloud gateway server according to claim 1, wherein the total number of said packet receiving buffers is equal to the total number of said processor cores, and a plurality of said packet receiving queues are associated with a plurality of said processor cores one by one.
3. The method for distributing traffic of multiple network ports in a cloud gateway server according to claim 1, wherein determining a target queue to which the target network traffic should be distributed from among the plurality of packet receiving queues comprises:
determining a hash value corresponding to the target network flow by adopting a hash algorithm;
determining a target redirection value of the hash value in a preset redirection table, wherein the redirection table comprises redirection values of a plurality of preset hash values;
and among the plurality of packet receiving queues, determining the packet receiving queue numbered as the target redirection value as a target queue to which the target network traffic is allocated.
4. The method for distributing traffic of multiple network ports in a cloud gateway server according to claim 3, wherein the determining a hash value corresponding to the target network traffic by using a hash algorithm includes:
if the target network traffic is the network traffic without tunnel encapsulation, acquiring a QinQ label and an IP header in the target network traffic;
and carrying out hash processing on the QinQ label and the IP header to obtain a hash value corresponding to the target network flow.
5. The method for distributing traffic of multiple network ports in a cloud gateway server according to claim 3, wherein the determining a hash value corresponding to the target network traffic by using a hash algorithm includes:
if the target network traffic is the network traffic packaged by the tunnel, acquiring a QinQ label and an inner layer IP header in the target network traffic;
and carrying out hash processing on the QinQ label and the inner layer IP header to obtain a hash value corresponding to the target network flow.
6. The traffic distribution method for multiple portals in a cloud gateway server according to claim 4 or 5, wherein the hash processing is a symmetric hash processing.
7. The method for distributing traffic of multiple network ports in a cloud gateway server according to claim 1, wherein said caching the target network traffic to the target queue comprises:
and caching the target network traffic to the target queue by using a direct memory access engine.
8. The cloud gateway server is characterized by comprising a processor, a plurality of packet receiving cache areas and a network card, wherein the processor comprises a plurality of processor cores, each packet receiving cache area is provided with a packet receiving queue, the total number of the packet receiving cache areas is matched with the total number of the processor cores, the network card comprises a plurality of network ports, and the cloud gateway server further comprises:
the acquisition module is used for acquiring the target network flow received by any network port;
the determining module is used for determining a target queue to which the target network flow is allocated from a plurality of packet receiving queues;
and the distribution module is used for caching the target network traffic to the target queue so as to enable the processor core associated with the target queue to process the target network traffic.
9. A computer device, the computer device comprising:
one or more processors;
a memory; and
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the method of traffic distribution for multiple portals in a cloud gateway server of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon a computer program, the computer program being loaded by a processor to perform the steps in the method of traffic distribution for multiple portals in a cloud gateway server according to any of claims 1 to 7.
CN202310123824.7A 2023-02-13 2023-02-13 Flow distribution method of multiple network ports in cloud gateway server and related equipment Pending CN116132369A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310123824.7A CN116132369A (en) 2023-02-13 2023-02-13 Flow distribution method of multiple network ports in cloud gateway server and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310123824.7A CN116132369A (en) 2023-02-13 2023-02-13 Flow distribution method of multiple network ports in cloud gateway server and related equipment

Publications (1)

Publication Number Publication Date
CN116132369A true CN116132369A (en) 2023-05-16

Family

ID=86298997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310123824.7A Pending CN116132369A (en) 2023-02-13 2023-02-13 Flow distribution method of multiple network ports in cloud gateway server and related equipment

Country Status (1)

Country Link
CN (1) CN116132369A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117234998A (en) * 2023-09-12 2023-12-15 中科驭数(北京)科技有限公司 Multi-host data access method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117234998A (en) * 2023-09-12 2023-12-15 中科驭数(北京)科技有限公司 Multi-host data access method and system

Similar Documents

Publication Publication Date Title
US20200241927A1 (en) Storage transactions with predictable latency
US20220114070A1 (en) System, Method and Computer Readable Medium for Offloaded Computation of Distributed Application Protocols within a Cluster of Data Processing Nodes
US8737410B2 (en) System and method for high-performance, low-power data center interconnect fabric
US8949847B2 (en) Apparatus and method for managing resources in cluster computing environment
KR101455899B1 (en) Microprocessor with software control over allocation of shared resources among multiple virtual servers
US8446824B2 (en) NUMA-aware scaling for network devices
US9910687B2 (en) Data flow affinity for heterogenous virtual machines
WO2014113059A1 (en) Network overlay system and method using offload processors
US10932202B2 (en) Technologies for dynamic multi-core network packet processing distribution
US20120297216A1 (en) Dynamically selecting active polling or timed waits
CN108984327B (en) Message forwarding method, multi-core CPU and network equipment
US20110082949A1 (en) Presenting multi-function devices behind a switch hierarchy as a single function device
US8671232B1 (en) System and method for dynamically migrating stash transactions
CN112671663A (en) Techniques for quality of service based throttling in fabric architectures
CN116132369A (en) Flow distribution method of multiple network ports in cloud gateway server and related equipment
US11042394B2 (en) Method for processing input and output on multi kernel system and apparatus for the same
US9158692B2 (en) Cache injection directing technique
CN114510321A (en) Resource scheduling method, related device and medium
US9128771B1 (en) System, method, and computer program product to distribute workload
US20190042434A1 (en) Dynamic prefetcher tuning
CN107493574B (en) Wireless controller equipment, parallel authentication processing method, system and networking device
US11929926B2 (en) Traffic service threads for large pools of network addresses
US20230109396A1 (en) Load balancing and networking policy performance by a packet processing pipeline
CN115766729A (en) Data processing method for four-layer load balancing and related device
Ortiz et al. Network interfaces for programmable NICs and multicore platforms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination