Load balancing system, method, device and equipment and storage medium
Through the coordinated work of virtual network components and load balancer, we determine whether the corresponding records exist in the data packet, and add load balancing control information to the load balancer, solving the problem of excessive pressure on the load balancer and realizing the unloading of data traffic and stricter security verification support.
Patent Information
- Application Number
- CN202310706326.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-12-17
AI Technical Summary
In traditional hardware load balancing solutions, the service requests received by the load balancer are too centralized, resulting in the load balancer being too heavy to collapse.
Through the virtual network component, based on the five-tuple information and tunnel identification of the client's access request, determine whether the data packet has a corresponding data transmission record. If not, it will be sent to the load balancer, and add the application layer protocol format to the load balancer. Load balancing control information is forwarded to the target server, and if there is, it is sent directly to the target server to realize data traffic offloading on the load balancer.
It effectively avoids the crash caused by excessive pressure of the load balancer. Since the data length of the application layer protocol format is scalable, it supports carrying more client information, and is suitable for application scenarios with stricter security verification.
Smart Images

Figure CN119155300A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer network technology, and in particular to a load balancing system, method, apparatus, device and storage medium. Background Art
[0002] Traditional hardware load balancing solutions usually involve installing an additional load balancing device between the server and the client. This type of device is called a load balancer. Figure 1 This is a diagram of the physical network topology of this load balancing solution. Figure 1 In the process, all the business requests of the client will pass through the load balancer, which makes the business requests received by the load balancer too centralized, which may cause the load balancer itself to bear too much pressure and cause it to crash. Therefore, how to provide a new load balancing method to deal with the above problems in the prior art still needs to provide further solutions. Summary of the invention
[0003] Multiple aspects of the present application provide a load balancing system, method, apparatus, device and storage medium to alleviate the problem that the service requests received by the load balancer are too concentrated, which easily causes the load balancer itself to bear too much pressure and cause it to crash.
[0004] The embodiment of the present application also provides a load balancing system, including: a client, used to send a data packet of an access request to a virtual network component, the data packet carrying a five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client; the virtual network component, used to send the data packet to the load balancer when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client, and send the data packet to a target server in the data transmission record when it is determined that there is a corresponding data transmission record for the data packet; the load balancer, used to match a target server for the data packet, add load balancing control information to the data packet, and send the data packet with the load balancing control information added to the target server, the load balancing control information including information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in an application layer protocol format; the target server, used to receive and respond to the data packet with the load balancing control information added.
[0005] The embodiment of the present application also provides a load balancing method, which is applied to a client, and the method comprises: sending a data packet of an access request to a virtual network component, the data packet carrying a five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client; through the virtual network component, when it is determined based on the five-tuple information of the data packet and the tunnel identifier of the client that the data packet does not have a corresponding data transmission record, sending the data packet of the access request to the load balancer, and when it is determined that the data packet has a corresponding data transmission record When receiving the data packet of the access request, the load balancer matches the data packet of the access request with the target server, adds load balancing control information in the data packet, and sends the data packet with the load balancing control information added to the target server, the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in the application layer protocol format, so that the target server receives and responds to the data packet with the load balancing control information added.
[0006] The embodiment of the present application also provides a load balancing method, which is applied to a load balancer, and the method includes: receiving a data packet of an access request from a client, the data packet is sent by the client to a virtual network component, the data packet carries a five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client, the data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client; matching a target server for the data packet; adding load balancing control information to the data packet; sending the data packet with the load balancing control information added to the target server, the load balancing control information including information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in an application layer protocol format, so that the target server receives and responds to the data packet of the access request with the load balancing control information added.
[0007] The embodiment of the present application also provides a load balancing method, which is applied to a server, and the method includes: receiving and responding to a data packet of an access request with load balancing control information added thereto; wherein the data packet of the access request with load balancing control information added thereto comes from a load balancer, and the data packet of the access request with load balancing control information added thereto is obtained by the load balancer matching a target server for the data packet after receiving the data packet from the client, and adding load balancing control information to the data packet, and the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in an application layer protocol format; the data packet is sent by the client to the virtual network component, and the data packet carries five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client, and the data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client.
[0008] The embodiment of the present application also provides a client, including: a sending module, used to send a data packet of an access request to a virtual network component, the data packet carrying a five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client; a forwarding module, used to send the data packet to a load balancer when the virtual network component determines that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client, and when it is determined that there is a corresponding data transmission record for the data packet, send the data packet to a target server corresponding to the data transmission record; wherein, when the load balancer receives the data packet, it matches the target server for the data packet, adds load balancing control information to the data packet, and sends the data packet with the load balancing control information added to the target server, the load balancing control information including information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in the application layer protocol format, so that the target server receives and responds to the data packet with the load balancing control information added.
[0009] The embodiment of the present application also provides a load balancer, including: a receiving module, used to receive a data packet of an access request from a client, the data packet of the access request is sent by the client to a virtual network component, the data packet of the access request carries a five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service and the transmission protocol, and the tunnel identifier of the client, the data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client; a matching module, used to match a target server for the data packet; an adding module, used to add load balancing control information to the data packet; a sending module, used to send the data packet with the load balancing control information added to the target server, the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client and the address of the client is the source address, and the load balancing control information is data in the application layer protocol format, so that the target server receives and responds to the data packet with the load balancing control information added.
[0010] The embodiment of the present application also provides a server, the method comprising: a response module, for receiving and responding to a data packet of an access request with load balancing control information added thereto; wherein the data packet of the access request with load balancing control information added thereto comes from a load balancer, the data packet of the access request with load balancing control information added thereto is obtained by the load balancer matching a target server for the data packet after receiving the data packet from a client, and adding load balancing control information to the data packet, the load balancing control information comprising information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in an application layer protocol format; the data packet is sent by the client deployed on the physical machine to the virtual network component, the data packet carries five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client, and the data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client.
[0011] An embodiment of the present application also provides an electronic device, comprising: a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to implement the steps in the load balancing method.
[0012] An embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is caused to implement the steps in the load balancing method.
[0013] In the embodiment of the present application, it is possible to determine whether there is a corresponding data transmission record for the access request based on the data packet of the access request from the client through the virtual network component, and only when there is no corresponding data transmission record for the access request, the data packet of the access request is sent to the load balancer, and the load balancer adds data in the application layer protocol format to the data packet of the access request, and forwards the data packet of the access request after the data in the application layer protocol format is added to the target server through the load balancer. Moreover, when the load balancer determines that there is no corresponding data transmission record for the access request, the data packet of the access request is directly sent to the target server. On the one hand, only the first data packet of the access request is forwarded to the target server through the load balancer, which realizes the unloading of most of the data traffic on the load balancer and avoids the situation where the load balancer crashes due to excessive pressure; on the other hand, when the load balancer receives the data packet of the access request, it adds the load balancing control information in the application layer protocol format to the data packet of the access request. Since the data length of the application layer protocol format can be extended and there is no fixed length limit, it can also support carrying more client information to the target server, so that the load balancing system can be applied to application scenarios with stricter security verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0015] Figure 1 A schematic diagram of a load balancing solution provided by the prior art;
[0016] Figure 2 A schematic diagram of another load balancing solution provided by the prior art;
[0017] Figure 3 A schematic diagram of a load balancing system provided for an exemplary embodiment of the present application;
[0018] Figure 4A schematic diagram of a process of applying a load balancing method provided by an exemplary embodiment of the present application to a client;
[0019] Figure 5 A schematic diagram of a flow chart of a load balancing method provided in an exemplary embodiment of the present application applied to a load balancer;
[0020] Figure 6 A flow chart of a load balancing method provided in an exemplary embodiment of the present application applied to a server;
[0021] Figure 7 A schematic diagram of the structure of a client provided for an exemplary embodiment of the present application;
[0022] Figure 8 A schematic diagram of the structure of a load balancer provided for an exemplary embodiment of the present application;
[0023] Fig. 9 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0024] Fig.10 A schematic structural diagram of an electronic device provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0025] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0026] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0027] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0028] First, the terms involved in one or more embodiments of the present application are explained.
[0029] VPC: VPC stands for Virtual Private Cloud, which is a virtual private network used to build a user-exclusive network environment in a public cloud environment, including IP addresses, routes, subnets, etc., and has a unique tunnel identifier.
[0030] Five-tuple information: Five-tuple information refers to the five key elements used to identify a data packet in network communication in a computer network, including source IP address, destination IP address, source port number, destination port number and protocol type. These five elements constitute a unique identifier that can uniquely identify a data packet in network communication.
[0031] Client: It can be simply understood as a virtual host created and managed on the cloud, which is deployed on a physical machine and belongs to a VPC.
[0032] Learning source: When transmitting network data packets to a virtual host, the data packets need to be transmitted to the physical machine where the virtual host is located first. Therefore, each virtual host should correspond to the network address of a physical machine. Generally, the address of the virtual host is called the overlay address, and the address of the physical machine is called the underlay address. Therefore, recording and retaining the correspondence between the two is called learning source capability.
[0033] Virtual network component: Responsible for finding the corresponding virtual host and transmitting the network packets transmitted to the physical machine. Responsible for finding the peer physical machine and transmitting the network packets sent by the virtual host to the peer physical machine, with learning source capability.
[0034] Business service: A service program that runs on the server and is used to provide business services to clients.
[0035] Load balancing plug-in module: A plug-in module installed on the server with the ability to learn sources. It obtains the client's network request packet one step ahead of the business service. It is responsible for parsing the access request data packet sent by the client and learning the address of the physical machine corresponding to the client. It is responsible for packaging the response data packet of the business service to the client's access request and transmitting it to the physical machine corresponding to the client.
[0036] VxLAN: VxLAN is an overlay network technology that uses the MAC inUDP method for encapsulation. It can create a virtual Layer 2 subnet across multiple physical IP subnets, creating a fully virtualized infrastructure cloud service that allows Layer 2 to communicate with any endpoint. VxLAN adds an 8-byte VxLAN Header to the original inner Ethernet frame, and the outer layers are UDP Header, outer IP Header, and outer Mac Header, a total of 50 bytes of encapsulation message header. For specific fields and attribute parameters, see rfc7348.
[0037] TCP Option: TCP Option refers to an optional field in the TCP protocol, which is used to carry some additional information in the TCP packet header, such as window size, timestamp, SACK, etc. The existence of TCP Option makes the TCP protocol more flexible and scalable, and can meet different application scenarios and requirements.
[0038] NGLB: A distributed load balancing technology based on cloud network.
[0039] PPv2: Proxy Protocol v2 is an abbreviation of Proxy Protocol. Proxy Protocol is a protocol used to transmit client information between a proxy server and a backend server. It can attach a special message header to the beginning of a TCP connection, which contains information such as the client's IP address and port number, so that the backend server can obtain the client's real IP address and port number. This is very useful for scenarios that require IP address restrictions and access control, such as load balancing, reverse proxy, and Web firewalls. Proxy Protocol supports multiple versions, including Proxy Protocol v1, v2, and v2SSL.
[0040] Load balancer: in the embodiments of the present application, refers to a load balancing device that integrates hardware and software.
[0041] Message: refers to network message, which can be understood as data packets transmitted in the network.
[0042] As described in the background technology, in the existing load balancing solution, all the business requests of the client will pass through the load balancer, and the load balancer itself will usually crash due to excessive load pressure. In response to this, a distributed load balancing solution came into being. For example, in this solution, the load balancer only processes the first data packet of the business request from the client, and the other data packets of the business request (the second, third, fourth, ..., nth data packets of the business request) can be directly transmitted between the client and the server, so as to unload the traffic of most of the data packets of the business request from the load balancer. Figure 2 This is a schematic diagram of the load balancing solution. Figure 2 In the load balancer, the first data packet of the received service request needs to add a TCP option field to carry client information and server information to the load balancing plug-in module on the server. Therefore, its usage scenario has two constraints: first, it can only be used for specific services based on the TCP protocol and cannot be used in services based on the UDP protocol; second, since the maximum data that can be carried in the TCP option field is 40 bytes, it cannot be expanded to more fields and cannot meet more complex usage requirements such as security verification.
[0043] In view of the many shortcomings of the current load balancing scheme, the embodiment of the present application considers determining whether there is a corresponding data transmission record for the access request based on the data packet of the access request from the client through the virtual network component, and only when there is no corresponding data transmission record for the access request, the data packet of the access request is sent to the load balancer, and the load balancer adds the data in the application layer protocol format to the data packet of the access request, and forwards the data packet of the access request after the data in the application layer protocol format is added to the target server through the load balancer. Moreover, when the load balancer determines that there is no corresponding data transmission record for the access request, the data packet of the access request is directly sent to the target server. On the one hand, only the first data packet of the access request is forwarded to the target server through the load balancer, which realizes the unloading of most of the data traffic on the load balancer and avoids the situation where the load balancer crashes due to excessive pressure; on the other hand, when the load balancer receives the data packet of the access request, the load balancing control information in the application layer protocol format is added to the data packet of the access request. Since the data length of the application layer protocol format can be extended and there is no fixed length limit, it can also support carrying more client information to the target server, so that the load balancing system can be applied to application scenarios with stricter security verification. Specifically, a load balancing system is provided in an embodiment of the present application. The embodiment of the present application also relates to a load balancing method, related devices, electronic devices, and computer-readable storage media, which are described in detail one by one in the following embodiments.
[0044] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0045] See also Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a load balancing system provided according to an embodiment of the present application. Figure 3 As shown, including:
[0046] The client 311 is used to send a data packet of an access request to the virtual network component 312, wherein the data packet carries a five-tuple information including a source address indicating the address of the client, a source port indicating the port of the client, a destination address indicating the address of the access service, a destination port indicating the port of the access service, and a transmission protocol, and a tunnel identifier of the client;
[0047] The virtual network component 312 is used to send the data packet to the load balancer when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client, and to send the data packet to the server corresponding to the destination address when it is determined that there is a corresponding data transmission record for the data packet;
[0048] The load balancer 32 is used to match a target server for a data packet, add load balancing control information to the data packet, and send the data packet with the load balancing control information added to the target server, wherein the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in an application layer protocol format;
[0049] The target server 33 is used to receive and respond to the data packet with the load balancing control information added.
[0050] The client 311 and the virtual network component 312 are deployed on the same physical machine 31 .
[0051] The transport protocol in the five-tuple information is used to indicate the data transmission protocol between the client and the access service that the client requests to access. In an exemplary embodiment, the transport protocol may be the User Datagram Protocol (UDP), which provides a method for the client to send encapsulated IP data packets without establishing a connection.
[0052] The virtual network component 312 determines whether there is a corresponding data transmission record for the access request based on the five-tuple information of the data packet of the access request and the tunnel identifier of the client, specifically, whether the data packet is the first data packet between the client and the access service it requests to access. If the data packet is the first data packet between the client and the access service it requests to access, the data packet can be forwarded to the load balancer for processing through the virtual network component 312. If the data packet is not the first data packet between the client and the access service it requests to access, the data packet can be directly sent to the target server that processes the access request. Among them, the target server that processes the access request can be matched by the load balancer 32 when the first data packet corresponding to the access request is received.
[0053] Optionally, the data in the application layer protocol format may be data in the PPv2 protocol format. Since the PPv2 protocol is a protocol carried on the transport layer, i.e., the application layer, it can be carried in either a TCP data packet or a UDP packet, and the data length is scalable without a fixed length restriction, thus avoiding the limitation that the load balancing system cannot be used in UDP scenarios.
[0054] In some exemplary embodiments, in order to facilitate smooth transmission of the data packet to the next destination address, that is, the address of the load balancer, when the virtual network component 312 sends the data packet to the load balancer 32, it is specifically used to:
[0055] Encapsulate the data packet into a first VxLAN message, wherein the outer source address of the first VxLAN message is the address of the physical machine on which the client is deployed, and the destination address of the first VxLAN message is the address of the load balancer;
[0056] Send the first VxLAN message to the load balancer.
[0057] Among them, the encapsulation process of the first VxLAN message is to use the original data packet, that is, the access request data packet, as the inner data content of the first VxLAN message, and based on the source address of the access request data packet, that is, the address of the physical machine where the client is deployed, and the next destination address of the access request data packet, that is, the address of the load balancer, re-add the VxLAN header and the IP header to obtain the first VxLAN message, and the VxLAN header has a fixed transmission protocol.
[0058] In some exemplary embodiments, when the load balancer 32 matches the target server for the data packet of the access request, it is specifically used to:
[0059] Obtain a data packet, a tunnel identifier of the client, and a destination address of the data packet of the access request from the first VxLAN message;
[0060] Determine a target dispatching rule that matches the tunnel identifier of the client and the destination address of the data packet;
[0061] Based on the target dispatching rule, the target server of the response data packet is determined from the server group.
[0062] Among them, the scheduling rules may include multiple types, such as polling scheduling rules, random scheduling rules, etc. Different types of access requests or clients can pre-set corresponding scheduling rules, and the target scheduling rule can be matched according to the type of access request and / or the type of client. The access service can be a server group that can respond to the client's access request, and the target server is a server selected by the load balancer from the server group according to the target scheduling rule.
[0063] In some exemplary embodiments, when the load balancer sends a data packet with load balancing control information added to the target server, it is specifically used to:
[0064] Encapsulate the data packet to which the load balancing control information is added to obtain a second VxLAN message to be forwarded, where the destination address of the second VxLAN message is the address of the target server;
[0065] Send the second VxLAN message to the target server.
[0066] Among them, the encapsulation process of the second VxLAN message is to use the data packet with added load balancing control information as the inner data content of the second VxLAN message, and use the address of the load balancer as the source address, and the next destination address of the data packet, that is, the address of the target server, and re-add the VxLAN header and IP header to obtain the second VxLAN message.
[0067] In some exemplary embodiments, the target server 33 further includes a load balancing plug-in module 332, which is specifically used to:
[0068] Receive the second VxLAN message, parse the second VxLAN message through the load balancing plug-in module, and obtain the load balancing control information, five-tuple information, and access request data packet in the second VxLAN message;
[0069] Establish an inbound index and inbound cache as well as an outbound index and outbound cache for the client's access request based on the load balancing control information and five-tuple information in the second VxLAN message through the load balancing plug-in module;
[0070] Modify the source address, source port, destination address and destination port of the data packet in the second VxLAN message based on the inbound index and the inbound cache through the load balancing plug-in module, and send the modified data packet to the target server;
[0071] In response to the modified data packet, a response message of the modified data packet is returned, and the response message is sent to the client based on the outbound index and the outbound cache through the load balancing plug-in module.
[0072] Among them, the inbound index is used for the load balancing plug-in module to match the source address, source port, destination address, destination port and tunnel identifier of the received data packet. When the load balancing plug-in module determines that the source address, source port, destination address, destination port and tunnel identifier of the received data packet can match the inbound index, the source address, source port, destination address and destination port of the received data packet are modified according to the inbound cache.
[0073] The outbound index is used by the load balancing plug-in module to match the source address, source port, destination address, and destination port of the data packet to be sent. When the load balancing plug-in module determines that the source address, source port, destination address, and destination port of the data packet to be sent can match the outbound index, the source address, source port, destination address, and destination port of the received data packet are modified according to the outbound cache, and the address of the physical machine where the client is deployed and the tunnel identifier of the client are carried in the data packet.
[0074] In some exemplary embodiments, when the target server establishes an inbound index and an inbound cache and an outbound index and an outbound cache for the client's access request based on the load balancing control information and the five-tuple information in the second VxLAN message through the load balancing plug-in module, it is specifically used to:
[0075] Determine, through the load balancing plug-in module, based on the load balancing control information and the five-tuple information in the second VxLAN message, that the inbound index is index information containing the five-tuple information of the second VxLAN message and the tunnel identifier combination of the client, and the inbound cache includes cache information for indicating that the source address in the inbound index is converted to a pseudo-random address, the source port in the inbound index is converted to a pseudo-random port, the destination address in the inbound index is converted to the address of the target server, and the destination port in the inbound index is converted to the port of the target server;
[0076] Based on the inbound index and the inbound cache, determine that the outbound index is the transmission protocol in the five-tuple information of the second VxLAN message, the source address is the address of the target server, the source port is the port of the target server, the destination address is a pseudo-random address, and the destination port is a pseudo-random port combination of index information, and the outbound cache includes cache information for indicating that the source address of the outbound index is converted to the address of the access service, the source port of the outbound index is converted to the port of the access service, the destination address of the outbound index is converted to a pseudo-random address, the destination port of the outbound index is converted to a pseudo-random port, the IP address of the physical machine where the client is deployed, and the tunnel identifier of the client;
[0077] A mapping relationship between an inbound index and an inbound cache and a mapping relationship between an outbound index and an outbound cache are established.
[0078] Based on the five-tuple information and TunnelID of the inner message, an inbound index and cache are created for the request.
[0079] Among them, based on the load balancing control information and quintuple information in the second VxLAN message, the inbound index information can be determined as: UDP+cip+cport+vip+vport+tunnel ID, UDP is the transmission protocol in the quintuple information of the second VxLAN message, cip is the source IP address in the quintuple information of the second VxLAN message, cport is the source port in the quintuple information of the second VxLAN message, vip is the destination IP address in the quintuple information of the second VxLAN message, vport is the destination port in the quintuple information of the second VxLAN message, and tunnel ID is the tunnel identifier of the client in the load balancing control information in the second VxLAN message.
[0080] The inbound cache information may include: converting the source IP address in the inbound index into a pseudo-random address, namely fake ip (abbreviated as fip), which can be generated by an algorithm, and each different access request has a different corresponding generated address; converting the destination IP address in the inbound index into the IP address of the target server (abbreviated as rip); converting the source port in the inbound index into a pseudo-random port, namely fake port (abbreviated as fport), which can also be generated by an algorithm, and each different access request has a different corresponding generated port; converting the destination port in the inbound index into the target server port (abbreviated as rport).
[0081] Based on the inbound index and inbound cache, the outbound index is determined to be: UDP+rip+rport+fip+fport.
[0082] The outbound cache information may include: converting the source IP address in the outbound index into the IP address of the access service (referred to as vip for short); converting the destination IP address in the outbound index into the IP address of the client (referred to as cip for short); converting the source port in the outbound index into the port of the access service (referred to as vport for short); converting the destination port in the outbound index into the port of the client (referred to as cport for short); and carrying the IP address of the physical machine where the client is deployed in the data packet, referred to as nc_ip for short, and the tunnel ID corresponding to the client.
[0083] The business service 331 in the target server may respond to the modified data packet and return the response message of the modified data packet. The business service runs on the target server and is a service program that can provide business services to the client, that is, a service program that responds to the client's access request.
[0084] In some exemplary embodiments, the response message of the modified data packet includes five-tuple information indicating that the source address is the address of the target server, the source port is the port of the target server, the destination address is a pseudo-random address, the destination port is a pseudo-random port, and the transmission protocol.
[0085] At this time, the five-tuple information of the response message of the modified data packet is UDP+rip+rport+fip+fport.
[0086] In some exemplary embodiments, when the target server sends a response message to the client through the load balancing plug-in module based on the outbound index and the outbound cache, it is specifically used to:
[0087] When it is determined through the load balancing plug-in module that the outbound index matches the five-tuple information of the response message, the source address, source port, destination address and destination port in the five-tuple information of the response message are modified through the load balancing plug-in module based on the outbound cache;
[0088] The modified response message is encapsulated into a third VxLAN message through the load balancing plug-in module, the destination address of the third VxLAN message is the address of the physical machine where the client is deployed, and the source address of the third VxLAN message is the address of the target server;
[0089] The modified response message is sent to the physical machine where the client is deployed through the load balancing plug-in module.
[0090] Since the five-tuple information UDP+rip+rport+fip+fport of the response message of the modified data packet can match the outbound index UDP+rip+rport+fip+fport, the source and destination addresses and source and destination ports in the five-tuple information of the response message of the modified access request data packet can be modified according to the outbound cache corresponding to the outbound index.
[0091] Among them, the encapsulation process of the third VxLAN message is to use the modified response message as the inner data content of the third VxLAN message, and use the source address of the modified response message, that is, the address of the target server, as the source address, and the next destination address of the third VxLAN message, that is, the address of the physical machine where the client is deployed, and re-add the VxLAN header and IP header to obtain the third VxLAN message.
[0092] In some exemplary embodiments, after the target server sends a response message to the client through the load balancing plug-in module based on the outbound index and the outbound cache, the response message can be first received by the physical machine because the IP address of the physical machine where the client is located is carried in the response message based on the outbound cache. Specifically, after the target server sends a response message to the client through the load balancing plug-in module based on the outbound index and the outbound cache, the physical machine is used to:
[0093] The address of the target server is recorded in the index and cache information established based on the five-tuple information of the data packet of the access request and the tunnel identifier of the client through the virtual network component, so as to generate a data transmission record between the client and the target server and the physical machine where the client is deployed;
[0094] The third VxLAN message is parsed through the virtual network component to obtain an inner response message in the third VxLAN message, and the inner response message in the third VxLAN message is sent to the client.
[0095] The data transmission record between the client and the target server and the physical machine where the client is deployed may also be referred to as the source record of the client's access request.
[0096] In some exemplary embodiments, in order to reduce the data traffic processed by the load balancer, when the virtual network component determines that a corresponding data transmission record exists for a data packet of an access request, when sending the data packet of the access request to a server corresponding to the destination address, it is specifically configured to:
[0097] When it is determined that a corresponding data transmission record exists for a data packet of the access request, encapsulate the data packet of the access request into a fourth VxLAN message, the outer source address of the fourth VxLAN message is the address of a physical machine on which the client is deployed, and the destination address of the fourth VxLAN message is the address of the target server in the data transmission record;
[0098] The fourth VxLAN message is sent to the target server.
[0099] Specifically, after the client receives the response message, it can continue to send subsequent data packets of the access request. The five-tuple information of the subsequent data packet is UDP+cip+cport+vip+vport. The data packet can be sent to the virtual network component for processing. The virtual network component can determine that the data packet has a corresponding data transmission record based on the source destination address and source destination port in the five-tuple information. When learning the source record, the data packet can be directly sent to the target server bypassing the load balancer. The response process of the target server receiving the data packet is consistent with the process of responding to the first data packet of the access request, and this application will not repeat it here.
[0100] Among them, the encapsulation process of the fourth VxLAN message is to use the access request data packet as the inner data content of the fourth VxLAN message, and use the source address of the access request data packet, that is, the client address, as the source address, and the next destination address of the fourth VxLAN message, that is, the address of the target server, and re-add the VxLAN header and IP header to obtain the fourth VxLAN message.
[0101] The load balancing system provided in the embodiment of the present application can determine whether there is a corresponding data transmission record for the access request based on the data packet of the access request from the client on the physical machine through the virtual network component, and only when there is no corresponding data transmission record for the access request, the data packet of the access request is sent to the load balancer, and the load balancer adds data in the application layer protocol format to the data packet of the access request, and forwards the data packet of the access request after the data in the application layer protocol format is added to the target server through the load balancer. Moreover, when the load balancer determines that there is no corresponding data transmission record for the access request, the data packet of the access request is directly sent to the target server. On the one hand, only the first data packet of the access request is forwarded to the target server through the load balancer, which realizes the unloading of most of the data traffic on the load balancer and avoids the situation where the load balancer crashes due to excessive pressure; on the other hand, when the load balancer receives the data packet of the access request, it adds the load balancing control information in the application layer protocol format to the data packet of the access request. Since the data length of the application layer protocol format can be extended and there is no fixed length limit, it can also support carrying more client information to the target server, so that the load balancing system can be applied to application scenarios with stricter security verification.
[0102] Figure 4 The following is a flow chart of a load balancing method applied to a client provided by an exemplary embodiment of the present application. Figure 4 As shown, the method includes:
[0103] Step 410: Send a data packet of an access request to the virtual network component through the client.
[0104] The access request data packet carries five-tuple information including the source address being the client's address, the source port being the client's port, the destination address being the access service's address, the destination port being the access service's port and the transport protocol, as well as the client's tunnel identifier.
[0105] Step 420, through the virtual network component, when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client, the data packet is sent to the load balancer; and when it is determined that there is a corresponding data transmission record for the data packet, the data packet is sent to the target server corresponding to the data transmission record.
[0106] When the load balancer receives a data packet of an access request, it matches the data packet with a target server, adds load balancing control information to the data packet, and sends the data packet with the added load balancing control information to the target server. The load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address. The load balancing control information is data in the application layer protocol format, so that the target server receives and responds to the data packet of the access request with the added load balancing control information.
[0107] The implementation process of load balancing method applied to physical machines Figure 3 The implementation process in the load balancing system shown is consistent and will not be repeated in this application.
[0108] By adopting the load balancing method provided in the embodiment of the present application, on the one hand, only the first data packet of the access request is processed and forwarded to the target server through the load balancer, thereby realizing the unloading of most of the data traffic on the load balancer and avoiding the situation where the load balancer crashes due to excessive pressure; on the other hand, when the load balancer receives the data packet of the access request, the load balancing control information in the application layer protocol format is added to the data packet of the access request. Since the data length of the application layer protocol format can be extended and there is no fixed length limit, it can also support carrying more client information to the target server, so that the load balancing system can be applied to application scenarios with stricter security verification.
[0109] Figure 5 A flow chart of a load balancing method provided in an exemplary embodiment of the present application applied to a load balancer.
[0110] like Figure 5 As shown, the method includes:
[0111] Step 510: Receive a data packet of an access request from a client.
[0112] The data packet of the access request is sent by the client to the virtual network component, and the data packet carries five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client. The data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet of the access request based on the five-tuple information of the data packet of the access request and the tunnel identifier of the client;
[0113] Step 520, matching a target server for the data packet.
[0114] Step 530: Add load balancing control information to the data packet.
[0115] Step 540: Send the data packet with the load balancing control information added to the target server.
[0116] The load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address. The load balancing control information is data in the application layer protocol format so that the target server receives and responds to the data packet with the load balancing control information added.
[0117] The implementation process of load balancing method applied to load balancer Figure 3 The implementation process in the load balancing system shown is consistent and will not be repeated in this application.
[0118] By adopting the load balancing method provided in the embodiment of the present application, on the one hand, only the first data packet of the access request is processed and forwarded to the target server through the load balancer, thereby realizing the unloading of most of the data traffic on the load balancer and avoiding the situation where the load balancer crashes due to excessive pressure; on the other hand, when the load balancer receives the data packet of the access request, the load balancing control information in the application layer protocol format is added to the data packet of the access request. Since the data length of the application layer protocol format can be extended and there is no fixed length limit, it can also support carrying more client information to the target server, so that the load balancing system can be applied to application scenarios with stricter security verification.
[0119] Figure 6 A flow chart of a load balancing method applied to a server provided in an exemplary embodiment of the present application. Figure 6 As shown, the method includes:
[0120] Step 610: Receive and respond to a data packet of an access request to which load balancing control information is added.
[0121] Among them, the data packet of the access request with the load balancing control information added comes from the load balancer. The data packet of the access request with the load balancing control information added is obtained by the load balancer after receiving the data packet of the access request from the client, matching the data packet with the target server and adding the load balancing control information to the data packet. The load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address. The load balancing control information is data in the application layer protocol format.
[0122] The data packet is sent by the client to the virtual network component, and the data packet carries five-tuple information indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the client's tunnel identifier. The data packet is sent to the load balancer by the virtual network component deployed on the physical machine when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the client's tunnel identifier.
[0123] The implementation process of load balancing method applied to servers Figure 3 The implementation process in the load balancing system shown is consistent and will not be repeated in this application.
[0124] By adopting the load balancing method provided in the embodiment of the present application, on the one hand, only the first data packet of the access request is processed and forwarded to the target server through the load balancer, thereby realizing the unloading of most of the data traffic on the load balancer and avoiding the situation where the load balancer crashes due to excessive pressure; on the other hand, when the load balancer receives the data packet of the access request, the load balancing control information in the application layer protocol format is added to the data packet of the access request. Since the data length of the application layer protocol format can be extended and there is no fixed length limit, it can also support carrying more client information to the target server, so that the load balancing system can be applied to application scenarios with stricter security verification.
[0125] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. In addition, in some processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed or executed in parallel in the order in which they appear in this article, and the sequence numbers of the operations, such as 410, 420, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel.
[0126] Figure 7 A schematic diagram of the structure of a client provided by an exemplary embodiment of the present application. Figure 7 As shown, the physical machine 700 includes: a sending module 710 and a forwarding module 720, wherein:
[0127] A sending module 710, configured to send a data packet of an access request to a virtual network component, wherein the data packet carries five-tuple information including a source address indicating that the source address is the address of the client, a source port is the port of the client, a destination address is the address of the access service, a destination port is the port of the access service, and a transmission protocol, and a tunnel identifier of the client;
[0128] The forwarding module 720 is configured to send the data packet to the load balancer when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client, and to send the data packet to the target server corresponding to the data transmission record when it is determined that there is a corresponding data transmission record for the data packet;
[0129] When the load balancer receives the data packet, it matches the target server for the data packet, adds load balancing control information to the data packet, and sends the data packet with the load balancing control information added to the target server. The load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address. The load balancing control information is data in the application layer protocol format, so that the target server receives and responds to the data packet with the load balancing control information added.
[0130] Physical machine 700 can achieve Figure 4 The method and corresponding technical effects of the method embodiment can be specifically referred to Figure 4 The load balancing method of the illustrated embodiment will not be described in detail.
[0131] Figure 8 A schematic diagram of the structure of a load balancer provided by an exemplary embodiment of the present application. Figure 8 As shown, the load balancer 800 includes: a receiving module 810, a matching module 820, an adding module 830 and a sending module 840, wherein:
[0132] The receiving module 810 is used to receive a data packet of an access request from a client, the data packet is sent by the client deployed on the physical machine to the virtual network component, the data packet carries five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client, and the data packet is sent to the load balancer by the virtual network component deployed on the physical machine when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client;
[0133] A matching module 820, configured to match a target server for the data packet;
[0134] An adding module 830, configured to add load balancing control information to the data packet;
[0135] The sending module 840 is used to send the data packet added with the load balancing control information to the target server, the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client and the address of the client is the source address, and the load balancing control information is data in the application layer protocol format, so that the target server receives and responds to the data packet added with the load balancing control information.
[0136] Load Balancer 800 enables Figure 5 The method and corresponding technical effects of the method embodiment can be specifically referred to Figure 5 The load balancing method of the illustrated embodiment will not be described in detail.
[0137] Fig. 9 A schematic diagram of the structure of a server provided by an exemplary embodiment of the present application. Fig. 9 As shown, the server 900 includes: a response module 910, wherein:
[0138] A response module 910, configured to receive and respond to a data packet of an access request to which load balancing control information is added;
[0139] The data packet of the access request with the added load balancing control information comes from the load balancer, and the data packet of the access request with the added load balancing control information is obtained by the load balancer after receiving the data packet from the physical machine, matching the data packet with a target server, and adding the load balancing control information to the data packet, and the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in the application layer protocol format;
[0140] The data packet is sent by the client deployed on the physical machine to the virtual network component, and the data packet carries five-tuple information indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client. The data packet is sent to the load balancer by the virtual network component deployed on the physical machine when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client.
[0141] Server 900 can achieve Figure 6 The method and corresponding technical effects of the method embodiment can be specifically referred to Figure 6 The load balancing method of the illustrated embodiment will not be described in detail.
[0142] Fig.10 The following is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. Fig.10 As shown, the device includes: a memory 101 and a processor 102 .
[0143] The memory 101 is used to store computer programs and can be configured to store various other data to support operations on the computing device. Examples of such data include instructions for any application or method operating on the computing device, contact data, phone book data, messages, pictures, videos, etc.
[0144] The processor 102 is coupled to the memory 101 and is used to execute the computer program in the memory 101, so as to: send a data packet of an access request to the virtual network component through a client, the data packet carrying five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client; through the virtual network component, when it is determined based on the five-tuple information of the data packet and the tunnel identifier of the client that the data packet does not have a corresponding data transmission record, the data packet is sent to the load balancer, and when it is determined that the data packet has a corresponding When a data transmission record is recorded, the data packet is sent to a target server corresponding to the data transmission record; wherein, when the load balancer receives the data packet, it matches the target server for the data packet, adds load balancing control information to the data packet, and sends the data packet with the load balancing control information added to the target server, wherein the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in an application layer protocol format, so that the target server receives and responds to the data packet with the load balancing control information added.
[0145] Alternatively, a data packet of an access request from a client is received, the data packet is sent by the client to the virtual network component, the data packet carries a five-tuple information including a source address indicating that the source address is the address of the client, a source port is the port of the client, a destination address is the address of the access service, a destination port is the port of the access service, and a transmission protocol, as well as a tunnel identifier of the client, the data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client; a target server is matched for the data packet; load balancing control information is added to the data packet; and the data packet with the load balancing control information added thereto is sent to the target server, the load balancing control information including information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in an application layer protocol format, so that the target server receives and responds to the data packet with the load balancing control information added thereto.
[0146] Alternatively, receiving and responding to a data packet of an access request with load balancing control information added thereto; wherein the data packet of the access request with load balancing control information added thereto comes from a load balancer, and the data packet of the access request with load balancing control information added thereto is obtained by the load balancer matching the data packet with a target server after receiving the data packet from a client, and adding load balancing control information to the data packet, the load balancing control information including information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in an application layer protocol format; the data packet is sent by the client to the virtual network component, and the data packet carries five-tuple information including five-tuple information indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client, and the data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client.
[0147] Further, if Fig.10 As shown, the electronic device also includes: a communication component 103, a display 104, a power component 105, an audio component 106 and other components. Fig.10 Only some components are shown schematically, which does not mean that the electronic device only includes Fig.10 In addition, depending on the implementation form of the traffic playback device, Fig.10The components in the dashed box are optional components, not mandatory components. For example, when the electronic device is implemented as a terminal device such as a smartphone, tablet computer or desktop computer, it may include Fig.10 Components in the dashed box; when the electronic device is implemented as a conventional server, cloud server, data center or server array and other server-side devices, it may not include Fig.10 Components within the dashed box.
[0148] Accordingly, an embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is enabled to implement the steps in the above-mentioned load balancing method embodiment.
[0149] Above Fig.10 The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may also include a near field communication (NFC) module, a radio frequency identification (RFID) technology, an infrared data association (IrDA) technology, an ultra-wideband (UWB) technology, a Bluetooth (BT) technology, etc.
[0150] Above Fig.10 The memory in can be implemented by any type of volatile or non-volatile storage device or a combination of them, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0151] Above Fig.10 The display in the embodiment includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0152] Above Fig.10 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.
[0153] Above Fig.10 The audio component in can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal.
[0154] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0155] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0156] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0157] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.
[0158] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0159] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0160] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0161] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0162] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A load balancing system, characterized in that: include: A client, used to send a data packet of an access request to a virtual network component, wherein the data packet carries a five-tuple of information including a source address indicating that the source address is the address of the client, a source port is the port of the client, a destination address is the address of the access service, a destination port is the port of the access service, and a transport protocol, and a tunnel identifier of the client; a virtual network component, configured to send the data packet to the load balancer when it is determined that no corresponding data transmission record exists for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client, and to send the data packet to a server corresponding to the data transmission record when it is determined that a corresponding data transmission record exists for the data packet; A load balancer, configured to match a target server for the data packet, add load balancing control information to the data packet, and send the data packet with the load balancing control information added thereto to the target server, wherein the load balancing control information includes information indicating that the address of the target server is a destination address, the tunnel identifier of the client, and the address of the client is a source address, and the load balancing control information is data in an application layer protocol format; The target server is used to receive and respond to the data packet to which the load balancing control information is added.
2. The system according to claim 1, characterized in that When the virtual network component sends the data packet to the load balancer, it is specifically used to: Encapsulate the data packet into a first VxLAN message, wherein the outer source address of the first VxLAN message is the address of the physical machine on which the client is deployed, and the destination address of the first VxLAN message is the address of the load balancer; Send the first VxLAN message to the load balancer.
3. The system according to claim 2, characterized in that When the load balancer matches the target server for the data packet, it is specifically used to: Obtain the data packet, the tunnel identifier of the client, and the destination address of the data packet from the first VxLAN message; Determine a target scheduling rule that matches the tunnel identifier of the client and the destination address of the data packet; Based on the target scheduling rule, a target server that responds to the data packet is determined from the server group.
4. The system according to claim 3, characterized in that When the load balancer sends the data packet with the load balancing control information added thereto to the target server, it is specifically used to: Encapsulate the data packet to which the load balancing control information is added to obtain a second VxLAN message to be forwarded, wherein the destination address of the second VxLAN message is the address of the target server; Send the second VxLAN message to the target server.
5. The system according to claim 4, characterized in that The target server further includes a load balancing plug-in module, which is specifically used to: Receive the second VxLAN message, parse the second VxLAN message through the load balancing plug-in module, and obtain the load balancing control information, five-tuple information, and data packet in the second VxLAN message; Establishing an inbound index and an inbound cache and an outbound index and an outbound cache for the access request of the client based on the load balancing control information and the five-tuple information in the second VxLAN message through the load balancing plug-in module; Modify the source address, source port, destination address and destination port of the data packet in the second VxLAN message based on the inbound index and the inbound cache through the load balancing plug-in module, and send the modified data packet to the target server; In response to the modified data packet, a response message of the modified data packet is returned, and the response message is sent to the client through the load balancing plug-in module based on the outbound index and the outbound cache.
6. The system according to claim 5, characterized in that When the target server establishes an inbound index and an inbound cache and an outbound index and an outbound cache for the access request of the client based on the load balancing control information and the five-tuple information in the second VxLAN message through the load balancing plug-in module, it is specifically used to: Determine, through the load balancing plug-in module, based on the load balancing control information and the five-tuple information in the second VxLAN message, that the inbound index is index information containing the five-tuple information of the second VxLAN message and the tunnel identifier combination of the client, and the inbound cache includes cache information for indicating that the source address in the inbound index is converted to a pseudo-random address, the source port in the inbound index is converted to a pseudo-random port, the destination address in the inbound index is converted to the address of the target server, and the destination port in the inbound index is converted to the port of the target server; Based on the inbound index and the inbound cache, determine that the outbound index is the transmission protocol in the five-tuple information of the second VxLAN message, the source address is the address of the target server, the source port is the port of the target server, the destination address is the pseudo-random address, and the destination port is the index information of the pseudo-random port combination, and the outbound cache includes cache information for indicating that the source address of the outbound index is converted to the address of the access service, the source port of the outbound index is converted to the port of the access service, the destination address of the outbound index is converted to the pseudo-random address, the destination port of the outbound index is converted to the pseudo-random port, the IP address of the physical machine where the client is deployed, and the tunnel identifier of the client; A mapping relationship between the inbound index and the inbound cache and a mapping relationship between the outbound index and the outbound cache are established.
7. The system according to claim 6, characterized in that The response message of the modified data packet includes five-tuple information indicating that the source address is the address of the target server, the source port is the port of the target server, the destination address is the pseudo-random address, the destination port is the pseudo-random port, and the transmission protocol.
8. The system according to claim 6, characterized in that When the target server sends the response message to the client through the load balancing plug-in module based on the outbound index and the outbound cache, it is specifically used to: When it is determined by the load balancing plug-in module that the outbound index matches the five-tuple information of the response message, the source address, source port, destination address and destination port in the five-tuple information of the response message are modified by the load balancing plug-in module based on the outbound cache; Encapsulating the modified response message into a third VxLAN message through the load balancing plug-in module, the destination address of the third VxLAN message is the address of the physical machine on which the client is deployed, and the source address of the third VxLAN message is the address of the target server; The modified response message is sent to the physical machine where the client is deployed through the load balancing plug-in module.
9. The system according to claim 8, characterized in that After the target server sends the response message to the client through the load balancing plug-in module based on the outbound index and the outbound cache, the physical machine is used to: The address of the target server is recorded in the index and cache information established based on the five-tuple information of the data packet and the tunnel identifier of the client through the virtual network component, so as to generate a data transmission record between the client and the target server and the physical machine where the client is deployed; The third VxLAN message is parsed by the virtual network component to obtain an inner response message in the third VxLAN message, and the inner response message in the third VxLAN message is sent to the client.
10. A load balancing method, characterized in that: The method is applied to a client, and the method comprises: Sending a data packet of an access request to the virtual network component, the data packet carrying a five-tuple of information including a source address indicating that the source address is the address of the client, a source port is the port of the client, a destination address is the address of the access service, a destination port is the port of the access service, and a transport protocol, and a tunnel identifier of the client; When it is determined through a virtual network component that no corresponding data transmission record exists for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client, the data packet is sent to a load balancer; and when it is determined that a corresponding data transmission record exists for the data packet, the data packet is sent to a target server corresponding to the data transmission record; When the load balancer receives the data packet, it matches the target server for the data packet, adds load balancing control information to the data packet, and sends the data packet with the load balancing control information added to the target server. The load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address. The load balancing control information is data in the application layer protocol format, so that the target server receives and responds to the data packet with the load balancing control information added.
11. A load balancing method, characterized in that: The method is applied to a load balancer, and the method comprises: Receive a data packet of an access request from a client, the data packet is sent by the client to the virtual network component, the data packet carries five-tuple information including a source address indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as a tunnel identifier of the client, and the data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client; Matching a target server for the data packet; Adding load balancing control information to the data packet; A data packet with the load balancing control information added thereto is sent to the target server, wherein the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in the application layer protocol format, so that the target server receives and responds to the data packet with the load balancing control information added thereto.
12. A load balancing method, characterized in that: The method is applied to a server, and the method comprises: Receive and respond to access request packets with load balancing control information added; The data packet of the access request with the added load balancing control information comes from the load balancer, and the data packet of the access request with the added load balancing control information is obtained by the load balancer after receiving the data packet from the client, matching the data packet with a target server, and adding the load balancing control information to the data packet, and the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in the application layer protocol format; The data packet is sent by the client to the virtual network component, and the data packet carries five-tuple information indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client. The data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client.
13. A client, characterized in that: include: A sending module, configured to send a data packet of an access request to a virtual network component, wherein the data packet carries five-tuple information including a source address indicating that the source address is the address of the client, a source port is the port of the client, a destination address is the address of the access service, a destination port is the port of the access service, and a transmission protocol, and a tunnel identifier of the client; a forwarding module, configured to send the data packet to the load balancer when it is determined through the virtual network component based on the five-tuple information of the data packet and the tunnel identifier of the client that the data packet does not have a corresponding data transmission record, and to send the data packet to a target server corresponding to the data transmission record when it is determined that the data packet has a corresponding data transmission record; When the load balancer receives the data packet, it matches the target server for the data packet, adds load balancing control information to the data packet, and sends the data packet with the load balancing control information added to the target server. The load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address. The load balancing control information is data in the application layer protocol format, so that the target server receives and responds to the data packet with the load balancing control information added.
14. A server, characterized in that: The method comprises: A response module, used for receiving and responding to a data packet of an access request to which load balancing control information is added; The data packet of the access request with the added load balancing control information comes from the load balancer, and the data packet of the access request with the added load balancing control information is obtained by the load balancer after receiving the data packet from the client, matching the data packet with a target server, and adding the load balancing control information to the data packet, and the load balancing control information includes information indicating that the address of the target server is the destination address, the tunnel identifier of the client, and the address of the client is the source address, and the load balancing control information is data in the application layer protocol format; The data packet is sent by the client to the virtual network component, and the data packet carries five-tuple information indicating that the source address is the address of the client, the source port is the port of the client, the destination address is the address of the access service, the destination port is the port of the access service, and the transmission protocol, as well as the tunnel identifier of the client. The data packet is sent to the load balancer by the virtual network component when it is determined that there is no corresponding data transmission record for the data packet based on the five-tuple information of the data packet and the tunnel identifier of the client.
Citation Information
Cited By
Method and system for determining service forwarding source
CN120602234A
A method and system for determining service forwarding sources
CN120602234B
