CN115766833A - Network connection method and network connection system - Google Patents

Network connection method and network connection system Download PDF

Info

Publication number
CN115766833A
CN115766833A CN202211262010.3A CN202211262010A CN115766833A CN 115766833 A CN115766833 A CN 115766833A CN 202211262010 A CN202211262010 A CN 202211262010A CN 115766833 A CN115766833 A CN 115766833A
Authority
CN
China
Prior art keywords
network connection
state information
nodes
leader
request packet
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.)
Pending
Application number
CN202211262010.3A
Other languages
Chinese (zh)
Inventor
董兴楷
丁玉杰
宋辰伟
易夏羽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202211262010.3A priority Critical patent/CN115766833A/en
Publication of CN115766833A publication Critical patent/CN115766833A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present application relates to a network connection method and a network connection system. Wherein, the method comprises the following steps: synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection when the state information of the network connection is updated; the network connection is continued at one of the plurality of nodes based on the state information. By the method and the device, the problem of service damage caused by disaster recovery disconnection of stock connection is solved, and high availability of network connection is realized.

Description

Network connection method and network connection system
Technical Field
The present application relates to the field of computer technologies, and in particular, to a network connection method and a network connection system.
Background
In conventional distributed systems, disaster recovery of individual components is typically achieved through a retry mechanism. Taking a storage system as an example, the storage system is generally divided into a storage gateway and a data node, and a user accesses data by connecting the storage gateway, and the storage gateway acquires data from the data node. The data node is generally composed of a plurality of machines, a plurality of copies of user data can be copied to exist in the plurality of machines, when a single machine fails, and the storage gateway fails to access the failed machine, other machines can be tried to be accessed, and therefore disaster tolerance in the system is achieved. However, for the storage gateway itself, the state of being able to be serviced at any time must be maintained, so that the service is generally not updated frequently, and even if the update is performed by a hot update, the storage gateway is prevented from disconnecting the user.
In a Content Delivery Network (CDN), a storage gateway generally implements disaster recovery through DNS scheduling, however, there is delay in DNS scheduling, and when a storage gateway fails, a connection stored in the storage gateway (i.e., an established connection) is disconnected, which causes service damage.
Disclosure of Invention
The embodiment provides a network connection method and a network connection system, so as to solve the problem of service damage caused by disaster recovery disconnection of related technology inventory connection.
A network connection method, comprising:
synchronizing status information of a network connection to a plurality of nodes corresponding to the network connection when the status information of the network connection is updated;
continuing the network connection at one of the plurality of nodes based on the status information.
In some of these embodiments, the network connection is identified by a five-tuple, and the status information includes: data and a sequence number of the network connection, the data comprising request data and/or response data.
In some of these embodiments, continuing the network connection at one of the plurality of nodes based on the state information comprises:
one of the plurality of nodes constructs a response packet for responding to a request of a client based on the state information and sends the response packet to the client; and
one of the plurality of nodes updates the state information.
In some of these embodiments, synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection comprises:
and synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection by adopting a mechanism of a distributed consistency protocol, wherein the plurality of nodes form a consensus group of the distributed consistency protocol.
In some of these embodiments, prior to synchronizing the state information of the network connection to the plurality of nodes, the method further comprises:
judging whether the network connection is inventory connection according to the quintuple of the network connection, wherein the inventory connection refers to the established network connection which is not disconnected;
in a case where the network connection is not a stock quantity connection, designating a plurality of nodes for the network connection as a consensus group that synchronizes state information of the network connection.
In some of these embodiments, the plurality of nodes comprises a leader and one or more followers; wherein synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection when the state information of the network connection is updated comprises:
under the condition that the leader receives a request packet of a client, the leader processes the request packet and generates a response packet;
the leader determines the network connection corresponding to the request packet according to the quintuple information of the request packet and updates the state information of the network connection;
the leader writes the state information of the network connection into a synchronization log corresponding to the network connection so as to synchronize the state information of the network connection to the one or more followers;
and after the synchronization of the state information of the network connection is completed, the leader sends the response packet to the client.
In some of these embodiments, synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection in the event that the state information of the network connection is updated comprises:
in the event that any of the followers receives a request packet for a client, any of the followers forwards the request packet to the leader.
In some of these embodiments, the plurality of nodes comprises a leader and one or more followers; wherein synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection when the state information of the network connection is updated comprises:
under the condition that any node in the plurality of nodes receives a request packet of a client, processing the request packet by the any node to generate a response packet, wherein the request packet is distributed to the plurality of nodes according to a load balancing strategy;
the any node determines the network connection corresponding to the request packet according to the quintuple information of the request packet and updates the state information of the network connection;
under the condition that any node is a leader, the any node writes the state information of the network connection into a synchronization log corresponding to the network connection so as to synchronize the state information of the network connection to the one or more followers; after the state information of the network connection is synchronized, the any node sends the response packet to the client;
under the condition that any node is a follower, the any node sends the state information of the network connection to the leader; after the leader synchronizes the state information of the network connection to the one or more followers, the any node sends the response packet to the client.
In some embodiments, the state information is stored in a memory corresponding to the node after being synchronized to the node.
A network connection system comprising a plurality of nodes corresponding to network connections, the plurality of nodes comprising a leader and one or more followers, wherein,
the leader is used for synchronizing the state information of the network connection to the one or more followers under the condition that the state information of the network connection is updated;
any node of the plurality of nodes connects the network connection based on the state information.
In some of these embodiments, the system further comprises:
and the load balancing device is used for distributing the request packet of the client to the plurality of nodes according to a load balancing strategy.
Compared with the related art, the network connection method and the network connection system provided by the embodiment synchronize the state information of the network connection to a plurality of nodes corresponding to the network connection under the condition that the state information of the network connection is updated; and the network connection is continued on one node in the plurality of nodes based on the state information, so that the problem of service damage caused by disaster recovery disconnection of stock connection is solved, and high availability of the network connection is realized.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
fig. 1 is a schematic diagram of a content distribution network of the present embodiment.
Fig. 2 is a flowchart of the network connection method of the present embodiment.
Fig. 3 is an alternative flowchart one of the network connection method of the present embodiment.
Fig. 4 is an alternative flowchart ii of the network connection method of the present embodiment.
Fig. 5 is a schematic diagram of a network connection system according to the present embodiment.
Fig. 6 is a schematic diagram of another network connection system of the present embodiment.
Detailed Description
For a clearer understanding of the objects, aspects and advantages of the present application, reference is made to the following description and accompanying drawings.
The embodiment provides a network connection method, which can be applied to a distributed system or other systems with system boundary devices, including but not limited to a distributed storage system, a distributed content distribution system, and the like. Taking a content distribution network as an example, fig. 1 is a schematic diagram of the content distribution network of this embodiment, and as shown in fig. 1, the content distribution network includes a source station server cluster 10 and a node device 20 located at a system boundary, where the node device 20 at the system boundary may be, for example, a gateway device. The client 30 (i.e., user) obtains data within the source site server cluster 10 by establishing a network connection with the gateway device.
Fig. 2 is a flowchart of a network connection method according to this embodiment, and as shown in fig. 2, based on the content distribution network, the flow of the network connection method according to this embodiment includes the following steps:
step S201, synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection when the state information of the network connection is updated.
Each network connection established between a client and a node device 20 is identified using a five-tuple, i.e., a source IP address, a source port address, a destination IP address, a destination port address, and a network transport protocol. In addition, status information of the network connection, including but not limited to data and a sequence number of the network connection, including request data and/or response data, is updated as each data packet is generated and transmitted over the network connection. In particular, the data is transmitted via the network connection, currently cached, and not sent to the client 30 or the origin server cluster 10.
Taking the TCP/IP protocol as an example, a TCP header contains, in addition to data (data), an important field for indicating the status information of the network connection, i.e. the Sequence Number (Sequence Number) of the network connection. Each end of a TCP session contains a 32-bit sequence number that is used to track the amount of data sent by that end, and the TCP protocol assembles the received packets, determining the order of the packets based on the sequence number and being able to determine if any packets are lost. Each packet in the TCP session contains a sequence Number, and the receiving end notifies the sending end of successful data reception through an acknowledgement Number (acknowledgement Number). That is, if the state information of the network connection can be synchronized among the plurality of nodes, any one of the plurality of nodes can continue the network connection using the state information, and the client does not perceive a change in the node at the opposite end of the network connection.
Each node may refer to a physical machine or a virtual machine, or may be a process in a physical machine or a virtual machine.
Step S202, connecting network connection on one node in the plurality of nodes based on the state information.
When a client uses a content distribution network, the client needs to maintain a network connection with a system edge device (storage gateway). In the related art, if the network connection between the client and the system boundary device is disconnected due to disaster tolerance, upgrading, or other reasons, the state information of the network connection will be lost, and the client needs to re-establish a new network connection with the available system boundary device, which not only will cause service interruption for a longer time due to the establishment of the network connection, but also will cause the loss of the cached data of the previous network connection or the ongoing service interruption due to the disconnection of the network connection and the loss of the state information of the network connection, thereby causing loss.
By adopting the network connection method from the step S201 to the step S202, it is not necessary to spend a long time to reestablish a new network connection, the established network connection is migrated to a new node in real time to continue providing service for the client, and the transmitted data is also retained, thereby avoiding loss caused by network connection interruption.
Based on the state information of the network connection, namely the cache data of the network connection and the serial number of the network connection, after the node synchronized with the state information of the network connection obtains a request packet of the client, a correct response packet can be generated by combining the state information, and the response packet is sent to the client.
Meanwhile, the status information of the network connection may be updated each time after a response packet is generated, and the synchronization of the status information of the network connection and the connection of the network connection are realized through the above steps S201 and S202 each time the status information of the network connection is updated. The response packet includes, but is not limited to, a response data packet carrying response data or an ACK message carrying an acknowledgement number.
Each network connection is allocated to a part of all nodes, and a corresponding relationship is established with the part of nodes, the corresponding relationship is identified by using identification information of the network connection, for example, a consensus group is identified by quintuple information of the network connection, the consensus group comprises a plurality of nodes, the consensus group represents a group of nodes which need to synchronize state information of a certain network connection, and the consensus group can be established by a distributed consistency protocol. Wherein, the corresponding relation between the node and the network connection is generated in the process of establishing the network connection.
In some embodiments, the synchronization of the status information of the network connections or the specification of the consensus group may be implemented by a distributed coherence protocol or a mechanism based on the protocol. The distributed coherency protocol may be a Raft protocol, and the mechanism based on the Raft protocol may be Multi-Raft.
The Raft protocol is a protocol based on a duplicate state machine concept. In this embodiment, the Raft protocol treats each network connection as a state machine, and the network connection receives an external command to make a change in state, which is a deterministic change, i.e., as long as the initial state and the received command are deterministic, its state at any time is deterministic. In the Raft protocol, a consensus group is generated for the network connection, all nodes in the consensus group are not in equal status, the Raft divides all nodes into 3 mutually disjoint subsets, namely a leader, a follower and a candidate, wherein the candidate is in a temporary state, the follower is temporarily changed into the candidate to participate in the election of the leader only in the case of re-election of the leader, and other nodes are changed into followers after the new leader is elected, so that the processing between the leader and the followers is mainly involved in the working process of the network connection method based on the Raft protocol. The leader maintains control over the followers, including issuing control instructions to the various followers and performing operations such as creating synchronization logs, writing logs, and the like. The follower follows the command of the leader, synchronizes the information of the synchronization log sent by the leader, and performs corresponding actions according to the requirement of the leader. The leader will also continuously send heartbeat packets to all followers in the consensus group, announcing his authority to the followers in the consensus group to maintain their dominance. Once the follower does not receive a heartbeat package from the leader within a given time, it considers the leader to have failed and then transitions its identity to a candidate for the leader's election.
In the Raft protocol, the instructions are passed in the form of a log, that is, the state information in the above embodiment is synchronized to other followers through the log. Although there may be many nodes in the consensus group, only one node that is the leader may validate the data that needs to be synchronized and write the data to the synchronization log. Therefore, all the synchronization logs receive the request of the client, and all other nodes receive the replication log from the leader, and the status is changed by analyzing and executing the replication log. All nodes execute the same log (instruction) in order, maintaining state consistency.
The Raft protocol can synchronize the state information of all network connections, but the Raft protocol executes serial operation when the state information synchronization is performed by using logs, that is, the state information synchronization of the next network connection can be executed only after the state information synchronization of the previous network connection is completed, and under the condition that the number of the network connections is large, the synchronization operation delay is possibly overlarge, so that the transmission efficiency of the network connection is influenced, and even data loss is caused.
For this reason, the Multi-Raft protocol may be employed in the present embodiment to improve the efficiency of state information synchronization. In the embodiment, the Multi-Raft protocol takes the state information of each network connection as one data slice, and generates a consensus group and a synchronization log for each data slice.
In some embodiments, before synchronizing the state information of the network connection to the plurality of nodes, it is required to ensure that the correspondence relationship between the network connection and the plurality of nodes is already established, and if the correspondence relationship is not established, the correspondence relationship may be established according to the following steps: after receiving the request packet, acquiring quintuple information of network connection according to information carried in a protocol header of the request packet, searching in all established consensus groups according to the quintuple information, and if no consensus group with the quintuple as an identifier exists in all the consensus groups, judging that the network connection is stock connection; if there is a common identification group identified by the five-tuple in all the common identification groups, the network connection is determined as a stock connection (a connection which is already established and is not disconnected). In the case where the network connection is the inventory connection, the above-described step S201 to step S202 may be performed; otherwise, after designating a plurality of nodes as the consensus group of the state information of the synchronous network connection for the new network connection, electing the leader and the follower in the consensus group and establishing the synchronization log, the above steps S201 to S202 are performed.
One node in each consensus group is selected as a leader through a protocol, and other nodes in the consensus group are taken as followers. In some of these embodiments, a request packet for a client received by a network connection corresponding to the consensus group is processed by the leader. A flow of the network connection method provided in this embodiment is shown in fig. 3, and the flow includes the following steps:
step S301, a client sends a request packet to gateway equipment at the system boundary to request for establishing network connection; the request packet arrives at any gateway device at random.
Step S302, the gateway device that receives the request packet queries, according to the quintuple information carried in the request packet, whether there is a consensus group identified by the quintuple information in the consensus group that the gateway device has joined.
Step S303, under the condition that the gateway device does not inquire the consensus group identified by the quintuple information, selecting a plurality of gateway devices including the gateway device as the consensus group and identifying by the quintuple information; and the leader is elected by a distributed consistency protocol in the consensus group, and the other gateway devices are followers.
Step S304, if the gateway device receiving the request packet is a follower, the follower forwards the request packet to the leader.
Step S305, if the gateway device receiving the request packet is a leader, the leader processes the request packet and generates a response packet; and the leader determines the network connection corresponding to the request packet according to the quintuple information of the request packet and updates the state information of the network connection.
Step S306, the leader writes the status information of the network connection into the synchronization log corresponding to the network connection.
Step S307, the leader synchronizes the synchronization log to all followers.
And step S308, after the synchronization of the synchronization logs is completed, the leader sends a response packet to the client.
After the network connection is established, the request packets of the client received through the network connection are processed through the processes from the step S302 to the step S308, so that the leader processes all the request packets, the state information is directly updated by the leader and synchronized to other followers, and the overhead of the synchronization log is reduced. After the leader fails, other followers in the consensus group will elect a new leader based on the distributed consistency protocol, thereby ensuring high availability of network connections.
In other embodiments, either the leader or the follower may process a request packet of the client received by the network connection corresponding to the consensus group. A flow of the network connection method provided in this embodiment is shown in fig. 4, and the flow includes the following steps:
step S401, a client sends a request packet to gateway equipment at the system boundary to request for establishing network connection; the request packet arrives at any gateway device at random.
Step S402, the gateway device that receives the request packet queries whether there is a common identification group identified by the quintuple information in the common identification groups that the gateway device has joined, according to the quintuple information carried in the request packet.
Step S403, selecting a plurality of gateway devices including the gateway device as a common identity group and identifying the common identity group by the quintuple information under the condition that the gateway device does not inquire the common identity group adopting the quintuple information identifier; and the leader is elected by a distributed consistency protocol in the consensus group, and the other gateway devices are followers.
Step S404, if the gateway device receiving the request packet is a follower, the follower processes the request packet to generate a response packet; and the follower determines the network connection corresponding to the request packet according to the quintuple information of the request packet and updates the state information of the network connection.
Step S405, the follower sends the state information of the network connection to the leader.
Step S406, if the gateway device receiving the request packet is the leader, the leader processes the request packet to generate a response packet; and the leader determines the network connection corresponding to the request packet according to the quintuple information of the request packet and updates the state information of the network connection.
In step S407, the leader writes the status information of the network connection into the synchronization log corresponding to the network connection.
Step S408, the leader synchronizes the synchronization log to all followers.
And step S409, after the synchronization of the synchronization logs is completed, the leader or the follower sends the generated response packet to the client.
After the network connection is established, the request packets of the client received through the network connection are processed through the flows of the above-described steps S402 to S409, so that all the request packets are collectively processed by the leader or follower, and load balancing can be achieved. The request packet may arrive at any gateway device in the consensus group at random, or may be distributed to the gateway devices in the consensus group by using a load balancer according to a load balancing policy. After the leader fails, other followers in the consensus group will elect a new leader based on the distributed consistency protocol, thereby ensuring high availability of network connections.
In the embodiment, the state information can be stored in the memory in the form of the synchronous log, and each node can quickly obtain the state information through the memory, and the state information is stored without additionally adopting a database, so that the system modification cost and the complexity are reduced.
The network connection in the above embodiment may be a network connection established based on the TCP/IP protocol, and when the network connection is established based on the TCP/IP protocol, the status information of the network connection includes, but is not limited to, data and a current Sequence Number (Sequence Number) of the network connection, where the data includes response data sent by the node to the client and may also include request data sent by the client to the node.
However, it is understood that when network connections are established using other network protocols, the status information of the network connections may be other information that can be used to connect the network connections. For example, the network Connection may be a network Connection established based on a fast UDP Internet Connection (QUIC).
The QUIC protocol is a new communication protocol, UDP based transport protocol and intended to eventually replace all TCP based HTTP requests. Since UDP is characterized by unreliability, frequent packet loss, reordering, duplication, etc., UDP does not include any of the reliability and order guarantees of TCP that are strictly required by higher level protocols (e.g., HTTP). To this end, the QUIC protocol defines a layer above UDP that introduces error handling, reliability, flow control, and built-in security (via TLS 1.3) into UDP. In fact, it re-implements most of the TCP functionality over UDP, but with a key difference: unlike TCP, it can still transmit packets out of order. When employing the QUIC protocol, similar to the TCP/IP protocol, the status information of the network connection includes, but is not limited to, data and sequence numbers.
The embodiment also provides a network connection system. Fig. 5 is a schematic diagram of a network connection system according to the embodiment, and as shown in fig. 5, the system includes a plurality of nodes corresponding to network connections. The plurality of nodes are divided into a leader 51 and one or more followers 52 by a distributed consistency protocol, the leader 51 and the followers 52 are located at the boundary of the system, and a consensus group corresponding to network connection, which is composed of the leader 51 and the followers 52, provides services inside the system for the client 53, such as content distribution services, data storage services, and the like provided by a source station server cluster 54 in the system.
A leader 51 for synchronizing the state information of the network connection to one or more followers 52 in case the state information of the network connection is updated;
any one of the plurality of nodes, i.e. the follower 52 or the leader 51, is used to connect the network connection based on the state information.
In some of these embodiments, the network connection is identified by a five-tuple and the state information includes: data and a serial number of the network connection, the data including request data and/or response data.
In some of these embodiments, the follower 52 or leader 51 is configured to construct a response packet for responding to a request of a client and to transmit the response packet to the client; and one of the plurality of nodes updates the status information.
In some of these embodiments, the leader 51 is configured to employ a mechanism of a distributed consistency protocol to synchronize state information of the network connection to a plurality of nodes corresponding to the network connection, wherein the plurality of nodes form a consensus group of the distributed consistency protocol.
In some of these embodiments, the distributed coherency protocol comprises a Raft protocol; the mechanism based on the Raft protocol may be Multi-Raft.
In some embodiments, any node in the plurality of nodes is further configured to determine whether the network connection is an inventory connection according to a quintuple of the network connection; and designating the plurality of nodes for the network connection as a consensus group for synchronizing status information of the network connection if the network connection is not an inventory connection.
In some of these embodiments, the leader 51 is further operable to: under the condition that the leader receives a request packet of the client, the leader processes the request packet and generates a response packet; the leader determines the network connection corresponding to the request packet according to the quintuple information of the request packet and updates the state information of the network connection; the leader writes the state information of the network connection into a synchronization log corresponding to the network connection so as to synchronize the state information of the network connection to one or more followers; and after the synchronization of the state information of the network connection is completed, the leader sends a response packet to the client.
In some of these embodiments, the follower 52 is further configured to, upon receiving the request packet of the client, the follower 52 forwards the request packet to the leader 51.
In some embodiments, the system may further include: and the load balancing device 55 is used for acquiring the request packet of the client 53 and distributing the request packet to the leader 51 or the follower 52 according to the load balancing strategy.
The leader 51 or the follower 52 is further configured to, in a case that a request packet of the client is received, process the request packet, and generate a response packet, where the request packet is distributed to the multiple nodes according to a load balancing policy; determining the network connection corresponding to the request packet according to the quintuple information of the request packet, and updating the state information of the network connection;
the leader 51 is further configured to write the status information of the network connection into a synchronization log corresponding to the network connection, so as to synchronize the status information of the network connection to one or more followers 52; and after the state information of the network connection is synchronized, sending a response packet to the client.
A follower 52, further configured to send status information of the network connection to the leader 51; after the leader 51 synchronizes the state information of the network connection to one or more followers, a response packet is sent to the client.
In some embodiments, the state information is stored in the memory corresponding to the node after being synchronized to the node.
Through the embodiment, the high availability of network connection of the stock at the system boundary is realized by adopting a mechanism of the state copy machine, and the embodiment can realize the viscous connection load balancing in a non-invasive way for a user without any modification or adaptation to the existing work flow of a client and can also realize the non-invasive high availability of connection for the user when a certain device at the system boundary fails.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be derived by a person skilled in the art from the examples provided herein without inventive step, shall fall within the scope of protection of the present application.
It is obvious that the drawings are only examples or embodiments of the present application, and it is obvious to those skilled in the art that the present application can be applied to other similar cases according to the drawings without creative efforts. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference throughout this application to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly or implicitly understood by one of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms used herein shall have the same general meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The use of the terms "a" and "an" and "the" and similar referents in the context of this application do not denote a limitation of quantity, either in the singular or the plural. The terms "comprises," "comprising," "has," "having," and any variations thereof, as referred to in this application, are intended to cover non-exclusive inclusions; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or modules, but may include other steps or modules (elements) not listed or inherent to such process, method, article, or apparatus. Reference throughout this application to "connected," "coupled," and the like is not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference to "a plurality" in this application means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. In general, the character "/" indicates a relationship in which the objects associated before and after are an "or". Reference in the present application to the terms "first," "second," "third," etc., merely distinguish between similar objects and do not denote a particular order or importance to the objects.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the patent protection. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (11)

1. A network connection method, characterized by comprising:
synchronizing status information of a network connection to a plurality of nodes corresponding to the network connection when the status information of the network connection is updated;
continuing the network connection at one of the plurality of nodes based on the status information.
2. The method of claim 1, wherein the network connection is identified by a five tuple, and wherein the status information comprises: data and a sequence number of the network connection, the data comprising request data and/or response data.
3. The method of claim 1, wherein continuing the network connection at one of the plurality of nodes based on the state information comprises:
one of the plurality of nodes constructs a response packet for responding to a request of a client based on the state information and sends the response packet to the client; and
one of the plurality of nodes updates the state information.
4. The method of claim 1, wherein synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection comprises:
and synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection by adopting a mechanism of a distributed consistency protocol, wherein the plurality of nodes form a consensus group of the distributed consistency protocol.
5. The method of claim 4, wherein prior to synchronizing the state information of the network connection to the plurality of nodes, the method further comprises:
judging whether the network connection is inventory connection according to the quintuple of the network connection, wherein the inventory connection refers to the established network connection which is not disconnected;
in the event that the network connection is not an inventory connection, designating a plurality of nodes for the network connection as a consensus group that synchronizes state information of the network connection.
6. The method of claim 5, wherein the plurality of nodes comprises a leader and one or more followers; wherein synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection when the state information of the network connection is updated comprises:
under the condition that the leader receives a request packet of a client, the leader processes the request packet and generates a response packet;
the leader determines the network connection corresponding to the request packet according to the quintuple information of the request packet and updates the state information of the network connection;
the leader writes the state information of the network connection into a synchronization log corresponding to the network connection so as to synchronize the state information of the network connection to the one or more followers;
and after the synchronization of the state information of the network connection is completed, the leader sends the response packet to the client.
7. The method of claim 6, wherein synchronizing the state information of the network connection to the plurality of nodes corresponding to the network connection in the event that the state information of the network connection is updated comprises:
in the case where any of the followers receives a request packet of a client, any of the followers forwards the request packet to the leader.
8. The method of claim 5, wherein the plurality of nodes comprises a leader and one or more followers; wherein synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection when the state information of the network connection is updated comprises:
under the condition that any node in the plurality of nodes receives a request packet of a client, processing the request packet by any node and generating a response packet, wherein the request packet is distributed to the plurality of nodes according to a load balancing strategy;
the any node determines the network connection corresponding to the request packet according to the quintuple information of the request packet and updates the state information of the network connection;
under the condition that any node is a leader, the any node writes the state information of the network connection into a synchronization log corresponding to the network connection so as to synchronize the state information of the network connection to the one or more followers; after the state information of the network connection is synchronized, the any node sends the response packet to the client;
under the condition that any node is a follower, the any node sends the state information of the network connection to the leader; after the leader synchronizes state information of the network connection to the one or more followers, the any node sends the response packet to the client.
9. The method according to any one of claims 1 to 8, wherein the state information is stored in a memory corresponding to the node after being synchronized to the node.
10. A network connection system comprising a plurality of nodes corresponding to network connections, the plurality of nodes comprising a leader and one or more followers, wherein,
the leader is used for synchronizing the state information of the network connection to the one or more followers under the condition that the state information of the network connection is updated;
any node of the plurality of nodes connects the network connection based on the state information.
11. The system of claim 10, further comprising:
and the load balancing device is used for distributing the request packet of the client to the plurality of nodes according to a load balancing strategy.
CN202211262010.3A 2022-10-14 2022-10-14 Network connection method and network connection system Pending CN115766833A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211262010.3A CN115766833A (en) 2022-10-14 2022-10-14 Network connection method and network connection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211262010.3A CN115766833A (en) 2022-10-14 2022-10-14 Network connection method and network connection system

Publications (1)

Publication Number Publication Date
CN115766833A true CN115766833A (en) 2023-03-07

Family

ID=85351468

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211262010.3A Pending CN115766833A (en) 2022-10-14 2022-10-14 Network connection method and network connection system

Country Status (1)

Country Link
CN (1) CN115766833A (en)

Similar Documents

Publication Publication Date Title
US10999184B2 (en) Health checking in a distributed load balancer
US11843657B2 (en) Distributed load balancer
US9659075B2 (en) Providing high availability in an active/active appliance cluster
US8375001B2 (en) Master monitoring mechanism for a geographical distributed database
US8014274B1 (en) Selective replay of state information within a computing device
US9553809B2 (en) Asymmetric packet flow in a distributed load balancer
US9432245B1 (en) Distributed load balancer node architecture
US10135914B2 (en) Connection publishing in a distributed load balancer
US11770359B2 (en) Maintaining communications in a failover instance via network address translation
US6871296B2 (en) Highly available TCP systems with fail over connections
US9559961B1 (en) Message bus for testing distributed load balancers
US9871712B1 (en) Health checking in a distributed load balancer
CN110351246A (en) Server cluster system Socket management method and device
US6061807A (en) Methods systems and computer products for error recovery of endpoint nodes
US10432504B2 (en) Message processing
US10447652B2 (en) High availability bridging between layer 2 networks
WO2021008591A1 (en) Data transmission method, device, and system
CN111756780B (en) Method for synchronizing connection information and load balancing system
US20120266211A1 (en) Transparent database connection reconnect
CN112217735A (en) Information synchronization method and load balancing system
CN115766833A (en) Network connection method and network connection system
US6230283B1 (en) Logical connection resynchronization
CN114885007A (en) Method and electronic device for real-time strong consistency session synchronization
US20220232071A1 (en) Load balancing systems and methods
US10841040B2 (en) Acknowledgment and packet retransmission for spliced streams

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