A multi-path TCP distribution method and system
By introducing the connection group identifier (GID) into the TCP connection and managing the GID table between the load balancer and the acceleration node, the problem of inaccurate TCP connection distribution is solved, and the correctness of data reassembly in multi-path TCP transmission is ensured.
Patent Information
- Application Number
- CN202211686309.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-12-27
AI Technical Summary
When distributing TCP connections, existing load balancers and Linux kernels cannot guarantee that multiple TCP connections in the same connection group are distributed to the same acceleration node or the same process for processing, resulting in data reassembly errors.
By generating a connection group identifier (GID) and carrying it in the SYN message, combined with the GID connection table and GID session table, the correct distribution and reorganization of TCP connections between the load balancer and acceleration nodes is ensured.
It achieves the correct reassembly of data in multi-path TCP transmission, ensuring the integrity of the data when it finally reaches the receiving end in the accelerated network.
Smart Images

Figure CN116155976B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-path distribution and network acceleration of TCP, and in particular to a multi-path TCP distribution system and method. Background Art
[0002] Currently, Internet applications are experiencing explosive growth, and application forms are also becoming more diverse. In addition to traditional applications based on the HTTP / HTTPS protocol, a large number of applications developed directly based on the TCP protocol have also emerged. At the same time, the content provided by these applications is also becoming more diverse. In order to provide customers with an extremely fast and smooth user experience and reduce the load on the server, CDN technology is often required for acceleration, which is commonly referred to as application acceleration.
[0003] Application acceleration usually involves technologies such as local access, resource caching, and protocol optimization. In addition to TCP congestion control and packet retransmission, protocol optimization also includes multi-path transmission technologies, such as the attached Figure 1 As shown, the edge nodes of the CDN acceleration network perform TCP multipath distribution on the data transmitted by users or source stations, distributing the data originally transmitted in one TCP connection to multiple TCP connections for transmission. Paths can be switched in real time according to link quality, or multipath redundant transmission can be performed.
[0004] The basic principles of multipath TCP transmission are as follows:
[0005] 1. The data of a TCP connection accessed by a user is stored in an acceleration node close to the sending end (such as the attached Figure 1 The data is split into Node-1 in the figure, and then multi-path TCP transmission is performed. That is, according to the path quality information detected and analyzed, the data is distributed to different TCP connections at different times, or a piece of data is redundantly transmitted in multiple TCP connections according to the configuration.
[0006] 2. When the data reaches the acceleration node close to the receiving end (such as the attached Figure 1 First, the load balancer must distribute multiple TCP connections belonging to the same connection group to the same acceleration node. Second, because the acceleration software on the acceleration node generally uses port reuse (i.e., REUSEPORT) to improve concurrent processing capabilities, meaning that multiple processes simultaneously listen on the same port, the acceleration node's operating system kernel must distribute multiple TCP connections from the same connection group to the same process for processing. This allows the acceleration software to reassemble the data from multiple TCP connections in the same connection group and transmit it to the receiving end, ensuring that the data received by the receiving end is correct.
[0007] However, the current load balancer and Linux kernel distribute TCP connections based on the hash of the TCP connection quad. Since the quads of multiple TCP connections in the same connection group are different, there is no guarantee that they will be distributed to the same acceleration node or the same process on the acceleration node for processing. Summary of the Invention
[0008] To solve the above problems, the present invention seeks to protect a multi-path TCP distribution method, which is applied to a communication system including an acceleration node and a load balancer, and comprises:
[0009] Step 1: When the acceleration node at the sending end receives the user's transmission data, it generates a connection group identifier (GID) based on the connection information in the data;
[0010] Step 2: Associate the GID with the TCP socket, create multiple TCP connections based on the configured acceleration requirements and the detected path quality information, and send the GID information to the peer end in a SYN message. The peer end stores the GID in the TCP socket.
[0011] Step 3: When establishing a TCP connection between other transfer acceleration nodes, the GID is also carried until the last acceleration node.
[0012] Furthermore, step 4 is also included: introducing a GID connection table in the cluster's load balancer to store active TCP connections and distribute new connections. The GID connection table uses the GID as the key and the acceleration node as the value.
[0013] Furthermore, in step 4, when the load balancer receives a new TCP connection request, it first parses the GID from the SYN message and searches the GID connection table. If it is a hit, it is forwarded to the corresponding acceleration node. Otherwise, it selects an acceleration node for forwarding based on algorithms such as quadruple hashing, GID hashing, or polling, and saves the mapping between GID and acceleration node in the GID connection table.
[0014] Furthermore, in step 3, a GID session table is introduced on the acceleration node to distribute new connections. The GIDsession table uses GID as the key and socket as the value to save active TCP connections.
[0015] Furthermore, in step 3, when a new TCP connection arrives near the acceleration node, the GID parsed from the SYN message is searched in the GID session table. If a match is found, the corresponding socket is selected for processing; otherwise, a socket is selected based on an algorithm such as quad hashing, GID hashing, or polling, and the mapping between the GID and the socket is saved in the GID session table.
[0016] The present application also requests protection for a multi-path TCP distribution system, which includes: a sending end, an acceleration node close to the sending end, a receiving end, and a load balancer close to the receiving end; wherein the acceleration node deploys a path detection and quality analysis module to create multiple TCP connections based on the configured acceleration requirements and the detected path quality information; corresponding acceleration nodes are also deployed in the load balancer, and the above-mentioned acceleration nodes cooperate with each other to implement any of the methods described in claims 1-5.
[0017] The multi-path TCP distribution system and method of the present invention are applicable to load balancing nodes and acceleration nodes in an application acceleration network, ensuring that data can be correctly reassembled and reach the receiving end after being transmitted through the multi-path TCP of the acceleration network. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work. Figure 1 A multi-path TCP distribution system is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0020] The following is a specific embodiment of the present invention. Figure 1 Described as an example topology diagram.
[0021] The following steps are involved:
[0022] Step 1: When the sending acceleration node receives the user's transmission data, it generates a connection group identifier (GID) based on the connection information in the data. Path detection and quality analysis modules are deployed in advance on each acceleration node. When the acceleration node receives the user's transmission data, it creates multiple TCP connections based on the configured acceleration requirements and the detected path quality information to plan the optimal path based on user access. Multipath TCP usage is configured in advance on each acceleration node, such as whether to perform redundant transmission and the number of TCP connections to use. When Node-1 receives a new user request, it first generates a GID based on the quadruple or other information.
[0023] Step 2: Associate the GID with the TCP socket. Create multiple TCP connections based on the configured acceleration requirements and detected path quality information. Send the GID information in a SYN packet to the peer, which stores the GID in the TCP socket. Based on the path quality information and configuration, create multiple TCP connections (assuming two) with the next acceleration node. When creating the TCP connections, call the kernel interface to set the GID. When the kernel sends the TCP handshake SYN packet, it uses the TCP option TCPOPT_GID to carry the GID to the next acceleration node (such as Node-2 and Node-3). The next acceleration node stores the GID in the TCP socket. Node1's acceleration software then distributes subsequent TCP data for that connection to the two established TCP connections based on the path quality information and configuration, transmitting it to Node-2 or Node-3.
[0024] Step 3: When establishing a TCP connection between other transfer acceleration nodes, the GID is also carried until the last acceleration node.
[0025] After receiving the new TCP connection request from Node-1, the acceleration software on Node-2 or Node-3 calls the kernel interface to obtain the GID and establishes a TCP connection with the next acceleration node, Node-N. Similarly, it uses a TCP option to carry the GID to Node-N. Note: Because Node-N belongs to a cluster, the connection is actually established with the cluster's virtual IP address.
[0026] Step 4: Introduce a GID connection table in the cluster's load balancer to store active TCP connections and distribute new connections. The GID connection table uses the GID as the key and the acceleration node as the value.
[0027] Before a TCP SYN packet reaches Node-N, it first passes through the load balancer. The cluster's load balancer introduces a GID connection table to distribute new connections. The GID connection table uses the GID as the key and the acceleration node as the value to store active TCP connections.
[0028] Furthermore, when the load balancer receives a TCP SYN packet, it will first parse the GID and use the GID to query the GID connection table. If a match is found, it will be forwarded to the corresponding acceleration node. Otherwise, it will select an acceleration node for forwarding based on algorithms such as quadruple hashing, GID hashing, or polling, and save the mapping between GID and acceleration node in the GID connection table.
[0029] Finally, the TCP SYN packet reaches Node-N, which uses the GID session table to distribute new connections. The GID session table stores active TCP connections, using the GID as the key and the socket as the value. The kernel parses the GID and uses it as the key to search the GID session table. If a match is found, the corresponding socket is selected for processing. Otherwise, a socket in the REUSEPORT group is selected for processing based on algorithms such as quad-tuple hashing, GID hashing, or round-robin. The mapping between the GID and the socket is stored in the GID session table.
[0030] Before reading data from a TCP connection, Node-N's acceleration software calls an interface to obtain the GID corresponding to the TCP connection from the kernel. It then reassembles the data of multiple TCP connections with the same GID and sends it to the receiving end.
[0031] The above-described embodiments merely represent implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A multipath TCP distribution method, applied to a communication system including an acceleration node and a load balancer, comprising: Step 1: When the acceleration node on the sending end receives the user's transmission data, it generates a connection group identifier (GID) based on the connection information in the data and embeds the GID into the SYN message through the TCP option field TCPOPT_GID; Step 2: Associate the GID with the TCP socket, create multiple TCP connections based on the configured acceleration requirements and the detected path quality information, and send the GID information to the peer end in a SYN message. The peer end stores the GID in the TCP socket. Step 3: When establishing a TCP connection between other transfer acceleration nodes, the GID is also carried until the last acceleration node, which is the acceleration node of the receiving end; Step 4: Before the TCP SYN packet reaches the last acceleration node, it first passes through the load balancer. The load balancer in the cluster to which the last acceleration node belongs introduces a GID connection table to store active TCP connections and distribute new connections. The GID connection table uses the GID as the key and the acceleration node as the value. When a new TCP connection arrives at the receiving end's acceleration node, the GID parsed from the SYN message is searched in the GIDsession table. If a match is found, the corresponding socket is selected for processing. Otherwise, a socket is selected based on the four-tuple hash, GID hash, or polling algorithm, and the mapping between GID and socket is saved in the GID session table.
2. The method according to claim 1, characterized in that In step 4, when the load balancer receives a new TCP connection request, it first parses the GID from the SYN message and searches the GID connection table. If it matches, it forwards it to the corresponding acceleration node. Otherwise, it selects an acceleration node for forwarding based on the four-tuple hash, GID hash, or polling algorithm, and saves the mapping between the GID and the acceleration node in the GID connection table.
3. The method according to claim 1, characterized in that In step 3, a GID session table is introduced on the acceleration node to distribute new connections. The GID session table uses GID as the key and socket as the value to save active TCP connections.
4. A multipath TCP distribution system, the system comprising: The sending end, and the acceleration node close to the sending end, the receiving end, and the load balancer close to the receiving end; in The acceleration node deploys a path detection and quality analysis module to create multiple TCP connections based on the configured acceleration requirements and the detected path quality information; the corresponding acceleration node is also deployed in the load balancer, and the above-mentioned acceleration nodes cooperate with each other to implement any of the methods described in claims 1-3.