A dpdk-based alg implementation method and system
An implementation method and user-mode technology, applied in the field of Internet communication, can solve problems such as single access control function and limited throughput, and achieve the effect of avoiding limited throughput
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Publication Date
- 2022-04-08
Smart Images

Figure 1 
Figure 2 
Figure 3
Abstract
Description
technical field
[0001] The present invention relates to the technical field of Internet communication, in particular to a DPDK-based ALG implementation method and system. Background technique
[0002] Ordinary NAT realizes the IP address and port translation function in the TCP or UDP message header, but it is powerless to the fields in the application layer data load. In many application layer protocols, such as multi-SIP, RTSP, FTP, etc., TCP / UDP The payload contains address or port information, which cannot be effectively translated by NAT, which may lead to service failure. The NATALG technology can convert the address in the application layer message, so as to ensure the correctness of the application layer communication.
[0003] The traditional Linux kernel ALG can solve the ALG conversion of the address in the control connection data packet of SIP, RTSP, FTP and other protocols passing through the nat device, but because it is implemented based on the Linux kernel m...
Examples
Embodiment 1
[0046] Such as figure 1 As shown, a DPDK-based ALG implementation method provided by an embodiment of the present invention includes the following steps:
[0047] Step 1: Configure a control reverse proxy in the user mode Nginx program, and proxy to the server;
[0048] Step 2: use the control reverse proxy as the static control connection listening address, and access the static control connection listening address through the client;
[0049] Step 3: the user state Nginx program disconnects from the client, and establishes a connection with the server, and the user state Nginx program is used to forward the control connection data packet between the client and the server;
[0050] Step 4: The user state Nginx program is based on the DPDK+FreeBSD+Nginx architecture, and performs protocol analysis and rewriting and related control actions on the control connection data packet;
[0051] Step 5: The server pushes the stream to the user state Nginx program dynamic media connect...
Embodiment 2
[0055] On the basis of the above-mentioned embodiment 1, the difference between the embodiment of the present invention and the above-mentioned embodiment is that step 4 is optimized, and when the client communicates with the server, the user state Nginx program is connected to the media in the data packet The receiving port is rewritten, and the reverse proxy configuration is made correspondingly, so as to ensure the normal transmission of the media stream, specifically:
[0056] When the user-mode Nginx program receives the SETUP command sent from the client to the server, it rewrites the media receiving port in the control connection packet as the dynamic media connection listening port, and at the same time, the user-mode Nginx program sends the dynamic media reverse proxy configuration;
[0057] When the user-mode Nginx program receives the SETUP Reply command sent from the server to the client, it rewrites the media sending port in the control connection packet as the loc...
Embodiment 3
[0059] In order to avoid the limitation of ALG throughput, the embodiment of the present invention also provides a DPDK-based ALG implementation method, which is different from the above-mentioned embodiments in that the DPDK+FreeBSD+Nginx architecture described in step 4 includes the user-mode Nginx program , FreeBSD user mode protocol stack, a plurality of CPU cores and a plurality of network cards, each of which includes a plurality of network card queues;
[0060] A worker process of the user state Nginx program is correspondingly bound to a CPU core, and is responsible for processing the control connection packets on the corresponding network card queues of all network cards;
[0061] The FreeBSD user state protocol stack forwards the control connection data packet taken out from the network card queue through the protocol stack routing, and transmits to the user state Nginx program.
[0062] In this example, if figure 2 As shown, the worker process labels are worker0~w...