CN109040323B - Load balancing device - Google Patents

Load balancing device Download PDF

Info

Publication number
CN109040323B
CN109040323B CN201811219998.9A CN201811219998A CN109040323B CN 109040323 B CN109040323 B CN 109040323B CN 201811219998 A CN201811219998 A CN 201811219998A CN 109040323 B CN109040323 B CN 109040323B
Authority
CN
China
Prior art keywords
hash
storage item
tcp data
tcp
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811219998.9A
Other languages
Chinese (zh)
Other versions
CN109040323A (en
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.)
Suzhou Centec Communications Co Ltd
Original Assignee
Centec Networks Suzhou 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 Centec Networks Suzhou Co Ltd filed Critical Centec Networks Suzhou Co Ltd
Priority to CN201811219998.9A priority Critical patent/CN109040323B/en
Publication of CN109040323A publication Critical patent/CN109040323A/en
Application granted granted Critical
Publication of CN109040323B publication Critical patent/CN109040323B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Landscapes

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

Abstract

The invention provides a load balancing device which comprises a hash module, a control module and a memory module, wherein the hash module is a hardware module provided with a storage module and comprises a plurality of hash storage items, and when the hash module sends hash conflicts, the hash module is processed by the control module. The hash module is a hardware module, has extremely high processing speed, and in the hash algorithm, the probability of collision is not high, so that the throughput rate of the load balancing device can be greatly improved.

Description

Load balancing device
Technical Field
The invention relates to the technical field of network communication, in particular to a load balancing device.
Background
Load Balance (LB) is a server clustering technology, and can allocate specific services (e.g., TCP data streams, etc.) to some or a certain server, so as to improve service processing capability and ensure high availability of the services, for example, in fig. 1, a Load balancing apparatus allocates a first TCP (Transmission Control Protocol) data stream of a first client to a first server for processing, and allocates a second TCP data stream of a second client to an nth server for processing.
Therefore, how to design a load balancing device becomes a problem to be solved urgently.
Disclosure of Invention
The invention aims to provide a load balancing device.
In order to achieve one of the above objects, an embodiment of the present invention provides a load balancing apparatus, including:
the system comprises a hash module, a control module and a memory module; the hash module is a hardware module provided with a storage module and comprises a plurality of hash storage items, the hash storage items comprise forwarding information and labels for identifying conflicts, and the forwarding information at least comprises an IP address of a destination server; the memory storage module stores a plurality of memory storage items;
the Hash module is used for generating a first Hash value of values of a plurality of preset fields of the received TCP data packet; when the TCP data packet is determined to be a TCP _ SYN data packet and the first hash storage item corresponding to the first hash value stores data, setting the label of the first hash storage item as the label of the first hash storage item that the conflict occurs, and sending a hash conflict signal and/or the first hash storage item to the control module; the preset fields can uniquely identify the TCP data stream to which the TCP data packet belongs;
and when receiving the hash collision signal and/or the first hash storage item, the control module generates first forwarding information of the TCP data packet according to a preset load balancing algorithm, and stores a mapping relation between a TCP data flow identifier and the first forwarding information and/or forwarding information in the first hash storage item in a first memory storage item corresponding to the first hash value, wherein the TCP data flow identifier comprises values of a plurality of preset fields of the TCP data packet.
As a further improvement of an embodiment of the present invention, the "setting a tag of a first hash entry to have collided and sending a hash collision signal and/or the first hash entry to the control module" includes: when the label of the first hash storage item is determined to be not collided, modifying the label of the first hash storage item into the label of the first hash storage item which is collided, and sending a hash collision signal and the first hash storage item to the control module;
the "storing the mapping relationship between the TCP data flow identifier and the first forwarding information in the first memory storage item corresponding to the first hash value and/or the forwarding information in the first hash storage item" includes: when it is determined that no data is stored in the first memory storage item corresponding to the first hash value, a link table header is stored in the first memory storage item, the first hash storage item is stored in the link table header, and a TCP data flow identifier and first forwarding information are stored in a next link table node of the link table header.
As a further improvement of an embodiment of the present invention, the "setting a tag of a first hash entry to have collided and sending a hash collision signal and/or the first hash entry to the control module" includes: when the label of the first hash storage item is determined to be in conflict, sending a hash conflict signal to the control module;
the "storing the mapping relationship between the TCP data flow identifier and the first forwarding information in the first memory storage item corresponding to the first hash value and/or the forwarding information in the first hash storage item" includes: and when determining that the first memory storage item corresponding to the first hash value stores a chain table head, adding a chain table node at the tail of a chain table represented by the chain table head, wherein the chain table node stores a TCP data flow identifier and first forwarding information.
As a further improvement of an embodiment of the present invention, the hash module is further configured to: when the TCP data packet is determined to be a TCP _ SYN data packet and no data is stored in a first hash storage item corresponding to the first hash value, generating first forwarding information of the TCP data packet according to a preset load balancing algorithm, storing the first forwarding information in the first hash storage item, and setting a label of the first hash storage item as non-conflict.
As a further improvement of an embodiment of the present invention, the hash module is further configured to: and when the TCP data packet is determined not to be a TCP _ SYN data packet, data is stored in the first hash storage item corresponding to the hash value, and the label in the first hash storage item is that no conflict occurs, forwarding the TCP data packet according to the forwarding information in the first hash storage item.
As a further improvement of an embodiment of the present invention, the hash module is further configured to: when the TCP data packet is determined not to be a TCP _ SYN data packet, the first hash storage item corresponding to the hash value stores data and the label in the first hash storage item is determined to have collided, sending a query collision signal to the control module;
the control module is further configured to: when receiving a query collision signal, generating a TCP data stream identifier and a hash value of the TCP data packet; and when determining that the TCP data flow identifier is inquired by a first linked list node in a linked list represented by a link list head in the first memory storage item corresponding to the hash value, forwarding the TCP data packet according to forwarding information in the first linked list node.
As a further improvement of an embodiment of the present invention, the control module is further configured to:
and when determining that no TCP data flow identifier is inquired by any link table node in the link table represented by the link table head in the first memory storage item corresponding to the hash value, forwarding the TCP data packet according to forwarding information in the link table head.
As a further improvement of an embodiment of the present invention, the "forwarding the TCP packet according to forwarding information in the chaining header" includes: modifying the TCP data packet, and sending the modified TCP data packet to a destination server IP address in forwarding information in the chaining header, wherein the modifying the TCP data packet at least comprises: and modifying the destination IP address of the TCP data packet into the destination server IP address in the forwarding information in the chain table head.
As a further improvement of an embodiment of the present invention, the preset fields include: source IP address, source port number, destination IP address, destination port number, and 8-bit protocol in the IP base header.
As a further improvement of an embodiment of the present invention, the load balancing algorithm includes: polling, random, source address hashing, weighted polling, weighted random, and least-squares.
Compared with the prior art, the invention has the technical effects that: the embodiment of the invention provides a load balancing device, which comprises a hash module, a control module and a memory module, wherein the hash module is a hardware module provided with a storage module and comprises a plurality of hash storage items, and when the hash module sends a hash conflict, the hash conflict is processed by the control module. The hash module is a hardware module, has extremely high processing speed, and in the hash algorithm, the probability of collision is not high, so that the throughput rate of the load balancing device can be greatly improved.
Drawings
FIG. 1 is a schematic diagram of load balancing in the present invention;
FIG. 2 is a schematic diagram of the present invention depicting TCP three-way handshaking;
FIG. 3A is a block diagram depicting a memory module in an embodiment of the invention;
FIG. 3B is a block diagram depicting a memory module according to an embodiment of the present invention;
FIG. 4 is a block diagram of the IPv4 protocol in an embodiment of the present invention;
fig. 5 is a structural diagram of a TCP protocol in the embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to embodiments shown in the drawings. These embodiments are not intended to limit the present invention, and structural, methodological, or functional changes made by those skilled in the art according to these embodiments are included in the scope of the present invention.
It will be understood that, although the terms first, second, etc. may be used herein to describe various elements or structures, these described elements should not be limited by these terms. These terms are only used to distinguish these descriptive objects from one another. For example, the first hash entry may be referred to as the second hash entry, and similarly the second hash entry may also be referred to as the first hash entry, without departing from the scope of the present application.
The cluster in fig. 1 may be a Web server, an FTP (File Transfer Protocol) server, and the like, the larger the number of servers in the cluster, the larger the service capability of the cluster, and it can be understood that, to improve the service capability of the whole cluster, it is necessary to allocate the access of the client to the cluster to different servers, and load balancing provides this function.
The basic principle of the load balancing device in the embodiment of the invention is as follows: when a client wants to access the cluster, the client needs to establish a stable TCP data flow with the load balancing device, it is understood that, the load balancing device does not provide any service, but selects a server from the cluster according to a preset load balancing algorithm, and forwards the TCP data stream sent by the client to the server (for convenience of description, the IP address of the server may be referred to as the IP address of the destination server), i.e. the load balancing device plays the role of transferring TCP data streams, the server provides services for the client, and the load balancing device will store a TCP data stream identifier that can uniquely identify the TCP data stream and corresponding forwarding information (for example, the forwarding information may include information on how to modify the TCP data packet in the TCP data stream and the IP address of the destination server); therefore, when the load balancing device receives the TCP data packet of the TCP data stream again, the forwarding information of the TCP data packet can be directly obtained, and the forwarding efficiency can be greatly improved. Here, the load balancing algorithm may be: polling, random, source address hashing, weighted polling, weighted random, and least-squares. Wherein, the IP is Internet Protocol.
It can be understood that, in the TCP/IP protocol, a quadruplet (a source IP address, a source port number, a destination IP address, and a destination port number) can uniquely identify a data stream at a transport layer, and when a value of an 8-bit protocol field in an IP basic header is equal to 6, it indicates that TCP data is carried, so that a TCP data stream can be uniquely identified by using a quintuple (a source IP address, a source port number, a destination IP address, a destination port number, and a value of an 8-bit protocol field in an IP basic header is equal to 6). Fig. 4 shows a format of an IPv4(Internet Protocol version 4, IP Protocol version 4) message, where a source IP address is a "32-bit source IP address" in an IP basic header, a destination IP address is a "32-bit destination IP address" in the IP basic header, and an "8-bit Protocol" field is explicitly identified in fig. 4; here, fig. 4 only shows the format of the IPv4 message, and similarly, it can be easily understood that the source IP address, the source port number, the destination IP address, and the destination port number correspond to fields in an IPv6(Internet Protocol version 6, IP Protocol version 6) Protocol. Fig. 5 shows the format of a TCP packet, where the source port number is "16-bit source port number" in the TCP basic header, and the destination port number is "16-bit destination port number" in the TCP basic header.
In the TCP protocol, as shown in fig. 2, the specific process of the three-way handshake is as follows:
first handshake: when establishing connection, a client sends a SYN (synchronization Sequence number) data packet (seq ═ x) to a server, enters a SYN _ SENT state, and waits for the confirmation of the server; in this patent application, for convenience of description, a SYN packet sent by a client to a server is referred to as a TCP _ SYN packet;
second handshake: the server receives the SYN packet, and must send an ACK packet to the client to acknowledge SYN (ACK ═ x +1), and at the same time, it also sends a SYN packet (seq ═ y) (i.e., SYN + ACK packet), and at this time, the server enters the SYN _ RECV state;
third handshake: the client receives the SYN + ACK packet from the server, and sends an acknowledgement packet ACK (ACK + y +1) to the server, after the transmission of the acknowledgement packet ACK is completed, the client and the server enter an ESTABLISHED (TCP connection successful) state, three-way handshake is completed, and then the client and the server can start to transmit data.
Here, in practice, a TCP connection is usually actively initiated to the cluster by the client, that is, when the load balancing apparatus receives the TCP _ SYN packet, it can be determined that there is a client that wants to establish a stable TCP data flow with the cluster, that is, wants to obtain the service of the cluster.
An embodiment of the present invention provides a load balancing apparatus, including:
the system comprises a hash module, a control module and a memory module; the hash module is a hardware module provided with a storage module and comprises a plurality of hash storage items, the hash storage items comprise forwarding information and labels for identifying conflicts, and the forwarding information at least comprises an IP address of a destination server; the memory storage module stores a plurality of memory storage items; here, since the hash module is a hardware module, the hash module has a very high operation speed, so that the throughput of the load balancing apparatus can be greatly improved. Here, when the load balancing device forwards the TCP packet, it needs to modify the TCP packet accordingly (for example, the destination IP address, the checksum in the TCP basic header, etc.), and the forwarding information may also include information on how to modify the TCP packet.
Fig. 3A is a schematic structural diagram of the storage module, where several hash entries are sequentially stored in the storage module (for example, the several hash entries may form a linear storage structure, such as an array, a linked list, and the like), and forwarding information and a tag are stored in each hash entry. That is, in the load balancing device, different TCP data flows correspond to different hash storage items, and in more detail, hash values of a plurality of preset fields (the plurality of preset fields can uniquely identify the TCP data flows) in the TCP data flows are generated, and then the hash storage item can be found according to the hash values. It is understood that although the values of several preset fields (for example, the above five tuples) of different TCP data flows are different, the hash values of the fields may be the same (i.e., hash collisions occur), i.e., different TCP data flows correspond to the same hash entry, which may cause errors, and a tag is further stored in the hash entry, i.e., if different TCP data flows correspond to the hash entry, the value of the tag is that a collision has occurred, otherwise the value is that no collision has occurred.
The Hash module is used for generating a first Hash value of values of a plurality of preset fields of the received TCP data packet; when the TCP data packet is determined to be a TCP _ SYN data packet and the first hash storage item corresponding to the first hash value stores data, setting the label of the first hash storage item as the label of the first hash storage item that the conflict occurs, and sending a hash conflict signal and/or the first hash storage item to the control module; the preset fields can uniquely identify the TCP data stream to which the TCP data packet belongs; here, when the load balancing device receives that the TCP packet is a TCP _ SYN packet, it may be determined that a client wants to establish a stable TCP data flow with the cluster, that is, the load balancing device has not forwarded the TCP packet in the TCP data flow before, and the load balancing device does not store the hash storage item corresponding to the TCP data flow, at this time, a hash value of values of the plurality of preset fields in the TCP data packet needs to be generated, and then the corresponding hash storage item is found according to the hash value, and if the hash storage item stores data, a collision occurs.
Here, it can be understood that, when the first hash storage item corresponding to the hash value already stores data, the tag in the first hash storage item may be that a conflict has occurred or may not occur, and if the conflict has occurred, the tag may not be modified; if no conflict occurs, the value of the tag needs to be modified to have occurred.
And when receiving the hash collision signal and/or the first hash storage item, the control module generates first forwarding information of the TCP data packet according to a preset load balancing algorithm, and stores a mapping relation between a TCP data flow identifier and the first forwarding information and/or forwarding information in the first hash storage item in a first memory storage item corresponding to the first hash value, wherein the TCP data flow identifier comprises values of a plurality of preset fields of the TCP data packet.
Here, when the hash module determines that a conflict occurs, the control module may process the conflict, and the policy of the conflict processing is: and the memory module stores a memory storage item corresponding to the TCP data stream to which the TCP data packet belongs, and stores forwarding information in the first hash storage item and forwarding information of the TCP data packet in the memory storage item. It is understood that when the load balancing apparatus receives another TCP packet belonging to the same TCP data flow as the TCP packet, the forwarding information is looked up in the memory storage item.
The load balancing device of the embodiment of the invention comprises the hash module, the control module and the memory module, wherein the hash module is a hardware module and has extremely high processing speed, so that the throughput rate of the load balancing device can be greatly improved, and the control module and the memory module can be used for solving the conflict.
Preferably, the "setting the label of the first hash entry to be that a collision has occurred and sending a hash collision signal and/or the first hash entry to the control module" includes: when the label of the first hash storage item is determined to be not collided, modifying the label of the first hash storage item into the label of the first hash storage item which is collided, and sending a hash collision signal and the first hash storage item to the control module; here, it can be understood that if the label of the first hash storage item is that no collision occurs, the forwarding information in the first hash storage item is not stored in the memory module, and therefore, a hash collision occurrence signal and the first hash storage item need to be transmitted to the control module.
The "storing the mapping relationship between the TCP data flow identifier and the first forwarding information in the first memory storage item corresponding to the first hash value and/or the forwarding information in the first hash storage item" includes: when it is determined that no data is stored in the first memory storage item corresponding to the first hash value, a link table header is stored in the first memory storage item, the first hash storage item is stored in the link table header, and a TCP data flow identifier and first forwarding information are stored in a next link table node of the link table header. Here, when no data is stored in the first memory storage item, a new linked list header needs to be created, the linked list header is stored in the first memory storage item, the first hash storage item is stored in the linked list header, and the information related to the TCP data stream of the TCP data packet can be stored in the next linked list node of the linked list header, it can be understood that the next linked list node of the "next linked list node" is NULL.
Preferably, the "setting the label of the first hash entry to be that a collision has occurred and sending a hash collision signal and/or the first hash entry to the control module" includes: when the label of the first hash storage item is determined to be in conflict, sending a hash conflict signal to the control module; here, it can be understood that if the label of the first hash storage item is that a collision has occurred, the forwarding information in the first hash storage item is positively stored in the memory module, and therefore, only a hash collision occurrence signal needs to be transmitted to the control module.
The "storing the mapping relationship between the TCP data flow identifier and the first forwarding information in the first memory storage item corresponding to the first hash value and/or the forwarding information in the first hash storage item" includes: and when determining that the first memory storage item corresponding to the first hash value stores a chain table head, adding a chain table node at the tail of a chain table represented by the chain table head, wherein the chain table node stores a TCP data flow identifier and first forwarding information. Here, when the first memory storage item already stores the link table header, it indicates that the link table is already created, so a link table node may be added at the end of the link table, and the link table node stores the relevant information of the TCP data stream to which the TCP data packet belongs, and it can be understood that the next link table node of the added link table node is NULL.
Here, fig. 3B shows a structural diagram of a memory module, where the memory module sequentially stores a plurality of memory entries (for example, the plurality of memory entries form a linear storage structure, such as an array, a linked list, and the like), and a linked list header is stored in each memory entry.
Here, it can be understood that, in the memory module, one region may be divided for sequentially storing a plurality of memory storage items, and the remaining regions are used for storing linked list nodes, so that the usage rate of the memory module may be effectively improved.
Preferably, the hash module is further configured to: when the TCP data packet is determined to be a TCP _ SYN data packet and no data is stored in a first hash storage item corresponding to the first hash value, generating first forwarding information of the TCP data packet according to a preset load balancing algorithm, storing the first forwarding information in the first hash storage item, and setting a label of the first hash storage item as non-conflict. Here, when the load balancing device receives that the TCP data packet is a TCP _ SYN data packet, it may be determined that a client wants to establish a stable TCP data stream with the cluster, that is, the load balancing device has not forwarded the TCP data packet in the TCP data stream before, and the load balancing device does not store the hash storage item corresponding to the TCP data stream, at this time, a hash value of the values of the plurality of preset fields in the TCP data packet needs to be generated, and the corresponding hash storage item is found according to the hash value, and if the hash storage item does not store data (i.e., is empty), there is no collision, so that the hash storage item may store the relevant information of the TCP data stream to which the TCP data packet belongs.
Preferably, the hash module is further configured to: and when the TCP data packet is determined not to be a TCP _ SYN data packet, data is stored in the first hash storage item corresponding to the hash value, and the label in the first hash storage item is that no conflict occurs, forwarding the TCP data packet according to the forwarding information in the first hash storage item. Here, when a client wants to establish a TCP connection with the cluster, a TCP _ SYN packet is usually sent actively, so that, when a TCP packet is not a TCP _ SYN packet, it indicates that the client and the cluster have sent at least one TCP packet belonging to the same TCP flow as the TCP packet, and if a storage entry corresponding to the TCP packet exists in the storage module in the hash module, the TCP packet can be forwarded based on the storage entry. It will be appreciated that prior to sending the TCP packet, a corresponding modification may be made to the TCP packet, for example, modifying the destination IP address of the TCP packet to the destination server IP address of the forwarding information in the first hash store, etc.
Preferably, the hash module is further configured to: when the TCP data packet is determined not to be a TCP _ SYN data packet, the first hash storage item corresponding to the hash value stores data and the label in the first hash storage item is determined to have collided, sending a query collision signal to the control module;
the control module is further configured to: when receiving a query collision signal, generating a TCP data stream identifier and a hash value of the TCP data packet; and when determining that the TCP data flow identifier is inquired by a first linked list node in a linked list represented by a link list head in the first memory storage item corresponding to the hash value, forwarding the TCP data packet according to forwarding information in the first linked list node.
Here, when a client wants to establish a TCP connection with the cluster, a TCP _ SYN packet is usually sent actively, so that when a TCP packet is not a TCP _ SYN packet, it indicates that the client and the cluster have sent at least one TCP packet belonging to the same TCP flow as the TCP packet, and if a storage entry corresponding to the TCP packet does not exist in the storage module in the hash module, the storage module can search the storage module. It will be appreciated that prior to sending the TCP packet, a corresponding modification may be made to the TCP packet, such as modifying the destination IP address of the TCP packet to the destination server IP address of the forwarding information in the first linked list node.
Preferably, the control module is further configured to: and when determining that no TCP data flow identifier is inquired by any link table node in the link table represented by the link table head in the first memory storage item corresponding to the hash value, forwarding the TCP data packet according to forwarding information in the link table head. Here, when the TCP data flow identifier is not found in the linked list, the default linked list header stores the relevant information of the TCP data packet. It will be appreciated that before sending the TCP packet, corresponding modifications may be made to the TCP packet, for example, modifying the destination IP address of the TCP packet to the destination server IP address in the forwarding information in the head of the chain table.
Preferably, the "forwarding the TCP packet according to the forwarding information in the chaining header" includes:
modifying the TCP data packet, and sending the modified TCP data packet to a destination server IP address in forwarding information in the chaining header, wherein the modifying the TCP data packet at least comprises: and modifying the destination IP address of the TCP data packet into the destination server IP address in the forwarding information in the chain table head.
Preferably, the preset fields include: source IP address, source port number, destination IP address, destination port number, and 8-bit protocol in the IP base header.
Preferably, the load balancing algorithm includes: polling, random, source address hashing, weighted polling, weighted random, and least-squares.
It should be understood that although the present description refers to embodiments, not every embodiment contains only a single technical solution, and such description is for clarity only, and those skilled in the art should make the description as a whole, and the technical solutions in the embodiments can also be combined appropriately to form other embodiments understood by those skilled in the art.
The above-listed detailed description is only a specific description of a possible embodiment of the present invention, and they are not intended to limit the scope of the present invention, and equivalent embodiments or modifications made without departing from the technical spirit of the present invention should be included in the scope of the present invention.

Claims (10)

1. A load balancing apparatus, comprising:
the system comprises a hash module, a control module and a memory module; the hash module is a hardware module provided with a storage module and comprises a plurality of hash storage items, the hash storage items comprise forwarding information and labels for identifying conflicts, and the forwarding information at least comprises an IP address of a destination server; the memory module stores a plurality of memory storage items;
the Hash module is used for generating a first Hash value of values of a plurality of preset fields of the received TCP data packet; when the TCP data packet is determined to be a TCP _ SYN data packet and the first hash storage item corresponding to the first hash value stores data, setting the label of the first hash storage item as the label of the first hash storage item that the conflict occurs, and sending a hash conflict signal and/or the first hash storage item to the control module; the preset fields can uniquely identify the TCP data stream to which the TCP data packet belongs;
and when receiving the hash collision signal and/or the first hash storage item, the control module generates first forwarding information of the TCP data packet according to a preset load balancing algorithm, and stores a mapping relation between a TCP data flow identifier and the first forwarding information and/or forwarding information in the first hash storage item in a first memory storage item corresponding to the first hash value, wherein the TCP data flow identifier comprises values of a plurality of preset fields of the TCP data packet.
2. The load balancing apparatus of claim 1,
the setting the label of the first hash storage item to be conflicted and sending a hash confliction signal and/or the first hash storage item to the control module comprises: when the label of the first hash storage item is determined to be not collided, modifying the label of the first hash storage item into the label of the first hash storage item which is collided, and sending a hash collision signal and the first hash storage item to the control module;
the storing the mapping relationship between the TCP data flow identifier and the first forwarding information and/or the forwarding information in the first hash storage item in the first memory storage item corresponding to the first hash value includes: when it is determined that no data is stored in the first memory storage item corresponding to the first hash value, a link table header is stored in the first memory storage item, the first hash storage item is stored in the link table header, and a TCP data flow identifier and first forwarding information are stored in a next link table node of the link table header.
3. The load balancing apparatus of claim 1,
the setting the label of the first hash storage item to be conflicted and sending a hash confliction signal and/or the first hash storage item to the control module comprises: when the label of the first hash storage item is determined to be in conflict, sending a hash conflict signal to the control module;
the storing the mapping relationship between the TCP data flow identifier and the first forwarding information and/or the forwarding information in the first hash storage item in the first memory storage item corresponding to the first hash value includes: and when determining that the first memory storage item corresponding to the first hash value stores a chain table head, adding a chain table node at the tail of a chain table represented by the chain table head, wherein the chain table node stores a TCP data flow identifier and first forwarding information.
4. The load balancing apparatus of claim 1, wherein the hashing module is further configured to:
when the TCP data packet is determined to be a TCP _ SYN data packet and no data is stored in a first hash storage item corresponding to the first hash value, generating first forwarding information of the TCP data packet according to a preset load balancing algorithm, storing the first forwarding information in the first hash storage item, and setting a label of the first hash storage item as non-conflict.
5. The load balancing apparatus of claim 2, wherein the hashing module is further configured to:
and when the TCP data packet is determined not to be a TCP _ SYN data packet, data is stored in the first hash storage item corresponding to the hash value, and the label in the first hash storage item is that no conflict occurs, forwarding the TCP data packet according to the forwarding information in the first hash storage item.
6. The load balancing apparatus of claim 2,
the hashing module is further configured to: when the TCP data packet is determined not to be a TCP _ SYN data packet, the first hash storage item corresponding to the hash value stores data and the label in the first hash storage item is determined to have collided, sending a query collision signal to the control module;
the control module is further configured to: when receiving a query collision signal, generating a TCP data stream identifier and a hash value of the TCP data packet; and when determining that the TCP data flow identifier is inquired by a first linked list node in a linked list represented by a link list head in the first memory storage item corresponding to the hash value, forwarding the TCP data packet according to forwarding information in the first linked list node.
7. The load balancing device of claim 6, wherein the control module is further configured to:
and when determining that no TCP data flow identifier is inquired by any link table node in the link table represented by the link table head in the first memory storage item corresponding to the hash value, forwarding the TCP data packet according to forwarding information in the link table head.
8. The apparatus according to claim 7, wherein said forwarding the TCP packet according to the forwarding information in the chaining header comprises:
modifying the TCP data packet, and sending the modified TCP data packet to a destination server IP address in forwarding information in the chaining header, wherein the modifying the TCP data packet at least comprises: and modifying the destination IP address of the TCP data packet into the destination server IP address in the forwarding information in the chain table head.
9. The load balancing apparatus of claim 1, wherein the predetermined fields comprise:
source IP address, source port number, destination IP address, destination port number, and 8-bit protocol in the IP base header.
10. The load balancing apparatus according to claim 1, wherein the load balancing algorithm comprises:
polling, random, source address hashing, weighted polling, weighted random, and least-squares.
CN201811219998.9A 2018-10-19 2018-10-19 Load balancing device Active CN109040323B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811219998.9A CN109040323B (en) 2018-10-19 2018-10-19 Load balancing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811219998.9A CN109040323B (en) 2018-10-19 2018-10-19 Load balancing device

Publications (2)

Publication Number Publication Date
CN109040323A CN109040323A (en) 2018-12-18
CN109040323B true CN109040323B (en) 2021-03-16

Family

ID=64613663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811219998.9A Active CN109040323B (en) 2018-10-19 2018-10-19 Load balancing device

Country Status (1)

Country Link
CN (1) CN109040323B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109936635B (en) * 2019-03-12 2021-09-28 北京百度网讯科技有限公司 Load balancing method and device
CN112311876B (en) * 2020-10-30 2022-08-16 武汉绿色网络信息服务有限责任公司 Method and device for determining back-end device of current session through load balancing device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420771A (en) * 2011-12-28 2012-04-18 中国科学技术大学苏州研究院 Method for increasing concurrent transmission control protocol (TCP) connection speed in high-speed network environment
CN102761517A (en) * 2011-04-25 2012-10-31 工业和信息化部电信传输研究所 Content reduction method for high-speed network
CN103209169A (en) * 2013-02-23 2013-07-17 北京工业大学 Network flow filtering system and method based on field programmable gate array (FPGA)
CN107294855A (en) * 2017-05-31 2017-10-24 国家电网公司 A kind of TCP under high-performance calculation network searches optimization method
CN107612840A (en) * 2017-09-26 2018-01-19 东软集团股份有限公司 A kind of data processing method and device of four-layer load-equalizing equipment
WO2018121535A1 (en) * 2016-12-30 2018-07-05 华为技术有限公司 Load balance processing method and apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761517A (en) * 2011-04-25 2012-10-31 工业和信息化部电信传输研究所 Content reduction method for high-speed network
CN102420771A (en) * 2011-12-28 2012-04-18 中国科学技术大学苏州研究院 Method for increasing concurrent transmission control protocol (TCP) connection speed in high-speed network environment
CN103209169A (en) * 2013-02-23 2013-07-17 北京工业大学 Network flow filtering system and method based on field programmable gate array (FPGA)
WO2018121535A1 (en) * 2016-12-30 2018-07-05 华为技术有限公司 Load balance processing method and apparatus
CN107294855A (en) * 2017-05-31 2017-10-24 国家电网公司 A kind of TCP under high-performance calculation network searches optimization method
CN107612840A (en) * 2017-09-26 2018-01-19 东软集团股份有限公司 A kind of data processing method and device of four-layer load-equalizing equipment

Also Published As

Publication number Publication date
CN109040323A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
US10999184B2 (en) Health checking in a distributed load balancer
US20180375928A1 (en) Distributed load balancer
US9432245B1 (en) Distributed load balancer node architecture
US7461128B2 (en) Method, apparatus and system for processing message bundles on a network
US9553809B2 (en) Asymmetric packet flow in a distributed load balancer
US10135914B2 (en) Connection publishing in a distributed load balancer
US6895443B2 (en) Method and system for facilitating communication between nodes on different segments of a network
US9871712B1 (en) Health checking in a distributed load balancer
US8539089B2 (en) System and method for vertical perimeter protection
CN113891396B (en) Data packet processing method and device, computer equipment and storage medium
CN109040323B (en) Load balancing device
CN104486228A (en) Route updating method and route updating device
CN107547339B (en) Method and device for feeding back MAC address of gateway media access control
CN109120556B (en) A kind of method and system of cloud host access object storage server
CN112637236B (en) HTTP proxy method, architecture and medium for separating from protocol stack
CN113806091A (en) Data processing method, device and equipment
CN102413038B (en) Processing method and system for inaccessibility of next hop of route
KR102536942B1 (en) TOE-Based Network Interface Card And Network Interface Method
CN113302883B (en) Method and apparatus for exchanging header information for data transmission
CN110602245B (en) Method and storage medium for improving application software throughput
CN108965126B (en) Message forwarding method and device
US20240098012A1 (en) Data packet transmission methods, data packet transmission apparatuses, and storage media
CN118714072A (en) Data message processing method and device, electronic equipment and storage medium
CN117099356A (en) Instance-affine service scheduling
CN110807160A (en) Content acquisition method and device

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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 215000 unit 13 / 16, 4th floor, building B, No.5 Xinghan street, Suzhou Industrial Park, Jiangsu Province

Patentee after: Suzhou Shengke Communication Co.,Ltd.

Address before: Xinghan Street Industrial Park of Suzhou city in Jiangsu province 215021 B No. 5 Building 4 floor 13/16 unit

Patentee before: CENTEC NETWORKS (SU ZHOU) Co.,Ltd.