Synchronous conntrack method, system and device based on four-layer load balancing cluster

By adopting the multi-active cluster deployment mode and the multicast synchronization mechanism of the conntrackd daemon in the four-layer load balancing cluster, the TCP connection interruption problem caused by the failure of the four-layer load balancer is solved, improving resource utilization and user experience, and reducing deployment costs.

CN115665048BActive Publication Date: 2024-09-27SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211227076.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-09
Publication Date
2024-09-27
Estimated Expiration
2042-10-09

AI Technical Summary

Technical Problem

The TCP connection interruption problem and low resource utilization caused by the failure of the four-layer load balancer lead to reduced cloud platform user experience and increased deployment costs.

Method used

Using the synchronous conntrack method based on the four-layer load balancing cluster, through the multi-active cluster deployment mode and the multicast synchronization mechanism of the conntrackd daemon, the TCP connection status is synchronized in real time, so that all load balancer nodes are in working status and jointly maintain the TCP connection .

Benefits of technology

It improves cloud platform resource utilization, avoids TCP connection interruption, improves user experience, and reduces deployment costs, while ensuring the high availability of the load balancing function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115665048B
    Figure CN115665048B
Patent Text Reader

Abstract

The present invention discloses a synchronous conntrack method, system and device based on a four-layer load balancing cluster, belonging to the field of cloud computing and computer network technology. The method adopts a four-layer load balancer multi-master cluster architecture deployment mode, and all load balancer nodes are in working state; the conntrackd daemon is run on multiple master four-layer load balancer nodes to extract the conntrack of the TCP connection maintained by the kernel on the node in real time; the conntrackd built-in multicast synchronization mechanism is used to synchronize conntrack to all master load balancer nodes. The present invention can improve the user experience of cloud services without affecting the load balancing function of the cloud platform, and use a multi-master cluster deployment mode to improve resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing and computer network technology, and in particular to a synchronous conntrack method, system and device based on a four-layer load balancing cluster. Background Art

[0002] In recent years, the public cloud virtual network has developed rapidly. The huge number of high-concurrency requests has brought unprecedented pressure to the cloud platform server. The load balancing cluster technology has become an important solution to the problem of huge high concurrency. Among them, the four-layer load balancing cluster has been widely used in the virtual network implementation of large-scale public clouds. It achieves the purpose of load balancing by evenly distributing a huge number of user requests to the server nodes in the system, solves the high concurrency problem of the system, and adopts the active-standby cluster deployment method to improve the high availability of the load balancing function. However, this deployment architecture does not solve the problem of TCP connection interruption caused by the failure of the four-layer load balancer, nor can it improve the utilization rate of cloud platform resources. For example, in the online transaction environment, the interruption of the TCP connection between the client and the server will inevitably lead to the failure of the entire online transaction. Once this happens, it will not only cause losses to customers, but also reduce the user experience of the public cloud platform. At the same time, the active-standby cluster deployment method is adopted, and the standby load balancer is not in working state, which will cause a certain degree of resource waste and increase the deployment cost of the cloud platform in disguise. Summary of the invention

[0003] The technical task of the present invention is to address the above shortcomings and provide a synchronous conntrack method, system and device based on a four-layer load balancing cluster, which can improve the user experience of cloud services without affecting the load balancing function of the cloud platform, and use a multi-active cluster deployment mode to improve resource utilization.

[0004] The technical solution adopted by the present invention to solve its technical problem is:

[0005] Based on the synchronous conntrack method of the four-layer load balancing cluster, the four-layer load balancer multi-master cluster architecture deployment mode is adopted, and all load balancer nodes are in working state;

[0006] Run the conntrackd daemon on multiple active layer-4 load balancer nodes to extract the conntrack of TCP connections maintained by the kernel on the nodes in real time;

[0007] Use conntrackd's built-in multicast synchronization mechanism to synchronize conntrack to all active load balancer nodes.

[0008] This method proposes a method for TCP connection conntrack synchronization based on a four-layer load balancing multi-master cluster. The four-layer load balancer cluster adopts a multi-master deployment method, and all load balancer nodes are in working state; the conntrackd daemon process needs to use a multicast method to synchronize the conntrack of each four-layer balancer node, which is very helpful for the dynamic expansion and contraction of the number of clusters.

[0009] This method adopts a multi-active cluster deployment mode for the four-layer load balancer cluster in the public cloud environment, and proposes a method for synchronizing TCP connection conntrack between multiple active load balancers. Compared with the active-standby cluster deployment mode, the multi-active deployment mode can maximize resource utilization and improve user experience without affecting the normal function of the load balancer cluster.

[0010] Furthermore, the four-layer load balancer uses the LVS module provided by the Linux kernel.

[0011] Further, when the client sends a TCP connection request to the server, the active layer-4 load balancer node A obtains the syn packet and creates a TCP connection conntrack between the client and the server, sets the conntrack state to syn_sent and sends it to other active load balancer nodes through a multicast method; after other active load balancer nodes receive the conntrack, their conntrackd daemon processes add the conntrack to the list maintained by the kernel;

[0012] The other active load balancer node receives the syn_ack packet replied by the server, and its kernel protocol stack retrieves the conntrack table entry with the status of syn_sent, and forwards the syn_ack packet to the client, and at the same time modifies the conntrack status to syn_recv and synchronizes it to the active four-layer load balancer node A through the multicast method;

[0013] The active layer 4 load balancer node A receives the ack packet sent by the client, and its kernel protocol stack retrieves the conntrack table entry with the syn_recv status, and forwards the ack packet to the server, and at the same time changes the conntrack status to established and synchronizes it to the other active layer 4 load balancer nodes through the multicast method;

[0014] The active layer-4 load balancer node A and the other active layer-4 load balancer nodes jointly maintain the conntrack in the established state.

[0015] Preferably, the main four-layer load balancer includes two, which are respectively set as the balancer LVS0 node and the balancer LVS1 node, and the specific implementation process of the method is as follows:

[0016] 1) Start the main LVS0 node of the Layer 4 load balancer, and then start the conntrackd daemon process;

[0017] 2) Start the main LVS1 node of the Layer 4 load balancer, and then start the conntrackd daemon process;

[0018] 3) Client client1 sends a TCP connection request message to server server1. The actual TCP connection request syn packet will be routed to the primary four-layer load balancer LVS0 node;

[0019] 4) After receiving the syn packet of the TCP connection request from client 1, LVS0 node creates a TCP connection conntrack between client 1 and server 1, sets its state to SYN_SENT, and then forwards the syn packet to server 1;

[0020] 5) The conntrackd daemon process of the LVS0 node starts working at this time, takes out the conntrack with the status of SYN_SENT, and then sends it to the LVS1 node through the multicast method;

[0021] 6) After receiving the synchronization conntrack sent by the LVS0 node, the conntrackd daemon process of the LVS1 node adds the conntrack with the status of SYN_SENT to the list maintained by the kernel;

[0022] 7) After receiving the syn packet forwarded by LVS0, server 1 knows that a client has initiated a TCP connection request to it, so it replies with a syn_ack packet to the LVS1 node;

[0023] 8) After LVS1 receives the syn_ack packet from server1, the kernel protocol stack searches the conntrack list it maintains and finds the conntrack entry with the SYN_SENT status synchronized from LVS0. At this time, LVS1 sets the conntrack to the SYN_RECV status and forwards the syn_ack packet to client1.

[0024] 9) The conntrackd daemon on the LVS1 node continues to work and synchronizes the conntrack in the SYN_RECV state to the LVS0 node again through multicast;

[0025] 10) After receiving the syn_ack packet forwarded by the LVS1 node, the client 1 knows that the server 1 has received its syn packet, so it sends an ack packet to the LVS0 node to complete the handshake process of the TCP connection;

[0026] 11) After receiving the ACK packet from client 1, the kernel protocol stack of LVS0 node will search the conntrack list maintained by itself, and find the conntrack entry with the SYN_RECV status synchronized from LVS1. At this time, LVS0 will set the conntrack to the ESTABLISHED state and forward the ACK packet to server 1.

[0027] 12) The conntrackd daemon on the LVS0 node continues to work and synchronizes the conntrack in the ESTABLISHED state to the LVS1 node again through multicast;

[0028] 13) After receiving the ack packet forwarded by LVS0, the server server1 has established a TCP connection with the client client1, and can provide the following reliable communication service. At the same time, both the LVS0 node and the LVS1 node maintain the conntrack of the connection with the state of ESTABLISHED. At this time, if any node fails, it will not affect the normal use of the TCP connection.

[0029] Furthermore, the conntrackd daemon process is started, that is, the TCP connection conntrack synchronization process.

[0030] This method aims at the problem of TCP connection interruption between client and server caused by four-layer load balancer failure in large-scale public cloud environment, and proposes to synchronize conntrack between multiple master nodes, which can not only solve the high availability problem of the system, but also improve the resource utilization of the cloud platform, and to a certain extent improve the data plane performance of the cloud platform system; at the same time, this method can also effectively eliminate the problem of TCP connection interruption between client and server caused by four-layer load balancer failure, and improve the performance of public cloud platform without affecting the load balancing function and high availability, improve the user experience of cloud business and reduce the deployment cost of cloud platform.

[0031] The present invention also claims protection for a synchronous conntrack system based on a four-layer load balancing cluster, the system adopts a four-layer load balancer multi-master cluster architecture deployment mode, and all load balancer nodes are in working state;

[0032] Run the conntrackd daemon on multiple active layer-4 load balancer nodes to extract the conntrack of TCP connections maintained by the kernel on the nodes in real time;

[0033] Use conntrackd's built-in multicast synchronization mechanism to synchronize conntrack to all active load balancer nodes.

[0034] Furthermore, the four-layer load balancer uses the LVS module provided by the Linux kernel.

[0035] Further, when the client sends a TCP connection request to the server, the active layer-4 load balancer node A obtains the syn packet and creates a TCP connection conntrack between the client and the server, sets the conntrack state to syn_sent and sends it to other active load balancer nodes through a multicast method; after other active load balancer nodes receive the conntrack, their conntrackd daemon processes add the conntrack to the list maintained by the kernel;

[0036] The other active load balancer node receives the syn_ack packet replied by the server, and its kernel protocol stack retrieves the conntrack table entry with the status of syn_sent, and forwards the syn_ack packet to the client, and at the same time modifies the conntrack status to syn_recv and synchronizes it to the active four-layer load balancer node A through the multicast method;

[0037] The active layer 4 load balancer node A receives the ack packet sent by the client, and its kernel protocol stack retrieves the conntrack table entry with the syn_recv status, and forwards the ack packet to the server, and at the same time changes the conntrack status to established and synchronizes it to the other active layer 4 load balancer nodes through the multicast method;

[0038] The active layer-4 load balancer node A and the other active layer-4 load balancer nodes jointly maintain the conntrack in the established state.

[0039] Preferably, the main four-layer load balancer includes two, which are set as the balancer LVS0 node and the balancer LVS1 node respectively. The specific process of implementing synchronous conntrack in the system is as follows:

[0040] 1) Start the main LVS0 node of the Layer 4 load balancer, and then start the conntrackd daemon process;

[0041] 2) Start the main LVS1 node of the Layer 4 load balancer, and then start the conntrackd daemon process;

[0042] 3) Client client1 sends a TCP connection request message to server server1. The actual TCP connection request syn packet will be routed to the primary four-layer load balancer LVS0 node;

[0043] 4) After receiving the syn packet of the TCP connection request from client 1, LVS0 node creates a TCP connection conntrack between client 1 and server 1, sets its state to SYN_SENT, and then forwards the syn packet to server 1;

[0044] 5) The conntrackd daemon process of the LVS0 node starts working at this time, takes out the conntrack with the status of SYN_SENT, and then sends it to the LVS1 node through the multicast method;

[0045] 6) After receiving the synchronization conntrack sent by the LVS0 node, the conntrackd daemon process of the LVS1 node adds the conntrack with the status of SYN_SENT to the list maintained by the kernel;

[0046] 7) After receiving the syn packet forwarded by LVS0, server1 knows that a client has initiated a TCP connection request to it, so it replies with a syn_ack packet to the LVS1 node;

[0047] 8) After LVS1 receives the syn_ack packet from server1, the kernel protocol stack searches the conntrack list it maintains and finds the conntrack entry with the SYN_SENT status synchronized from LVS0. At this time, LVS1 sets the conntrack to the SYN_RECV status and forwards the syn_ack packet to client1.

[0048] 9) The conntrackd daemon on the LVS1 node continues to work and synchronizes conntrack-SYN_RECV to the LVS0 node again through multicast;

[0049] 10) After receiving the syn_ack packet forwarded by the LVS1 node, the client 1 knows that the server 1 has received its syn packet, so it sends an ack packet to the LVS0 node to complete the handshake process of the TCP connection;

[0050] 11) After receiving the ack packet from client1, the kernel protocol stack of LVS0 node will search the conntrack list maintained by itself, and retrieve the conntrack table entry with the SYN_RECV status synchronized from LVS1. At this time, LVS0 will set the conntrack to the ESTABLISHED state and forward the ack packet to server1.

[0051] 12) The conntrackd daemon on the LVS0 node continues to work and synchronizes the conntrack in the ESTABLISHED state to the LVS1 node again through multicast.

[0052] 13) After server 1 receives the ack packet forwarded by LVS0, the TCP connection between it and client 1 has been established, and the subsequent reliable communication service can be carried out. At the same time, both LVS0 and LVS1 nodes maintain the conntrack status of the connection as ESTABLISHED. At this time, if any node fails, it will not affect the normal use of the TCP connection.

[0053] The present invention also claims a synchronous conntrack device based on a four-layer load balancing cluster, characterized by comprising: at least one memory and at least one processor;

[0054] The at least one memory is used to store a machine-readable program;

[0055] The at least one processor is used to call the machine-readable program to execute the above-mentioned method for synchronizing conntrack based on a four-layer load balancing cluster.

[0056] Compared with the prior art, the synchronous conntrack method, system and device based on the four-layer load balancing cluster of the present invention have the following beneficial effects:

[0057] Using a four-layer load balancing multi-master cluster can solve the load balancing problem of the public cloud platform.

[0058] The four-layer load balancer is deployed using the multi-master cluster mode to achieve high availability of the load balancing function and effectively improve resource utilization.

[0059] The conntrack synchronization mechanism of TCP connection is used to eliminate the situation where the TCP connection between the client and the server is forced to be interrupted due to the failure of the four-layer load balancer, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a system architecture diagram of synchronous conntrack based on a four-layer load balancing cluster provided by an embodiment of the present invention;

[0061] Figure 2 This is a diagram showing an example of the conntrack format of a TCP connection provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0063] The embodiment of the present invention provides a synchronous conntrack method based on a four-layer load balancing cluster, adopts a four-layer load balancer multi-master cluster architecture deployment mode, and all load balancer nodes are in working state;

[0064] Run the conntrackd daemon on multiple active layer-4 load balancer nodes to extract the conntrack of TCP connections maintained by the kernel on the nodes in real time;

[0065] Use conntrackd's built-in multicast synchronization mechanism to synchronize conntrack to all active load balancer nodes.

[0066] In this method, the four-layer load balancer uses the LVS module that comes with the Linux kernel. LVS is a high-performance four-layer load balancer (Layer-4 Load Balancer) based on the Linux kernel; at the same time, the conntrackd daemon is used to be responsible for the conntrack synchronization between multiple load balancing nodes. conntrackd is an open source software that works in user mode based on the iptables service. It can use the multicast method to synchronize the conntrack of TCP connections between multiple active load balancing nodes, and has high reliability and real-time performance.

[0067] This method proposes a method for TCP connection conntrack synchronization based on a four-layer load balancing multi-master cluster. The four-layer load balancer cluster adopts a multi-master deployment method, and all load balancer nodes are in working condition; the conntrackd daemon needs to use a multicast method to synchronize the conntrack of each four-layer balancer node, which is very helpful for the dynamic expansion and contraction of the number of clusters. This method can not only solve the high availability problem of the system, but also improve the resource utilization of the cloud platform, and to a certain extent improve the data plane performance of the cloud platform system; at the same time, this method can also effectively eliminate the problem of TCP connection interruption between the client and the server caused by the failure of the four-layer load balancer, and improve the performance of the public cloud platform without affecting the load balancing function and high availability, improve the user experience of cloud services and reduce the deployment cost of the cloud platform.

[0068] When the client sends a TCP connection request to the server, the active layer-4 load balancer node A obtains the syn packet and creates a TCP connection conntrack between the client and the server, sets the conntrack state to syn_sent and sends it to other active load balancer nodes through multicast. After other active load balancer nodes receive the conntrack, their conntrackd daemon processes add the conntrack to the list maintained by the kernel.

[0069] The other active load balancer node receives the syn_ack packet replied by the server, and its kernel protocol stack retrieves the conntrack table entry with the status of syn_sent, and forwards the syn_ack packet to the client, and at the same time modifies the conntrack status to syn_recv and synchronizes it to the active four-layer load balancer node A through the multicast method;

[0070] The active layer 4 load balancer node A receives the ack packet sent by the client, and its kernel protocol stack retrieves the conntrack table entry with the syn_recv status, and forwards the ack packet to the server, and at the same time changes the conntrack status to established and synchronizes it to the other active layer 4 load balancer nodes through the multicast method;

[0071] The active layer-4 load balancer node A and the other active layer-4 load balancer nodes jointly maintain the conntrack in the established state.

[0072] by Figure 1As shown in the example, a virtual machine (client1) representing a user initiates TCP communication to another virtual machine (server1) representing a public cloud server. The main four-layer load balancer includes two nodes, which are set as the balancer LVS0 node and the balancer LVS1 node. The specific implementation process of this method is as follows:

[0073] 1) Start the main LVS0 node of the Layer 4 load balancer, and then start the conntrackd daemon process (TCP connection conntrack synchronization process);

[0074] 2) Start the main LVS1 node of the Layer 4 load balancer, and then start the conntrackd daemon process (TCP connection conntrack synchronization process);

[0075] 3) Client client1 sends a TCP connection request message to server server1. The actual TCP connection request syn packet will be routed to the primary four-layer load balancer LVS0 node;

[0076] 4) After receiving the syn packet of the TCP connection request from client 1, LVS0 node creates a TCP connection conntrack between client 1 and server 1, sets its state to SYN_SENT, and then forwards the syn packet to server 1;

[0077] 5) The conntrackd daemon process of the LVS0 node starts working, takes out the conntrack (SYN_SENT), and then sends it to the LVS1 node through the multicast method;

[0078] 6) After LVS1 node receives the synchronous conntrack sent by LVS0 node, the conntrackd daemon adds the conntrack (SYN_SENT) to the list maintained by the kernel;

[0079] 7) After receiving the syn packet forwarded by LVS0, server 1 knows that a client has initiated a TCP connection request to it, so it replies with a syn_ack packet to the LVS1 node;

[0080] 8) After LVS1 receives the syn_ack packet from server1, the kernel protocol stack searches the conntrack list it maintains and finds the conntrack (SYN_SENT) entry synchronized from LVS0. At this time, LVS1 sets the conntrack to the SYN_RECV state and forwards the syn_ack packet to client1.

[0081] 9) The conntrackd daemon on the LVS1 node continues to work and synchronizes conntrack (SYN_RECV) to the LVS0 node again through multicast;

[0082] 10) After receiving the syn_ack packet forwarded by the LVS1 node, the client 1 knows that the server 1 has received its syn packet, so it sends an ack packet to the LVS0 node to complete the handshake process of the TCP connection;

[0083] 11) After receiving the ack packet from client1, the kernel protocol stack of LVS0 node will search the conntrack list maintained by itself, and find the conntrack (SYN_RECV) table entry synchronized by LVS1. At this time, LVS0 will set the conntrack to ESTABLISHED state and forward the ack packet to server1.

[0084] 12) The conntrackd daemon on the LVS0 node continues to work and synchronizes conntrack (ESTABLISHED) to the LVS1 node again through multicast;

[0085] 13) After server 1 receives the ack packet forwarded by LVS0, the TCP connection between it and client 1 has been established, and the subsequent reliable communication service can be carried out. At the same time, both LVS0 and LVS1 nodes maintain the conntrack (ESTABLISHED) of the connection. At this time, if any node fails, it will not affect the normal use of the TCP connection.

[0086] The embodiment of the present invention also provides a synchronous conntrack system based on a four-layer load balancing cluster, which adopts a four-layer load balancer multi-master cluster architecture deployment mode, and all load balancer nodes are in working state;

[0087] Run the conntrackd daemon on multiple active layer-4 load balancer nodes to extract the conntrack of TCP connections maintained by the kernel on the nodes in real time;

[0088] Use conntrackd's built-in multicast synchronization mechanism to synchronize conntrack to all active load balancer nodes.

[0089] The four-layer load balancer uses the LVS module provided by the Linux kernel.

[0090] When the client sends a TCP connection request to the server, the active layer-4 load balancer node A obtains the syn packet and creates a TCP connection conntrack between the client and the server, sets the conntrack state to syn_sent and sends it to other active load balancer nodes through multicast. After other active load balancer nodes receive the conntrack, their conntrackd daemon processes add the conntrack to the list maintained by the kernel.

[0091] The other active load balancer node receives the syn_ack packet replied by the server, and its kernel protocol stack retrieves the conntrack table entry with the status of syn_sent, and forwards the syn_ack packet to the client, and at the same time modifies the conntrack status to syn_recv and synchronizes it to the active four-layer load balancer node A through the multicast method;

[0092] The active layer 4 load balancer node A receives the ack packet sent by the client, and its kernel protocol stack retrieves the conntrack table entry with the syn_recv status, and forwards the ack packet to the server, and at the same time changes the conntrack status to established and synchronizes it to the other active layer 4 load balancer nodes through the multicast method;

[0093] The active layer-4 load balancer node A and the other active layer-4 load balancer nodes jointly maintain the conntrack in the established state.

[0094] refer to Figure 1 As shown in the figure, a virtual machine (client1) representing a user initiates TCP communication to another virtual machine (server1) representing a public cloud server. The main four-layer load balancer includes two nodes, which are set as the balancer LVS0 node and the balancer LVS1 node. The specific process of implementing synchronous conntrack in the system is as follows:

[0095] 1) Start the main LVS0 node of the Layer 4 load balancer, and then start the conntrackd daemon process (TCP connection conntrack synchronization process);

[0096] 2) Start the main LVS1 node of the Layer 4 load balancer, and then start the conntrackd daemon process (TCP connection conntrack synchronization process);

[0097] 3) Client client1 sends a TCP connection request message to server server1. The actual TCP connection request syn packet will be routed to the primary four-layer load balancer LVS0 node;

[0098] 4) After receiving the syn packet of the TCP connection request from client 1, LVS0 node creates a TCP connection conntrack between client 1 and server 1, sets its state to SYN_SENT, and then forwards the syn packet to server 1;

[0099] 5) The conntrackd daemon process of the LVS0 node starts working, takes out the conntrack (SYN_SENT), and then sends it to the LVS1 node through the multicast method;

[0100] 6) After LVS1 node receives the synchronous conntrack sent by LVS0 node, the conntrackd daemon adds the conntrack (SYN_SENT) to the list maintained by the kernel;

[0101] 7) After receiving the syn packet forwarded by LVS0, server 1 knows that a client has initiated a TCP connection request to it, so it replies with a syn_ack packet to the LVS1 node;

[0102] 8) After LVS1 receives the syn_ack packet from server1, the kernel protocol stack searches the conntrack list it maintains and finds the conntrack (SYN_SENT) entry synchronized from LVS0. At this time, LVS1 sets the conntrack to the SYN_RECV state and forwards the syn_ack packet to client1.

[0103] 9) The conntrackd daemon on the LVS1 node continues to work and synchronizes conntrack (SYN_RECV) to the LVS0 node again through multicast;

[0104] 10) After receiving the syn_ack packet forwarded by the LVS1 node, the client 1 knows that the server 1 has received its syn packet, so it sends an ack packet to the LVS0 node to complete the handshake process of the TCP connection;

[0105] 11) After receiving the ack packet from client1, the kernel protocol stack of LVS0 node will search the conntrack list maintained by itself, and find the conntrack (SYN_RECV) table entry synchronized by LVS1. At this time, LVS0 will set the conntrack to ESTABLISHED state and forward the ack packet to server1.

[0106] 12) The conntrackd daemon on the LVS0 node continues to work and synchronizes conntrack (ESTABLISHED) to the LVS1 node again through multicast;

[0107] 13) After server 1 receives the ack packet forwarded by LVS0, the TCP connection between it and client 1 has been established, and the subsequent reliable communication service can be carried out. At the same time, both LVS0 and LVS1 nodes maintain the conntrack (ESTABLISHED) of the connection. At this time, if any node fails, it will not affect the normal use of the TCP connection.

[0108] This system adopts a multi-active cluster deployment mode for the four-layer load balancer cluster in the public cloud environment, and proposes a method for synchronizing TCP connection conntrack between multiple active load balancers. Compared with the active-standby cluster deployment mode, the multi-active deployment mode can maximize resource utilization and improve user experience without affecting the normal function of the load balancer cluster.

[0109] This system aims at the problem of TCP connection interruption between client and server caused by four-layer load balancer failure in large-scale public cloud environment, and proposes to synchronize conntrack between multiple master nodes, which can not only solve the high availability problem of the system, but also improve the resource utilization of the cloud platform, and to a certain extent improve the data plane performance of the cloud platform system; at the same time, this method can also effectively eliminate the problem of TCP connection interruption between client and server caused by four-layer load balancer failure, without affecting the load balancing function and high availability, improve the performance of the public cloud platform, improve the user experience of cloud services and reduce the deployment cost of the cloud platform.

[0110] The embodiment of the present invention also provides a synchronous conntrack device based on a four-layer load balancing cluster, characterized by comprising: at least one memory and at least one processor;

[0111] The at least one memory is used to store a machine-readable program;

[0112] The at least one processor is used to call the machine-readable program to execute the above method.

[0113] Through the above specific implementations, those skilled in the art can easily implement the present invention. However, it should be understood that the present invention is not limited to the above specific implementations. On the basis of the disclosed implementations, those skilled in the art can arbitrarily combine different technical features to achieve different technical solutions.

[0114] Except for the technical features described in the specification, all other technical features are known technologies to those skilled in the art.

Claims

1. Synchronous conntrack method based on four-layer load balancing cluster, It is characterized in that Adopting the deployment mode of multi-master cluster architecture of four-layer load balancer, all load balancer nodes are in working state; Run the conntrackd daemon on multiple active layer-4 load balancer nodes to extract the conntrack of TCP connections maintained by the kernel on the nodes in real time; Use conntrackd's built-in multicast synchronization mechanism to synchronize conntrack to all active load balancer nodes; The four-layer load balancer uses the LVS module that comes with the Linux kernel. The main four-layer load balancer includes two, which are set as the balancer LVS0 node and the balancer LVS1 node respectively. The specific implementation process of the method is as follows: 1) Start the active LVS0 node of the Layer 4 load balancer and start the conntrackd daemon process; 2) Start the active LVS1 node of the Layer 4 load balancer and start the conntrackd daemon process; 3) Client client1 sends a TCP connection request message to server server1. The actual TCP connection request syn packet will be routed to the active layer 4 load balancer LVS0 node; 4) After receiving the syn packet of the TCP connection request from client 1, LVS0 node creates a TCP connection conntrack between client 1 and server 1, sets its state to SYN_SENT, and then forwards the syn packet to server 1. 5) The conntrackd daemon process of the LVS0 node starts working at this time, takes out the conntrack with the status of SYN_SENT, and then sends it to the LVS1 node through the multicast method; 6) After receiving the synchronization conntrack sent by the LVS0 node, the conntrackd daemon process of the LVS1 node adds the conntrack with the status of SYN_SENT to the list maintained by the kernel; 7) After receiving the syn packet forwarded by LVS0, server 1 knows that a client has initiated a TCP connection request to it, so it replies with a syn_ack packet to the LVS1 node; 8) After LVS1 receives the syn_ack packet from server1, the kernel protocol stack searches the conntrack list it maintains and finds the conntrack entry with the SYN_SENT status synchronized from LVS0. At this time, LVS1 sets the conntrack to the SYN_RECV status and forwards the syn_ack packet to client1. 9) The conntrackd daemon on the LVS1 node continues to work and synchronizes the conntrack in the SYN_RECV state to the LVS0 node again through multicast; 10) After receiving the syn_ack packet forwarded by the LVS1 node, client 1 knows that server 1 has received its syn packet, so it sends an ack packet to the LVS0 node to complete the handshake process of the TCP connection; 11) After receiving the ACK packet from client 1, the kernel protocol stack of LVS0 node will search the conntrack list maintained by itself, and find the conntrack entry with the SYN_RECV status synchronized from LVS1. At this time, LVS0 will set the conntrack to the ESTABLISHED status and forward the ACK packet to server 1. 12) The conntrackd daemon on the LVS0 node continues to work and synchronizes the conntrack in the ESTABLISHED state to the LVS1 node again through multicast; 13) After server 1 receives the ack packet forwarded by LVS0, the TCP connection between it and client 1 has been established, and the subsequent reliable communication service can be carried out. At the same time, both LVS0 node and LVS1 node maintain the conntrack of the connection with the state of ESTABLISHED. At this time, if any node fails, it will not affect the normal use of the TCP connection.

2. According to claim 1, the synchronous conntrack method based on the four-layer load balancing cluster, It is characterized in that When the client sends a TCP connection request to the server, the active layer-4 load balancer node A obtains the syn packet and creates a TCP connection conntrack between the client and the server, sets the conntrack state to syn_sent and sends it to other active load balancer nodes through multicast. After other active load balancer nodes receive the conntrack, their conntrackd daemon processes add the conntrack to the list maintained by the kernel. The other active load balancer node receives the syn_ack packet replied by the server, and its kernel protocol stack retrieves the conntrack table entry with the status of syn_sent, and forwards the syn_ack packet to the client, and at the same time modifies the conntrack status to syn_recv and synchronizes it to the active four-layer load balancer node A through the multicast method; The active layer 4 load balancer node A receives the ack packet sent by the client, and its kernel protocol stack retrieves the conntrack table entry with the syn_recv status, and forwards the ack packet to the server, and at the same time changes the conntrack status to established and synchronizes it to the other active layer 4 load balancer nodes through the multicast method; The active layer-4 load balancer node A and the other active layer-4 load balancer nodes jointly maintain the conntrack in the established state.

3. According to claim 1, the synchronous conntrack method based on the four-layer load balancing cluster, It is characterized in that The conntrackd daemon process is started, that is, the TCP connection conntrack synchronization process.

4. Synchronous conntrack system based on four-layer load balancing cluster, It is characterized in that The system adopts a four-layer load balancer multi-master cluster architecture deployment mode, and all load balancer nodes are in working state; Run the conntrackd daemon on multiple active layer-4 load balancer nodes to extract the conntrack of TCP connections maintained by the kernel on the nodes in real time; Use conntrackd's built-in multicast synchronization mechanism to synchronize conntrack to all active load balancer nodes; The four-layer load balancer uses the LVS module that comes with the Linux kernel. The main four-layer load balancer includes two, which are set as the balancer LVS0 node and the balancer LVS1 node respectively. The specific process of implementing synchronous conntrack in the system is as follows: 1) Start the active LVS0 node of the Layer 4 load balancer and start the conntrackd daemon process; 2) Start the active LVS1 node of the Layer 4 load balancer and start the conntrackd daemon process; 3) Client client1 sends a TCP connection request message to server server1. The actual TCP connection request syn packet will be routed to the active layer 4 load balancer LVS0 node; 4) After receiving the syn packet of the TCP connection request from client 1, LVS0 node creates a TCP connection conntrack between client 1 and server 1, sets its state to SYN_SENT, and then forwards the syn packet to server 1. 5) The conntrackd daemon process of the LVS0 node starts working at this time, takes out the conntrack with the status of SYN_SENT, and then sends it to the LVS1 node through the multicast method; 6) After receiving the synchronization conntrack sent by the LVS0 node, the conntrackd daemon process of the LVS1 node adds the conntrack with the status of SYN_SENT to the list maintained by the kernel; 7) After receiving the syn packet forwarded by LVS0, server 1 knows that a client has initiated a TCP connection request to it, so it replies with a syn_ack packet to the LVS1 node; 8) After LVS1 receives the syn_ack packet from server1, the kernel protocol stack searches the conntrack list it maintains and finds the conntrack entry with the SYN_SENT status synchronized from LVS0. At this time, LVS1 sets the conntrack to the SYN_RECV status and forwards the syn_ack packet to client1. 9) The conntrackd daemon on the LVS1 node continues to work and synchronizes the conntrack in the SYN_RECV state to the LVS0 node again through multicast; 10) After receiving the syn_ack packet forwarded by the LVS1 node, client 1 knows that server 1 has received its syn packet, so it sends an ack packet to the LVS0 node to complete the handshake process of the TCP connection; 11) After receiving the ACK packet from client 1, the kernel protocol stack of LVS0 node will search the conntrack list maintained by itself, and find the conntrack entry with the SYN_RECV status synchronized from LVS1. At this time, LVS0 will set the conntrack to the ESTABLISHED status and forward the ACK packet to server 1. 12) The conntrackd daemon on the LVS0 node continues to work and synchronizes the conntrack in the ESTABLISHED state to the LVS1 node again through multicast; 13) After server 1 receives the ack packet forwarded by LVS0, the TCP connection between it and client 1 has been established, and the subsequent reliable communication service can be carried out. At the same time, both LVS0 node and LVS1 node maintain the conntrack of the connection with the state of ESTABLISHED. At this time, if any node fails, it will not affect the normal use of the TCP connection.

5. According to claim 4, the synchronous conntrack system based on the four-layer load balancing cluster, It is characterized in that When the client sends a TCP connection request to the server, the active layer-4 load balancer node A obtains the syn packet and creates a TCP connection conntrack between the client and the server, sets the conntrack state to syn_sent and sends it to other active load balancer nodes through multicast. After other active load balancer nodes receive the conntrack, their conntrackd daemon processes add the conntrack to the list maintained by the kernel. The other active load balancer node receives the syn_ack packet replied by the server, and its kernel protocol stack retrieves the conntrack table entry with the status of syn_sent, and forwards the syn_ack packet to the client, and at the same time modifies the conntrack status to syn_recv and synchronizes it to the active four-layer load balancer node A through the multicast method; The active layer 4 load balancer node A receives the ack packet sent by the client, and its kernel protocol stack retrieves the conntrack table entry with the syn_recv status, and forwards the ack packet to the server, and at the same time changes the conntrack status to established and synchronizes it to the other active layer 4 load balancer nodes through the multicast method; The active layer-4 load balancer node A and the other active layer-4 load balancer nodes jointly maintain the conntrack in the established state.

6. Synchronous conntrack device based on four-layer load balancing cluster, Features include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to any one of claims 1 to 3.