CN112653740A - Load balancing method and device supporting QUIC connection migration and computer product - Google Patents

Load balancing method and device supporting QUIC connection migration and computer product Download PDF

Info

Publication number
CN112653740A
CN112653740A CN202011463461.4A CN202011463461A CN112653740A CN 112653740 A CN112653740 A CN 112653740A CN 202011463461 A CN202011463461 A CN 202011463461A CN 112653740 A CN112653740 A CN 112653740A
Authority
CN
China
Prior art keywords
quic
message
socket
unique
identification number
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
CN202011463461.4A
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202011463461.4A priority Critical patent/CN112653740A/en
Publication of CN112653740A publication Critical patent/CN112653740A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/148Migration or transfer of sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Abstract

The embodiment of the invention relates to a load balancing method, a device and a computer product for supporting QUIC connection migration, wherein the method comprises the following steps: acquiring messages to be loaded in a balanced manner; determining whether the message is a QUIC message according to the destination address of the message; if the message is a QUIC message, extracting a unique identification number of QUIC connection from the message; determining a socket corresponding to the unique QUIC connection identification number from a plurality of sockets as a target socket; and sending the QUIC message to the target socket. The embodiment of the invention realizes that the Nginx server can support the QUIC connection migration function to perform the load balancing function, simultaneously reserves the multi-process scheme of the Nginx server and keeps the load balancing performance of the Nginx server.

Description

Load balancing method and device supporting QUIC connection migration and computer product
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a load balancing method, a load balancing device and a computer product for supporting QUIC connection migration.
Background
In the current cloud computing network architecture, a nginnx server is generally adopted to implement a load balancing function of traffic of an application layer (a seventh layer in an OSI network model). However, when the flow message is the QUIC protocol, because the Nginx server uses multiple processes, the existing Nginx server cannot support the connection migration function of the QUIC protocol, and if the configuration of the Nginx is modified, the multiple processes are modified into a single process. In the prior art, each process corresponds to a Central Processing Unit (CPU), and when multiple processes are modified into a single process, the utilization rate of the CPU is inevitably extremely low, the service performance of load balancing is strictly limited, great performance loss is caused, and the expandability is lost.
Disclosure of Invention
In view of this, embodiments of the present invention provide a load balancing method, an apparatus, and a computer product for supporting QUIC connection migration, so that a Nginx server can support a QUIC connection migration function to perform load balancing, and meanwhile, a multi-process scheme of the Nginx server is retained, and load balancing performance of the Nginx server is maintained.
In a first aspect, an embodiment of the present invention provides a load balancing method for supporting QUIC connection migration, where the method includes:
acquiring messages to be loaded in a balanced manner;
determining whether the message is a QUIC message according to the destination address of the message;
if the message is a QUIC message, extracting a unique QUIC connection identification number from the message, wherein the unique QUIC connection identification number is uniquely corresponding to one QUIC connection;
determining sockets corresponding to the unique QUIC connection identification number from a plurality of sockets as target sockets, wherein each socket corresponds to a process, and the process is used for monitoring and processing messages received by the sockets;
and sending the QUIC message to the target socket.
In one possible embodiment, determining whether the message is a QUIC message according to the destination address of the message includes:
extracting a destination IP address and a destination port number from the message;
and if the destination IP address and the destination port number are the same as the preset IP address and the preset port number of the QUIC service, determining that the message is the QUIC message.
In one possible embodiment, determining a socket corresponding to the QUIC connection unique identification number from a plurality of sockets as a target socket comprises:
carrying out Hash operation on the unique identification number connected with the QUIC to obtain a Hash value;
and determining the socket corresponding to the hash value from the plurality of sockets as a target socket.
In one possible embodiment, the method further comprises: and acquiring a pre-stored corresponding table of the unique QUIC connection identification number and the socket from a database or a cache, wherein the corresponding table comprises at least one unique QUIC connection identification number and at least one socket, and each unique QUIC connection identification number corresponds to one socket.
In a second aspect, an embodiment of the present invention provides a load balancing apparatus for supporting QUIC connection migration, where the apparatus includes:
the acquiring unit is used for acquiring messages to be subjected to load balancing;
the processing unit is used for determining whether the message is a QUIC message according to the destination address of the message;
if the message is a QUIC message, extracting a unique QUIC connection identification number from the message, wherein the unique QUIC connection identification number is uniquely corresponding to one QUIC connection;
determining sockets corresponding to the unique QUIC connection identification number from a plurality of sockets as target sockets, wherein each socket corresponds to a process, and the process is used for monitoring and processing messages received by the sockets;
and the sending unit is used for sending the QUIC message to the target socket.
In a possible embodiment, the processing unit is specifically configured to extract a destination IP address and a destination port number from the packet;
and if the destination IP address and the destination port number are the same as the preset IP address and the preset port number of the QUIC service, determining that the message is the QUIC message.
In one possible embodiment, the processing unit is specifically adapted to,
carrying out Hash operation on the unique identification number connected with the QUIC to obtain a Hash value;
and determining the socket corresponding to the hash value from the plurality of sockets as a target socket.
In a third aspect, an embodiment of the present invention provides a computer product, which includes computer programs/instructions, and is characterized in that, when the computer programs/instructions are executed by a processor, the method for load balancing supporting QUIC connection migration as described in any implementation manner of the first aspect is implemented.
In a fourth aspect, an embodiment of the present invention provides a computer apparatus, including: at least one processor, a memory and computer programs/instructions stored in the memory, which when executed by the processor, implement the method for load balancing supporting QUIC connection migration as introduced in any of the embodiments of the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer storage medium storing a computer program/instruction, which when executed by a processor implements the load balancing method for supporting QUIC connection migration as described in any one of the embodiments of the first aspect.
The load balancing method supporting the QUIC connection migration, provided by the embodiment of the invention, is used for obtaining a message to be load balanced and determining whether the message is a QUIC message according to a destination address of the message. And if the message is a QUIC message, extracting the unique QUIC connection identification number from the message, and determining the socket corresponding to the unique QUIC connection identification number from the plurality of sockets as a target socket. In turn, the QUIC message is sent to the target socket. In the embodiment of the invention, the unique identification number of the QUIC connection uniquely corresponds to one QUID connection, and the unique identification number of the QUIC connection corresponds to only one socket, and the socket corresponds to one process. So that the same unique identification number of QUIC connection corresponds to the same process. Therefore, in the case where the unique identification number of the QUIC connection is not changed, the process of processing the message is not changed and the QUIC connection does not need to be reestablished regardless of any one or more elements among the source address, the source port, the destination address and the destination port in the QUIC connection, thereby ensuring a connection migration mechanism unique to the QUIC. In addition, the method can also ensure that a plurality of processes work simultaneously, and avoid the problem of resource waste caused by low CPU utilization rate. The method and the system realize the load balancing function of allowing the Nginx server to support QUIC connection migration, simultaneously reserve the multi-process scheme of the Nginx server, and maintain the load balancing performance of the Nginx server.
Drawings
FIG. 1 is a schematic flow chart of a load balancing method supporting QUIC connection migration according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for determining that a message is a QUIC message according to a destination address of the message according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for determining a target socket corresponding to a QUIC connection unique identification number from a plurality of sockets according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a load balancing apparatus supporting QUIC connection migration according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The noun explains:
OSI is an abbreviation for Open System Interconnect, which proposes seven layers including: a physical layer, a data link layer, a network layer, a transport layer, a session layer, a presentation layer, and an application layer.
The Nginx server is a high-performance HTTP and reverse proxy web server, and can also provide load balancing service of an application layer.
QUIC, English called as Quick UDP Internet Connection, is a UDP-based low-latency Internet transport layer protocol. QUIC integrates the features of protocols including TCP, TLS, HTTP/2, etc., but based on UDP transport, addresses the various requirements that the transport and application layers face, including handling more connections, security, and low latency.
Socket, known by the english name Socket, is a basic operation unit for supporting the path communication of the TCP/IP protocol. Sockets are abstractions of endpoints that communicate bi-directionally between application processes on different hosts in a network. A socket is the end of a process's communication over a network and provides a mechanism for application layer processes to exchange data using a network protocol. The socket upper connection application process and the lower connection network protocol stack are interfaces for the application program to communicate through the network protocol and are interfaces for the application program to interact with the network protocol root. The Client and the Server need to communicate through the internet, and at least one pair of sockets is needed, wherein one Socket runs on the Client and is called a Client Socket, and the other Socket runs on the Server and is called a Server Socket.
For the convenience of understanding of the embodiments of the present invention, the following description will be further explained with reference to specific embodiments, which are not to be construed as limiting the embodiments of the present invention.
In the prior art, network connections are often handed over between Wi-Fi and Cellular networks (Cellular). Such as: going out of home in the morning, and changing the connection from Wi-Fi to cellular; when the favorite restaurant eats breakfast, the mobile phone is automatically connected with the Wi-Fi of the restaurant; from restaurant to company, the connection goes through Wi-Fi- > cellular- > Wi-Fi. Each handover of a user may result in a change in the source IP address and/or source port number of the network connection.
In the TCP protocol, the connection identifier of each TCP connection is a unique five-tuple consisting of "source IP address + source Port + destination IP address + destination Port + protocol number", and once one of the parameters changes, a new TCP connection needs to be created again. If the user is watching short video or live, the network will experience an impact on the user experience due to the interruption of the reconnection during the handover process.
In the QUIC protocol, the connection identifier of each QUIC connection is a 64-bit random number called connection unique identifier (connection id), so when the IP address or Port (Port) corresponding to one QUIC connection changes, the connection unique identifier in the QUIC connection is kept unchanged, therefore, connection re-creation is not needed, and the user can not be experienced as interruption due to network switching. This user unaware network handover feature is called Connection Migration (Connection Migration).
In current cloud computing network architectures, cloud computing providers typically employ a nginnx server to implement load balancing of packets at the application layer (layer seven in the OSI network model). However, when the message is a QUIC protocol, since the Nginx server employs multiple processes, the Nginx server cannot support the connection migration function of the QUIC protocol, specifically: if the Nginx server is adopted to perform load balancing on the QUIC message, because the Nginx server generally adopts a multi-process scheme (in order to improve efficiency), namely, a plurality of processes are operated simultaneously, a corresponding socket is established for each process, and each process is used for processing a corresponding QUIC connection. When the message is distributed, hash calculation is carried out according to five tuples such as a source address, a source port, a destination address, a destination port, a protocol and the like to obtain a hash value, and a corresponding socket is selected according to the hash value. In the above manner, once any one element of the source address, the source port number, the destination address, and the destination port number changes, the hash value changes accordingly, so that the selection of the socket changes, and the distribution of the packet is disturbed: for example, the message of the a connection is distributed to the process of the B connection.
And if the configuration of the Nginx server is modified, modifying the multi-process into a single process. In the prior art, each process corresponds to a Central Processing Unit (CPU), and when multiple processes are modified into a single process, the performance utilization rate of the CPU is inevitably extremely low, the task processing capacity of the Nginx server is limited, the processing speed of load balancing is limited, great resource waste is caused, and the expandability is lost.
Fig. 1 is a schematic flowchart of a load balancing method for supporting QUIC connection migration according to an embodiment of the present invention, as shown in fig. 1, the method includes:
step 110, obtaining the message to be load balanced.
The execution subject of the step is any computer device running the computer device capable of realizing the application layer load balancing function. Such as a Nginx server. The message may be sent by the client. The message may include: the source IP address (i.e., the client's IP address), the source port number (i.e., the port number of the service that sent the message), the destination IP address, the destination port number, and the communication protocol, and the body of the message.
And step 120, determining whether the message is a QUIC message according to the destination address of the message.
The protocols of the messages received by the computer device with load balance are diversified, the messages can be TCP messages or UDP messages, and the messages of the TCP and UDP protocols have zone bits which clearly show the name of the protocol to which the messages belong. Therefore, when a message of a TCP or UDP protocol is acquired, the flag bit can be identified to determine which protocol the current message belongs to.
Because of the numerous versions of the QUIC protocol, and currently, there is no uniform way to determine the flag bits of the QUIC protocol name in each version. This makes it difficult to identify whether each message is a QUIC protocol. In the prior art, the flag bits of various QUIC protocol versions are prestored, and then when the flag bits are identified, the versions are respectively identified so as to determine whether the message is a QUIC protocol message. The method has the advantages of complex logic, high error rate and difficult use in large-scale message processing.
The present embodiment provides a method for identifying which protocol a message belongs to by means of a destination address, instead of a flag bit in the message. Specifically, in this embodiment, the computer program for processing the QUIC connection is separately made into one service and deployed, so that all the QUIC messages carry the addresses of the QUIC services, and therefore, it is possible to determine whether a message is a QUIC protocol by identifying whether the destination address of the message is the address of a prestored QUIC service.
In addition, it should be noted that TCP and UDP messages do not have the same connection migration mechanism as the QUIC protocol. The load balancing method supporting the QUIC connection migration proposed by the embodiment is only used for processing the QUIC protocol.
And step 130, if the message is a QUIC message, extracting a unique QUIC connection identification number from the message, wherein the unique QUIC connection identification number only corresponds to one QUIC connection.
In the QUIC protocol, each QUIC message has a QUIC Connection unique identification number (QUIC Connection ID) for identifying the uniqueness of the QUIC Connection. Thus, if step 120 identifies a message as a QUIC message, this step may extract the QUIC connection unique identification number from the message. In other words, if the step 120 identifies an error, a certain message is mistaken as a QUIC message, and if the unique identification number of the QUIC connection cannot be extracted in the step, the message is not the QUIC message, and an error is reported or the message is discarded.
And 140, determining a socket corresponding to the unique QUIC connection identification number from the plurality of sockets as a target socket, wherein each socket corresponds to a process, and the process is used for monitoring and processing messages received by the corresponding socket.
The same socket corresponds to the same process, and the same QUIC connection unique identification corresponds to the same socket, so that the same QUIC connection unique identification number corresponds to the same process, and different QUICs are connected to different processes corresponding to the unique identification numbers.
In this embodiment, the socket corresponding to the unique QUIC connection identification number is determined from the multiple sockets as the target socket according to the unique QUIC connection identification number, and since all messages in the same QUIC connection have the same unique QUIC connection identification number and the unique QUIC connection identification number does not change during network switching, all messages in the same QUIC connection can be allocated to the corresponding process even if the source IP address or the source port number changes.
Step 150, sending the QUIC message to the target socket.
Sockets are the end of a process's communication over a network and provide a mechanism for application layer processes to exchange data using network protocols. The socket upper connection application process and the lower connection network protocol stack are interfaces for the application program to communicate through the network protocol and are interfaces for the application program to interact with the network protocol root. After the QUIC message is sent to the target socket, the process corresponding to the socket processes the message while monitoring the received message.
The QUIC connection migration method provided by the embodiment of the invention obtains the message to be load balanced, and determines whether the message is a QUIC message according to the destination address of the message. And if the message is a QUIC message, extracting the unique QUIC connection identification number from the message, and determining the socket corresponding to the unique QUIC connection identification number from the plurality of sockets as a target socket. In turn, the QUIC message is sent to the target socket. Therefore, when the process corresponding to the target socket monitors the message, the message can be processed in time. In the above process, because the unique identification number of the QUIC connection uniquely corresponds to one QUID connection, and it corresponds to only one target socket, the target socket corresponds to one process. So that the same unique identification number of QUIC connection corresponds to the same process. Therefore, in the case that the unique identification number of the QUIC connection is not changed, no matter how any one or more elements of the source address, the source port, the destination address and the destination port in the message are changed, the process of processing the message is not changed, and the QUIC connection does not need to be reestablished, so that the unique connection migration mechanism of the QUIC is ensured. In addition, the method can also ensure that a plurality of processes work simultaneously, and avoid the problem of resource waste caused by low CPU utilization rate. The method and the system realize the load balancing function of allowing the Nginx server to support QUIC connection migration, simultaneously reserve the multi-process scheme of the Nginx server, and maintain the load balancing performance of the Nginx server.
In another specific embodiment, see in particular fig. 2. Fig. 2 details how to determine whether a message is a QUIC message according to its destination address. See specifically below:
step 210, extracting the destination IP address and the destination port number from the message.
And step 220, if the destination IP address and the destination port number are the same as the preset IP address and the preset port number of the QUIC service, determining that the message is the QUIC message.
Specifically, as described above, the message may include: the source IP address (i.e., the client's IP address), the source port number (i.e., the port number of the service that sent the message), the destination IP address, the destination port number, and the communication protocol, and the body of the message.
Therefore, the destination IP address and the destination port number can be extracted from the message. Then comparing the destination IP address with the IP address of the preset QUIC service, and comparing the destination port number extracted from the message with the port number of the preset QUIC service, if the destination port number and the port number are the same, the message can be indicated as a QUIC message, otherwise, the message is determined not to be a QUIC message,
by the method, whether the message to be subjected to load balancing is the QUIC message or not can be determined. And, only through purpose IP address and purpose port number carried in the message, and IP address and port number of the QUIC service preserved, can confirm. The process has simple logic, is not easy to make mistakes, has high identification efficiency and can be applied to large-scale message processing.
In another specific embodiment, specifically referring to fig. 3, the method steps for determining the socket corresponding to the QUIC connection unique identification number as the target socket from the plurality of sockets are detailed in fig. 3, and include the following steps:
and step 310, carrying out hash operation on the unique QUIC connection identification number to obtain a hash value.
In step 320, the socket corresponding to the hash value is determined as the target socket from the plurality of sockets.
In particular, the QUIC connection unique identification number is not typically changed. Then the resulting hash value will not change after it is hashed.
Then the socket corresponding to the hash value is found, and no change occurs. Further, a target socket corresponding to the unique identification number may be determined from the plurality of sockets. The target socket corresponds to a unique process. The unique process corresponding to the unique identification number can be realized.
By the method, the message cannot fall into different processes to be processed no matter how the source address, the source port, the destination address and elements in the destination port in the message are changed when the unique QUIC connection identification number is not changed, and therefore a unique connection migration mechanism of QUIC is guaranteed.
In another embodiment, the target socket is determined by a hash value, in addition to the manner described above. Besides ensuring unique connection migration mechanism of quic, the method can also be realized by the following mode:
specifically, a pre-stored correspondence table of the unique identification number of the QUIC connection and the socket may be obtained from a database or a cache, where the correspondence table includes at least one unique identification number of the QUIC connection and at least one socket, and each unique identification number of the QUIC connection corresponds to one socket.
Namely, the unique QUIC connection identification number can be matched with the prestored unique QUIC connection identification number and the unique QUIC connection identification number in the socket correspondence table, and when the matching is successful, the socket corresponding to the QUIC connection unique identification number which is successfully matched is used as the target socket. And the target socket corresponds to a unique process. It may also be implemented that the unique identification number corresponds to a unique process.
Through the method, the unique QUIC connection identification number can be guaranteed not to be processed in different processes no matter how the source address, the source port, the destination address and elements in the destination port in the message are changed when the unique QUIC connection identification number is not changed, and therefore a unique connection migration mechanism of QUIC is guaranteed.
Fig. 4 is a load balancing apparatus supporting the migration of QUIC connections according to an embodiment of the present invention, where the apparatus includes: an acquisition unit 401, a processing unit 402 and a transmission unit 403.
An obtaining unit 401, configured to obtain a message to be load balanced;
a processing unit 402, configured to determine whether a message is a QUIC message according to a destination address of the message;
if the message is a QUIC message, extracting a unique QUIC connection identification number from the message, wherein the unique QUIC connection identification number is uniquely corresponding to one QUIC connection;
determining sockets corresponding to the unique QUIC connection identification number from a plurality of sockets as target sockets, wherein each socket corresponds to a process, and the process is used for monitoring and processing messages received by the sockets;
a sending unit 403, configured to send the QUIC message to the target socket.
Optionally, the processing unit 402 is specifically configured to extract a destination IP address and a destination port number from the packet;
and if the destination IP address and the destination port number are the same as the preset IP address and the preset port number of the QUIC service, determining that the message is the QUIC message.
Optionally, the processing unit 402 is specifically configured to perform a hash operation on the unique identifier for QUIC connection to obtain a hash value;
and determining the socket corresponding to the hash value from the plurality of sockets as a target socket.
Optionally, the obtaining unit 401 is further configured to obtain a pre-stored mapping table between the unique QUIC connection identification number and the socket from a database or a cache, where the mapping table includes at least one unique QUIC connection identification number and at least one socket, and each unique QUIC connection identification number corresponds to one socket.
The functions executed by each functional component in the load balancing apparatus supporting the QUIC connection migration provided in this embodiment have been described in detail in the embodiments corresponding to fig. 1 to fig. 3, and therefore are not described again here.
The load balancing device supporting the QUIC connection migration, provided by the embodiment of the invention, is used for acquiring the message to be load balanced and determining whether the message is a QUIC message according to the destination address of the message. And if the message is a QUIC message, extracting the unique QUIC connection identification number from the message, and determining the socket corresponding to the unique QUIC connection identification number from the plurality of sockets as a target socket. In turn, the QUIC message is sent to the target socket. Therefore, when the process corresponding to the target socket monitors the message, the message can be processed in time. In the above process, because the unique identification number of the QUIC connection uniquely corresponds to one QUID connection, and it corresponds to only one target socket, the target socket corresponds to one process. So that the same unique identification number of QUIC connection corresponds to the same process. Therefore, in the case that the unique identification number of the QUIC connection is not changed, no matter how any one or more elements of the source address, the source port, the destination address and the destination port in the message are changed, the process of processing the message is not changed, and the QUIC connection does not need to be reestablished, so that the unique connection migration mechanism of the QUIC is ensured. In addition, the method can also ensure that a plurality of processes work simultaneously, and avoid the problem of resource waste caused by low CPU utilization rate. The method and the system realize the load balancing function of allowing the Nginx server to support QUIC connection migration, simultaneously reserve the multi-process scheme of the Nginx server, and maintain the load balancing performance of the Nginx server.
Embodiments of the present invention further provide a computer product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the steps of the method described in the embodiments corresponding to fig. 1 to 3 are implemented.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention, where the computer device 500 shown in fig. 5 includes: at least one processor 501, memory 502, at least one network interface 503, and other user interfaces 504. The various components in the load balancing computer apparatus 500 that support QUIC connection migration are coupled together by a bus system 505. It is understood that the bus system 505 is used to enable connection communications between these components. The bus system 505 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 505 in FIG. 5.
The user interface 504 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, trackball, touch pad, or touch screen, among others.
It is to be understood that the memory 502 in embodiments of the present invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (ddr Data Rate SDRAM, ddr SDRAM), Enhanced Synchronous SDRAM (ESDRAM), synchlronous SDRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 502 described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some embodiments, memory 502 stores elements, executable units or data structures, or a subset thereof, or an expanded set thereof as follows: an operating system 5021 and application programs 5022.
The operating system 5021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application 5022 includes various applications, such as a Media Player (Media Player), a Browser (Browser), and the like, for implementing various application services. The program for implementing the method according to the embodiment of the present invention may be included in the application program 5022.
In the embodiment of the present invention, by calling a program or an instruction stored in the memory 502, specifically, a program or an instruction stored in the application 5022, the processor 501 is configured to execute the method steps provided by the method embodiments, for example, including:
acquiring messages to be loaded in a balanced manner;
determining whether the message is a QUIC message according to the destination address of the message;
if the message is a QUIC message, extracting a unique QUIC connection identification number from the message, wherein the unique QUIC connection identification number is uniquely corresponding to one QUIC connection;
determining sockets corresponding to the unique QUIC connection identification number from a plurality of sockets as target sockets, wherein each socket corresponds to a process, and the process is used for monitoring and processing messages received by the sockets;
and sending the QUIC message to the target socket.
Optionally, extracting a destination IP address and a destination port number from the packet;
and if the destination IP address and the destination port number are the same as the preset IP address and the preset port number of the QUIC service, determining that the message is the QUIC message.
Optionally, performing hash operation on the unique QUIC connection identification number to obtain a hash value;
and determining the socket corresponding to the hash value from the plurality of sockets as a target socket.
Optionally, a pre-stored mapping table of the unique QUIC connection identification number and the socket is obtained from a database or a cache, where the mapping table includes at least one unique QUIC connection identification number and at least one socket, and each unique QUIC connection identification number corresponds to one socket.
The method disclosed by the above-mentioned embodiments of the present invention may be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 501. The Processor 501 may be a general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software elements in the decoding processor. The software elements may be located in ram, flash, rom, prom, or eprom, registers, among other storage media that are well known in the art. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the method in combination with the hardware.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing unit 402203501 may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions of the present Application, or a combination thereof.
For a software implementation, the techniques herein may be implemented by means of units performing the functions herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
The computer device provided in this embodiment may be the computer device shown in fig. 5, and may perform all the steps of the load balancing method supporting the QUIC connection migration shown in fig. 1 to 3, so as to achieve the technical effects of the load balancing method supporting the QUIC connection migration shown in fig. 1 to 3, which are described with reference to fig. 1 to 3 for brevity, and are not described herein again.
The embodiment of the invention also provides a storage medium (computer readable storage medium). The storage medium herein stores computer programs/instructions. Among others, the storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk; the memory may also comprise a combination of memories of the kind described above.
When the computer program/instructions in the storage medium are executable by the processor(s), the load balancing method supporting QUIC connection migration is implemented on the computer device side.
The processor is used for executing the load balancing program/instruction which supports the QUIC connection migration and is stored in the memory so as to realize the following steps of the load balancing method which supports the QUIC connection migration and is executed on the computer device side:
acquiring messages to be loaded in a balanced manner;
determining whether the message is a QUIC message according to the destination address of the message;
if the message is a QUIC message, extracting a unique QUIC connection identification number from the message, wherein the unique QUIC connection identification number is uniquely corresponding to one QUIC connection;
determining sockets corresponding to the unique QUIC connection identification number from a plurality of sockets as target sockets, wherein each socket corresponds to a process, and the process is used for monitoring and processing messages received by the sockets;
and sending the QUIC message to the target socket.
Optionally, extracting a destination IP address and a destination port number from the packet;
and if the destination IP address and the destination port number are the same as the preset IP address and the preset port number of the QUIC service, determining that the message is the QUIC message.
Optionally, performing hash operation on the unique QUIC connection identification number to obtain a hash value;
and determining the socket corresponding to the hash value from the plurality of sockets as a target socket.
Optionally, a pre-stored mapping table of the unique QUIC connection identification number and the socket is obtained from a database or a cache, where the mapping table includes at least one unique QUIC connection identification number and at least one socket, and each unique QUIC connection identification number corresponds to one socket.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, a software module executed by a processor, or a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above embodiments are provided to further explain the objects, technical solutions and advantages of the present invention in detail, it should be understood that the above embodiments are merely exemplary embodiments of the present invention and are not intended to limit the scope of the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for load balancing to support migration of QUIC connections, comprising:
acquiring messages to be loaded in a balanced manner;
determining whether the message is a QUIC message according to the destination address of the message;
if the message is a QUIC message, extracting a QUIC connection unique identification number from the message, wherein the QUIC connection unique identification number is only corresponding to a QUIC connection;
determining a socket corresponding to a unique QUIC connection identification number from a plurality of sockets as a target socket, wherein each socket corresponds to a process, and the process is used for monitoring and processing a message received by the socket;
and sending the QUIC message to the target socket.
2. The method of claim 1, said determining whether the packet is a QUIC packet according to the destination address of the packet comprising:
extracting a destination IP address and a destination port number from the message;
and if the destination IP address and the destination port number are the same as the preset IP address and the preset port number of the QUIC service, determining that the message is the QUIC message.
3. The method according to claim 1, wherein said determining from the plurality of sockets that the socket corresponding to the QUIC connection unique identification number is the target socket comprises:
carrying out Hash operation on the unique QUIC connection identification number to obtain a Hash value;
determining a socket corresponding to the hash value from a plurality of sockets as the target socket.
4. The method of claim 1, further comprising:
and acquiring a pre-stored corresponding table of the unique QUIC connection identification number and the socket from a database or a cache, wherein the corresponding table comprises at least one unique QUIC connection identification number and at least one socket, and each unique QUIC connection identification number corresponds to one socket.
5. A load balancing apparatus supporting QUIC connection migration, said apparatus comprising:
the acquiring unit is used for acquiring messages to be subjected to load balancing;
the processing unit is used for determining whether the message is a QUIC message according to the destination address of the message;
if the message is a QUIC message, extracting a QUIC connection unique identification number from the message, wherein the QUIC connection unique identification number is only corresponding to a QUIC connection;
determining a socket corresponding to a unique QUIC connection identification number from a plurality of sockets as a target socket, wherein each socket corresponds to a process, and the process is used for monitoring and processing a message received by the socket;
and the sending unit is used for sending the QUIC message to the target socket.
6. The apparatus according to claim 5, wherein the processing unit is specifically configured to extract a destination IP address and a destination port number from the message;
and if the destination IP address and the destination port number are the same as the preset IP address and the preset port number of the QUIC service, determining that the message is the QUIC message.
7. The apparatus according to claim 5, characterized in that the processing unit is specifically configured to,
carrying out Hash operation on the unique QUIC connection identification number to obtain a Hash value;
determining a socket corresponding to the hash value from a plurality of sockets as the target socket.
8. A computer product comprising computer program/instructions, characterized in that said computer program/instructions, when executed by a processor, implement the steps of the method according to any of claims 1-4.
9. A computer apparatus, comprising: at least one processor, a memory, and computer programs/instructions stored in the memory, wherein the steps of the method of any of claims 1-4 are implemented when the computer programs/instructions are executed by the processor.
10. A computer storage medium storing a computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the steps of the method according to any of claims 1-4.
CN202011463461.4A 2020-12-11 2020-12-11 Load balancing method and device supporting QUIC connection migration and computer product Pending CN112653740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011463461.4A CN112653740A (en) 2020-12-11 2020-12-11 Load balancing method and device supporting QUIC connection migration and computer product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011463461.4A CN112653740A (en) 2020-12-11 2020-12-11 Load balancing method and device supporting QUIC connection migration and computer product

Publications (1)

Publication Number Publication Date
CN112653740A true CN112653740A (en) 2021-04-13

Family

ID=75353851

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011463461.4A Pending CN112653740A (en) 2020-12-11 2020-12-11 Load balancing method and device supporting QUIC connection migration and computer product

Country Status (1)

Country Link
CN (1) CN112653740A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113141582A (en) * 2021-04-25 2021-07-20 深圳市元征科技股份有限公司 Log export method and device, computer equipment and storage medium
CN114172976A (en) * 2021-11-11 2022-03-11 北京天融信网络安全技术有限公司 Upstream and downstream connection association method, device, network forwarding equipment, system and medium
CN114637703A (en) * 2022-03-25 2022-06-17 北京有竹居网络技术有限公司 Data access device, method, readable medium and electronic equipment
CN115225644A (en) * 2022-07-27 2022-10-21 天翼云科技有限公司 Load balancing system and data packet distribution method
US11924299B2 (en) 2021-09-15 2024-03-05 Cisco Technology, Inc. QUIC and anycast proxy resiliency

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297270A (en) * 2013-05-24 2013-09-11 华为技术有限公司 Application type recognition method and network equipment
CN103916294A (en) * 2014-04-29 2014-07-09 华为技术有限公司 Identification method and device for protocol type
CN107070983A (en) * 2017-01-23 2017-08-18 天地融科技股份有限公司 A kind of load-balancing method, equipment and system forwarded based on address
CN107846364A (en) * 2016-09-19 2018-03-27 阿里巴巴集团控股有限公司 A kind for the treatment of method and apparatus of message
CN109818997A (en) * 2017-11-21 2019-05-28 中兴通讯股份有限公司 A kind of load-balancing method, system and storage medium
CN110233880A (en) * 2019-05-23 2019-09-13 北京字节跳动网络技术有限公司 Transmission method, system, medium and the electronic equipment of UDP message packet
CN110247848A (en) * 2018-03-09 2019-09-17 华为技术有限公司 Send method, the network equipment and the computer readable storage medium of message
CN111756776A (en) * 2020-07-28 2020-10-09 支付宝(杭州)信息技术有限公司 Server, message distribution device, program handover system, and program handover method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297270A (en) * 2013-05-24 2013-09-11 华为技术有限公司 Application type recognition method and network equipment
CN103916294A (en) * 2014-04-29 2014-07-09 华为技术有限公司 Identification method and device for protocol type
CN107846364A (en) * 2016-09-19 2018-03-27 阿里巴巴集团控股有限公司 A kind for the treatment of method and apparatus of message
CN107070983A (en) * 2017-01-23 2017-08-18 天地融科技股份有限公司 A kind of load-balancing method, equipment and system forwarded based on address
CN109818997A (en) * 2017-11-21 2019-05-28 中兴通讯股份有限公司 A kind of load-balancing method, system and storage medium
CN110247848A (en) * 2018-03-09 2019-09-17 华为技术有限公司 Send method, the network equipment and the computer readable storage medium of message
CN110233880A (en) * 2019-05-23 2019-09-13 北京字节跳动网络技术有限公司 Transmission method, system, medium and the electronic equipment of UDP message packet
CN111756776A (en) * 2020-07-28 2020-10-09 支付宝(杭州)信息技术有限公司 Server, message distribution device, program handover system, and program handover method

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113141582A (en) * 2021-04-25 2021-07-20 深圳市元征科技股份有限公司 Log export method and device, computer equipment and storage medium
US11924299B2 (en) 2021-09-15 2024-03-05 Cisco Technology, Inc. QUIC and anycast proxy resiliency
CN114172976A (en) * 2021-11-11 2022-03-11 北京天融信网络安全技术有限公司 Upstream and downstream connection association method, device, network forwarding equipment, system and medium
CN114172976B (en) * 2021-11-11 2024-02-02 北京天融信网络安全技术有限公司 Method, device, network forwarding equipment, system and medium for associating upstream and downstream connections
CN114637703A (en) * 2022-03-25 2022-06-17 北京有竹居网络技术有限公司 Data access device, method, readable medium and electronic equipment
CN114637703B (en) * 2022-03-25 2023-09-01 北京有竹居网络技术有限公司 Data access device, method, readable medium and electronic equipment
CN115225644A (en) * 2022-07-27 2022-10-21 天翼云科技有限公司 Load balancing system and data packet distribution method
CN115225644B (en) * 2022-07-27 2023-11-03 天翼云科技有限公司 Load balancing system and data packet distribution method

Similar Documents

Publication Publication Date Title
CN112653740A (en) Load balancing method and device supporting QUIC connection migration and computer product
EP3675432B1 (en) Intelligent and dynamic overlay tunnel formation via automatic discovery of citrivity/sdwan peer in the datapath in a pure plug and play environment with zero networking configuration
Barbette et al. A {High-Speed}{Load-Balancer} Design with Guaranteed {Per-Connection-Consistency}
CN110313163B (en) Load balancing in distributed computing systems
US9325785B2 (en) Device, system, and method for client-governed session persistency between one or more clients and servers of a data center
US7606929B2 (en) Network load balancing with connection manipulation
WO2018001269A1 (en) Method of processing cloud resource, and physical node
TWI626537B (en) Methods and systems for analyzing record and usage in post package repair
CN111034160B (en) non-DSR distributed load balancer with virtual VIP and source agent over load balancing connection
CN105993161B (en) Element, method, system and computer readable storage device for resolving an address
US20040268357A1 (en) Network load balancing with session information
US11956100B1 (en) System for scaling network address translation (NAT) and firewall functions
WO2017000593A1 (en) Packet processing method and device
US11570239B2 (en) Distributed resilient load-balancing for multipath transport protocols
US11570100B2 (en) Data processing method, apparatus, medium and device
CN111414208A (en) Application program starting method, device and equipment
US11882196B2 (en) Distributed inline proxy
US10673971B1 (en) Cross-partition messaging using distributed queues
CN106878311B (en) HTTP message rewriting method and device
US11223567B2 (en) Transmission control protocol session mobility
US20080056263A1 (en) Efficient transport layer processing of incoming packets
CN108848175B (en) Method and device for establishing TCP connection
CN113890789B (en) UDP tunnel traffic shunting method and traffic forwarding method suitable for data center
CN111371723B (en) Method and device for realizing PPTP VPN network isolation under DPDK framework
CN112804716B (en) Configuration method and device of data limit value and storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210413