CN109547519B - Reverse proxy method, apparatus and computer readable storage medium - Google Patents
Reverse proxy method, apparatus and computer readable storage medium Download PDFInfo
- Publication number
- CN109547519B CN109547519B CN201710868532.0A CN201710868532A CN109547519B CN 109547519 B CN109547519 B CN 109547519B CN 201710868532 A CN201710868532 A CN 201710868532A CN 109547519 B CN109547519 B CN 109547519B
- Authority
- CN
- China
- Prior art keywords
- protocol stack
- message
- application layer
- reverse proxy
- client
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/30—Definitions, standards or architectural aspects of layered protocol stacks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer And Data Communications (AREA)
Abstract
In the reverse proxy method, apparatus, and computer-readable storage medium provided by the embodiments of the present invention, a protocol stack receives a packet and locally stores the packet in a preset manner; the protocol stack sends a notification signal to an application layer; and after receiving a trigger signal fed back by the application layer according to the notification signal, the protocol stack calls the locally stored message and sends the message to a client on a client link of the protocol stack. The embodiment of the invention improves the user mode protocol stack in a targeted manner, optimizes the interactive flow between the application layer and the protocol stack, reduces the forwarding operation of the existing application layer to the transmission layer for realization, ensures that the application layer is only responsible for receiving the notification and triggering the message sending flow, does not relate to data reading and writing, realizes data calling in the improved protocol stack, does not need to copy the message with the application layer, effectively reduces the overhead of the transparent transmission flow, and obviously improves the system efficiency.
Description
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a reverse proxy method, apparatus, and computer-readable storage medium.
Background
With the development of network communication technology, the rapid increase of network bandwidth, and the exponential increase of network traffic, new challenges are presented to the performance of devices such as application gateways, web servers, and the like.
For example, in scenarios such as an ISG gateway and a reverse proxy server, a server application layer receives a download request of a client at a client, and after the request is analyzed, the application layer establishes a socket link and requests a message to a background server, and after receiving a message sent by the background server, receives the message to the application layer first, and then sends the message to the socket link at the client side, and specifically, an interaction flow between the application layer and a protocol stack is shown in fig. 1, which includes the following steps:
s101, copying a message from a protocol stack by an application layer;
s102, a protocol stack releases an mbuf (memory buffer) structure in a link of a server side;
s103, transferring the received message to a client link by the application layer according to the link pairing relation;
s104, copying the message back to a protocol stack by the application layer;
s105, the protocol stack distributes mbuf to store the message;
s106, finally, after the protocol stack finishes message sending, releasing the mbuf.
In the above conventional process, the application layer has message copies in a process space and a protocol stack space, the whole process has multiple copies, and switching between a kernel mode and a user mode, so that the performance overhead is large, and in the interactive process between the protocol stack and the application layer, the mbuf structure has malloc (memory allocation) and free (release) processes, which further increases the performance overhead. When downloading large files, the message transmission process is very frequent, and the performance index of the whole system is greatly influenced.
Disclosure of Invention
The reverse proxy method, the reverse proxy device and the computer-readable storage medium provided by the embodiment of the invention mainly solve the technical problem that the interaction flow between an application layer and a protocol stack in the traditional scheme is not perfect, so that the system performance overhead is large.
To solve the foregoing technical problem, an embodiment of the present invention provides a reverse proxy method, including: a protocol stack receives a message and locally stores the message in a preset mode; the protocol stack sends a notification signal to an application layer; and after receiving a trigger signal fed back by the application layer according to the notification signal, the protocol stack calls the locally stored message and sends the message to a client on a client link of the protocol stack.
The embodiment of the invention also provides another reverse proxy method, which comprises the following steps: the application layer receives the notification signal sent by the protocol stack; the application layer judges whether the message to be received needs to be processed according to the notification signal; and if the judgment result is negative, sending a trigger signal to the protocol stack, wherein the trigger signal is used for indicating the protocol stack to send the message to a client on a client link.
An embodiment of the present invention further provides a reverse proxy apparatus, including: the first receiving module is used for receiving the message; the storage module is used for locally storing the message in a preset mode; a first sending module, configured to send a notification signal to an application layer; a second receiving module, configured to receive a trigger signal fed back by the application layer; the calling module is used for calling the locally stored message; and the second sending module is used for sending the message called by the calling module on a client link of the protocol stack.
The embodiment of the invention also provides another multi-core parallel reverse proxy device, which comprises: the third receiving module is used for receiving the notification signal sent by the protocol stack; the judging module is used for judging whether the message to be received needs to be processed according to the notification signal; and a third sending module, configured to send a trigger signal to the protocol stack if the determination result of the determining module is negative, where the trigger signal is used to instruct the protocol stack to send the packet to the client on its client link.
The embodiment of the invention also provides another reverse proxy device, which comprises a processor, a memory and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory; the processor is configured to execute one or more programs stored in the memory to implement the steps of the reverse proxy method of any of the above.
The embodiment of the invention also provides a computer readable storage medium which is used for storing the program code
One or more programs are stored that are executable by one or more processors to implement the steps of the reverse proxy method of any of the above.
The invention has the beneficial effects that:
according to the reverse proxy method, the reverse proxy device and the computer readable storage medium provided by the embodiment of the invention, the protocol stack locally stores the received message, the application layer is only responsible for receiving the notification signal, whether the self-processing is needed or not is judged according to the notification signal, the trigger signal is sent to the protocol stack if the self-processing is not needed, and the protocol stack directly sends the message stored before the local calling after receiving the trigger signal. The core of the embodiment of the invention is that the user mode protocol stack is improved in a targeted manner, the interactive flow between the application layer and the protocol stack is optimized, the forwarding operation of the existing application layer is reduced to the transmission layer for realization, the application layer is only responsible for receiving the notification and triggering the message sending flow, the data reading and writing are not involved, the data calling is realized in the improved protocol stack, the message copying with the application layer is not needed, the instruction and the data in the transparent transmission process are separated, only one application and one release are carried out in the whole message life cycle, the repeated application and release operation is avoided, the transparent transmission flow overhead is effectively reduced, and the system efficiency is obviously improved. The embodiment of the invention can be applied to a multi-core parallel scene, and has better effect in the multi-core parallel reverse proxy scene.
Further, the embodiment of the present invention may also adopt a memory Chi Baocun message provided by a Data Plane Development Kit (DPDK) framework, so as to effectively utilize the L1 and L2 level caches (buffers) of the CPU, and improve the cache hit rate.
Furthermore, the embodiment of the present invention may further set the application operation of the mbuf structure before the protocol stack receives the message, for example, the mbuf structure is allocated when the network card receives the message, and the release operation of the mbuf structure is set after the message is sent, so that only one application and one release are performed in the whole message life cycle, thereby avoiding multiple application and release operations, and simultaneously avoiding the application and release operations performed in the interactive flow between the application layer and the protocol stack.
Additional features and corresponding advantages of the invention are set forth in the description which follows, and it is understood that at least some of the advantages will be apparent from the description of the invention.
Drawings
FIG. 1 is a flow chart of a prior art reverse proxy method;
FIG. 2 is a flowchart of a reverse proxy method according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a reverse proxy method according to a second embodiment of the present invention;
fig. 4 is a schematic diagram of a reverse proxy apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic diagram of a reverse proxy apparatus according to a fourth embodiment of the present invention;
fig. 6 is a schematic diagram of a reverse proxy apparatus according to a fifth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention are described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Example one
In order to solve the problem of high system performance overhead caused by imperfect interaction flow between an application layer and a protocol stack in the conventional scheme, the present embodiment provides a reverse proxy method, and the core of the present embodiment is to perform targeted improvement on a user mode protocol stack and optimize the interaction flow between the protocol stack and the application layer in a reverse proxy service scenario. Referring to fig. 2, the present embodiment mainly includes the following processes:
s201, a protocol stack receives a message and stores the message locally in a preset mode.
There are many ways to store the message in this step, including but not limited to the following listed ways: and locally storing the message by adopting an mbuf structural body distributed from the memory pool. By adopting the memory Chi Baocun message provided by the DPDK frame, the L1 and L2 level caches of the CPU are effectively utilized, and the cache hit rate is improved.
The DPDK is a user mode network message transceiving mechanism introduced by Intel, and the current DPDK transceiving mechanism is mainly used for forwarding a network device message. In the embodiment of the present invention, DPDK may be used as a network packet transceiving frame, and a TCP (Transmission Control Protocol) or an IP (Internet Protocol, protocol for interconnection between networks) originating Protocol stack of BSD (Berkeley Software Distribution) may be used as a user mode Protocol stack. Of course, other messaging frameworks and other protocol stacks may be used.
After the protocol stack receives the message in step S201, the mbuf structure may be temporarily allocated from the memory pool, or before step S201, that is, before the protocol stack receives the message, the mbuf structure may be allocated from the memory pool in advance, so as to avoid applying and allocating the mbuf structure in the interactive process between the application layer and the protocol stack, and improve the interactive efficiency.
In some embodiments, after the message is locally stored by using the mbuf structure allocated from the memory pool, the message may be further added to a receive buffer queue of a server link of the protocol stack. Existing frameworks based on protocol stacks ensure that messages are received in order.
In some embodiments, the messages received by the protocol stack in this step may be distributed by the network card by using an RSS (received side scaling) multi-queue technology, the message distribution process is implemented by network card hardware, CPU resources are released, an RSS multi-queue of the network card is opened, the messages are distributed to a designated work thread by using a Toeplitz hash algorithm, and data binding may be implemented.
S202, the protocol stack sends a notification signal to an application layer.
After the protocol stack completes the step S201, the notification signal may be sent to the application layer without copying the message to the application layer.
S203, the application layer receives the notification signal sent by the protocol stack.
And S204, the application layer judges whether the message to be received needs to be processed according to the notification signal, if so, the message needs to be processed, the existing scheme can be referred to, and the step S205 is performed, and if not, the step S206 is performed.
As an embodiment, if the message to be received does not need application layer verification, updating, etc., it is considered that no processing is required, and the application layer may call a tcp _ trans interface to notify the protocol stack, that is, execute step S206. After the interface returns, the application layer can select subsequent operations according to the returned value and continue to monitor the states of the two socket handles.
S205, the application layer copies the message from the protocol stack to the application layer for processing, and copies the processed message to the protocol stack, and the protocol stack sends the message to the client on the client link.
S206, the application layer sends a trigger signal to the protocol stack.
And S207, after receiving the trigger signal fed back by the application layer, the protocol stack calls the locally stored message and sends the message to the client on a client link of the protocol stack.
There are many implementations of this step, including but not limited to the following:
adding the message into a sending buffer queue of a client link of a protocol stack;
and sequentially calling the locally stored messages according to the sequence of the messages in the sending buffer queue and sending the messages to the client on a client link of the protocol stack.
In this way, the messages are guaranteed to be sent in order based on the existing framework of the protocol stack.
In some embodiments, after the message is sent, the mbuf structure is released and returned to the memory pool. Therefore, the embodiment of the invention only needs one mbuf structure releasing operation in the whole message life cycle.
The reverse proxy optimization method provided by the embodiment of the invention improves the user mode protocol stack in a targeted manner, optimizes the interactive flow between the application layer and the protocol stack, reduces the forwarding operation of the existing application layer to the transmission layer for realization, ensures that the application layer is only responsible for receiving the notification and triggering the message sending flow, does not relate to data reading and writing, realizes data calling in the improved protocol stack, does not need to copy the message with the application layer, realizes the separation of the instruction and the data in the transparent transmission process, effectively reduces the transparent transmission flow overhead, and obviously improves the system efficiency. In addition, the application operation of the mbuf structure can be set before the protocol stack receives the message, and the release operation of the mbuf structure is set after the message is sent, so that only one application and one release are performed in the whole message life cycle, multiple application and release operations are avoided, and the application and release operations in the interactive process of the application layer and the protocol stack are avoided.
Example two
In order to solve the problem that the interaction flow between the application layer and the protocol stack is not perfect enough in the conventional scheme, which causes large system performance overhead, the embodiment provides a reverse proxy optimization method. In this embodiment, a DPDK network packet transceiving frame and a TCP protocol stack are taken as an example, and the core of this embodiment is to perform targeted improvement on a user state TCP protocol stack and optimize an interaction flow between the TCP protocol stack and an application layer in a reverse proxy service scenario.
The user state TCP protocol stack is subjected to expansion design, a flow for transparently transmitting data between two links is newly added, and an interface which is open to the outside is as follows:
int tcp_trans(socket fd_in,socket fd_out);
description of parameters:
fd _ in server side link socket identification;
fd _ out client Link socket identification.
And returning a value:
greater than 0 indicates a successfully forwarded data length;
equal to 0 indicates that there is no data to be forwarded;
less than 0 indicates that data forwarding cannot be completed.
Referring to fig. 3, the reverse proxy method provided in this embodiment mainly includes the following processes:
s301, the network card receives messages, the messages are distributed to a plurality of receiving queues through an RSS mechanism, and meanwhile, the memory pool is requested to distribute the mbuf structure.
In the step, network card hardware is adopted to realize message distribution, RSS multi-queues of the network card are opened, and Toeplitz Hash algorithm is adopted to distribute TCP stream data to a designated working thread, so that data binding is realized. Meanwhile, before entering an interactive flow of a TCP protocol stack and an application layer, an mbuf structural body is distributed, so that the application and distribution of the mbuf structural body in the interactive flow of the application layer and the TCP protocol stack are avoided, the interactive efficiency is improved, and the mbuf structural body application and distribution operation is only performed once in the whole message life cycle.
S302, the TCP stack receives the message, the received message is stored by adopting the mbuf structure distributed in S301, the mbuf structure carrying the message enters a TCP stack receiving process, and finally the message is added into a receiving buffer queue of an fd _ in server link of the TCP stack.
S303, the TCP protocol stack sends a notification signal to the application layer to notify the application layer that the data to be received on the link is ready.
S304, after receiving the receiving notification signal, the application layer determines whether to perform processing such as application layer verification and update on the message to be received, if so, the existing scheme may be referred to, for example, the process goes to step S305, and if not, the process goes to step S306.
S305, the application layer copies the message from the TCP stack to the application layer for processing, then copies the processed message to the TCP stack, and the TCP stack sends the message on the fd _ out client link.
S306, the application layer executes a TCP _ trans interface to feed back a trigger signal to the TCP protocol stack and initiate data movement operation of the TCP protocol stack.
S307, the TCP protocol stack completes data transfer from the fd _ in service end link to the fd _ out client end link, specifically, the packet in the receiving buffer queue of the fd _ in service end link is moved to the sending buffer queue of the fd _ out client end link, the object of the moving operation is a packet structure mbuf pointer, and the key operation pseudo code is as follows:
while (input queue not empty & output queue not full)
Fd _ in.out (& mbuf _ pkg); // receiving dequeue messages from buffer queue
Fd _ out.in (& mbuf _ pkg); // sending buffer queue enqueue message
Tcp _ out (fd _ out); // TCP _ out sending procedure of the last trigger protocol stack
S308, the TCP protocol stack calls the messages stored by the mbuf structure body in the memory pool in sequence according to the sequence of the messages in the transmission buffer queue of the fd _ out client link, and transmits the messages to the client on the fd _ out client link.
And S309, after the message is sent, releasing the mbuf structural body by the TCP stack, and returning the mbuf structural body to the memory pool.
In the embodiment of the invention, the proxy server software adopts the TCP protocol stack, and the message transmission flow can be obviously optimized. Taking a reverse proxy server as an example, after receiving a notification signal sent by a TCP protocol stack, an application layer determines that a subsequent message to be received does not need processing such as application layer verification, updating, and the like, the application layer calls a TCP _ trans interface to notify the TCP protocol stack to transparently transmit the message between an fd _ in service end link and an fd _ out client end link, and after the interface returns, the application layer selects subsequent operation according to a return value and continues to monitor the states of two socket handles. Therefore, in the message transmission process of the reverse proxy service, the application layer does not need to copy the message and does not relate to data reading and writing, the data calling is realized in the improved TCP protocol stack, the instruction and the data in the transparent transmission process are separated, the transparent transmission process overhead is effectively reduced, and the system efficiency is obviously improved. In addition, a memory pool provided by the DPDK is used for storing the TCP message, the L1 and L2 level caches of the CPU are effectively utilized, and the cache hit rate is improved; network card RSS multi-queue technology is adopted, the message distribution process is realized by network card hardware, and CPU resources are liberated; the interactive process of the TCP protocol stack and the application layer does not have the application and release operation of the mbuf structure, the mbuf structure is distributed when the network card receives the message, the mbuf structure is released after the message is sent, the mbuf structure is applied and released only once in the whole message life cycle, and multiple application and release operations are avoided.
EXAMPLE III
In order to solve the problem of large system performance overhead caused by imperfect interaction flow between an application layer and a protocol stack in the conventional scheme, this embodiment provides a reverse proxy apparatus, please refer to fig. 4, which can be applied to the protocol stack, and the reverse proxy apparatus mainly includes:
a first receiving module 41, configured to receive a message;
a storage module 42, configured to store the message locally in a preset manner;
a first sending module 43, configured to send a notification signal to the application layer;
a second receiving module 44, configured to receive a trigger signal fed back by the application layer according to the notification signal;
a calling module 45, configured to call the locally stored message;
a second sending module 46, configured to send the message called by the calling module 45 to the client on the client link of the protocol stack.
The saving module 42 may locally save the packet by using the mbuf structure allocated from the memory pool. By adopting the memory Chi Baocun message provided by the DPDK frame, the L1 and L2 level caches of the CPU are effectively utilized, and the cache hit rate is improved.
Further, after the storage module 42 locally stores the packet by using the mbuf structure allocated from the memory pool, the packet may be added to a receive buffer queue of the server link of the protocol stack. Existing frameworks based on protocol stacks ensure that messages are received in order.
The second sending module 46 may add the packet to a send buffer queue of a client link of a protocol stack; the calling module 45 calls the locally stored messages in sequence according to the sequence of the messages in the transmission buffer queue, and the calling module 45 transmits the called messages on a client link of the protocol stack. In this way, the messages are guaranteed to be sent in order based on the existing framework of the protocol stack.
Further, the reverse proxy apparatus may further include a release module (not shown in the figure) configured to release the mbuf structure after the message is sent, and return the mbuf structure to the memory pool. Invalid data in the memory pool can be cleared in time, and memory pool resources are saved; meanwhile, the mbuf structure is released after the message is sent, so that the release operation of the mbuf structure in the interactive process of the protocol stack and the application layer is avoided, the interactive efficiency is improved, and in the whole message life cycle, only one mbuf structure release operation is performed.
The reverse proxy device provided by the embodiment of the invention can be applied to a protocol stack, the embodiment of the invention improves the protocol stack in a targeted manner, optimizes the interactive flow between an application layer and the protocol stack, reduces the forwarding operation of the existing application layer to a transmission layer for realization, the application layer is only responsible for receiving notification and triggering a message sending flow, does not relate to data reading and writing, realizes data calling in the improved protocol stack, does not need to copy messages with the application layer, realizes separation of instructions and data in a transparent transmission process, effectively reduces the overhead of the transparent transmission flow, and obviously improves the system efficiency. In addition, the application operation of the mbuf structure can be set before the protocol stack receives the message, and the release operation of the mbuf structure is set after the message is sent, so that only one application and one release are performed in the whole message life cycle, multiple application and release operations are avoided, and the application and release operations in the interactive process of the application layer and the protocol stack are avoided.
Example four
In order to solve the problem of large system performance overhead caused by imperfect interaction flow between the application layer and the protocol stack in the conventional scheme, the present embodiment provides a reverse proxy apparatus, please refer to fig. 5, which can be applied to the application layer, and the reverse proxy apparatus mainly includes:
a third receiving module 51, configured to receive a notification signal sent by a protocol stack;
the judging module 52 is configured to judge whether to process the message to be received according to the notification signal;
a third sending module 53, configured to send a trigger signal to the protocol stack if the determination result of the determining module 52 is negative, where the trigger signal is used to instruct the protocol stack to send the packet to the client on its client link.
As an embodiment, if the determining module 52 determines that the message to be received does not need application layer verification, updating, or the like, it is considered that no processing is needed, and the third sending module 53 may call a tcp _ trans interface to notify the protocol stack, and send the message received and stored locally on its client link. After the interface returns, the application layer can select subsequent operations according to the return value and continue to monitor the states of the two socket handles.
If the determination result of the determination module 52 is yes, that is, processing is required, the reverse-proxy apparatus may further include (not shown in the figure):
the copying module is used for copying the message from the protocol stack to an application layer; the message processing module is also used for copying the message generated after the processing module processes the message to a protocol stack;
and the processing module is used for processing the message copied to the application layer.
The reverse proxy apparatus provided in the embodiment of the present invention may be applied to an application layer, and needs to be interfaced with a protocol stack interface provided in the above embodiment of the present invention, so as to optimize an interaction flow between the application layer and the protocol stack.
EXAMPLE five
In order to solve the problem of large system performance overhead caused by imperfect interaction flow between an application layer and a protocol stack in the conventional scheme, the present embodiment provides a reverse proxy apparatus, please refer to fig. 6, in which the multi-core parallel reverse proxy apparatus includes a processor 61, a memory 62, and a communication bus 63; the communication bus 63 is used to realize connection communication between the processor 61 and the memory 62. Processor 61 is operative to execute one or more programs stored in memory 62 to implement the steps of the reverse proxy method in embodiments of the present invention.
In particular, the processor 61 is configured to execute one or more programs stored in the memory 62 to implement the following steps: receiving a message and locally storing the message in a preset mode; sending a notification signal to an application layer; after receiving the trigger signal fed back by the application layer according to the notification signal, calling the locally stored message and sending the message to the client on the client link of the protocol stack.
Alternatively, the processor 61 is configured to execute one or more programs stored in the memory 62 to implement the following steps: receiving a notification signal sent by a protocol stack; judging whether the message to be received needs to be processed or not according to the notification signal; and sending a trigger signal to the protocol stack under the condition that the judgment result is negative, wherein the trigger signal is used for indicating the protocol stack to send the message to a client on a client link.
The specific implementation details of the reverse proxy device provided by the embodiment of the invention can refer to other embodiments of the invention, the interactive flow between the application layer and the protocol stack is optimized, the forwarding operation of the existing application layer is reduced to the implementation of the transmission layer, the application layer is only responsible for receiving the notification and triggering the message sending flow, the data reading and writing are not involved, the data calling is implemented in the improved protocol stack, the message copying between the improved protocol stack and the application layer is not needed, the instruction and the data in the transparent transmission process are separated, the transparent transmission flow overhead is effectively reduced, and the system efficiency is obviously improved.
Embodiments of the present invention further provide a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement the steps of any reverse proxy method described in the embodiments of the present invention.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented in program code executable by a computing device, such that they may be stored on a computer storage medium (ROM/RAM, magnetic disk, optical disk) and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The foregoing is a more detailed description of embodiments of the present invention, and the present invention is not to be considered limited to such descriptions. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.
Claims (10)
1. A reverse proxy method, comprising:
a protocol stack receives a message and locally stores the message in a preset mode, wherein the protocol stack is a user mode protocol stack;
the protocol stack sends a notification signal to an application layer, and the message is not copied to the application layer;
and after receiving a trigger signal fed back by the application layer according to the notification signal, the protocol stack calls the locally stored message and sends the message to a client on a client link of the protocol stack.
2. The reverse proxy method of claim 1, wherein said locally storing the packet in a predetermined manner comprises:
and storing the message locally by adopting a memory cache mbuf structural body distributed from a memory pool.
3. The reverse proxy method of claim 2, wherein prior to receiving the packet, the protocol stack further comprises:
and allocating the memory cache mbuf structure from a memory pool.
4. The reverse proxy method of claim 2, wherein said locally storing said message in a predetermined manner further comprises:
and adding the message into a receiving buffer queue of a service end link of the protocol stack.
5. The reverse proxy method of any of claims 1 to 4, wherein said invoking the locally stored message and sending it to a client over a client link of the protocol stack comprises:
adding the message into a sending buffer queue of a client link of the protocol stack;
and sequentially calling the locally stored messages according to the sequence of the messages in the transmission buffer queue and transmitting the messages to the client on a client link of the protocol stack.
6. A reverse proxy method, comprising:
an application layer receives a message receiving notification signal sent by a protocol stack, and does not copy a message locally stored by the protocol stack, wherein the protocol stack is a user mode protocol stack;
the application layer judges whether the message to be received needs to be processed or not according to the notification signal;
and sending a trigger signal to the protocol stack under the condition that the judgment result is negative, wherein the trigger signal is used for indicating the protocol stack to send the message to a client on a client link.
7. A reverse proxy apparatus, comprising:
the first receiving module is used for receiving the message;
the storage module is used for locally storing the message in a preset mode;
a first sending module, configured to send a message reception notification signal to an application layer, where the message is not copied to the application layer;
a second receiving module, configured to receive a trigger signal fed back by the application layer according to the notification signal;
the calling module is used for calling the locally stored message;
and the second sending module is used for sending the message called by the calling module to a client on a client link of a protocol stack, wherein the protocol stack is a user mode protocol stack.
8. A reverse proxy apparatus, comprising:
the third receiving module is used for receiving a notification signal sent by a protocol stack, and a message locally stored by the protocol stack is not copied, wherein the protocol stack is a user mode protocol stack;
the judging module is used for judging whether the message to be received needs to be processed according to the notification signal;
and a third sending module, configured to send a trigger signal to the protocol stack if the determination result of the determining module is negative, where the trigger signal is used to instruct the protocol stack to send the packet to the client on its client link.
9. A reverse proxy device comprises a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the steps of the reverse proxy method of any of claims 1-6.
10. A computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of the reverse proxy method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710868532.0A CN109547519B (en) | 2017-09-22 | 2017-09-22 | Reverse proxy method, apparatus and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710868532.0A CN109547519B (en) | 2017-09-22 | 2017-09-22 | Reverse proxy method, apparatus and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109547519A CN109547519A (en) | 2019-03-29 |
CN109547519B true CN109547519B (en) | 2022-11-01 |
Family
ID=65830673
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710868532.0A Active CN109547519B (en) | 2017-09-22 | 2017-09-22 | Reverse proxy method, apparatus and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109547519B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112217772B (en) * | 2019-07-11 | 2022-07-01 | 中移(苏州)软件技术有限公司 | Protocol stack implementation method, device and storage medium |
CN112583874B (en) * | 2019-09-30 | 2024-02-20 | 中兴通讯股份有限公司 | Message forwarding method and device of heterogeneous network |
CN110995656B (en) * | 2019-11-06 | 2022-08-05 | 深信服科技股份有限公司 | Load balancing method, device, equipment and storage medium |
US11831616B2 (en) * | 2020-03-24 | 2023-11-28 | Microsoft Technology Licensing, Llc | Reverse proxy servers for implementing application layer-based and transport layer-based security rules |
CN112787998B (en) * | 2020-12-26 | 2022-04-08 | 郑州信大捷安信息技术股份有限公司 | DPDK-based ALG implementation method and system |
CN113596171B (en) * | 2021-08-04 | 2024-02-20 | 杭州网易数之帆科技有限公司 | Cloud computing data interaction method, system, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101150485A (en) * | 2007-11-15 | 2008-03-26 | 曙光信息产业(北京)有限公司 | A management method for network data transmission of zero copy buffer queue |
CN102185936A (en) * | 2011-06-23 | 2011-09-14 | 上海牙木通讯技术有限公司 | DNS (domain name system) service system and method based on Linux operation system |
CN102215231A (en) * | 2011-06-03 | 2011-10-12 | 华为软件技术有限公司 | Data forwarding method and gateway |
CN103905420A (en) * | 2013-12-06 | 2014-07-02 | 北京太一星晨信息技术有限公司 | Method and device for data transmission between protocol stack and application program |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101286978B (en) * | 2008-05-22 | 2011-08-31 | 上海交通大学 | TCP connection separation with complete semantic, control method and system |
CN102364429B (en) * | 2011-05-31 | 2015-04-08 | 北京瑞工科技发展有限公司 | Wireless printing system capable of guaranteeing reliable transmission of data |
CN105306326B (en) * | 2015-11-13 | 2019-03-29 | 上海新时达电气股份有限公司 | Driver integrates the implementation method of a variety of industrial bus |
US9961002B2 (en) * | 2015-12-02 | 2018-05-01 | Macau University Of Science And Technology | PacketUsher: accelerating computer-intensive packet processing |
CN106302199B (en) * | 2016-08-10 | 2019-12-17 | 成都广达新网科技股份有限公司 | user mode protocol stack implementation method and system based on three-layer switch equipment |
CN107070934B (en) * | 2017-04-26 | 2018-08-28 | 腾讯科技(深圳)有限公司 | A kind of transparent proxy implementation, device, client and terminal |
-
2017
- 2017-09-22 CN CN201710868532.0A patent/CN109547519B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101150485A (en) * | 2007-11-15 | 2008-03-26 | 曙光信息产业(北京)有限公司 | A management method for network data transmission of zero copy buffer queue |
CN102215231A (en) * | 2011-06-03 | 2011-10-12 | 华为软件技术有限公司 | Data forwarding method and gateway |
CN102185936A (en) * | 2011-06-23 | 2011-09-14 | 上海牙木通讯技术有限公司 | DNS (domain name system) service system and method based on Linux operation system |
CN103905420A (en) * | 2013-12-06 | 2014-07-02 | 北京太一星晨信息技术有限公司 | Method and device for data transmission between protocol stack and application program |
Also Published As
Publication number | Publication date |
---|---|
CN109547519A (en) | 2019-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109547519B (en) | Reverse proxy method, apparatus and computer readable storage medium | |
EP3482298B1 (en) | Multicast apparatuses and methods for distributing data to multiple receivers in high-performance computing and cloud-based networks | |
US7571247B2 (en) | Efficient send socket call handling by a transport layer | |
US7822053B2 (en) | Apparatus and method for TCP buffer copy distributed parallel processing | |
JP6177934B2 (en) | Data retransmission method and access network gateway in cooperative service transmission | |
US10609125B2 (en) | Method and system for transmitting communication data | |
US9794354B1 (en) | System and method for communication between networked applications | |
US11218570B2 (en) | Network packet processing method and apparatus and network server | |
CN113572582B (en) | Data transmission and retransmission control method and system, storage medium and electronic device | |
CN111404714A (en) | A network transport layer connection control method and network device | |
US8726287B2 (en) | Method for reducing inter-process communication latency | |
CN102984089B (en) | Traffic management dispatching method and device | |
CN111404986A (en) | Data transmission processing method, device and storage medium | |
CN110445580A (en) | Data transmission method for uplink and device, storage medium, electronic device | |
US11444882B2 (en) | Methods for dynamically controlling transmission control protocol push functionality and devices thereof | |
CN106685854B (en) | Data sending method and system | |
US11792139B2 (en) | Efficient packet reordering using hints | |
CN113204517B (en) | Inter-core sharing method of Ethernet controller special for electric power | |
CN114595080A (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
CN116192816A (en) | Data transmission method, sending server, receiving server and storage medium | |
CN109688085B (en) | Transmission control protocol proxy method, storage medium and server | |
CN111405046A (en) | Authorization method for batch equipment | |
CN115665042B (en) | Data processing method, device, user plane functional entity and storage medium | |
CN116760504A (en) | Session synchronization method, device, service node, terminal and readable storage medium | |
Wang | Design and Implementation of TCPHA |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |