Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A method and system for implementing dynamic proxy based on f-stack and nginx

A dynamic proxy and purpose technology, applied in the field of Internet communication, can solve problems that are not suitable for large concurrency and high throughput application scenarios, and achieve the effect of satisfying large concurrency

Active Publication Date: 2022-03-11
ZHENGZHOU XINDA JIEAN INFORMATION TECH
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Aiming at the problem that the traditional Linux kernel ALG method is not suitable for large concurrency and high throughput application scenarios, the present invention provides a method and system for realizing dynamic proxy based on F-Stack and Nginx

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and system for implementing dynamic proxy based on f-stack and nginx
  • A method and system for implementing dynamic proxy based on f-stack and nginx

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0044] Such as figure 1 As shown, the first aspect of the present invention proposes a kind of method based on F-Stack and Nginx to realize dynamic agent, described method comprises the following steps:

[0045] S101: Receive a data packet, and put the data packet on the corresponding queue of the network card; the data packet includes a request data packet from the client and a response data packet from the server;

[0046] Specifically, the DPDK gateway receives the request data packet from the client or the response data packet from the server, calculates the hash value according to the quintuple information in the data packet, and then takes the remainder of the queue number of the network card to determine where the received data packet is placed. on the corresponding queue of the network card.

[0047] A queue of a network card is processed by a corresponding CPU core, queues of all network cards with the same number are processed by a designated CPU core, and a worker ...

Embodiment 2

[0058] Taking the signaling protocol of Nginx parsing SIP as an example, the present invention is further set forth based on F-Stack and Nginx to realize the dynamic agent method, comprising the following steps:

[0059] Step A1: Preset the media receiving address carried in the video viewing signaling packet when the server is viewing video as serip+recv_media_port;

[0060] Step A2: Nginx rewrites the media receiving address in the video viewing signaling packet sent by the server as vip+recv_media_vport, and forwards it to the client;

[0061] Step A3: The client responds with the push address cip+push_media_port in the 200-OK signaling;

[0062] Step A4: Nginx rewrites the media push address in the client response 200-OK signaling to lip+push_media_lport, and uses shared memory to issue proxy rules to all worker processes.

[0063] Specifically, in the proxy rules issued in step A4, the media listening address is: vip+recv_media_vport, the streaming address of the client ...

Embodiment 3

[0067] Taking the media data transmission of SIP as an example, the present invention is further set forth based on F-Stack and Nginx to realize the dynamic agent method, comprising the following steps:

[0068] Step B1: The client pushes the video stream, and the source address and destination address in the request packet are cip+push_media_port->vip+recv_media_vport, and the request packet is handled by a worker process;

[0069] Step B2: the request packet is first processed by the hook function of the ipfw mechanism, and whether there is a connection tracking table according to the quintuple information in the request packet, if there is a connection tracking table, then use the connection tracking table in the connection tracking table The cache information rewrites the source address and destination address in the request packet;

[0070] Step B3: Determine whether the destination address of the request packet matches the media listening address in the proxy rule. If it...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention provides a method and system for realizing dynamic proxy based on F-Stack and Nginx. The method comprises: receiving the data packet, putting the data packet on the corresponding queue of the network card; for each data packet on the queue, making the data packet go through the hook function processing of the ipfw mechanism first, and finding whether there is a connection tracking table: if there is connection tracking table, then rewrite the source address and destination address in the data packet according to the proxy rules; if there is no connection tracking table, create a new connection tracking table according to the proxy rules, so that it can be used when processing subsequent data packets to find the connection tracking table; The packets with successful source and destination addresses are processed by the FreeBSD protocol stack; and further judge whether the packets are processed by Nginx, specifically: the packets that match the Nginx listening address vip+vport are processed by Nginx, and Nginx processes The completed data packets are forwarded by the FreeBSD protocol stack again; for the data packets of the data protocol, they do not need to be processed by Nginx, and are directly processed by the FreeBSD protocol stack for routing lookup and forwarding.

Description

technical field [0001] The invention relates to the technical field of Internet communication, in particular to a method and system for realizing dynamic proxy based on F-Stack and Nginx. Background technique [0002] The traditional Linux kernel ALG method supports SIP, FTP, and RTSP protocol proxies, but due to the lock\interrupt\context switching of the kernel's own implementation mechanism, the performance is low, and it is not suitable for large concurrency and high throughput application scenarios. [0003] DPDK uses large pages, ring lock-free queues, polling packet processing, and network card multi-queue combined with multi-core to improve packet forwarding performance, but it does not provide support for the TCP / IP protocol stack. The open source F-Stack integrates DPDK and user-mode protocol stacks FreeBSD and Nginx to facilitate users to implement their own business logic. In addition, what SIP, FTP, and RTSP protocols have in common is composed of a signaling p...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): H04L67/565H04L45/74H04L45/745H04L69/22
CPCH04L45/74H04L45/745H04L45/742H04L69/22H04L67/565
Inventor 王兵权马骥冀博李昭熹焦小涛
Owner ZHENGZHOU XINDA JIEAN INFORMATION TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products