CN116938936A - Data packet processing method, device and equipment in load balancing cluster - Google Patents

Data packet processing method, device and equipment in load balancing cluster Download PDF

Info

Publication number
CN116938936A
CN116938936A CN202311027076.9A CN202311027076A CN116938936A CN 116938936 A CN116938936 A CN 116938936A CN 202311027076 A CN202311027076 A CN 202311027076A CN 116938936 A CN116938936 A CN 116938936A
Authority
CN
China
Prior art keywords
server
virtual service
packet
request packet
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311027076.9A
Other languages
Chinese (zh)
Inventor
汤斌
张海森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Baiguoyuan Information Technology Co Ltd
Original Assignee
Guangzhou Baiguoyuan Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Baiguoyuan Information Technology Co Ltd filed Critical Guangzhou Baiguoyuan Information Technology Co Ltd
Priority to CN202311027076.9A priority Critical patent/CN116938936A/en
Publication of CN116938936A publication Critical patent/CN116938936A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a data packet processing method, a device and equipment in a load balancing cluster, wherein the method comprises the following steps: receiving a request packet sent by a client, wherein the request packet records a virtual service address; under the condition that the mapping relation between the request packet and the server is not recorded, determining the server corresponding to the request packet based on the virtual service address, and recording the mapping relation between the request packet and the server; replacing the virtual service address in the request packet with the server address of the server, and forwarding the request packet to the server; and receiving the reflow package sent by the server or other servers, and determining a virtual service address corresponding to the reflow package for forwarding to a corresponding client. The scheme realizes high availability and decoupling of the request packet and the reflux packet during processing of the data packet in the load balancing cluster, can reduce response delay of the data packet, and is beneficial to horizontal expansion.

Description

Data packet processing method, device and equipment in load balancing cluster
Technical Field
The embodiment of the application relates to the technical field of networks, in particular to a data packet processing method, device and equipment in a load balancing cluster.
Background
With the rapid development of internet technology, more and more enterprises and users start to use network services, so that a server needs to process a large number of concurrent requests, and the pressure of the server is increased. Meanwhile, as service demands increase, service logic becomes more and more complex, requirements on server performance are higher and higher, measures are required to prevent single-point faults in order to ensure stable operation of services, usability of the system is improved, and meanwhile, the system is required to be easily expanded to cope with the increasing access amount.
Based on the above background, load balancing techniques have evolved. In the load balancing technology, the set load balancing system can disperse requests to a plurality of servers, so that the pressure of a single server is reduced, and the availability and expansibility of the system are improved. Meanwhile, the load balancing system can conduct intelligent scheduling according to the performance and the load condition of the servers, and therefore load balancing of the servers is guaranteed, and the performance of the whole system is improved.
In a load balancing system, bidirectional network address translation is required for data communication between a client and a server. Among them, network address translation is a technique of replacing a source IP address or a destination IP address with other IP addresses during packet transmission.
In the related art, in order to perform bidirectional network address conversion in the implementation process of the load balancing system, each load balancing node in the load balancing cluster is adopted to perform synchronization of connection information and mapping relation, so as to implement network address conversion of a request packet and a reflux packet. In the method, each piece of connection information and mapping relation are required to be synchronized to all load balancing nodes, when the connection information reaches more than ten millions, the synchronization or searching performance is obviously reduced, so that response time delay is increased, meanwhile, if a reflux packet reaches the load balancing nodes before the synchronization information, network address conversion cannot be performed, the reflux packet needs to be cached, and the like, the information is converted again when the synchronization information reaches, so that the overall processing performance is influenced, and the processing logic is complicated.
In another related art, there is a scheme of using a specific network topology and dynamic policy routing to ensure that both a request packet and a return packet pass through the same load balancing node, but this scheme increases the complexity of network and route management, and needs improvement.
Disclosure of Invention
The embodiment of the application provides a data packet processing method, a device and equipment in a load balancing cluster, which realize high availability and decoupling of a request packet and a reflux packet during data packet processing in the load balancing cluster, can reduce response delay of the data packet and is beneficial to horizontal expansion.
In a first aspect, an embodiment of the present application provides a method for processing a data packet in a load balancing cluster, where the method includes:
receiving a request packet sent by a client, wherein the request packet records a virtual service address;
under the condition that the mapping relation between the request packet and the server is not recorded, determining the server corresponding to the request packet based on the virtual service address, and recording the mapping relation between the request packet and the server;
replacing the virtual service address in the request packet with the server address of the server, and forwarding the request packet to the server;
and receiving the reflow package sent by the server or other servers, and determining a virtual service address corresponding to the reflow package for forwarding to a corresponding client.
In a second aspect, an embodiment of the present application further provides a packet processing device in a load balancing cluster, including:
the receiving module is configured to receive a request packet sent by a client, wherein the request packet records a virtual service address;
the virtual service module is configured to determine a server corresponding to the request packet and allocated based on the virtual service address under the condition that the mapping relation between the request packet and the server is not recorded, and record the mapping relation between the request packet and the server;
An address translation module configured to replace a server address of the server with a virtual service address in the request packet;
a forwarding module configured to forward the request packet to the server;
the receiving module is further configured to receive a reflux packet sent by the server or other servers;
the address conversion module is further configured to determine a virtual service address corresponding to the reflux packet, and is used for forwarding the virtual service address to a corresponding client by the forwarding module.
In a third aspect, an embodiment of the present application further provides a packet processing device in a load balancing cluster, where the device includes:
one or more processors;
storage means for storing one or more programs,
and when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method for processing data packets in the load balancing cluster according to the embodiment of the application.
In a fourth aspect, embodiments of the present application further provide a non-volatile storage medium storing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for processing data packets in a load balancing cluster according to an embodiment of the present application.
In a fifth aspect, the embodiment of the present application further provides a computer program product, where the computer program product includes a computer program, where the computer program is stored in a computer readable storage medium, and where at least one processor of the device reads and executes the computer program from the computer readable storage medium, so that the device performs the method for processing a data packet in the load balancing cluster according to the embodiment of the present application.
In the embodiment of the application, a request packet sent by a client is received, wherein the request packet records a virtual service address, a server corresponding to the request packet is determined based on the virtual service address under the condition that the mapping relation between the request packet and the server is not recorded, the mapping relation between the request packet and the server is recorded, the server address of the server is replaced with the virtual service address in the request packet, the request packet is forwarded to the server, a reflux packet sent by the allocated server or other servers is received, and the virtual service address corresponding to the reflux packet is determined for forwarding to the corresponding client. In the scheme, the mapping relation between the request packet and the server is determined through the virtual service address recorded by the request packet, the request packet is further forwarded to the corresponding server, when the reflux packet is processed, the corresponding virtual service address corresponding to the reflux packet is forwarded after the determination, the arrival of synchronous information is not needed, the high availability of the data packet in the load balancing cluster during processing is realized, the decoupling of the request packet and the reflux packet is realized through the set binding relation between the virtual service address and the server, the state independence is realized, the response delay of the data packet can be reduced, and the horizontal expansion of the data packet in the load balancing cluster during processing is facilitated due to the strong configuration flexibility and the expandability of the binding relation between the virtual service address and the server.
Drawings
Fig. 1 is a flowchart of a method for processing a data packet in a load balancing cluster according to an embodiment of the present application;
fig. 2 is a flowchart of another method for processing a data packet in a load balancing cluster according to an embodiment of the present application;
fig. 3 is a flowchart of another method for processing a data packet in a load balancing cluster according to an embodiment of the present application;
fig. 4 is a flowchart of another method for processing a data packet in a load balancing cluster according to an embodiment of the present application;
fig. 5 is a block diagram of a packet processing device in a load balancing cluster according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a packet processing device in a load balancing cluster according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in further detail below with reference to the drawings and examples. It should be understood that the particular embodiments described herein are illustrative only and are not limiting of embodiments of the application. It should be further noted that, for convenience of description, only some, but not all of the structures related to the embodiments of the present application are shown in the drawings.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
According to the data packet processing method in the load balancing cluster, the execution main body can be a load balancing node in the load balancing cluster. The load balancing cluster refers to a cluster comprising a plurality of load balancing nodes, and a high-availability and high-concurrency cluster system is ensured for the load balancing nodes. The data packet processing method in the load balancing cluster provided by the embodiment of the application can be applied to the cluster environment of the multi-load balancing program of the multi-load balancing node, for example, the cluster environment of the multi-load balancing program of the multi-load balancing node converted by the bidirectional network address.
Fig. 1 is a flowchart of a method for processing a data packet in a load balancing cluster according to an embodiment of the present application, as shown in fig. 1, specifically including the following steps:
step S101, receiving a request packet sent by a client, wherein the request packet records a virtual service address.
In one embodiment, any load balancing node in the load balancing cluster receives a request packet sent by an external client and forwards the request packet to a real server of the internal network. Wherein the request packet records a virtual service address.
In one embodiment, the virtual service address includes a virtual service IP and a virtual service port. Optionally, the request packet uniquely identifies five parameters of the particular network connection in five-tuple form. Five parameters in a computer network for uniquely identifying a particular network connection include a source IP address, a destination IP address, a source port number, a destination port number, and a transport protocol, often denoted as < source IP, destination IP, source port, destination port, transport protocol >. For a request packet, the five-tuple is exemplified by < client IP, virtual service IP, client port, virtual service port, transport protocol >.
Step S102, when the mapping relation between the request packet and the server is not recorded, determining the server corresponding to the request packet based on the virtual service address, and recording the mapping relation between the request packet and the server.
In one embodiment, after receiving a request packet sent by a client, it is first queried whether a mapping relationship between the request packet and a server is recorded, or whether a session connection between the request packet and a corresponding server is established. If the session connection between the request packet and the corresponding server exists or the mapping relation between the request packet and the server is recorded, determining the real server corresponding to the request packet directly based on the session connection or the recorded mapping relation between the request packet and the server, so as to forward the request packet to the determined server. For example, for the case that the mapping relationship between the request packet and the server is recorded, a specific server corresponding to the request packet may be recorded in the mapping relationship between the request packet and the server, and may be recorded in a list form, for the case that a session connection is established, a connection session table created when the session connection is established may be queried to determine the server corresponding to the request packet.
When the mapping relation between the request packet and the server is not recorded, the server corresponding to the request packet is determined based on the virtual service address. The server corresponding to the request packet is queried and determined through the virtual service address recorded in the request packet, and the request packet is forwarded. Correspondingly, after the server corresponding to the request packet is determined, the mapping relation between the request packet and the server is recorded for server allocation of the subsequent request packet. Optionally, taking the quintuple of the request packet as < client IP, virtual service IP, client port, virtual service port, and transport protocol > as an example, the recorded mapping relationship may be the association relationship of the < client IP, virtual service IP, client port, virtual service port, and transport protocol > of the request packet and the corresponding allocated server, such as the corresponding relationship between the server IP and the server port of the server. In the subsequent inquiry, the corresponding allocated server IP and server port are directly determined aiming at the five-tuple (client IP, virtual service IP, client port, virtual service port and transmission protocol), so that the quick response to the request packet can be realized, and meanwhile, the record is only carried out aiming at the mapping relation of the request packet received by the load balancing node, so that the record data volume is obviously reduced.
In one embodiment, when determining a server to which a request packet corresponds based on a virtual service address, it may be: and determining the server corresponding to the allocation of the request packet according to the virtual service address and the stored virtual service configuration rule, wherein the virtual service configuration rule comprises a polling selection rule and/or a random selection rule. The load balancing node receives configured virtual service configuration rules in advance, and determines the server corresponding to the request packet by the virtual service configuration rules and the virtual service address in the request packet. Optionally, the virtual service configuration rule records different virtual service addresses and a plurality of servers corresponding to each virtual service address, and after the virtual service address in the request packet is acquired, one allocated server can be selected from the plurality of servers corresponding to the virtual service address, where a specific manner of selecting the server may adopt a polling selection rule, or a random selection rule, or both of them are switched for use. The polling selection rule may be one of a plurality of servers corresponding to the virtual service address sequentially selected, and the random selection rule may be one of a plurality of servers corresponding to the virtual service address randomly selected as the server allocated to the request packet.
Step S103, replacing the virtual service address in the request packet with the server address of the server, and forwarding the request packet to the server.
In one embodiment, after determining the server to which the request packet is allocated, the server address is substituted for the virtual service address in the request packet, where the server address may include a server IP and a server port, and the request packet five-tuple is < client IP, virtual service IP, client port, virtual service port, and transport protocol > for example, and the substituted five-tuple of the request packet is < client IP, server IP, client port, server port, and transport protocol >. After the address replacement is completed, the address is forwarded to a corresponding server for processing.
Step S104, receiving the reflow package sent by the server or other servers, and determining a virtual service address corresponding to the reflow package for forwarding to a corresponding client.
In one embodiment, such as a cluster environment of a multi-load balancing program for multiple load balancing nodes of bi-directional network address translation, each load balancing node may handle request packet and reflux packet processing, respectively. In the related art, as the design mechanism of the method makes the processing of the reflow package corresponding to the request package by the same load balancing node, the decoupling of the request package and the reflow package is realized in the method, and the reflow package sent by the server allocated to the request package and other servers, namely the server allocated by the request package processed by the non-current load balancing node, is forwarded to the corresponding client by determining the virtual service address corresponding to the reflow package. The other servers are servers which are different from the servers allocated when the request packet processing is performed in the steps, namely, the received reflux packets of the other servers have no corresponding relation with the request packet when the request packet processing is performed. Optionally, after determining the virtual service address corresponding to the reflux packet, the determined virtual service address is used for replacing the server address in the reflux packet so as to forward the server address to the corresponding client.
In the above-mentioned embodiments, the method includes receiving a request packet sent by a client, where the request packet records a virtual service address, determining, based on the virtual service address, a server to which the request packet corresponds and allocated when a mapping relationship between the request packet and the server is not recorded, recording a mapping relationship between the request packet and the server, replacing a virtual service address in the request packet with a server address of the server, forwarding the request packet to the server, receiving a reflux packet sent by the allocated server or another server, and determining a virtual service address corresponding to the reflux packet for forwarding to the corresponding client. In the scheme, the mapping relation between the request packet and the server is determined through the virtual service address recorded by the request packet, the request packet is further forwarded to the corresponding server, when the reflux packet is processed, the corresponding virtual service address corresponding to the reflux packet is determined and then forwarded, the arrival of synchronous information is not required to be waited, the high availability of the data packet in the load balancing cluster during processing is realized, the decoupling of the request packet and the reflux packet is realized through the binding relation between the set virtual service address and the server, the state independence is realized, the response delay of the data packet can be reduced, and the horizontal expansion is facilitated.
Fig. 2 is a flowchart of another method for processing a data packet in a load balancing cluster according to an embodiment of the present application, where, as shown in fig. 2, the method includes:
step 201, receiving and storing a virtual service configuration rule sent by a control system, where the virtual service configuration rule includes correspondence between a virtual service address and a plurality of different server addresses.
In one embodiment, a developer may perform configuration of the virtual service configuration rule through the control system, and after the configuration is completed, send the configuration result to each load balancing node in the load balancing cluster, where the virtual service configuration rule is used to determine, after each load balancing node receives the request packet, a real server corresponding to the allocation of the request packet.
Wherein, in the virtual service configuration rule, a plurality of virtual service addresses can be included, one server list can be corresponding to each virtual service address, and each virtual service address can select a server in the corresponding server list for distributing the received request packet sent by the client through polling or random. The method avoids the problems that the synchronization or searching performance brought by synchronizing each piece of connection information and the mapping relation in the load balancing node is obviously reduced and the response time delay is increased.
Step S202, receiving a request packet sent by a client, wherein the request packet records a virtual service address.
Step S203, when the mapping relationship between the request packet and the server is not recorded, determining the server allocated corresponding to the request packet based on the virtual service address, and recording the mapping relationship between the request packet and the server.
Step S204, replacing the virtual service address in the request packet with the server address of the server, and forwarding the request packet to the server.
Step 205, receiving a reflux packet sent by the server or other servers, and determining a virtual service address corresponding to the reflux packet for forwarding to a corresponding client.
The method includes the steps of receiving a request packet sent by a client, wherein the request packet records a virtual service address, determining a server corresponding to the request packet and allocated based on the virtual service address when the mapping relation between the request packet and the server is not recorded, recording the mapping relation between the request packet and the server, replacing the virtual service address in the request packet with the server address of the server, forwarding the request packet to the server, receiving a backflow packet sent by the server or other servers, determining the virtual service address corresponding to the backflow packet, and forwarding the backflow packet to the corresponding client. In the scheme, the mapping relation between the request packet and the server is determined through the virtual service address recorded by the request packet, the request packet is further forwarded to the corresponding server, when the reflux packet is processed, the corresponding virtual service address corresponding to the reflux packet is determined and then forwarded, the arrival of synchronous information is not required to be waited, the high availability of the data packet in the load balancing cluster during processing is realized, the decoupling of the request packet and the reflux packet is realized through the binding relation between the set virtual service address and the server, the state independence is realized, the response delay of the data packet can be reduced, and the horizontal expansion is facilitated.
Fig. 3 is a flowchart of another method for processing a data packet in a load balancing cluster according to an embodiment of the present application, where, as shown in fig. 3, the method includes:
step S301, a request packet sent by a client is received, where a virtual service address is recorded in the request packet.
Step S302, when the mapping relationship between the request packet and the server is not recorded, determining the server allocated corresponding to the request packet based on the virtual service address, recording the mapping relationship between the request packet and the server, and recording the mapping relationship between the reflux packet and the virtual service address.
Step S303, replacing the virtual service address in the request packet with the server address of the server, and forwarding the request packet to the server.
Step S304, under the condition that the reflow package of the server is received, determining a virtual service address corresponding to the reflow package based on the mapping relation between the reflow package and the virtual service address, and forwarding to the client after replacing the server address in the reflow package.
In one embodiment, when the mapping relationship between the request packet and the server is recorded, the mapping relationship between the reflow packet and the virtual service address is recorded correspondingly, so that when the reflow packet of the server is received, the virtual service address corresponding to the reflow packet is determined based on the mapping relationship between the reflow packet and the virtual service address, and the virtual service address is forwarded to the client after the server address in the reflow packet is replaced. Optionally, taking the form of the five-tuple of the reflux packet as < server IP, client IP, server port, client port, and transport protocol > as an example, the recorded mapping relationship may be a mapping relationship between < server IP, client IP, server port, client port, and transport protocol > and the virtual server IP and virtual server port. Correspondingly, when the network address in the reflux packet is converted, the virtual server IP and the virtual server port are replaced with the server IP and the server port in the five-tuple of the reflux packet. Therefore, the quick response to the reflux packet is realized, the problem that the synchronization or searching performance caused by synchronizing each connection information and the mapping relation in the load balancing node is obviously reduced and the response time delay is increased is also solved, and the problems that if the reflux packet reaches the load balancing node before the synchronization information, the network address conversion cannot be carried out, the information such as the cache reflux packet needs to be converted again when the information reaches the load balancing node, the overall processing performance is further influenced, and the processing logic is complicated in the related technology are also solved.
The method includes the steps of receiving a request packet sent by a client, wherein the request packet records a virtual service address, determining a server corresponding to the request packet and allocated based on the virtual service address when the mapping relation between the request packet and the server is not recorded, recording the mapping relation between the request packet and the server, replacing the virtual service address in the request packet with the server address of the server, forwarding the request packet to the server, receiving a reflux packet sent by the server, determining the virtual service address corresponding to the reflux packet, and forwarding the virtual service address to the corresponding client. In the scheme, the mapping relation between the request packet and the server is determined through the virtual service address recorded by the request packet, the request packet is further forwarded to the corresponding server, when the reflux packet is processed, the corresponding virtual service address corresponding to the reflux packet is determined and then forwarded, the arrival of synchronous information is not required to be waited, the high availability of the data packet in the load balancing cluster during processing is realized, the decoupling of the request packet and the reflux packet is realized through the binding relation between the set virtual service address and the server, the state independence is realized, the response delay of the data packet can be reduced, and the horizontal expansion is facilitated.
Fig. 4 is a flowchart of another method for processing a data packet in a load balancing cluster according to an embodiment of the present application, where receiving a reflux packet sent by another server includes receiving a first reflux packet sent by a first server, and as shown in fig. 4, the method includes:
step S401, a first reflux packet sent by a first server is received, and whether a first virtual service address corresponding to the first reflux packet is recorded is queried.
In one embodiment, the reflow packet may be handled by any load balancing node in the load balancing cluster according to network routing rules, and is not limited to handling by the load balancing node when forwarding the request packet. At this time, for the current load balancing node, the reflux packet corresponding to the forwarded request packet may be received and forwarded to the client by other load balancing nodes, and for the current load balancing node, the reflux packet corresponding to the request packet not allocated by the current load balancing node is also received. At this time, the first reflux packet transmitted by the first server is exemplarily marked as being different from the aforementioned received request packet and the allocated server.
In one embodiment, after receiving a first reflux packet sent by a first server, whether a first virtual service address corresponding to the first reflux packet is recorded is queried, where the first virtual service address is an address that needs to be used when the first reflux packet performs network address conversion, and the first virtual service address replaces a first server address in the first reflux packet to forward the first server address to a corresponding first client.
Step S402, when there is a first virtual service address corresponding to the first reflux packet, replacing the first server address in the first reflux packet with the first virtual service address, and forwarding the first server address to a corresponding first client.
And under the condition that the first virtual service address corresponding to the first reflow package exists, the first virtual service address can be directly replaced with the first server address in the first reflow package and forwarded to the corresponding first client.
Step S403, when the first virtual service address corresponding to the first reflux packet does not exist, determining the first virtual service address corresponding to the first reflux packet according to the stored virtual service configuration rule, replacing the first server address in the first reflux packet with the first virtual service address, and forwarding to the corresponding first client.
And if the first virtual service address corresponding to the first reflow package does not exist, determining the first virtual service address corresponding to the first reflow package through the stored virtual service configuration rule, replacing the first server address in the first reflow package with the first virtual service address, and forwarding to the corresponding first client.
In one embodiment, when determining the first virtual service address corresponding to the first reflux packet through the stored virtual service configuration rule, the virtual service configuration rule records the correspondence between a plurality of virtual service addresses and the server, and at this time, the corresponding virtual service address, that is, the first virtual service address, is obtained based on the reverse query of the first server address recorded in the reflux packet.
Correspondingly, after determining the first server address corresponding to the first reflux packet through the stored virtual service configuration rule, the mapping relationship between the first request packet and the first server may be further recorded, so that when the first request packet sent by the first client is received, the first server corresponding to the first request packet is determined based on the mapping relationship between the first request packet and the first server, so as to improve the response speed of the request packet.
In one embodiment, if the first virtual service address corresponding to the first reflux packet is not determined according to the stored virtual service configuration rule, the reflux packet is not a reflux packet obtained by responding to a request packet sent by an external client, and if possible, the internal network server actively accesses a data packet of the external network, and at this time, the address of the first server in the first reflux packet is replaced based on address information in the set address pool, and the data packet is forwarded to the corresponding client.
As can be seen from the foregoing, according to the method for processing a data packet in a load balancing cluster provided by the present embodiment, network address conversion can be performed on a reflow packet according to a stored virtual service configuration rule, so that high availability and decoupling of a request packet and the reflow packet during processing the data packet in the load balancing cluster are achieved, response delay of the data packet can be reduced, and horizontal expansion is facilitated.
Fig. 5 is a block diagram of a data packet processing device in a load balancing cluster according to an embodiment of the present application, where, as shown in fig. 5, the device is configured to execute a data packet processing method in a load balancing cluster provided in the foregoing embodiment, and has a function module and beneficial effects corresponding to the execution method. As shown in fig. 5, the apparatus specifically includes: a receiving module 101, a virtual service module 102, an address translation module 103, and a forwarding module 104, wherein,
a receiving module 101, configured to receive a request packet sent by a client, where the request packet records a virtual service address;
the virtual service module 102 is configured to determine a server corresponding to the request packet and allocated based on the virtual service address, and record the mapping relationship between the request packet and the server, where the mapping relationship between the request packet and the server is not recorded;
An address translation module 103 configured to replace a virtual service address in the request packet with a server address of the server;
a forwarding module 104 configured to forward the request packet to the server;
the receiving module 101 is further configured to receive a reflux packet sent by the server or other servers;
the address conversion module 103 is further configured to determine a virtual service address corresponding to the reflux packet, and is used for forwarding the reflux packet to a corresponding client by the forwarding module 104.
The method includes the steps of receiving a request packet sent by a client, wherein the request packet records a virtual service address, determining a server corresponding to the request packet and allocated based on the virtual service address when the mapping relation between the request packet and the server is not recorded, recording the mapping relation between the request packet and the server, replacing the virtual service address in the request packet with the server address of the server, forwarding the request packet to the server, receiving a backflow packet sent by the server or other servers, determining the virtual service address corresponding to the backflow packet, and forwarding the backflow packet to the corresponding client. In the scheme, the mapping relation between the request packet and the server is determined through the virtual service address recorded by the request packet, the request packet is further forwarded to the corresponding server, when the reflux packet is processed, the corresponding virtual service address corresponding to the reflux packet is determined and then forwarded, the arrival of synchronous information is not required to be waited, the high availability of the data packet in the load balancing cluster during processing is realized, the decoupling of the request packet and the reflux packet is realized through the binding relation between the set virtual service address and the server, the state independence is realized, the response delay of the data packet can be reduced, and the horizontal expansion is facilitated.
In one possible embodiment, the virtual service module 102 is further configured to:
and under the condition that the mapping relation between the request packet and the server is recorded, determining the server corresponding to the request packet according to the mapping relation between the request packet and the server or a connection session table.
In one possible embodiment, the virtual service module 102 is configured to:
and determining the server corresponding to the allocation of the request packet according to the virtual service address and a stored virtual service configuration rule, wherein the virtual service configuration rule comprises a polling selection rule and/or a random selection rule.
In a possible embodiment, the receiving module 101 is further configured to:
and before the request packet sent by the client is received, receiving and storing a virtual service configuration rule sent by the control system, wherein the virtual service configuration rule comprises the corresponding relation between a virtual service address and a plurality of different server addresses.
In one possible embodiment, the virtual service module 102 is further configured to:
after the mapping relation between the request packet and the server is recorded, the mapping relation between a reflow packet and the virtual service address is recorded;
And the address conversion module is configured to determine a virtual service address corresponding to the reflow package based on the mapping relation between the reflow package and the virtual service address under the condition that the reflow package of the server is received, and replace the server address in the reflow package for forwarding the reflow package to the client by the conversion module.
In one possible embodiment, receiving the reflux packet sent by the other server includes: the receiving module 101 is further configured to receive a first reflux packet sent by the first server:
receiving a first reflow packet sent by a first server;
the virtual service module, 102, is configured to:
under the condition of receiving a first reflow packet sent by the first server, inquiring whether a first virtual service address corresponding to the first reflow packet is recorded or not;
the address translation module 103 is configured to:
under the condition that a first virtual service address corresponding to the first reflow package exists, replacing the first server address in the first reflow package with the first virtual service address;
the forwarding module 104 is configured to: forwarding the reflux packet with the replaced address to a corresponding first client; and, the virtual service module 102 is configured to:
Determining a first virtual service address corresponding to the first reflow package according to a stored virtual service configuration rule under the condition that the first virtual service address corresponding to the first reflow package does not exist;
the address translation module 103 is configured to:
replacing the first virtual service address with a first server address in the first reflux packet;
the forwarding module 104 is configured to: and forwarding the first reflux packet with the replaced address to a corresponding first client.
In one possible embodiment, the virtual service module 102 is further configured to:
after the address of the first server corresponding to the first reflux packet is determined according to the stored virtual service configuration rule, recording a mapping relationship between a first request packet and the first server, wherein the mapping relationship is used for determining the first server corresponding to the first request packet based on the mapping relationship between the first request packet and the first server when the first request packet sent by the first client is received.
In a possible embodiment, the address translation module 103 is configured to:
and under the condition that the first virtual service address corresponding to the first reflow package is not determined through the stored virtual service configuration rule, replacing the first server address in the first reflow package based on the address information in the set address pool, and forwarding to the corresponding client.
In one possible embodiment, the virtual service address includes a virtual service IP and a virtual service port, and the server address includes a server IP and a server port.
Fig. 6 is a schematic structural diagram of a packet processing device in a load balancing cluster according to an embodiment of the present application, where, as shown in fig. 6, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device may be one or more, one processor 201 being taken as an example in fig. 6; the processor 201, memory 202, input devices 203, and output devices 204 in the apparatus may be connected by a bus or other means, for example in fig. 6. The memory 202 is used as a computer readable storage medium for storing software programs, computer executable programs and modules, such as program instructions/modules corresponding to the packet processing method in the load balancing cluster in the embodiment of the present application. The processor 201 executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory 202, i.e. implements the packet processing method in the load balancing cluster described above. The input device 703 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the apparatus. The output device 204 may include a display device such as a display screen.
The embodiment of the present application further provides a non-volatile storage medium containing computer executable instructions, which when executed by a computer processor, are configured to perform a method for processing a data packet in a load balancing cluster described in the foregoing embodiment, where the method includes:
receiving a request packet sent by a client, wherein the request packet records a virtual service address;
under the condition that the mapping relation between the request packet and the server is not recorded, determining the server corresponding to the request packet based on the virtual service address, and recording the mapping relation between the request packet and the server;
replacing the virtual service address in the request packet with the server address of the server, and forwarding the request packet to the server;
and receiving the reflow package sent by the server or other servers, and determining a virtual service address corresponding to the reflow package for forwarding to a corresponding client.
It should be noted that, in the embodiment of the packet processing device in the load balancing cluster, each unit and module included are only divided according to the functional logic, but are not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present application.
In some possible embodiments, the aspects of the method provided by the present application may also be implemented as a program product, which includes program code for causing a computer device to perform the steps of the method according to the various exemplary embodiments of the present application described in the present specification, when the program product is run on the computer device, for example, the computer device may perform the packet processing method in the load balancing cluster described in the embodiment of the present application. The program product may be implemented using any combination of one or more readable media.

Claims (13)

1. The data packet processing method in the load balancing cluster is characterized by comprising the following steps:
receiving a request packet sent by a client, wherein the request packet records a virtual service address;
under the condition that the mapping relation between the request packet and the server is not recorded, determining the server corresponding to the request packet based on the virtual service address, and recording the mapping relation between the request packet and the server;
replacing the virtual service address in the request packet with the server address of the server, and forwarding the request packet to the server;
And receiving the reflow package sent by the server or other servers, and determining a virtual service address corresponding to the reflow package for forwarding to a corresponding client.
2. The method for processing data packets in a load balancing cluster according to claim 1, further comprising:
and under the condition that the mapping relation between the request packet and the server is recorded, determining the server corresponding to the request packet according to the mapping relation between the request packet and the server or a connection session table.
3. The method for processing the data packets in the load balancing cluster according to claim 1, wherein the determining, based on the virtual service address, the server to which the request packet corresponds includes:
and determining the server corresponding to the allocation of the request packet according to the virtual service address and a stored virtual service configuration rule, wherein the virtual service configuration rule comprises a polling selection rule and/or a random selection rule.
4. A method of processing data packets in a load balancing cluster according to claim 3, wherein prior to receiving a request packet sent by a client, the method further comprises:
and receiving and storing a virtual service configuration rule sent by the control system, wherein the virtual service configuration rule comprises the corresponding relation between a virtual service address and a plurality of different server addresses.
5. The method for processing data packets in a load balancing cluster according to claim 1, further comprising, after said recording of the mapping relationship between the request packet and the server:
recording the mapping relation between the reflow package and the virtual service address;
the determining the virtual service address corresponding to the reflux packet includes:
and under the condition that a reflow packet of the server is received, determining a virtual service address corresponding to the reflow packet based on the mapping relation between the reflow packet and the virtual service address, and forwarding the reflow packet to the client after replacing the server address in the reflow packet.
6. The method for processing data packets in a load balancing cluster according to claim 1, wherein receiving the reflux packet sent by the other server includes:
receiving a first reflow packet sent by a first server;
the determining the virtual service address corresponding to the reflux packet includes:
under the condition of receiving a first reflow packet sent by the first server, inquiring whether a first virtual service address corresponding to the first reflow packet is recorded or not;
under the condition that a first virtual service address corresponding to the first reflow package exists, replacing a first server address in the first reflow package with the first virtual service address, and forwarding to a corresponding first client;
And under the condition that the first virtual service address corresponding to the first reflow package does not exist, determining the first virtual service address corresponding to the first reflow package through the stored virtual service configuration rule, replacing the first server address in the first reflow package with the first virtual service address, and forwarding to the corresponding first client.
7. The method for processing a data packet in a load balancing cluster according to claim 6, further comprising, after the determining, by the stored virtual service configuration rule, a first server address corresponding to the first reflux packet:
and recording the mapping relation between the first request packet and the first server, wherein the mapping relation is used for determining the first server corresponding to the first request packet based on the mapping relation between the first request packet and the first server when the first request packet sent by the first client is received.
8. The method of packet processing in a load balancing cluster of claim 6, further comprising:
and under the condition that the first virtual service address corresponding to the first reflow package is not determined through the stored virtual service configuration rule, replacing the first server address in the first reflow package based on the address information in the set address pool, and forwarding to the corresponding client.
9. The method according to any of claims 1-8, wherein the virtual service address comprises a virtual service IP and a virtual service port, and wherein the server address comprises a server IP and a server port.
10. A packet processing device in a load balancing cluster, comprising:
the receiving module is configured to receive a request packet sent by a client, wherein the request packet records a virtual service address;
the virtual service module is configured to determine a server corresponding to the request packet and allocated based on the virtual service address under the condition that the mapping relation between the request packet and the server is not recorded, and record the mapping relation between the request packet and the server;
an address translation module configured to replace a server address of the server with a virtual service address in the request packet;
a forwarding module configured to forward the request packet to the server;
the receiving module is further configured to receive a reflux packet sent by the server or other servers;
the address conversion module is further configured to determine a virtual service address corresponding to the reflux packet, and is used for forwarding the virtual service address to a corresponding client by the forwarding module.
11. A packet processing device in a load balancing cluster, the device comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of packet processing in a load balancing cluster of any of claims 1-9.
12. A non-transitory storage medium storing computer executable instructions which, when executed by a computer processor, are for performing the method of packet processing in a load balancing cluster of any of claims 1-9.
13. A computer program product comprising a computer program, which when executed by a processor implements the method of packet processing in a load balancing cluster according to any one of claims 1-9.
CN202311027076.9A 2023-08-14 2023-08-14 Data packet processing method, device and equipment in load balancing cluster Pending CN116938936A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311027076.9A CN116938936A (en) 2023-08-14 2023-08-14 Data packet processing method, device and equipment in load balancing cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311027076.9A CN116938936A (en) 2023-08-14 2023-08-14 Data packet processing method, device and equipment in load balancing cluster

Publications (1)

Publication Number Publication Date
CN116938936A true CN116938936A (en) 2023-10-24

Family

ID=88380763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311027076.9A Pending CN116938936A (en) 2023-08-14 2023-08-14 Data packet processing method, device and equipment in load balancing cluster

Country Status (1)

Country Link
CN (1) CN116938936A (en)

Similar Documents

Publication Publication Date Title
US11134134B2 (en) Routing for origin-facing points of presence
CN108449282B (en) Load balancing method and device
US10320738B2 (en) Address allocation method, CGN device, and CGN dual-active system
CN108270676B (en) Network data processing method and device based on Intel DPDK
CN111193773B (en) Load balancing method, device, equipment and storage medium
US7532620B2 (en) Routing table synchronization method, network apparatus, and routing table synchronization program
CN107172120B (en) Information processing method, processing node and network node
JP2014504484A (en) State synchronization between load balancer components
CN114095430B (en) Access message processing method, system and working node
CN111314450B (en) Data transmission method and device, electronic equipment and computer storage medium
CN111371920A (en) DNS front-end analysis method and system
CN104468401A (en) Message processing method and device
JP2013090072A (en) Service provision system
CN113839862B (en) Method, system, terminal and storage medium for synchronizing ARP information between MCLAG neighbors
CN109088957B (en) NAT rule management method, device and equipment
CN112866433A (en) Message load balancing processing method and device and computer equipment
CN109413224B (en) Message forwarding method and device
CN112087382B (en) Service routing method and device
CN109788075B (en) Private network system, data acquisition method and edge server
CN116938936A (en) Data packet processing method, device and equipment in load balancing cluster
CN114422469B (en) IPv4/IPv6 flow intelligent scheduling method, device and scheduling system
CN111147611B (en) Electronic device providing fast packet forwarding with reference to additional network address translation tables
CN115225606A (en) Domain name access method and system of cross-network protocol of container cloud platform
CN114338832A (en) Network protocol conversion method and system of container cloud platform
CN112637285A (en) Edge cloud communication method, management system, computer device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination