Patent Description:
A network at the network server side is very stable and supports user requests at high concurrency and high throughput. A wireless mobile network has inherent transmission characteristics, such as disorder of packet forwarding, incapability of accurately and timely identifying packet loss, and resource shortage in busy time. When the above situations occur, the Internet access rate of the user changes rapidly, which influences the Internet access experience of mobile users.

A proxy technology in related art is mainly based on forward proxy technology and reverse proxy technology. Transmission Control Protocol (TCP) connections are respectively established between a proxy service and two ends of communication, that is, the proxy service needs to establish the TCP connection with both an access client and a server, and then interactively forwards data at a session layer. The forward proxy technology is non-transparent to the client, and the reverse proxy technology is non-transparent to the server. D1(<CIT>) relates to data processing method, device and user state protocol stack of transport layer; D2(XP <NUM>) relates to "Userspace Networking with libuinet"; D3(XP <NUM>) relates to "libuinet:The FreeBSD TCP/IP Stack as a Userland Library, Plus Extras"; D4(XP <NUM>) relates to "Userspace Networking with libuinet"; D5(<CIT>) relates to a satellite communicating network acceleration device and method.

The technical problem to be solved by embodiments of the present application is to realize a transparent proxy service between a client and a server, and solve the problem that the forwarding performance is influenced due to multiple copies of data between a user mode and a kernel mode in the proxy service. The embodiments of the present application provide a packet forwarding method and apparatus for a heterogeneous network.

The present application is set out in the appended set of claims.

A packet forwarding method for a heterogeneous network according to the embodiments of the present application is provided in independent claim <NUM>. Further embodiments of the method are provided in dependent claims <NUM>-<NUM>.

The embodiments of the present application also provide a computer-readable storage medium, in which a program for implementing information transfer is stored. The program, when executed by a processor, implements the operations of the above packet forwarding method for a heterogeneous network.

According to the computer-readable storage medium in the embodiments of the present application, by means of running the packet forwarding method for a heterogeneous network, packet forwarding can be completed in a transport layer of a proxy node, and the problem of a bottleneck in proxy service performance caused by multiple copies of a packet in a user mode and a kernel mode during a forwarding process can be avoided, thereby realizing packet zero-copy forwarding based on a user mode protocol stack, and effectively improving the system performance. Moreover, according to the packet forwarding method in the present application, there is no need to fake a man-in-the-middle and there is no risk of a man-in-the-middle attack, and encryption transmission of TLS, etc. is supported, thereby improving the security and reliability of packet forwarding.

The embodiments of the present application also provide a proxy node device, which includes: a memory, a processor and a computer program which is stored on the memory and capable of running on the processor. The computer program, when executed by the processor, implements the operations of the above packet forwarding method for a heterogeneous network.

According to the proxy node device in the embodiments of the present application, packet forwarding can be completed in a transport layer of a proxy node, thereby avoiding the problem of a bottleneck in proxy service performance caused by multiple copies of a packet in a user mode and a kernel mode during a forwarding process.

In order to further elaborate the technical means adopted by the embodiments of the present application to achieve a predetermined purpose and the efficacy thereof, the present application is described in detail below in combination with the accompanying drawings and exemplary embodiments.

As shown in <FIG>, in the related art, a proxy service between a client A and a server B is a pseudo-transparent technology, for example, haproxy. The proxy process is described in detail as follows.

The client A initiates a link establishment request to the server B, and a proxy server P intercepts the link establishment request and disguises itself as the server B to complete three-way handshake with the client A.

When the client A initiates a service request, the proxy server P disguises itself as the client A to establish a link with the server B, and initiates a request.

The server B sends a response message to the proxy server P, a proxy server process receives the response message and searches for a link of the client A; and the proxy server P finds the corresponding link and disguises itself as the server B to send the response message to the client A.

In the above technical solution, the proxy server P is transparent to both the client A and the server B, but still needs to establish a link with the client A and the server B respectively, and there is a risk of a man-in-the-middle attack, so encryption channels such as TLS and HTTP Security (HTTPS) cannot be supported. Moreover, during a forwarding process, data flows need to be received to an application layer and sent from the application layer to a destination node, and multiple copies are made between a kernel mode and a user mode, so there is a performance bottleneck.

As shown in <FIG> and <FIG>, a packet forwarding method for a heterogeneous network according to some embodiments of the present application includes the following operations S101 and S102.

At S101, a link establishment request sent by a client is received, and the link establishment request is sent to a server, so as to establish a connection between the client and the server.

At S102, an interaction packet is forwarded between the client and the server based on a user mode protocol stack.

It is to be noted that in the present application, as shown in <FIG>, there is a proxy node set between the client and the server. The proxy node is configured to forward an interaction packet between the client and the server. Moreover, the proxy node in the embodiments of the present application completes packet forwarding through a transport layer. Therefore, the proxy node can realize a transparent proxy service and packet forwarding based on the user mode protocol stack.

According to the packet forwarding method for a heterogeneous network in the embodiments of the present application, by means of completing packet forwarding in a transport layer, the problem of a bottleneck in proxy service performance caused by multiple copies of a packet in a user mode and a kernel mode during a forwarding process can be avoided, thereby realizing packet zero-copy forwarding based on a user mode protocol stack, and effectively improving the system performance. Moreover, according to the packet forwarding method in the present application, there is no need to fake a man-in-the-middle and there is no risk of a man-in-the-middle attack, and encryption transmission of TLS, etc. is supported, thereby improving the security and reliability of packet forwarding.

As shown in <FIG>, according to some embodiments of the present application, the operation that the link establishment request and the response message are forwarded between the client and the server includes the following operations S201 to S203.

At S201, the link establishment request sent by the client is received and forwarded to the server, so that the server sends a first response message to the client in responsive to the link establishment request.

At S202, the first response message is received and forwarded to the client, so that the client sends a second response message to the server in responsive to the first response message.

At S203, the second response message is received and forwarded to the server, so as to establish the connection between the client and the server.

It is to be noted that the "link establishment request" here may be an SYN request, and the "first response message" and "second response message" may be ACK packets. For example, the client may send the SYN request to the server through the proxy node, after receiving the SYN request, the server sends the ACK packet to the client through the proxy node, and after receiving the ACK packet, the client sends the ACK packet to the server through the proxy node, so as to complete three-way handshake between the client and the server to establish a TCP connection between the client and the server.

In some embodiments of the present application, the operation that the link establishment request sent by the client is received and forwarded to the server includes the following operations.

The link establishment request sent by the client is received according to a preset default route.

A session is created based on the link establishment request, and the link establishment request is forwarded to the server after an address of the link establishment request is updated.

According to some embodiments of the present application, message contents of the session include: a link serial number and a window size.

It is to be noted that there is a TCP Optimizer (TCPO) module set between a transport layer and a network layer of the proxy node, which is configured to bidirectionally forward a TCP packet. For example, when a client UE wants to establish a link with a WEB server SP, the client UE first initiates an SYN request with a target port of <NUM> to the WEB server, and configures a default route to direct the SYN request to an intermediate proxy node. The proxy node configures a forwarding rule of sending the TCP packet with the target port of <NUM> to a protocol stack, and an IP layer sends the packet to be processed to the TCPO module. The TCPO module creates a session, records the serial number of a new TCP link, a window size and other information, and updates an MAC address according to a routing address and then sends the packet through a network adapter. For example, when the client sends a packet to the server, the TCPO module updates the MAC address of the client to the MAC address of the proxy node according to the routing address and sends the packet to the server through the network adapter. A source IP and a port of a link establishment packet received by the server are from the client UE, so as to send an SYN+ACK packet to the client UE.

As shown in <FIG> and <FIG>, in some embodiments of the present application, the operation that an interaction packet is forwarded between the client and the server based on the user mode protocol stack includes the following operations S401 to S404.

At S401, a request packet sent by the client is received, and a first response packet is sent to the client in responsive to the request packet.

At S402, the request packet is added to a first queue and forwarded to the server, so that the server sends a second response packet in responsive to the request packet.

At S403, the second response packet is received, and an acknowledgement packet is sent to the server based on the second response packet.

At S404, the second response packet is added to a second buffer queue and sent to the client.

It is to be noted that, as shown in <FIG>, after the three-way handshake is completed to establish a connection between the client and the server, the client may send a request packet to the server. The preset default route directs the request packet to the proxy node. The TCPO module of the proxy node receives the request packet, adds the request packet to a buffer queue A to forward the request packet to the server, and sends an ACK packet to the client. After receiving the second response packet from the server, the TCPO module adds the second response packet to a queue B to forward the second response packet to the client, and sends the ACK packet to the server to confirm that data is received.

According to some embodiments of the present application, the method further includes that: in a case where a data capacity of the second response packet in the second buffer queue is greater than a threshold, a window size of the request packet sent to the server is reduced, so as to reduce a packet sending rate of the server. As shown in <FIG>, when the network at the client side causes too much backlogged data in buffer queue B, the size of an announcement window sent to the server can be reduced to inform the server to reduce a data transmission rate. Thus, the optimization during the packet interaction process is realized, and the problems of congestion, packet loss, etc. are effectively avoided.

In some embodiments of the present application, the method further includes that: in a case where the client does not receive the second response packet within a predetermined period of time, the second response packet is added to the second buffer queue again and sent to the client. As shown in <FIG>, the data in the buffer queue B is dequeued one by one, and a data packet is forwarded to the client. When receiving the ACK packet, the proxy node may delete immediately the corresponding packet in the queue. A retransmission timer may be set. If the client does not receive the data packet within a predetermined period of time, the client may retransmit the response packet. Thus, the problem of packet loss is effectively avoided.

According to some embodiments of the present application, the method further includes that: in a case where packet loss is detected during the packet interaction process, a window size of the interaction packet is adjusted to a preset threshold. It is to be noted that the "preset threshold" here may be a "slow start threshold". The slow start threshold may be understood as the maximum value of slow start in a packet sending process. By means of adjusting the window size to be the same as the slow start threshold, it is possible to skip a slow start phase and enter a congestion avoidance phase directly, so that the packet interaction process between the client and the server is optimized and accelerated.

As shown in <FIG> and <FIG>, a packet forwarding apparatus for a heterogeneous network according to some embodiments of the present application includes a forwarding module. The forwarding module may be the TCPO module and is configured to forward a link establishment request and a response message between a client and a server, establish a connection between the client and the server, and forward an interaction packet between the client and the server based on a user mode protocol stack.

According to the packet forwarding apparatus for a heterogeneous network in the embodiments of the present application, by means of completing packet forwarding in a transport layer by the forwarding module, the problem of a bottleneck in proxy service performance caused by multiple copies of a packet in a user mode and a kernel mode during a forwarding process can be avoided, thereby realizing packet zero-copy forwarding based on a user mode protocol stack, and effectively improving the system performance. Moreover, according to the packet forwarding apparatus in the present application, there is no need to fake a man-in-the-middle and there is no risk of a man-in-the-middle attack, and encryption transmission of TLS, etc. is supported, thereby improving the security and reliability of packet forwarding.

In a computer-readable storage medium according to the embodiments of the present application, a program for implementing information transfer is stored. The program, when executed by a processor, implements the operations of the above packet forwarding method for a heterogeneous network.

A proxy node device according to the embodiments of the present application includes: a memory, a processor and a computer program which is stored on the memory and capable of running on the processor. The computer program, when executed by the processor, implements the operations of the above packet forwarding method for a heterogeneous network.

According to the proxy node device in the embodiments of the present application, packet forwarding can be completed in the transport layer of the proxy node device, and the problem of a bottleneck in proxy service performance caused by multiple copies of a packet in a user mode and a kernel mode during a forwarding process can be avoided, thereby realizing packet zero-copy forwarding based on a user mode protocol stack, and effectively improving the system performance. Moreover, according to the packet forwarding method in the present application, there is no need to fake a man-in-the-middle and there is no risk of a man-in-the-middle attack, and encryption transmission of TLS, etc. is supported, thereby improving the security and reliability of packet forwarding.

It is to be noted that Intel launches a Data Plane Development Kit (DPDK) project, which supports sending and receiving of user mode network packets. At present, a DPDK sending and receiving framework is mainly used for packet forwarding between network devices. In the embodiments of the present application, the DPDK is used as the sending and receiving framework of a transparent proxy server, and a TCP/IP open source protocol stack of Berkeley Software Distribution (BSD) is used as the user mode protocol stack. Other user mode protocol stack frameworks may also be used.

Taking that a mobile phone user accesses web pages through a browser as an example, the packet forwarding method and apparatus for a heterogeneous network according to the embodiments of the present application are introduced below. As shown in <FIG> and <FIG>, a proxy node is embedded between a User End (UE) and a Service Provider (SP), transparent packet forwarding is realized based on a DPDK+user mode TCP/IP protocol stack, and a TCP protocol stack is optimized and accelerated according to the transmission characteristics of wireless networks, so as to improve the Internet access experience of mobile users. As shown in <FIG> and <FIG>, the specific process is described as follows.

A client UE initiates an SYN request with a target port of <NUM> to a WEB server SP, and configures a default route to direct the SYN request to an intermediate proxy node.

The proxy node configures a forwarding rule of forwarding the TCP packet with a target port of <NUM> to a protocol stack, and the IP layer sends the packet to be processed by the TCPO module to the TCPO module.

The TCPO module creates a session, records the serial number of a new TCP link, a window size and other information, and updates the MAC address according to the routing address and then sends the packet through the network adapter.

The source IP and the port of the link establishment packet received by the SP are from the client UE, so the SYN+ACK packets are sent to the UE.

The proxy node forwards the packet from the SP to the TCPO module, and the TCPO module forwards the SYN+ACK packets to the UE.

The UE receives the SYN+ACK packet and sends the ACK packet, the SP receives the ACK packet, and the UE completes the three-way handshake with SP.

The client UE sends a GET request to the TCPO module.

The TCPO module receives the data packet, enqueues the data packet in the buffer queue A, sends the ACK packet to the UE, and forwards the request packet to the SP.

The TCPO module receives the response packet sent by the SP, enqueues the response packet in the buffer queue B, and sends an ACK packet to the SP to confirm reception of the data. If the network at the UE side causes much backlogged data in queue B, the size of the announcement window sent to the SP is reduced, and the SP is informed to reduce the data transmission rate.

The data packets in the buffer queue B are dequeued one by one and forwarded to the client. A retransmission timer is set, and if the timer times out, the specified packet is retransmitted, and the packet in the queue is deleted immediately after the ACK is received.

The UE breaks the link actively. The TCPO transmits transparently a handshake packet for four times, and breaks the link with the SP.

After receiving a link breaking request from the SP, if there are backlogged messages in the queue B, the TCPO disguises itself as the UE to break the link with the SP, and then breaks the link with the UE after the data in the queue B is sent completely.

Realizing the packet forwarding between the client and the server by means of the above proxy node has the following advantages.

To sum up, according to the proxy schemes provided in the embodiments of the present application, by embedding the TCPO module, which is configured to forward bidirectionally the TCP packet, in the user mode TCP/IP protocol stack, fully transparent proxy is realized, TCP optimization logic is added, and the network experience of the client is improved. Thus, not only the performance bottleneck of the traditional proxy server is solved, but also an open framework is provided for TCP optimization, thereby ensuring the stability and reliability of the native protocol stack as well as facilitating the implementation of customized policies for services.

It is apparent that those having ordinary skill in the art should appreciate that the above modules and operations of the embodiments of the present application may be implemented by a general-purpose computing device, and they may be centralized in a single computing device or distributed on a network composed of multiple computing devices. The above modules and operations may be implemented by a program code which is capable of being executed by the computing device, so that they may be stored in a storage device and executed by the computing device. In some situations, the presented or described operations may be executed in an order different from that described here; or they are made into integrated circuit modules, respectively; or multiple modules and operations of them are made into a single integrated circuit module for implementation. Therefore, the present application is not limited to any particular combination of hardware and software.

Claim 1:
A packet forwarding method for a heterogeneous network, performed by a proxy node device and comprising:
receiving a link establishment request sent by a client, and forwarding the link establishment request to a server, so as to establish a connection between the client and the server (S101); and
forwarding an interaction packet between the client and the server based on a user mode protocol stack (S102), wherein the interaction packet is forwarded through a transport layer;
characterized in that
forwarding an interaction packet between the client and the server based on a user mode protocol stack comprises: receiving a request packet sent by the client, and sending a first response packet to the client in response to the request packet (S401), wherein the first response packet is an acknowledgement packet; adding the request packet to a first buffer queue and forwarding the request packet to the server, so that the server sends a second response packet in response to the request packet (S402); receiving the second response packet, and sending an acknowledgement packet to the server based on the second response packet (S403); and adding the second response packet to a second buffer queue and sending the second response packet to the client (S404).