WO2014023003A1 - Method, apparatus, and system for controlling data transmission - Google Patents
Method, apparatus, and system for controlling data transmission Download PDFInfo
- Publication number
- WO2014023003A1 WO2014023003A1 PCT/CN2012/079887 CN2012079887W WO2014023003A1 WO 2014023003 A1 WO2014023003 A1 WO 2014023003A1 CN 2012079887 W CN2012079887 W CN 2012079887W WO 2014023003 A1 WO2014023003 A1 WO 2014023003A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data packet
- data message
- address
- server
- information
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 96
- 230000005540 biological transmission Effects 0.000 title claims abstract description 50
- 238000012545 processing Methods 0.000 claims abstract description 153
- 238000004891 communication Methods 0.000 claims description 55
- 230000004044 response Effects 0.000 description 11
- 230000006870 function Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 238000007689 inspection Methods 0.000 description 5
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000004140 cleaning Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1014—Server selection for load balancing based on the content of a request
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Definitions
- the present invention relates to the field of communications and, more particularly, to a method, apparatus and system for controlling data transmission. Background technique
- a set of servers can be grouped into a cluster of servers (also known as virtual server clusters) that provide scalable, highly available network services.
- a group of servers are connected to each other through a high-speed local area network or a geographically distributed wide area network, and have a load balancer at their front end.
- the load balancer can seamlessly dispatch data packets from the client device to the real server.
- the structure of the server cluster is transparent, and the client device accesses the network service provided by the server cluster just like access.
- a high-performance, highly available server As a way for the load balancer to dispatch data packets to the real server (destination server), there are known data message based address information (L3/4 layer) and load balancing scheduling solution based on content request (L7 layer) distribution. .
- the load balancer includes a gateway device for receiving data packets of the service, and a load balancing processor for performing load balancing on the data packet by executing various programs, in which, in order to schedule the data packet To the specified server, for each data message, the load balancing processor needs to parse its L3/4 layer information (for example, Internet Protocol (IP) address and port) or L7 layer information (Uniform Resource Locator).
- L3/4 layer information for example, Internet Protocol (IP) address and port
- L7 layer information Uniform Resource Locator
- Embodiments of the present invention provide a method, apparatus, and system for controlling data transmission, which can improve access speed and reduce the burden of a load balancing processor.
- a method for controlling data transmission comprising: transmitting a first data message from a client device to a load balancing processor; receiving a message sent by the load balancing processor Control information, where the control information is based on the first data packet by the load balancing processor
- the control information includes server information indicating a destination server of the first data message; when receiving the second data message And controlling transmission of the second data packet according to the control information.
- the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data message.
- the server information is determined according to the L3/4 layer information of the first data packet
- the control information is Controlling the transmission of the second data packet, specifically: when the quintuple of the second data packet is the same as the quintuple of the first data packet, according to the server information, to the first datagram
- the destination server sends the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
- the server information is based on the L3/4 layer information of the first data packet and the L7 If the layer information is determined, or the server information is determined according to the L7 layer information of the first data packet, and the control information further includes an L7 layer resolution indication identifier, the second data packet is controlled according to the control information.
- the transmission is specifically: when the quintuple of the second data packet is the same as the quintuple of the first data packet, performing L7 layer information on the second data packet according to the L7 layer resolution indication identifier.
- the server information includes a first control information entry,
- the first control information entry is used to indicate a correspondence between a quintu of the first data packet and an internal IP address and an internal port of the destination server of the first data packet.
- the method further includes: after receiving the first control information entry, starting a timer, and determining that the second data packet is not received before the timer expires; or determining that the client device and the first The communication connection established between the destination servers of the data message for transmitting the first data message ends; deleting the first control information entry.
- the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet
- the transmission of the second data packet is controlled according to the control information, specifically:
- the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the destination IP address of the second data packet is The address is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the transport layer protocol number of the second data packet is When the transport layer protocol number of the first data packet is the same, sending the first to the client device according to the external IP address and the external port of the destination server of the first data packet. Two data messages.
- the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, the first An internal port of the destination server of the data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet and the first data packet Correspondence between the external IP address of the destination server and the external port.
- the method further includes: after receiving the second control information entry, starting a timer, and determining, before the timer expires Receiving the second data message; or determining that the communication connection established between the client device and the destination server of the first data message for transmitting the first data message ends; deleting the second control Information item.
- an apparatus for controlling data transmission comprising: a sending unit, configured to send a first data message from a client device to a load balancing processor; Receiving the control information sent by the load balancing processor, and transmitting the control information to the processing unit, where the control information is the L3/4 layer information and/or the first load of the first data message by the load balancing processor Determining, by the L7 layer information of a data packet, the control information includes server information for indicating a destination server of the first data packet, and configured to transmit the second data to the processing unit when receiving the second data packet a data message; a processing unit, configured to acquire the control information and the second data message from the receiving unit, and control, according to the control information, the sending unit to transmit the second data message.
- the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data message.
- the server information is determined according to the L3/4 layer information of the first data packet, and the processing unit is specifically used to When the quintuple of the second data packet is the same as the quintuple of the first data packet, according to the server information, the sending unit is controlled to send the second data packet to the destination server of the first data packet.
- the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
- the server information is based on the L3/4 layer information of the first data packet and the L7 If the layer information is determined, or the server information is determined according to the L7 layer information of the first data packet, and the control information further includes an L7 layer resolution indication identifier, the processing unit is specifically configured to use the second data packet.
- the quintuple is the same as the quintuple of the first data packet
- the L7 layer information is parsed by the L7 layer to obtain the second data packet according to the L7 layer resolution indication identifier.
- URL information of the Uniform Resource Locator URL address of the destination server where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number; if the URL information is not empty, And controlling the sending unit to send the second data packet and the URL information to the load balancing processor, so that the load balancing processor determines the second number according to the URL information. And sending, by the destination server of the packet, the second data packet to the destination server of the second data packet; or, if the URL information is empty, controlling the sending unit to the first according to the server information The destination server of the data packet sends the second data packet.
- the server information includes a first control information entry,
- the first control information entry is used to indicate a quintuple of the first data packet and the first Correspondence between the internal IP address of the destination server of a data packet and the internal port.
- the processing unit The method is further configured to: after determining that the receiving unit receives the first control information entry, start a timer, and determine that the second data packet is not received before the timer expires; or is used to determine the client device And ending the communication connection established between the destination server of the first data packet and transmitting the first data packet; and deleting the first control information entry.
- the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet, where the processing unit is specifically configured to use a source IP address of the second data packet and the destination
- the internal IP address of the server is the same, and the source port of the second data packet is the same as the source port of the destination data server, and the destination IP address of the second data packet is the same as the source IP address of the first data packet.
- the destination port of the second data packet is the same as the source port of the first data packet
- the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet.
- the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, the first An internal port of the destination server of the data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet and the first data packet Correspondence between the external IP address of the destination server and the external port.
- the processing unit is further configured to: after determining that the receiving unit receives the second control information entry, start a timer, and determine The second data packet is not received before the timer expires; or is used to determine a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet End; used to delete the second control information entry.
- the third aspect provides a system for controlling data transmission, where the system includes: a load balancing processing module, configured to acquire a first data packet from a network card module, and according to L3/4 layer information of the first data packet, And the L7 layer information of the first data packet, determining server information for indicating the destination server of the first data packet, sending control information including the server information to the network card module; and using a network card module for loading
- the equalization processing module sends the first data packet from the user equipment, and obtains the control information from the load balancing processing module.
- the second data packet is controlled according to the control information. transmission.
- the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data message.
- the server information is determined by the load balancing processing module according to the L3/4 layer information of the first data packet
- the NIC module is configured to: when the quintuple of the second data packet is the same as the quintuple of the first data packet, send the second data to the destination server of the first data packet according to the server information
- the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
- the server information is that the load balancing processing module is based on the L3/ of the first data packet. Determined by the layer 4 information and the L7 layer information, or the server information is determined by the load balancing processing module according to the L7 layer information of the first data packet, and the control information further includes an L7 layer resolution indication identifier, and the network card module is Specifically, when the quintuple of the second data packet is the same as the quintuple of the first data packet, performing L7 layer information parsing on the second data packet according to the L7 layer parsing indication identifier, Obtaining URL information of a Uniform Resource Locator URL address of the destination server of the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number; If the URL information is not empty, sending the second data packet and the URL information to
- the server information includes the first control The information entry, the first control information entry is used to indicate a correspondence between a quintu of the first data packet and an internal IP address and an internal port of the destination server of the first data packet.
- the network card module And the method is further configured to: after receiving the first control information entry, start a timer, and determine that the second data message is not received before the timer expires; or to determine the client device and the first The communication connection established between the destination server of the data packet for transmitting the first data packet ends; and the first control information entry is deleted.
- the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet
- the network card module is specifically configured to use the source IP address of the second data packet and the destination
- the internal IP address of the server is the same, and the source port of the second data packet is the same as the source port of the destination data server, and the destination IP address of the second data packet is the same as the source IP address of the first data packet.
- the destination port of the second data packet is the same as the source port of the first data packet
- the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet.
- the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, the first An internal port of the destination server of the data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet and the first data packet Correspondence between the external IP address of the destination server and the external port.
- the network card module is further configured to: after receiving the second control information entry, start a timer, and determine that the timer expires The second data message is not received before; or is used to determine a communication established between the client device and the destination server of the first data message for transmitting the first data message End of connection; used to delete the second control information entry.
- control information is determined by the load balancing processor according to the first data packet, and the control information is sent to the network card device, and the network card device receives the second datagram.
- the second data message can be transmitted according to the control information, thereby reducing the processing of the load balancing processor, thereby improving the access speed and reducing the load of the load balancing processor.
- 1 is a schematic flow chart of a method of controlling data transmission according to an embodiment of the present invention.
- 2 is a schematic block diagram of an apparatus for controlling data transmission in accordance with an embodiment of the present invention.
- FIG. 3 is a schematic block diagram of a system for controlling data transmission in accordance with an embodiment of the present invention. detailed description
- FIG. 1 shows a schematic flow diagram of a method 100 of controlling data transmission in accordance with an embodiment of the present invention, as described from the perspective of a network card device. As shown in FIG. 1, the method 100 includes:
- S110 Send a first data packet from the client device to the load balancing processor.
- S120. Receive control information sent by the load balancing processor, where the control information is that the load balancing processor is configured according to the first data packet. Determined by the L3/4 layer information and/or the L7 layer information of the first data message, the control information includes server information indicating a destination server of the first data message;
- the client device may be a computer, a smart phone, or the like.
- the communication device when the user accesses the service through the client device, the client device sends a data message to a server (hereinafter, referred to as a destination server) that provides the service.
- a server hereinafter, referred to as a destination server
- the server may be, for example, a web server, an FTP server, an enterprise critical application server, and other mission-critical servers.
- the destination server and other servers form a server cluster to expand the bandwidth of the network device and the server, increase the throughput, strengthen the network data processing capability, and improve the flexibility and availability of the network.
- each server has a different IP address (internal IP address, which will be described later) and a port (internal port, which will be described later).
- the server cluster has one or more unified external (e.g., client-facing devices) IP addresses (described later as external IP addresses) and ports (described later as external ports).
- a load balancer (a gateway device including a data packet for receiving a service, and a load balancing processor for performing load balancing on the data packet by executing various programs) is disposed in the server cluster and the client device.
- a large amount of concurrent access or data traffic can be shared to multiple servers for processing, reducing the time for the client device to wait for a response, and also sharing the operation of a single heavy load to multiple servers for parallel processing, each node After the device is processed, the results are summarized and returned to the client device, so that the system processing capability is greatly improved.
- the externally facing IP address of the load balancer is the same as the externally facing IP address of the server cluster to which it is connected.
- load balancing can be implemented by a software load balancing solution, where one or more additional applications are installed on an operating system of one or more servers to implement load balancing.
- load balancing can be implemented by a software load balancing solution, where one or more additional applications are installed on an operating system of one or more servers to implement load balancing.
- DNS domain name system load balancing
- the processor of the server implements load balancing by executing the software, which is equivalent to a load balancing processor.
- the load balancer can also be directly installed between the server and the external network, independent of the operating system of the server.
- NAT Network Address Translation
- the load balancer rewrites data from the client device.
- the target address/source address of the packet is sent to each server according to a preset load balancing algorithm; and when the response data packet from the server passes through the load balancer, the load balancer rewrites The source address/destination address of the response data message is returned to the client to complete the entire load scheduling process.
- DR Direct routing
- load balancing that is, the load balancer sends data packets to the server by rewriting the media access control layer (MAC, Media Access Control) address from the client device data message. And the server returns the response data packet directly to the client device according to the MAC address of the client device.
- MAC media access control layer
- IP tunnel (TUN, TUNNEL) load balancing that is, the load balancer forwards data packets from the client device to the server through the IP tunnel, and the server directly returns the response data packet to the client device.
- the load balancer can map one external address to multiple internal addresses (corresponding to each server), and dynamically use one of the internal addresses for each communication connection to achieve load balancing. It should be understood that the above-described load balancing modes are merely illustrative, and the present invention is not limited thereto, and other methods for load balancing fall within the scope of protection of the present invention.
- the client device can send the first data packet of the service according to the externally unified IP address and port of the server cluster (that is, the external IP address and the external port).
- the first data message first arrives at the load balancer (received by the network card device).
- the network card device of the load balancer receives the first data packet, and the network card device can send the first data packet to a load balancing processor of the load balancer (hereinafter, for convenience of description, the cartridge The processor is used, so that the processor can determine the destination server of the data packet from the server cluster by using any of the foregoing load balancing algorithms.
- the processor may perform load balancing according to different layers of the network (network seven layers), specifically, load balancing according to L3/4 layer information of the data packet (ie, as described below). Case 1), load balancing may also be performed according to the L7 layer of the data message, or the L3/4 layer information and the L7 layer information (i.e., Case 2 described below).
- the L3/4 layer may include an L3 layer, or an L4 layer, or an L3 layer and an L4 layer.
- the L3 layer information may include IP address information of a network layer in an Open System Interconnect (OSI) network model
- the L4 layer information may include a Transmission Layer Control Control Protocol/User Datagram Protocol (TCP) in the OSI network model. /UDP, Transfer Control Protocol/ User Datagram Protocol) Port information. Therefore, the L3/4 layer information may include an external IP address of the service server transmitting the service (in relation to the destination IP address of the data packet) Same), external port (same as the destination port of the data packet) and other information.
- the L7 layer information may include application layer information, specifically, a URL address carried in the data message.
- the processor After receiving the first data packet sent by the network card device, the processor parses the L3/4 layer of the data packet, for example, performs a shallow packet inspection (SPI, Shallow Packet Inspection) on the data packet to obtain the data packet.
- the L3/4 layer information of the data packet for example, the source IP address, the destination IP address, the source port, the destination port, and the like
- the method for performing load balancing processing by the processor according to the L3/4 layer information It is the same as the prior art, and the description thereof is omitted here to avoid redundancy.
- the control information is a result of the load balancing process, and may be, for example, server information indicating a destination server.
- the processor may directly control, according to the result of the load balancing process, the sending device (for example, the network card device) to send the first data packet to correspond to the result of the load balancing process.
- the sending device for example, the network card device
- the destination server and send the server information to the NIC device.
- the server information may be used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data message.
- the processor can send the internal IP address and the internal port of the destination server of the first data packet to the network card device.
- the network card device can obtain an internal IP address and an internal port of the destination server from the processor.
- the network card device can receive the second data packet sent by the sending end.
- the sending end can be the client device or the server, and the present invention is not specifically limited.
- DR load balancing is adopted in the load balancer.
- IP TUN-type load balancing the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is a client device; for example, in a load balancer.
- the server that the server (the destination server) returns to the client device needs to pass the load balancer. Therefore, the sender of the second data packet can be the client device or the server (the destination server). ).
- the load balancer adopts NAT-type load balancing will be described as an example.
- the network card device may control transmission of the second data packet according to the control information.
- the server information is based on the first data packet. If the L3/4 layer information is determined, then
- the controlling the transmission of the second data packet according to the control information is specifically:
- the second data packet is sent to the destination server of the first data packet according to the server information, where The quintuple is the source IP address, source port, destination IP address, destination port, and transport layer protocol number.
- the sending end is a client device
- the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are The destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) of the first data packet are the same.
- the load balancing processor performs load balancing processing based on the L3/4 layer information.
- the processing of the second data packet is the L3/4 layer information (including the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet) and the first data packet.
- the processing of the second data packet is the same as that of the destination server of the first data packet (ie, the second data packet and the first data packet belong to the client device and the destination server) The same communication connection between).
- the network card device can modify the destination IP address of the second data packet to the internal IP address of the destination server (of the first data packet), and modify the destination port of the second data packet to the An internal port of the destination server of the data packet to send the second data packet to the destination server (of the first data message).
- the above is an example of determining whether the target server and the second data packet of the first data packet belong to the same communication connection between the client device and the destination server according to the quintuple of the data packet, but
- the present invention is not limited thereto.
- the load balancer is only connected to one server cluster, and the server cluster has only one unified external IP address, the destination IP address for the data packet arriving at the load balancer. It is the same as the destination port. Therefore, it can be determined only whether the source IP address, source port, and transport layer protocol number are the same.
- the description of the same or similar cases will be omitted.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the processor may perform load balancing processing (corresponding to DR-type load balancing or IP TUN-type load balancing) according to the L3/4 layer information of the first data packet, and determining the destination server, the processor may
- the control information table entry in the positive direction is generated only according to the L3/4 layer information of the first data packet.
- the forward direction refers to the direction from the client device to the server.
- the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and Corresponding relationship between the transport layer protocol number of the first data packet (hereinafter, referred to as the first quintuple for convenience of explanation) and the destination server information (for example, including the IP address and port of the destination server), and thus, at S130, The NIC device may search according to the source IP address, the source port, the destination IP address, the destination port of the second data packet, and the transport layer protocol number of the second data packet (hereinafter, for convenience of description, the second quintuple)
- the control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple.
- the network card device can modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the purpose of the second data packet.
- the port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and the second datagram can be sent to the destination server (indicated by the control information corresponding to the first quintuple) Text.
- the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet
- the controlling the transmission of the second data packet according to the control information is specifically:
- the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the destination of the second data packet is The IP address is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the transport layer protocol number of the second data packet is When the transport layer protocol number of the first data packet is the same, the sending unit controls the sending unit to send the second data packet to the client device according to the external IP address of the destination server of the first data packet and the external port.
- the sending end is a server (corresponding to NAT-type load balancing)
- the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized.
- the destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet.
- the source port is the same as the internal port of the destination server determined by the processor after equalizing the first data, and the second data packet transport layer protocol number and the first data The transport layer protocol number of the packet is the same.
- the load balancing processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is the response data generated by the destination server and corresponding to the first data packet.
- the message ie, the second data message and the first data message belong to the same communication connection between the client device and the destination server).
- the network card device can modify the source IP address of the second data packet to be the external IP address of the destination server (same as the destination IP address of the first data packet), and the source port of the second data packet.
- the external port of the destination server is the same as the destination port of the first data packet, and the second data packet is sent to the client device that sends the first data packet.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, and the The source IP address of the data packet, the source port of the first data packet, and the correspondence between the transport layer protocol number of the first data packet and the external IP address and the external port of the destination server of the first data packet .
- the processor may be configured according to the L3/4 layer information of the first data packet. Generate control information entries in both forward and reverse directions.
- the forward direction refers to the direction from the client device to the server.
- the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The correspondence between the transport layer protocol number of the first data packet (hereinafter, for convenience of description, the first quintuple) and the destination server information (for example, including the IP address and port of the destination server), so that the network card device can According to the source IP address of the second data, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet (hereinafter, for convenience of description, the cartridge is called the second quintuple),
- the control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple.
- the network card device can modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the purpose of the second data packet.
- the port is modified to this (indicated by the control information corresponding to the first quintuple)
- the port of the server is capable of transmitting the second data message to the destination server (indicated by the control information corresponding to the first quintuple).
- the reverse direction refers to the direction from the server to the client device.
- the reverse direction control information entry may include, for example, an internal IP address of the destination server, an internal port of the destination server, and a source of the first data packet.
- the server has the same external IP address, and the destination port of the first data packet (same as the external port of the destination server), so that the network card device can use the source IP address, source port, and destination of the second data.
- the network card device can modify the source IP address of the second data packet to the destination IP address of the first data packet corresponding to the third quintuple indicated by the control information entry (with the external IP address of the destination server)
- the destination port of the second data packet is modified to be the destination port of the first data packet corresponding to the first quintuple (the same as the external port of the destination server) indicated by the control information entry. Therefore, the second data packet can be sent to the client device that sends the first data packet.
- the above determines that the second data packet can be controlled according to the control information according to the source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet. It should be understood that the present invention is not limited thereto, and other methods for determining whether the second data message can be transmitted according to the control information (for example, determining that the first data message and the second data message belong to the same client) The method of the same communication connection between the device and the same server) falls within the scope of the present invention. Hereinafter, the description of the same or similar cases will be omitted.
- the method after receiving the control information entry, the method further includes:
- the method further includes:
- the second control information entry is deleted.
- the network card device after acquiring the control information entry (including the first control information entry and the second control information entry) from the processor, the network card device does not receive the message after a long time (for example, 30 minutes after the timer expires).
- the data packet that can be transmitted according to the control information included in the control information table (for example, the second data packet) can be considered as having ended the communication connection of the first data packet, so that the control information entry can be deleted (
- the first control information table item and the second control information table item are included.
- the network card device obtains the control information entry (including the first control information entry and the second control information entry) from the processor, after detecting the data packet indicating the end of the communication connection, the network data device can consider the first data packet.
- the associated communication connection has been completed, so that the control information entry (including the first control information entry and the second control information entry) can be deleted.
- the description of the same or similar cases will be omitted.
- the processor parses the L3/4 layer of the data packet, for example, performs a shallow packet inspection (SPI, Shallow Packet Inspection) on the data packet to obtain the data packet.
- L3/4 layer information of the data packet for example, source IP address, destination IP address, source port, destination port, etc.
- parsing the L7 layer of the data text for example, deep-text detection of the data text (DPI, Deep Packet Inspection), thereby obtaining L7 layer information of the data packet (for example, the URL of the data packet, etc.).
- the processor performs load balancing processing only according to the L3/4 layer information, and the The method of performing load balancing processing based on the L3/4 layer information is the same as that of the prior art, and the description thereof is omitted here to avoid redundancy.
- the processor may perform load balancing processing according to the L7 layer information, and the method for performing load balancing processing according to the L7 layer information is the same as the prior art.
- the description thereof is omitted.
- control information may include, for example, server information indicating the destination server, and indicating that the network card device needs to indicate the subsequent data packet.
- the processor may directly control, according to the result of the load balancing process, the sending device (for example, the network card device) to send the first data packet to correspond to the result of the load balancing process.
- the destination server The destination server. And send this control information to the NIC device.
- the server information may be used to indicate an internal IP address and an internal port of the destination server.
- the processor can send the internal IP address and the internal port of the destination server of the first data packet to the network card device.
- the network card device can obtain the IP address, the port, and the L7 layer resolution indication identifier of the destination server from the processor.
- the network card device can receive the second data packet sent by the sending end.
- the sending end can be the client device or the server, and the present invention is not particularly limited.
- DR load balancing is adopted in the load balancer.
- IP TUN-type load balancing the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is a client device; for example, in a load balancer.
- the server that the server (the destination server) returns to the client device needs to pass the load balancer. Therefore, the sender of the second data packet can be the client device or the server (the destination server). ).
- the load balancer adopts NAT-type load balancing will be described as an example.
- the network card device after receiving the second data packet, the network card device can control the transmission of the second data packet according to the control information.
- the server information is determined according to L3/4 layer information and L7 layer information of the first data packet, or
- control information further includes an L7 layer resolution indication identifier, and the shell
- the controlling the transmission of the second data packet according to the control information is specifically:
- the L7 layer parses the indication identifier, and performs L7 layer information parsing on the second data packet to obtain a URL information of a Uniform Resource Locator URL address of the destination server of the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number;
- the second data message is sent to the destination server of the first data message according to the server information.
- the transmitting end is a client device
- the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are The destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) of the first data packet are the same.
- the load balancing processor performs load balancing processing based on the L3/4 layer information.
- the processing of the second data packet is the L3/4 layer information (including the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet) and the first data packet.
- the processing of the second data packet is the same as that of the destination server of the first data packet (ie, the second data packet and the first data packet belong to the client device and the destination server) The same communication connection between).
- the NIC device can obtain the L7 layer information of the second data packet, that is, the URL address of the second data packet, according to the L7 layer resolution indication identifier. If the URL address of the second data packet is obtained, the second data packet and the URL address are sent to the processor, so that the processor does not need to perform L7 layer parsing on the second data packet, and can directly according to the URL.
- the address is subjected to load balancing processing.
- the process of parsing the URL is performed by the network card device, that is, by hardware analysis, the parsing speed is improved and the processing is reduced compared with the manner of using the software to parse by the processor. The burden of the device.
- the processor may be configured by using a sending device (for example, , the gateway device), sending the second data packet.
- a sending device for example, , the gateway device
- the second data packet may be sent according to the server information, the process and the network.
- the process performed in the card device S130 is the same, and the description thereof is omitted here.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the processor may be configured according to the first data packet.
- the L3/4 layer information only generates the control information entries in the above positive direction.
- the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet
- the controlling the transmission of the second data packet according to the control information is specifically:
- the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the destination of the second data packet is The IP address is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the transport layer protocol number of the second data packet is When the transport layer protocol number of the first data packet is the same, the sending unit controls the sending unit to send the second data packet according to the external IP address of the destination server of the first data packet and the external port.
- the sending end is a server (corresponding to NAT-type load balancing)
- the source IP address of the second data packet is the same as the source IP address of the first data packet
- the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized.
- the destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet.
- the source port is the same as the internal port of the destination server determined by the processor after the first data is equalized, and the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet,
- the load balancing processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server (that is, the second data packet) And the first data message belongs to the same communication connection between the client device and the destination server).
- the network card device can modify the source IP address of the second data packet to be the external IP address of the destination server (same as the destination IP address of the first data packet), and the source port of the second data packet.
- the external port of the destination server is the same as the destination port of the first data packet, and the second data packet is sent to the client device that sends the first data packet.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
- the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, and the The source IP address of the data, the source port of the first data, and the correspondence between the transport layer protocol number of the first data packet and the external IP address and the external port of the destination server of the first data packet .
- the processor may be configured according to the L3/4 layer information of the first data packet.
- the control information entry in the forward and reverse directions is generated.
- the method after receiving the control information entry, the method further includes:
- the method further includes:
- the second control information entry is deleted.
- the load balancer adopts NAT-type load balancing
- the load balancer may also adopt the DR-type load balancing or the IP TUN type. Load balancing.
- the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is the client device.
- the load balancing processor determines the control information according to the first data packet, and sends the control information to the network card device, where the network card device receives After the second data packet is sent to the second data packet, the second data packet can be directly sent to the destination server according to the control information, or the second data packet can be obtained in the second data packet.
- the URL information notifies the load balancing processor that the load balancing processor does not need to parse the second data packet, thereby reducing the processing of the load balancing processor, improving the access speed, and reducing the load of the load balancing processor.
- FIG. 2 shows a schematic block diagram of an apparatus 200 for controlling data transmission in accordance with an embodiment of the present invention.
- the apparatus 200 includes:
- the sending unit 210 is configured to send, to the load balancing processor, the first data packet from the client device.
- the receiving unit 220 is configured to receive the control information sent by the load balancing processor, and transmit the control information to the processing unit 230, where the control information is the L3/4 layer of the first data packet by the load balancing processor. Determining information and/or L7 layer information of the first data message, the control information including server information indicating a destination server of the first data message;
- the processing unit 230 For transmitting the second data message to the processing unit 230 when receiving the second data message; the processing unit 230 is configured to obtain the control information and the second data message from the receiving unit 220, and according to the Controlling information, controlling the sending unit to transmit the second data packet;
- the client device may send the first datagram of the service according to the externally unified IP address and port of the server cluster (ie, the external IP address and the external port).
- Text first data message
- the data message first arrives at the load balancer (received by the network card device).
- the receiving unit 220 of the network card device can receive the first data packet
- the sending unit 210 of the network card device can send the first data packet to the load balancing processor of the load balancer (hereinafter, for convenience of description, the cartridge
- the processor can determine the destination server of the data packet from the server cluster by using any of the foregoing load balancing methods.
- the processor can perform load balancing according to different layers of the network (network seven layers). Specifically, load balancing can be performed according to the L3/4 layer of the data packet, or load balancing can be performed according to the L7 layer of the data packet.
- the L3/4 layer may include an L3 layer, or an L4 layer, or an L3 layer. And L4 layer.
- the L3 layer information may include IP address information of a network layer in the OSI network model, and the L4 layer information may include TCP/UDP port information in the OSI network model. Therefore, the L3/4 layer information may include information such as an IP address, a port, and the like of a service server that transmits the service.
- the L7 layer information may include application layer information, specifically, a URL address carried in the data message.
- the processor parses the L3/4 layer of the data packet, for example, performs SPI on the data packet to obtain L3/4 layer information of the data packet (for example, the source IP address, the destination IP address, the source port, the destination port, and the like, in the embodiment of the present invention, the method for the processor to perform load balancing processing according to the L3/4 layer information is the same as the prior art, where , the description is omitted.
- the control information may be server information indicating a destination server.
- the processor may directly control, according to the result of the load balancing process, the sending device (for example, the network card device) to send the first data packet to correspond to the result of the load balancing process.
- the sending device for example, the network card device
- the destination server and send the server information to the network card device.
- the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data packet.
- the server information is determined according to the L3/4 layer information of the first data packet.
- the processing unit 230 is specifically configured to control, according to the server information, the purpose of the sending unit to the first data packet when the quintuple of the second data text is the same as the quintuple of the first data file
- the server sends the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
- the processor can send the internal IP address and the internal port of the destination server to the network card device. Internal internal IP address and internal port.
- the receiving unit 220 of the network card device may receive the second data packet sent by the sending end.
- the sending end may be the client device or the server, and the present invention is not particularly limited, for example, in a load balancer.
- the packet returned by the server (the destination server) to the client device does not pass through the load balancer.
- the sender of the second data packet is the client device; for example, When the load balancer adopts NAT-type load balancing, the packet sent by the server (the destination server) to the client device needs to pass through the load balancer. Therefore, the sender of the second data packet can be a client device, or For the server (destination server).
- the load balancer adopts NAT type load balancing will be described as an example. The transmission of the second data message.
- the load balancing processor processes the load based on the L3/4 layer information.
- the L3/4 layer information (including the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet) is the same as that for the first data packet, and the first The destination server of the second data packet is the same as the destination server of the first data packet (ie, the second data packet and the first data packet belong to the same communication connection between the client device and the destination server).
- the processing unit 230 of the network card device can control the sending unit 210 to modify the destination IP address of the second data packet to the IP address of the destination server (of the first data packet), and the second data packet is The destination port is modified to be the port of the destination server (of the first data packet), and the second data packet can be sent to the destination server (of the first data packet).
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the processor may be configured according to the first data packet.
- the L3/4 layer information only generates the control information entries in the positive direction.
- the forward direction refers to the direction from the client device to the server.
- the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The correspondence between the transport layer protocol number of the first data packet (hereinafter, referred to as the first quintuple for convenience of explanation) and the destination server information (for example, including the IP address and port of the destination server), thereby processing unit 230
- the source layer address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet may be used according to the second data packet.
- the second quintuple is called, and the control information table item is found.
- the processing unit 230 may modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the purpose of the second data packet.
- the port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and the second datagram can be sent to the destination server (indicated by the control information corresponding to the first quintuple) Text.
- the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet
- the processing unit is configured to: when the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the The destination IP address of the second data packet is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the second data packet is the second data packet.
- the sending unit is controlled to send the first unit to the client device according to the external IP address and the external port of the destination server of the first data packet. Two data messages.
- the sending end is a server (corresponding to NAT-type load balancing)
- the source IP address of the second data packet is the same as the source IP address of the first data packet
- the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized.
- the destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet.
- the source port is the same as the internal port of the destination server determined by the processor after the first data is equalized, and the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet,
- the load balancing processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server (that is, the second data packet) And the first data message belongs to the same communication connection between the client device and the destination server).
- the sending unit 220 may modify the source IP address of the second data packet to the external IP address of the destination server of the first data packet (same as the destination IP address of the first data packet), and the first The source port of the second data packet is modified to be the external port of the destination server of the first data packet (same as the destination port of the first data packet), so that the first datagram can be sent to The client device sends the second data packet.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet, and an external IP address and an external port of the destination server of the first data packet Correspondence relationship.
- the processor may be configured according to the L3/4 layer information of the first data packet. Generate control information entries in both forward and reverse directions.
- the forward direction refers to the direction from the client device to the server.
- the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The correspondence between the transport layer protocol number of the first data packet (hereinafter, referred to as the first quintuple for convenience of explanation) and the destination server information (for example, including the IP address and port of the destination server), thereby processing unit 230
- the source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet (hereinafter, referred to as the second quintuple for convenience of description) may be searched according to the source IP address, the source port, the destination IP address, the destination port, and the second data packet.
- the control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple. Therefore, the sending unit 210 may modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the purpose of the second data packet.
- the port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and the second datagram can be sent to the destination server (indicated by the control information corresponding to the first quintuple) Text.
- the reverse direction refers to the direction from the server to the client device.
- the reverse direction control information entry may include, for example, an internal IP address of the destination server, an internal port of the destination server, and a source of the first data packet.
- the external IP address of the server is the same), the destination of the first data packet Corresponding relationship between the port (same as the external port of the destination server), so that the processing unit 230 can use the source IP address, the source port, the destination IP address, the destination port, and the transport layer of the second data packet according to the second data
- the protocol number (the second quintuple) is used to find the control information entry.
- the second quintuple When the second quintuple is the same as the third quintuple described in the control information entry, the second quintuple can be determined to send the second
- the server of the data message is the destination server of the first data message corresponding to the first quintuple. Therefore, the sending unit 210 may modify the source IP address of the second data packet to the destination IP address of the first data packet corresponding to the third quintuple indicated by the control information entry (with the external IP address of the destination server)
- the destination port of the second data packet is modified to be the destination port of the first data packet corresponding to the first quintuple (the same as the external port of the destination server) indicated by the control information entry. Therefore, the second data message can be sent to the client device that sends the first data packet.
- the processing unit 230 is further configured to: after determining that the receiving unit 220 receives the first control information entry, start a timer, and determine that the timer is not received before the timer expires.
- the second data message or
- processing unit 230 is further configured to: after determining that the receiving unit 220 receives the second control information entry, start a timer, and determine that the second data message is not received before the timer expires; or
- the processing unit 230 acquires the control information entry (including the first control information entry and the second control information entry) from the processor by the receiving unit 220, the processing unit 230 is for a long time (after the timer expires, for example, 30) If the data packet that can be transmitted according to the control information included in the control information table (for example, the second data packet) is not received, the communication connection to which the first data packet belongs may be considered to be deleted. Control information entry (including the first control information entry and the second control information entry).
- the processing unit 230 detects that the communication connection is ended. After the data packet, the communication connection to which the first data packet belongs is considered to be ended, so that the control information entry (including the first control information entry and the second control information entry) can be deleted.
- the description of the same or similar cases will be omitted.
- the above determines that the second data packet can be controlled according to the control information according to the source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet. It should be understood that the present invention is not limited thereto, and other methods for determining whether the second data message can be transmitted according to the control information (for example, determining that the first data message and the second data message belong to the same client) The method of the same communication connection between the device and the same server) falls within the scope of the present invention.
- the processor is used for L7 layer information according to data packets, or L3/4 layer information and
- the processor parses the L3/4 layer of the data packet, for example, performs SPI on the data packet to obtain the L3/ of the data packet.
- Layer 4 information for example, the source IP address, the destination IP address, the source port, the destination port, and so on
- the L7 layer of the data packet is parsed, for example, DPI is performed on the data packet to obtain the data packet.
- L7 layer information for example, the URL of the data message, etc.
- the processor performs load balancing processing only according to the L3/4 layer information, and the The method of performing load balancing processing based on the L3/4 layer information is the same as that of the prior art, and the description thereof is omitted here to avoid redundancy.
- the processor may perform load balancing processing according to the L7 layer information, and the method for performing load balancing processing according to the L7 layer information It is the same as the prior art, and the description thereof is omitted here to avoid redundancy.
- the control information may be server information indicating the destination server, and the network card device is required to send subsequent data packets (mainly the data packets sent by the client device to the server).
- the processor may directly control, according to the result of the load balancing process, the sending device (for example, the network card device) to send the first data packet to correspond to the result of the load balancing process.
- the destination server And send this control information to the NIC device.
- the server information is used to indicate an internal address of the destination server and Internal port.
- the processor may send the internal IP address and the internal port of the destination server and the L7 layer resolution indication identifier to the network card device.
- the sending unit 210 of the network card device may acquire, from the processor, an internal IP address, an internal port, and an L7 layer resolution indication identifier of the destination server within the server cluster.
- the sending unit 210 of the network card device may receive the second data packet sent by the sending end.
- the sending end may be the client device or the server, and the present invention is not particularly limited.
- the DR is adopted in the load balancer.
- the sender of the second data packet is the client device; for example, in load balancing.
- the server that the server (the destination server) returns to the client device needs to pass the load balancer. Therefore, the sender of the second data packet can be a client device or a server. Destination server).
- the load balancer adopts NAT-type load balancing will be described as an example.
- the processing unit 230 of the network card device determines whether the transmission of the second data message can be transmitted based on the server information acquired from the processor.
- the server information is determined according to L3/4 layer information and L7 layer information of the first data packet, or
- the server information is determined according to the L7 layer information of the first data packet.
- the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data packet, and the control information further includes an L7 layer resolution indication identifier,
- the processing unit is configured to: when the quintuple of the second data packet is the same as the quintuple of the first data packet, perform L7 layer information on the second data packet according to the L7 layer resolution indication identifier Parsing, to obtain URL information of a Uniform Resource Locator URL address of the destination server for indicating the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer Agreement number;
- the sending information is sent to the load balancing processor to send the second data packet and the URL information, so that the load balancing processor determines the second data according to the URL information.
- a destination server of the packet and sending the second data packet to the destination server of the second data packet; or
- the sending unit is controlled to send the second data packet to the destination server of the first data packet according to the server information.
- the transmitting end is a client device
- the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are The destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) of the first data packet are the same.
- the processor performs load balancing processing based on the L3/4 layer information.
- the processing of the second data packet is the L3/4 layer information (including the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet) and the processing basis for the first data packet.
- the processing unit 230 may determine that the destination server of the second data packet is the same as the destination server of the first data packet (ie, the second data packet and the first data packet belong to the client device and the destination server. The same communication connection between).
- the processing unit 230 of the network card device can obtain the L7 layer information of the second data packet, that is, the URL address of the second data packet, according to the L7 layer resolution indication identifier.
- the sending unit 210 sends the second data packet and the URL address to the processor, so that the processor does not need to perform L7 layer parsing on the second data packet.
- the load balancing process can be performed directly according to the URL address.
- the process of parsing the URL is performed by the network card device, that is, by hardware analysis, the resolution speed is improved compared with the method of using the software to parse by the processor. And reduce the burden on the processor.
- the processor may be configured by using a sending device (for example, , the gateway device), sending the second data packet.
- a sending device for example, , the gateway device
- control sending unit 210 may send the second data packet according to the server information.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the processor may be configured according to the L3 of the first data packet. /4 layer information, only the control information entries in the above positive direction are generated.
- the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet
- the processing unit 230 is specifically configured to: when the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the The destination IP address of the second data packet is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the second data packet is When the transport layer protocol number of the text is the same as the transport layer protocol number of the first data packet, the sending unit is controlled to send the sending unit to the client device according to the external IP address and the external port of the destination server of the first data packet. Second data message.
- the sending end is a server (corresponding to NAT-type load balancing)
- the source IP address of the second data packet is the same as the source IP address of the first data packet
- the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized.
- the destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet.
- the source port is the same as the internal port of the destination server determined by the processor after the first data is equalized, and the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet,
- the load balancing processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server (that is, the second data packet) And the first data message belongs to the same communication connection between the client device and the destination server).
- the sending unit 220 may modify the source IP address of the second data packet to the external IP address of the destination server of the first data packet (same as the destination IP address of the first data packet), and the first The source port of the second data packet is modified to be the external port of the destination server of the first data packet (same as the destination port of the first data packet), so that the client device (which sends the first data packet) can be Send the second data packet.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet, and an external IP address and an external port of the destination server of the first data packet Correspondence relationship.
- the processor performs load balancing according to the L3/4 layer information of the first data packet.
- the control information entries in the forward and reverse directions can be generated according to the L3/4 layer information of the first data packet.
- the processing unit 230 is further configured to: after determining that the receiving unit 220 receives the first control information entry, start a timer, and determine that the timer expires The second data message has not been received before; or
- processing unit 230 is further configured to: after determining that the receiving unit 220 receives the second control information entry, start a timer, and determine that the second data message is not received before the timer expires; or
- the load balancer adopts NAT-type load balancing
- the load balancer may also adopt the DR-type load balancing or the IP TUN type. Load balancing.
- the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is the client device.
- the units in 200 and the other operations and/or functions described above are respectively implemented to implement the corresponding flow of method 100 in FIG.
- the device for controlling data transmission determines the control information according to the first data packet by the load balancing processor, and sends the control information to the network card device, and the network card device receives the second data packet and determines that After the second data packet is transmitted according to the control information, the second data packet may be directly sent to the destination server according to the control information, or the URL information in the second data packet may be obtained and notified to the load balancing processor.
- the load balancing processor does not need to parse the second data packet, thereby reducing the processing of the load balancing processor, improving the access speed, and reducing the load of the load balancing processor.
- FIG. 3 shows a schematic block diagram of a system 300 for controlling data transmission in accordance with an embodiment of the present invention. As shown in Figure 3, the system includes:
- the load balancing processing module 310 is configured to obtain the first data packet from the network card module 320, and determine, according to the L3/4 layer information of the first data packet and/or the L7 layer information of the first data packet, Instructing server information of the destination server of the first data packet, and sending control information including the server information to the network card module;
- the NIC module 320 is configured to send the first data packet from the user equipment to the load balancing processing module 310, and obtain the control information from the load balancing processing module 310.
- the control Information controlling the transmission of the second data message.
- the client device may send the first datagram of the service according to the externally unified IP address and port of the server cluster (ie, the external IP address and the external port).
- Text first data message
- the data message first arrives at the load balancer (received by the network card device).
- the NIC module 320 can send the first data packet to the load balancing processing module 310 of the load balancer, so that the equalization processing module 310 can adopt a preset algorithm, and use any of the foregoing load balancing methods to obtain a slave server cluster. Determine the destination server for this data message.
- the equalization processing module 310 can perform load balancing according to different layers of the network (network seven layers), specifically, load balancing according to the L3/4 layer of the data packet, or according to the datagram.
- the L7 layer of the text performs load balancing.
- the L3/4 layer may include an L3 layer, or an L4 layer, or an L3 layer and an L4 layer.
- the L3 layer information may include IP address information of the network layer in the OSI network model, and the L4 layer information may include TCP/UDP port information in the OSI network model. Therefore, the L3/4 layer information may include information such as an IP address, a port, and the like of a service server that transmits the service.
- the L7 layer information may include application layer information, specifically, a URL address carried in the data packet.
- the equalization processing module 310 parses the L3/4 layer of the data packet, for example, performs SPI on the data packet to obtain the L3/4 of the data packet.
- the equalization processing module 310 performs load balancing processing according to the L3/4 layer information, in the layer information (for example, the source IP address, the destination IP address, the source port, the destination port, and the like). The method is the same as that of the prior art, and the description thereof is omitted here to avoid redundancy.
- the control information may be server information indicating a destination server.
- the equalization processing module 310 can directly control the sending device (for example, the network card module 320) to send the first data packet to the load balancing process according to the result of the load balancing process.
- the result corresponds to the destination server. And sending the server information to the network card module 320.
- the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data packet.
- the server information is determined by the load balancing processing module 310 according to the L3/4 layer information of the first data packet,
- the NIC module 320 is configured to send the quintuple of the second data packet to the destination server of the first data packet according to the server information when the quintuple of the second data packet is the same as the quintuple of the first data packet.
- the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
- the equalization processing module 310 can send the internal IP address and the internal port of the destination server in the server cluster to the network card module 320.
- the network card module 320 can obtain the internal IP address and the internal port of the destination server within the server cluster from the equalization processing module 310.
- the network card module 320 can receive the second data packet sent by the sending end.
- the sending end can be the client device or the server, and the invention is not particularly limited.
- the DR is used in the load balancer.
- load balancing or IP TUN load balancing the packets returned by the server (destination server) to the client device do not pass through the load balancer. Therefore, the sender of the second data packet is the client device; for example, in load balancing.
- the server that the server (the destination server) returns to the client device needs to pass the load balancer. Therefore, the sender of the second data packet can be a client device or a server. Destination server).
- the load balancer adopts NAT-type load balancing will be described as an example.
- the network card module 320 controls the transmission of the second data message based on the server information acquired from the equalization processing module 310.
- the transmitting end is a client device
- the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are Destination IP address, source IP address, destination port, and source of the first data packet
- the port and the transport layer protocol number (TCP connection or UDP connection) are the same, because the load balancing processor performs load balancing processing based on the L3/4 layer information, and the processing basis of the second data packet is L3/4 layer information (including the first
- the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet are the same as those for the first data packet, and the destination server of the second data packet can be determined.
- the destination server of the data packet is the same (that is, the second data packet and the first data packet belong to the same communication connection between the client device and the destination server).
- the network card module 320 can modify the destination IP address of the second data packet to the IP address of the destination server (of the first data packet), and modify the destination port of the second data packet to the a port of the destination server of the data packet, to send the second data packet to the destination server (of the first data message).
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the load balancing processing module 310 may perform load balancing processing (corresponding to DR-type load balancing or IP TUN-type load balancing) according to the L3/4 layer information of the first data packet, and determine the destination server, according to the first The L3/4 layer information of the data packet only generates the control information entry in the positive direction.
- load balancing processing corresponding to DR-type load balancing or IP TUN-type load balancing
- the forward direction refers to the direction from the client device to the server.
- the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The transport layer protocol number of the first data message (hereinafter, for convenience of description, the first quintuple) and the destination server information (for example, including the IP address and port of the destination server), so that the network card module 320
- the source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet (hereinafter, referred to as the second quintuple for convenience of description) may be searched according to the source IP address, the source port, the destination IP address, the destination port, and the second data packet.
- the control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple. Therefore, the network card module 320 can modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the second data packet is The destination port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and can be directed to the control information corresponding to the first quintuple The destination server sends the second data packet.
- the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet
- the NIC module is specifically configured to: when the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the The destination IP address of the second data packet is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the second data packet is the second data packet.
- the transport layer protocol number is the same as the transport layer protocol number of the first data packet
- the second data packet is sent according to the external IP address and the external port of the destination server of the first data packet.
- the sending end is a server (corresponding to NAT-type load balancing)
- the source IP address of the second data packet is the same as the source IP address of the first data packet
- the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized.
- the destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet.
- the source port is the same as the internal port of the destination server determined by the processor after equalizing the first data
- the second data packet transport layer protocol number is the same as the transport layer protocol number of the first data packet, due to the load
- the equalization processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server (ie, the second data packet is The first data packet belongs to the same communication connection between the client device and the destination server).
- the network card module 320 can modify the source IP address of the second data packet to the destination IP address of the external IP address of the destination server of the first data packet (same as the destination IP address of the first data packet), and Modifying the source port of the second data packet to the external port of the destination server of the first data packet (same as the destination port of the first data packet), so as to be able to send the first data packet
- the client device sends the second data packet.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, The source IP address of the first data packet and the source end of the first data packet Correspondence between the port and the transport layer protocol number of the first data packet and the external IP address and the external port of the destination server of the first data packet.
- the load balancing processing module 310 may be configured according to the L3/4 of the first data packet. Layer information, generating control information entries in both forward and reverse directions.
- the forward direction refers to the direction from the client device to the server.
- the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The transport layer protocol number of the first data message (hereinafter, for convenience of description, the first quintuple) and the destination server information (for example, including the IP address and port of the destination server), so that the network card module 320
- the source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet (hereinafter, referred to as the second quintuple for convenience of description) may be searched according to the source IP address, the source port, the destination IP address, the destination port, and the second data packet.
- the control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple. Therefore, the network card module 320 can modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the second data packet is The destination port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and the second server is capable of transmitting the second data to the destination server (indicated by the control information corresponding to the first quintuple) Message.
- the reverse direction refers to the direction from the server to the client device.
- the reverse direction control information entry may include, for example, an internal IP address of the destination server, an internal port of the destination server, and a source of the first data packet.
- the server has the same external IP address, and the destination port of the first data packet (same as the external port of the destination server), so that the network card module 320 can use the source IP address, source port, and destination of the second data.
- An address (which is the same as the external IP address of the destination server), and the destination port of the second data packet is modified to be the destination port of the first data packet corresponding to the first quintuple indicated by the control information entry ( The same as the external port of the destination server, so that the second data packet can be sent to the client device that sends the first data packet.
- the description of the same or similar cases will be omitted.
- the network card module 320 is further configured to: after receiving the first control information entry, start a timer, and determine that the second datagram is not received before the timer expires. Text; or
- NIC module 320 is further configured to: after receiving the second control information entry, start the timer, and determine that the second data packet is not received before the timer expires; or
- the NIC module 320 is for a long time (after the timer expires, for example, 30 minutes)
- the data packet (for example, the second data packet) that can be transmitted according to the control information included in the control information table is not received, and the communication connection to which the first data packet belongs is considered to be ended, so that the control can be deleted.
- the information item (including the first control information item and the second control information item).
- the NIC module 320 After the NIC module 320 obtains the control information entry (including the first control information entry and the second control information entry) from the load balancing processing module 310, after detecting the data packet indicating the end of the communication connection, the NIC module 320 may consider The communication connection to which the data packet belongs is ended, so that the control information entry (including the first control information entry and the second control information entry) can be deleted.
- the description of the same or similar cases will be omitted.
- the above determines that the second data packet can be controlled according to the control information according to the source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet. It should be understood that the present invention is not limited thereto, and other methods for determining whether the second data message can be transmitted according to the control information (for example, determining that the first data message and the second data message belong to the same client) The same communication connection between the device and the same server The method) falls within the scope of protection of the present invention.
- the processor is configured to perform load balancing according to the L7 layer information of the data packet, or the L3/4 layer information and the L7 layer information.
- the load balancing processing module 310 parses the L3/4 layer of the data packet, for example, performs SPI on the data packet to obtain the L3/4 of the data packet.
- the layer information for example, the source IP address, the destination IP address, the source port, the destination port, and the like
- the L7 layer of the data packet is parsed, for example, DPI is performed on the data packet, thereby acquiring the data packet.
- L7 layer information for example, the URL of the data message, etc.
- the L7 layer information of the first data packet may be empty (that is, there is no URL or the like).
- the load balancing processing module 310 performs load balancing processing only according to the L3/4 layer information.
- the method of performing load balancing processing based on the L3/4 layer information is the same as that of the prior art. Here, in order to avoid redundancy, the description thereof will be omitted.
- the load balancing processing module 310 may perform load balancing processing according to the L7 layer information, and perform load balancing according to the L7 layer information.
- the method of processing is the same as that of the prior art, and the description thereof is omitted here to avoid redundancy.
- the control information may include, for example, server information indicating the destination server, and indicating that the network card module 320 needs to send subsequent data packets (mainly data sent by the client device to the server). Message) The L7 layer resolution indication flag for L7 layer parsing.
- the load balancing processing module 310 can directly control the sending device (for example, the network card module 320) to send the first data packet to the load balancing processing according to the result of the load balancing processing. The result corresponds to the destination server. And sending the control information to the network card module 320.
- the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data packet.
- the server information is determined by the load balancing processing module according to the L3/4 layer information and the L7 layer information of the first data packet, or
- the server information is determined by the load balancing processing module according to the L7 layer information of the first data packet, where the control information further includes an L7 layer resolution indication identifier,
- the NIC module is specifically configured to: when the quintuple of the second data packet is the same as the quintuple of the first data packet, perform L7 layer signaling on the second data packet according to the L7 layer resolution indication identifier Parsing to obtain a uniform resource locator for indicating the destination server of the second data packet
- the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number;
- the second data message is sent to the destination server of the first data message according to the server information.
- the load balancing processing module 310 can send the internal IP address and the internal port of the destination server in the server cluster to the network card module 320.
- the NIC module 320 may obtain the internal IP address, the internal port, and the L7 layer resolution indication identifier of the destination server in the server cluster from the load balancing processing module 310, and the load balancing processing module 310 may be the IP address and port of the destination server. And the L7 layer resolution indication identifier.
- the NIC module 320 can receive the second data packet sent by the sending end.
- the sending end can be the client device or the server, and the present invention is not particularly limited.
- the load balancer adopts DR load balancing or In the IP TUN load balancing mode, the server (destination server) returns the packet to the client device without passing through the load balancer. Therefore, the sender of the second data packet is the client device; for example, the NAT is used in the load balancer.
- the packet sent by the server (destination server) to the client device needs to pass through the load balancer. Therefore, the sender of the second data packet may be a client device or a server (destination server). .
- the load balancer adopts NAT-type load balancing will be described as an example.
- the network card module 320 transmits the transmission of the second data message based on the server information acquired from the load balancing processing module 310.
- the sending end is a client device
- the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are The destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) of the first data packet are the same, because the load balancing processing module 310 performs load balancing processing based on the L3/4 layer information.
- the network card module 320 For processing the second data packet, that is, L3/4 layer information (including the destination IP address, source IP address, and destination end of the second data packet)
- the port, the source port, and the transport layer protocol number are the same as the processing for the first data packet
- the network card module 320 can determine that the destination server of the second data packet is the same as the destination server of the first data packet (ie, The two data messages and the first data message belong to the same communication connection between the client device and the destination server.
- the NIC module 320 can obtain the L7 layer information of the second data packet, that is, the URL address of the second data packet, according to the L7 layer resolution indication identifier.
- the network card module 320 can obtain the URL address of the second data packet, the second data packet and the URL address are sent to the load balancing processing module 310, so that the load balancing processing module 310 does not need to perform the second data packet.
- the load balancing process can be directly performed according to the URL address.
- the process of parsing the URL is performed by the network card module 320, that is, by hardware parsing, and by means of the software that is parsed by the load balancing processing module 310. In comparison, the resolution speed is increased and the burden on the load balancing processing module 310 is reduced.
- the load balancing processing module 310 may send The device (eg, the gateway device) sends the second data message. .
- the second data packet may be sent according to the server information.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the load balancing processing module 310 may perform load balancing processing (corresponding to DR-type load balancing or IP TUN-type load balancing) according to the L7 layer information of the first data packet, and determine the destination server, according to the first datagram. For the L3/4 layer information of the text, only the control information entries in the positive direction described above are generated.
- the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet
- the NIC module is specifically configured to: when the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the The destination IP address of the second data packet is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the second data packet is the second data packet.
- the transport layer protocol number is the same as the transport layer protocol number of the first data packet
- the sending end is a server (corresponding to NAT-type load balancing)
- the source IP address of the second data packet determines that the internal IP address of the destination server is the same after the equalization processing of the first data, and the destination port of the second data packet is the same as the source IP address of the first data packet, and the second The source port of the data packet is the same as the internal port of the destination server determined by the load balancing processing module 310 after the equalization processing on the first data, and the second data packet transport layer protocol number and the transport layer of the first data packet.
- the protocol number is the same.
- the load balancing processing module 310 performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server.
- the second data packet and the first data packet belong to the same communication connection between the client device and the destination server.
- the network card module 320 can modify the source IP address of the second data packet to the destination IP address of the external IP address of the destination server of the first data packet (same as the destination IP address of the first data packet), and Modifying the source port of the second data packet to the external port of the destination server of the first data packet (same as the destination port of the first data packet), so as to be able to send the first data packet
- the client device sends the second data packet.
- the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet.
- the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet, and an external IP address and an external port of the destination server of the first data packet Correspondence relationship.
- the load balancing processing module 310 may be configured according to the L3/4 of the first data packet. Layer information, generating control information entries in both the forward and reverse directions.
- the network card module 320 is further configured to: after receiving the first control information entry, start a timer, and determine that the timer is not received before the timer expires. To the second data message; or
- NIC module 320 is further configured to: after receiving the second control information entry, start the timer, and determine that the second data packet is not received before the timer expires; or
- the load balancer adopts NAT-type load balancing
- the load balancer may also adopt the DR-type load balancing or the IP TUN type. Load balancing.
- the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is the client device.
- the units in system 300 and the other operations and/or functions described above are respectively implemented to implement the corresponding processes of method 100 in FIG.
- the device for controlling data transmission determines the control information according to the first data packet by the load balancing processor, and sends the control information to the network card device, and the network card device receives the second data packet and determines that After the second data packet is transmitted according to the control information, the second data packet may be directly sent to the destination server according to the control information, or the URL information in the second data packet may be obtained and notified to the load balancing processor.
- the load balancing processor does not need to parse the second data packet, thereby reducing the processing of the load balancing processor, improving the access speed, and reducing the load of the load balancing processor.
- the size of the sequence numbers of the above processes does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not be taken to the embodiments of the present invention.
- the implementation process constitutes any limitation.
- Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
- the disclosed systems, devices, and methods may be implemented in other ways.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
- the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
- the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
- the technical solution of the present invention which is essential to the prior art or part of the technical solution, may be embodied in the form of a software product stored in a storage medium, including
- the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Provided are a method, an apparatus, and a system for controlling data transmission, which can improve the access speed and reduce the burden of a load balancing processor. The method comprises: sending a first data packet from a client device to the load balancing processor; receiving control information sent by the load balancing processor, the control information being determined by the load balancing processor according to L3/4 information of the first data packet and/or L7 information of the first data packet, and comprising server information for indicating a target server of the first data packet; and after a second data packet is received, controlling transmission of the second data packet according to the control information. The load balancing processor determines control information according to the first data packet, and delivers the control information to a network card device; the network card device can transmit the second data packet according to the control information when receiving the second data packet, which reduces processing by the load balancing processor, thereby improving the access speed and reducing the burden of the load balancing processor.
Description
控制数据传输的方法、 装置和系统 技术领域 Method, device and system for controlling data transmission
本发明涉及通信领域, 并且更具体地, 涉及一种控制数据传输的方法、 装置和系统。 背景技术 The present invention relates to the field of communications and, more particularly, to a method, apparatus and system for controlling data transmission. Background technique
目前, 可以将一组服务器构成一个提供可伸缩的、 高可用网络服务的服 务器集群(也称为虚拟服务器集群)。 具体地说, 一组服务器通过高速的局 域网或者地理分布的广域网相互连接, 在它们的前端有一个负载均衡器 ( Load Balancer )。 负载均衡器能无缝地将来自客户端设备的数据报文调度 到真实服务器上, 从而, 对于客户端设备, 服务器集群的结构是透明的, 客 户端设备访问服务器集群提供的网络服务就像访问一台高性能、 高可用的服 务器一样。 作为负载均衡器将数据报文调度到真实服务器(目的服务器)的 方式, 已知有基于数据报文的地址信息( L3/4层)和基于内容请求( L7层) 分发的负载平衡调度解决方法。 Currently, a set of servers can be grouped into a cluster of servers (also known as virtual server clusters) that provide scalable, highly available network services. Specifically, a group of servers are connected to each other through a high-speed local area network or a geographically distributed wide area network, and have a load balancer at their front end. The load balancer can seamlessly dispatch data packets from the client device to the real server. Thus, for the client device, the structure of the server cluster is transparent, and the client device accesses the network service provided by the server cluster just like access. A high-performance, highly available server. As a way for the load balancer to dispatch data packets to the real server (destination server), there are known data message based address information (L3/4 layer) and load balancing scheduling solution based on content request (L7 layer) distribution. .
负载均衡器包括用于接收业务的数据报文的网关设备, 以及用于通过执 行各种程序以对该数据报文进行负载均衡的负载均衡处理器, 在该技术中, 为了将数据报文调度到规定的服务器, 对于每一个数据报文, 均需要负载均 衡处理器解析出其 L3/4层信息(例如, 网际协议(IP, Internet Protocol )地 址和端口)或 L7层信息(统一资源定位器( URL , Uniform Resource Locator ) 地址), 这样, 例如, 对于发往同一目的服务器的多个数据报文(例如, 同 一通信连接的多个数据报文), 尽管各数据报文的负载调度结果相同 (发往 同一目的服务器), 负载均衡处理器仍然需要对每个数据报文进行解析, 增 加了负载均衡处理器的负担, 并影响访问速度。 发明内容 The load balancer includes a gateway device for receiving data packets of the service, and a load balancing processor for performing load balancing on the data packet by executing various programs, in which, in order to schedule the data packet To the specified server, for each data message, the load balancing processor needs to parse its L3/4 layer information (for example, Internet Protocol (IP) address and port) or L7 layer information (Uniform Resource Locator). (URL, Uniform Resource Locator) address, such as, for example, for multiple data messages destined for the same destination server (for example, multiple data messages for the same communication connection), although the load scheduling results for each data message are the same (Send to the same destination server), the load balancing processor still needs to parse each data packet, increasing the load on the load balancing processor and affecting the access speed. Summary of the invention
本发明实施例提供一种控制数据传输的方法、 装置和系统, 能够提高访 问速度, 减小负载均衡处理器的负担。 Embodiments of the present invention provide a method, apparatus, and system for controlling data transmission, which can improve access speed and reduce the burden of a load balancing processor.
第一方面, 提供了一种控制数据传输的方法, 该方法包括: 向负载均衡 处理器发送来自客户端设备的第一数据报文;接收该负载均衡处理器发送的
控制信息, 其中, 该控制信息是该负载均衡处理器根据该第一数据报文的In a first aspect, a method for controlling data transmission is provided, the method comprising: transmitting a first data message from a client device to a load balancing processor; receiving a message sent by the load balancing processor Control information, where the control information is based on the first data packet by the load balancing processor
L3/4层信息和 /或该第一数据报文的 L7层信息确定的,该控制信息包括用于 指示该第一数据报文的目的服务器的服务器信息; 当接收到第二数据报文 时, 根据该控制信息, 控制该第二数据报文的传输。 Determining L3/4 layer information and/or L7 layer information of the first data message, the control information includes server information indicating a destination server of the first data message; when receiving the second data message And controlling transmission of the second data packet according to the control information.
在一种可能的实施方式中, 该服务器信息用于指示该第一数据报文的目 的服务器的内部网际协议 IP地址和内部端口。 In a possible implementation, the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data message.
结合第一方面和第一种可能的实施方式,在第二种可能的实施方式中,, 该服务器信息是根据该第一数据报文的 L3/4层信息确定的, 则该根据该控 制信息, 控制该第二数据报文的传输, 具体为: 当该第二数据报文的五元组 与该第一数据报文的五元组相同时, 根据该服务器信息, 向该第一数据报文 的目的服务器发送该第二数据报文, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地址、 目的端口和传输层协议号。 With reference to the first aspect and the first possible implementation manner, in the second possible implementation manner, the server information is determined according to the L3/4 layer information of the first data packet, and the control information is Controlling the transmission of the second data packet, specifically: when the quintuple of the second data packet is the same as the quintuple of the first data packet, according to the server information, to the first datagram The destination server sends the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
结合第一方面、 第一种可能的实施方式和第二种可能的实施方式, 在第 三种可能的实施方式中, 该服务器信息是根据该第一数据报文的 L3/4层信 息和 L7层信息确定的,或该服务器信息是根据该第一数据报文的 L7层信息 确定的, 且该控制信息还包括 L7层解析指示标识, 则该根据该控制信息, 控制该第二数据报文的传输, 具体为: 当该第二数据报文的五元组与该第一 数据报文的五元组相同时, 根据该 L7层解析指示标识, 对该第二数据报文 进行 L7层信息解析, 以获取用于指示该第二数据报文的目的服务器的统一 资源定位器 URL地址的 URL信息, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地址、 目的端口和传输层协议号; 如果该 URL信息不为空, 则向该 负载均衡处理器发送该第二数据报文和该 URL信息, 以便于该负载均衡处 理器根据该 URL信息, 确定该第二数据报文的目的服务器, 并向该第二数 据报文的目的服务器发送该第二数据报文; 或如果该 URL信息为空, 则根 据该服务器信息, 向该第一数据报文的目的服务器发送该第二数据报文。 With reference to the first aspect, the first possible implementation manner, and the second possible implementation manner, in a third possible implementation manner, the server information is based on the L3/4 layer information of the first data packet and the L7 If the layer information is determined, or the server information is determined according to the L7 layer information of the first data packet, and the control information further includes an L7 layer resolution indication identifier, the second data packet is controlled according to the control information. The transmission is specifically: when the quintuple of the second data packet is the same as the quintuple of the first data packet, performing L7 layer information on the second data packet according to the L7 layer resolution indication identifier. Parsing, to obtain URL information of a Uniform Resource Locator URL address of the destination server for indicating the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer a protocol number; if the URL information is not empty, sending the second data packet and the URL information to the load balancing processor, so that the load balancing processor according to the URL Determining the destination server of the second data packet, and sending the second data packet to the destination server of the second data packet; or if the URL information is empty, according to the server information, The destination server of the data packet sends the second data packet.
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式和第三 种可能的实施方式, 在第四种可能的实施方式中, 该服务器信息包括第一控 制信息表项, 该第一控制信息表项用于指示该第一数据报文的五元组与该第 一数据报文的目的服务器的内部 IP地址和内部端口的对应关系。 With reference to the first aspect, the first possible implementation manner, the second possible implementation manner, and the third possible implementation manner, in a fourth possible implementation manner, the server information includes a first control information entry, The first control information entry is used to indicate a correspondence between a quintu of the first data packet and an internal IP address and an internal port of the destination server of the first data packet.
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式和第四种可能的实施方式, 在第五种可能的实施方式中,
该方法还包括: 在接收到该第一控制信息表项后, 启动定时器, 并确定在该 定时器超时之前未接收到该第二数据报文; 或确定在该客户端设备与该第一 数据报文的目的服务器之间建立的用于传输该第一数据报文的通信连接结 束; 删除该第一控制信息表项。 With reference to the first aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, and the fourth possible implementation manner, in a fifth possible implementation manner, The method further includes: after receiving the first control information entry, starting a timer, and determining that the second data packet is not received before the timer expires; or determining that the client device and the first The communication connection established between the destination servers of the data message for transmitting the first data message ends; deleting the first control information entry.
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式和第五种可能的实施方式, 在第 六种可能的实施方式中, 该服务器信息还用于指示该第一数据报文的目的服 务器的外部 IP地址和外部端口, 则该根据该控制信息, 控制该第二数据报 文的传输, 具体为: 当该第二数据报文的源 IP地址与该目的服务器的内部 IP地址相同,且该第二数据报文的源端口与该目的服务器的内部端口信息相 同, 且该第二数据报文的目的 IP地址与该第一数据报文的源 IP地址相同, 且该第二数据报文的目的端口与该第一数据报文的源端口相同,且该第二数 据报文的传输层协议号与该第一数据报文的传输层协议号相同时, 根据该 第一数据报文的目的服务器的外部 IP地址和外部端口, 向该客户端设备发 送该第二数据报文。 Combining the first aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, the fourth possible implementation manner, and the fifth possible implementation manner, in the sixth possibility In an embodiment, the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet, and the transmission of the second data packet is controlled according to the control information, specifically: The source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the destination IP address of the second data packet is The address is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the transport layer protocol number of the second data packet is When the transport layer protocol number of the first data packet is the same, sending the first to the client device according to the external IP address and the external port of the destination server of the first data packet. Two data messages.
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式和第六 种可能的实施方式, 在第七种可能的实施方式中, 该服务器信息包括第二控 制信息表项, 该第二控制信息表项用于指示该第一数据报文的目的服务器的 内部 IP地址、 该第一数据报文的目的服务器的内部端口、 该第一数据报文 的源 IP地址、 该第一数据报文的源端口以及该第一数据报文的传输层协议 号与该第一数据报文的目的服务器的外部 IP地址和外部端口的对应关系。 Combining the first aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, the fourth possible implementation manner, the fifth possible implementation manner, and the sixth possible Embodiments, in a seventh possible implementation, the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, the first An internal port of the destination server of the data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet and the first data packet Correspondence between the external IP address of the destination server and the external port.
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式、 第六 种可能的实施方式和第七种可能的实施方式, 在第八种可能的实施方式中, 该方法还包括: 在接收到该第二控制信息表项后, 启动定时器, 并确定在该 定时器超时之前未接收到该第二数据报文; 或确定在该客户端设备和该第一 数据报文的目的服务器之间建立的用于传输该第一数据报文的通信连接结 束; 删除该第二控制信息表项。 Combining the first aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, the fourth possible implementation manner, the fifth possible implementation manner, and the sixth possible Embodiments and a seventh possible implementation manner. In an eighth possible implementation manner, the method further includes: after receiving the second control information entry, starting a timer, and determining, before the timer expires Receiving the second data message; or determining that the communication connection established between the client device and the destination server of the first data message for transmitting the first data message ends; deleting the second control Information item.
第二方面, 提供了一种控制数据传输的装置, 该装置包括: 发送单元, 用于向负载均衡处理器发送来自客户端设备的第一数据报文; 接收单元, 用
于接收该负载均衡处理器发送的控制信息, 以及向处理单元传输该控制信 息, 其中, 该控制信息是该负载均衡处理器根据该第一数据报文的 L3/4层 信息和 /或该第一数据报文的 L7层信息确定的, 该控制信息包括用于指示该 第一数据报文的目的服务器的服务器信息; 用于当接收到第二数据报文时, 向处理单元传输该第二数据报文; 处理单元, 用于从该接收单元获取该控制 信息和该第二数据报文, 并根据该控制信息, 控制该发送单元传输该第二数 据报文。 In a second aspect, an apparatus for controlling data transmission is provided, the apparatus comprising: a sending unit, configured to send a first data message from a client device to a load balancing processor; Receiving the control information sent by the load balancing processor, and transmitting the control information to the processing unit, where the control information is the L3/4 layer information and/or the first load of the first data message by the load balancing processor Determining, by the L7 layer information of a data packet, the control information includes server information for indicating a destination server of the first data packet, and configured to transmit the second data to the processing unit when receiving the second data packet a data message; a processing unit, configured to acquire the control information and the second data message from the receiving unit, and control, according to the control information, the sending unit to transmit the second data message.
在一种可能的实施方式中, 该服务器信息用于指示该第一数据报文的目 的服务器的内部网际协议 IP地址和内部端口。 In a possible implementation, the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data message.
结合第二方面和第一种可能的实施方式, 在第二种可能的实施方式中, 该服务器信息是根据该第一数据报文的 L3/4层信息确定的, 则该处理单元 具体用于当该第二数据报文的五元组与该第一数据报文的五元组相同时,根 据该服务器信息,控制该发送单元向该第一数据报文的目的服务器发送该第 二数据 文, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地址、 目的端 口和传输层协议号。 With reference to the second aspect and the first possible implementation manner, in the second possible implementation manner, the server information is determined according to the L3/4 layer information of the first data packet, and the processing unit is specifically used to When the quintuple of the second data packet is the same as the quintuple of the first data packet, according to the server information, the sending unit is controlled to send the second data packet to the destination server of the first data packet. The quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
结合第二方面、 第一种可能的实施方式和第二种可能的实施方式, 在第 三种可能的实施方式中, 该服务器信息是根据该第一数据报文的 L3/4层信 息和 L7层信息确定的,或该服务器信息是根据该第一数据报文的 L7层信息 确定的, 且该控制信息还包括 L7层解析指示标识, 则该处理单元具体用于 当该第二数据报文的五元组与该第一数据报文的五元组相同时, 根据该 L7 层解析指示标识, 对该第二数据报文进行 L7层信息解析, 以获取用于指示 该第二数据报文的目的服务器的统一资源定位器 URL地址的 URL信息, 其 中, 该五元组为源 IP地址、 源端口、 目的 IP地址、 目的端口和传输层协议 号; 用于如果该 URL信息不为空, 则控制该发送单元向该负载均衡处理器 发送该第二数据报文和该 URL信息, 以便于该负载均衡处理器根据该 URL 信息, 确定该第二数据报文的目的服务器, 并向该第二数据报文的目的服务 器发送该第二数据报文; 或用于如果该 URL信息为空, 则根据该服务器信 息, 控制该发送单元向该第一数据报文的目的服务器发送该第二数据报文。 With reference to the second aspect, the first possible implementation manner, and the second possible implementation manner, in a third possible implementation manner, the server information is based on the L3/4 layer information of the first data packet and the L7 If the layer information is determined, or the server information is determined according to the L7 layer information of the first data packet, and the control information further includes an L7 layer resolution indication identifier, the processing unit is specifically configured to use the second data packet. When the quintuple is the same as the quintuple of the first data packet, the L7 layer information is parsed by the L7 layer to obtain the second data packet according to the L7 layer resolution indication identifier. URL information of the Uniform Resource Locator URL address of the destination server, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number; if the URL information is not empty, And controlling the sending unit to send the second data packet and the URL information to the load balancing processor, so that the load balancing processor determines the second number according to the URL information. And sending, by the destination server of the packet, the second data packet to the destination server of the second data packet; or, if the URL information is empty, controlling the sending unit to the first according to the server information The destination server of the data packet sends the second data packet.
结合第二方面、 第一种可能的实施方式、 第二种可能的实施方式和第三 种可能的实施方式, 在第四种可能的实施方式中, 该服务器信息包括第一控 制信息表项, 该第一控制信息表项用于指示该第一数据报文的五元组与该第
一数据报文的目的服务器的内部 IP地址和内部端口的对应关系。 With reference to the second aspect, the first possible implementation manner, the second possible implementation manner, and the third possible implementation manner, in a fourth possible implementation manner, the server information includes a first control information entry, The first control information entry is used to indicate a quintuple of the first data packet and the first Correspondence between the internal IP address of the destination server of a data packet and the internal port.
结合第二方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式和第四种可能的实施方式, 在第五种可能的实施方式中, 该处理单元还用于在确定该接收单元接收到该第一控制信息表项后, 启动定 时器, 并确定在该定时器超时之前未接收到该第二数据报文; 或用于确定在 该客户端设备和该第一数据报文的目的服务器之间建立的用于传输该第一 数据报文的通信连接结束; 用于删除该第一控制信息表项。 With reference to the second aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, and the fourth possible implementation manner, in the fifth possible implementation manner, the processing unit The method is further configured to: after determining that the receiving unit receives the first control information entry, start a timer, and determine that the second data packet is not received before the timer expires; or is used to determine the client device And ending the communication connection established between the destination server of the first data packet and transmitting the first data packet; and deleting the first control information entry.
结合第二方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式和第五种可能的实施方式, 在第 六种可能的实施方式中, 该服务器信息还用于指示该第一数据报文的目的服 务器的外部 IP地址和外部端口, 则该处理单元具体用于当该第二数据报文 的源 IP地址与该目的服务器的内部 IP地址相同, 且该第二数据报文的源端 口与该目的服务器的内部端口信息相同, 且该第二数据报文的目的 IP地址 与该第一数据报文的源 IP地址相同, 且该第二数据报文的目的端口与该第 一数据报文的源端口相同,且该第二数据报文的传输层协议号与该第一数据 报文的传输层协议号相同时, 根据该第一数据报文的目的服务器的外部 IP 地址和外部端口, 控制该发送单元向该客户端设备发送该第二数据报文。 Combining the second aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, the fourth possible implementation manner, and the fifth possible implementation manner, in the sixth possibility In an embodiment, the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet, where the processing unit is specifically configured to use a source IP address of the second data packet and the destination The internal IP address of the server is the same, and the source port of the second data packet is the same as the source port of the destination data server, and the destination IP address of the second data packet is the same as the source IP address of the first data packet. And the destination port of the second data packet is the same as the source port of the first data packet, and the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet. And sending, by the sending unit, the second data packet to the client device according to the external IP address and the external port of the destination server of the first data packet.
结合第二方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式和第六 种可能的实施方式, 在第七种可能的实施方式中, 该服务器信息包括第二控 制信息表项, 该第二控制信息表项用于指示该第一数据报文的目的服务器的 内部 IP地址、 该第一数据报文的目的服务器的内部端口、 该第一数据报文 的源 IP地址、 该第一数据报文的源端口以及该第一数据报文的传输层协议 号与该第一数据报文的目的服务器的外部 IP地址和外部端口的对应关系。 Combining the second aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, the fourth possible implementation manner, the fifth possible implementation manner, and the sixth possible Embodiments, in a seventh possible implementation, the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, the first An internal port of the destination server of the data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet and the first data packet Correspondence between the external IP address of the destination server and the external port.
结合第二方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式、 第六 种可能的实施方式和第七种可能的实施方式, 在第八种可能的实施方式中, 该处理单元还用于在确定该接收单元接收到该第二控制信息表项后, 启动定 时器, 并确定在该定时器超时之前未接收到该第二数据报文; 或用于确定在 该客户端设备和该第一数据报文的目的服务器之间建立的用于传输该第一 数据报文的通信连接结束; 用于删除该第二控制信息表项。
第三方面, 提供了一种控制数据传输的系统, 该系统包括: 负载均衡处 理模块, 用于从网卡模块获取第一数据报文, 并根据该第一数据报文的 L3/4 层信息和 /或该第一数据报文的 L7层信息, 确定用于指示该第一数据报文的 目的服务器的服务器信息, 向该网卡模块发送包括该服务器信息的控制信 息; 网卡模块, 用于向负载均衡处理模块发送来自用户设备的该第一数据报 文,以及从该负载均衡处理模块获取该控制信息,当接收到第二数据报文时, 根据该控制信息, 控制该第二数据报文的传输。 With reference to the second aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, the fourth possible implementation manner, the fifth possible implementation manner, the sixth possible Embodiments and a seventh possible implementation manner, in an eighth possible implementation, the processing unit is further configured to: after determining that the receiving unit receives the second control information entry, start a timer, and determine The second data packet is not received before the timer expires; or is used to determine a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet End; used to delete the second control information entry. The third aspect provides a system for controlling data transmission, where the system includes: a load balancing processing module, configured to acquire a first data packet from a network card module, and according to L3/4 layer information of the first data packet, And the L7 layer information of the first data packet, determining server information for indicating the destination server of the first data packet, sending control information including the server information to the network card module; and using a network card module for loading The equalization processing module sends the first data packet from the user equipment, and obtains the control information from the load balancing processing module. When the second data packet is received, the second data packet is controlled according to the control information. transmission.
在一种可能的实施方式中, 该服务器信息用于指示该第一数据报文的目 的服务器的内部网际协议 IP地址和内部端口。 In a possible implementation, the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data message.
结合第三方面和第一种可能的实施方式, 在第二种可能的实施方式中, 该服务器信息是该负载均衡处理模块根据该第一数据报文的 L3/4层信息确 定的, 则该网卡模块具体用于当该第二数据报文的五元组与该第一数据报文 的五元组相同时, 根据该服务器信息, 向该第一数据报文的目的服务器发送 该第二数据 文, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地址、 目 的端口和传输层协议号。 With reference to the third aspect and the first possible implementation manner, in a second possible implementation manner, the server information is determined by the load balancing processing module according to the L3/4 layer information of the first data packet, The NIC module is configured to: when the quintuple of the second data packet is the same as the quintuple of the first data packet, send the second data to the destination server of the first data packet according to the server information The quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
结合第三方面、 第一种可能的实施方式和第二种可能的实施方式, 在第 三种可能的实施方式中, 该服务器信息是该负载均衡处理模块根据该第一数 据报文的 L3/4层信息和 L7层信息确定的, 或该服务器信息是该负载均衡处 理模块根据该第一数据报文的 L7 层信息确定的, 且该控制信息还包括 L7 层解析指示标识, 则该网卡模块具体用于当该第二数据报文的五元组与该第 一数据报文的五元组相同时, 根据该 L7层解析指示标识, 对该第二数据报 文进行 L7层信息解析, 以获取用于指示该第二数据报文的目的服务器的统 一资源定位器 URL地址的 URL信息, 其中, 该五元组为源 IP地址、 源端 口、 目的 IP地址、 目的端口和传输层协议号;如果如果该 URL信息不为空, 则向该负载均衡处理器发送该第二数据报文和该 URL信息, 以便于该负载 均衡处理器根据该 URL信息, 确定该第二数据报文的目的服务器, 并向该 第二数据报文的目的服务器发送该第二数据报文; 或如果该 URL信息为空, 则根据该服务器信息, 向该第一数据报文的目的服务器发送该第二数据报 文。 With reference to the third aspect, the first possible implementation manner, and the second possible implementation manner, in a third possible implementation manner, the server information is that the load balancing processing module is based on the L3/ of the first data packet. Determined by the layer 4 information and the L7 layer information, or the server information is determined by the load balancing processing module according to the L7 layer information of the first data packet, and the control information further includes an L7 layer resolution indication identifier, and the network card module is Specifically, when the quintuple of the second data packet is the same as the quintuple of the first data packet, performing L7 layer information parsing on the second data packet according to the L7 layer parsing indication identifier, Obtaining URL information of a Uniform Resource Locator URL address of the destination server of the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number; If the URL information is not empty, sending the second data packet and the URL information to the load balancing processor, so that the load balancing processor is configured according to a URL information, determining a destination server of the second data packet, and sending the second data packet to the destination server of the second data packet; or if the URL information is empty, according to the server information, The destination server of the data packet sends the second data packet.
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式和第三 种可能的实施方式, 在第四种可能的实施方式中, 该服务器信息包括第一控
制信息表项, 该第一控制信息表项用于指示该第一数据报文的五元组与该第 一数据报文的目的服务器的内部 IP地址和内部端口的对应关系。 With reference to the first aspect, the first possible implementation manner, the second possible implementation manner, and the third possible implementation manner, in the fourth possible implementation manner, the server information includes the first control The information entry, the first control information entry is used to indicate a correspondence between a quintu of the first data packet and an internal IP address and an internal port of the destination server of the first data packet.
结合第三方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式和第四种可能的实施方式, 在第五种可能的实施方式中, 该网卡模块还用于在接收到该第一控制信息表项后, 启动定时器, 并确定在 该定时器超时之前未接收到该第二数据报文; 或用于确定在该客户端设备和 该第一数据报文的目的服务器之间建立的用于传输该第一数据报文的通信 连接结束; 用于删除该第一控制信息表项。 With reference to the third aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, and the fourth possible implementation manner, in a fifth possible implementation manner, the network card module And the method is further configured to: after receiving the first control information entry, start a timer, and determine that the second data message is not received before the timer expires; or to determine the client device and the first The communication connection established between the destination server of the data packet for transmitting the first data packet ends; and the first control information entry is deleted.
结合第三方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式和第五种可能的实施方式, 在第 六种可能的实施方式中,该服务器信息还用于指示该第一数据报文的目的服 务器的外部 IP地址和外部端口, 以及该网卡模块具体用于当该第二数据报 文的源 IP地址与该目的服务器的内部 IP地址相同, 且该第二数据报文的源 端口与该目的服务器的内部端口信息相同, 且该第二数据报文的目的 IP地 址与该第一数据报文的源 IP地址相同, 且该第二数据报文的目的端口与该 第一数据报文的源端口相同,且该第二数据报文的传输层协议号与该第一数 据报文的传输层协议号相同时,根据该第一数据报文的目的服务器的外部 IP 地址和外部端口, 发送该第二数据>¾文。 Combining the third aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, the fourth possible implementation manner, and the fifth possible implementation manner, in the sixth possibility In an embodiment, the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet, and the network card module is specifically configured to use the source IP address of the second data packet and the destination The internal IP address of the server is the same, and the source port of the second data packet is the same as the source port of the destination data server, and the destination IP address of the second data packet is the same as the source IP address of the first data packet. And the destination port of the second data packet is the same as the source port of the first data packet, and the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet. Sending the second data>3⁄4 text according to the external IP address and the external port of the destination server of the first data message.
结合第三方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式和第六 种可能的实施方式, 在第七种可能的实施方式中, 该服务器信息包括第二控 制信息表项, 该第二控制信息表项用于指示该第一数据报文的目的服务器的 内部 IP地址、 该第一数据报文的目的服务器的内部端口、 该第一数据报文 的源 IP地址、 该第一数据报文的源端口以及该第一数据报文的传输层协议 号与该第一数据报文的目的服务器的外部 IP地址和外部端口的对应关系。 Combining the third aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, the fourth possible implementation manner, the fifth possible implementation manner, and the sixth possible Embodiments, in a seventh possible implementation, the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, the first An internal port of the destination server of the data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet and the first data packet Correspondence between the external IP address of the destination server and the external port.
结合第三方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式、 第六 种可能的实施方式和第七种可能的实施方式, 在第八种可能的实施方式中, 该网卡模块还用于在接收到该第二控制信息表项后, 启动定时器, 并确定在 该定时器超时之前未接收到该第二数据报文; 或用于确定在该客户端设备和 该第一数据报文的目的服务器之间建立的用于传输该第一数据报文的通信
连接结束; 用于删除该第二控制信息表项。 Combining the third aspect, the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, the fourth possible implementation manner, the fifth possible implementation manner, and the sixth possible Embodiments and a seventh possible implementation manner, in an eighth possible implementation manner, the network card module is further configured to: after receiving the second control information entry, start a timer, and determine that the timer expires The second data message is not received before; or is used to determine a communication established between the client device and the destination server of the first data message for transmitting the first data message End of connection; used to delete the second control information entry.
根据本发明实施例的控制数据传输的方法、 装置和系统, 通过负载均衡 处理器根据第一数据报文确定控制信息, 并向网卡设备下发该控制信息, 网 卡设备在接收到第二数据报文时能够根据该控制信息传输该第二数据报文, 减少负载均衡处理器的处理, 从而, 能够提高访问速度, 减小负载均衡处理 器的负担。 附图说明 The method, device, and system for controlling data transmission according to the embodiment of the present invention, the control information is determined by the load balancing processor according to the first data packet, and the control information is sent to the network card device, and the network card device receives the second datagram. The second data message can be transmitted according to the control information, thereby reducing the processing of the load balancing processor, thereby improving the access speed and reducing the load of the load balancing processor. DRAWINGS
为了更清楚地说明本发明实施例的技术方案, 下面将对实施例或现有技 术描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图 仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造 性劳动的前提下, 还可以根据这些附图获得其他的附图。 In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings to be used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only the present invention. For some embodiments, other drawings may be obtained from those of ordinary skill in the art without departing from the drawings.
图 1是根据本发明实施例的控制数据传输的方法的示意性流程图。 图 2是根据本发明实施例的控制数据传输的装置的示意性框图。 1 is a schematic flow chart of a method of controlling data transmission according to an embodiment of the present invention. 2 is a schematic block diagram of an apparatus for controlling data transmission in accordance with an embodiment of the present invention.
图 3是根据本发明实施例的控制数据传输的系统的示意性框图。 具体实施方式 3 is a schematic block diagram of a system for controlling data transmission in accordance with an embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是 全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创 造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。 The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without making creative labor are within the scope of the present invention.
图 1示出了从网卡设备角度描述的,根据本发明实施例的控制数据传输 的方法 100的示意性流程图。 如图 1所示, 该方法 100包括: 1 shows a schematic flow diagram of a method 100 of controlling data transmission in accordance with an embodiment of the present invention, as described from the perspective of a network card device. As shown in FIG. 1, the method 100 includes:
S110, 向负载均衡处理器发送来自客户端设备的第一数据报文; S120, 接收该负载均衡处理器发送的控制信息, 其中, 该控制信息是该 负载均衡处理器根据该第一数据报文的 L3/4层信息和 /或该第一数据报文的 L7 层信息确定的, 该控制信息包括用于指示该第一数据报文的目的服务器 的服务器信息; S110: Send a first data packet from the client device to the load balancing processor. S120. Receive control information sent by the load balancing processor, where the control information is that the load balancing processor is configured according to the first data packet. Determined by the L3/4 layer information and/or the L7 layer information of the first data message, the control information includes server information indicating a destination server of the first data message;
S130, 当接收到第二数据报文时, 根据该控制信息, 控制该第二数据报 文的传输; S130, when receiving the second data packet, controlling transmission of the second data packet according to the control information;
具体地说, 在本发明实施例中, 客户端设备可以是计算机、 智能手机等
通信设备, 用户在通过该客户端设备访问业务时, 客户端设备向提供该业务 的服务器(以下, 称为目的服务器)发送数据报文。 Specifically, in the embodiment of the present invention, the client device may be a computer, a smart phone, or the like. The communication device, when the user accesses the service through the client device, the client device sends a data message to a server (hereinafter, referred to as a destination server) that provides the service.
服务器(包括上述目的服务器)可以是, 例如 Web服务器、 FTP服务 器、 企业关键应用服务器和其它关键任务服务器等。 在本发明实施例中, 该 目的服务器与其他服务器构成服务器集群, 以扩展网络设备和服务器的带 宽、 增加吞吐量、 加强网络数据处理能力、 提高网络的灵活性和可用性。 在 服务器集群内部, 各服务器拥有不同的 IP地址(后述内部 IP地址)和端口 (后述内部端口)。并且,该服务器集群具有一个或多个统一的面向外部(例 如, 面向客户端设备 ) 的 IP地址(后述外部 IP地址)和端口 (后述外部端 口)。 The server (including the destination server described above) may be, for example, a web server, an FTP server, an enterprise critical application server, and other mission-critical servers. In the embodiment of the present invention, the destination server and other servers form a server cluster to expand the bandwidth of the network device and the server, increase the throughput, strengthen the network data processing capability, and improve the flexibility and availability of the network. Within the server cluster, each server has a different IP address (internal IP address, which will be described later) and a port (internal port, which will be described later). Also, the server cluster has one or more unified external (e.g., client-facing devices) IP addresses (described later as external IP addresses) and ports (described later as external ports).
负载均衡器(包括用于接收业务的数据报文的网关设备, 以及用于通过 执行各种程序以对该数据报文进行负载均衡的负载均衡处理器 )设置在该服 务器集群与客户端设备之间,可以将大量的并发访问或数据流量分担到多个 服务器上分别处理, 减少客户端设备等待响应的时间, 还可以将单个重负载 的运算分担到多个服务器上做并行处理, 每个节点设备处理结束后, 将结果 汇总, 返回给客户端设备, 使系统处理能力得到大幅度提高。 并且, 负载均 衡器的面向外部的 IP地址和与其连接的服务器集群的面向外部的 IP地址相 同。 A load balancer (a gateway device including a data packet for receiving a service, and a load balancing processor for performing load balancing on the data packet by executing various programs) is disposed in the server cluster and the client device In the meantime, a large amount of concurrent access or data traffic can be shared to multiple servers for processing, reducing the time for the client device to wait for a response, and also sharing the operation of a single heavy load to multiple servers for parallel processing, each node After the device is processed, the results are summarized and returned to the client device, so that the system processing capability is greatly improved. Also, the externally facing IP address of the load balancer is the same as the externally facing IP address of the server cluster to which it is connected.
在本发明实施例中, 例如, 可以通过软件负载均衡解决方案实现负载均 衡, 该软件负载均衡解决方案是指在一个或多个服务器的操作系统上安装一 个或多个附加应用程序来实现负载均衡,如域名系统负载均衡( DNS( Domain Name System ) Load Balance )等,从而,该服务器的处理器通过执行该软件, 实现负载均衡, 相当于负载均衡处理器。 In the embodiment of the present invention, for example, load balancing can be implemented by a software load balancing solution, where one or more additional applications are installed on an operating system of one or more servers to implement load balancing. For example, domain name system load balancing (DNS), the processor of the server implements load balancing by executing the software, which is equivalent to a load balancing processor.
并且, 在本发明实施例中, 该负载均衡器也可以直接安装在服务器和外 部网络间之间, 独立于服务器的操作系统。 Moreover, in the embodiment of the present invention, the load balancer can also be directly installed between the server and the external network, independent of the operating system of the server.
在本发明实施例中,作为负载均衡器的负载均衡方式,可以列举,例如: 1. 网络地址转换( NAT, Network Address Translation )式负载均衡, 即, 负载均衡器重写来自客户端设备的数据报文的目标地址 /源地址,根据预设的 负载均衡算法, 将该修改后的数据报文发送给各服务器; 并且, 来自服务器 的响应数据报文经过负载均衡器时, 负载均衡器重写该响应数据报文的源地 址 /目的地址, 再返回给客户, 完成整个负载调度过程。
2. 直接路由 (DR, Direct Rout ) 式负载均衡, 即, 负载均衡器通过改 写来自客户端设备数据报文的媒体接入控制层( MAC, Media Access Control ) 地址, 将数据报文发送到服务器, 而服务器将响应数据报文根据客户端设备 的 MAC地址直接返回给客户端设备。 In the embodiment of the present invention, as a load balancing manner of the load balancer, for example,: 1. Network Address Translation (NAT), that is, the load balancer rewrites data from the client device. The target address/source address of the packet is sent to each server according to a preset load balancing algorithm; and when the response data packet from the server passes through the load balancer, the load balancer rewrites The source address/destination address of the response data message is returned to the client to complete the entire load scheduling process. 2. Direct routing (DR, Direct Rout) load balancing, that is, the load balancer sends data packets to the server by rewriting the media access control layer (MAC, Media Access Control) address from the client device data message. And the server returns the response data packet directly to the client device according to the MAC address of the client device.
3. IP隧道(TUN, TUNNEL ) 式负载均衡, 即, 负载均衡器将来自客 户端设备数据报文通过 IP 隧道转发给服务器, 而服务器将响应数据报文直 接返回给客户端设备。 3. IP tunnel (TUN, TUNNEL) load balancing, that is, the load balancer forwards data packets from the client device to the server through the IP tunnel, and the server directly returns the response data packet to the client device.
在以上列举的各负载均衡方式中, 负载均衡器可以将一个外部地址映射 为多个内部地址(对应各服务器), 对每次通信连接动态地使用其中一个内 部地址, 达到负载均衡的目的。 应理解, 以上列举的各负载均衡方式仅为示 例性说明, 本发明并不限定于此, 其他用于负载均衡的方式均落入本发明的 保护范围。 In each of the load balancing methods enumerated above, the load balancer can map one external address to multiple internal addresses (corresponding to each server), and dynamically use one of the internal addresses for each communication connection to achieve load balancing. It should be understood that the above-described load balancing modes are merely illustrative, and the present invention is not limited thereto, and other methods for load balancing fall within the scope of protection of the present invention.
因此, 在用户需要访问由服务器集群提供的业务时, 客户端设备可以根 据该服务器集群对外统一的 IP地址和端口 (即, 外部 IP地址和外部端口 ), 发送该业务的首个数据报文(第一数据报文 ), 首先到达负载均衡器(由网 卡设备接收)。 Therefore, when the user needs to access the service provided by the server cluster, the client device can send the first data packet of the service according to the externally unified IP address and port of the server cluster (that is, the external IP address and the external port). The first data message) first arrives at the load balancer (received by the network card device).
在 S110 中, 负载均衡器的网卡设备接收到该第一数据报文, 并且, 该 网卡设备可以将该第一数据报文发送给负载均衡器的负载均衡处理器 (以 下, 为了便于说明, 筒称处理器), 从而, 该处理器可以采用预先设置的负 载均衡算法, 通过上述任意负载均衡方式, 从服务器集群中, 确定该数据报 文的目的服务器。 In S110, the network card device of the load balancer receives the first data packet, and the network card device can send the first data packet to a load balancing processor of the load balancer (hereinafter, for convenience of description, the cartridge The processor is used, so that the processor can determine the destination server of the data packet from the server cluster by using any of the foregoing load balancing algorithms.
在本发明实施例中, 处理器可以根据网络的不同层次(网络七层)来进 行负载均衡,具体地说,可以根据数据报文的 L3/4层信息进行负载均衡(即, 下文所述的情况 1 ), 也可以根据数据报文的 L7层, 或者, L3/4层信息和 L7层信息 (即, 下文所述的情况 2 )进行负载均衡。 In the embodiment of the present invention, the processor may perform load balancing according to different layers of the network (network seven layers), specifically, load balancing according to L3/4 layer information of the data packet (ie, as described below). Case 1), load balancing may also be performed according to the L7 layer of the data message, or the L3/4 layer information and the L7 layer information (i.e., Case 2 described below).
其中, 在本发明实施例中, L3/4层可以包括 L3层, 或 L4层, 或 L3层 和 L4 层。 L3 层信息可以包括开放式系统互联 ( OSI , Open System Interconnect ) 网络模型中的网络层的 IP地址信息, L4层信息可以包括 OSI 网络模型中的传输层的传输控制协议 /用户数据报协议(TCP/UDP, Transfer Control Protocol/ User Datagram Protocol )端口信息。 因此, L3/4层信息可以 包括传输该业务的业务服务器的外部 IP地址(与数据报文的目的 IP地址相
同)、 外部端口 (与数据报文的目的端口相同)等信息。 L7层信息可以包括 应用层信息, 具体地说, 是数据报文携带的 URL地址。 Wherein, in the embodiment of the present invention, the L3/4 layer may include an L3 layer, or an L4 layer, or an L3 layer and an L4 layer. The L3 layer information may include IP address information of a network layer in an Open System Interconnect (OSI) network model, and the L4 layer information may include a Transmission Layer Control Control Protocol/User Datagram Protocol (TCP) in the OSI network model. /UDP, Transfer Control Protocol/ User Datagram Protocol) Port information. Therefore, the L3/4 layer information may include an external IP address of the service server transmitting the service (in relation to the destination IP address of the data packet) Same), external port (same as the destination port of the data packet) and other information. The L7 layer information may include application layer information, specifically, a URL address carried in the data message.
下面, 首先对处理器用于根据数据报文的 L3/4层信息进行负载均衡的 情况(情况 1 )进行说明。 Next, the case where the processor is used for load balancing based on the L3/4 layer information of the data message will be described first.
情况 1 Situation 1
处理器接收到网卡设备发送的第一数据报文后,通过对数据报文的 L3/4 层进行解析, 例如, 对数据报文进行浅层报文探测 (SPI, Shallow Packet Inspection ), 从而获取该数据报文的 L3/4层信息 (例如, 源 IP地址、 目的 IP地址、 源端口和目的端口等), 在本发明实施例中, 处理器根据 L3/4层信 息进行负载均衡处理的方法与现有技术相同, 这里, 为避免赘述, 省略其说 明。 在本发明实施例中, 控制信息作为该负载均衡处理的结果, 例如, 可以 是指示目的服务器的服务器信息。 并且, 在本发明实施例中, 处理器可以根 据负载均衡处理的结果, 直接控制发送设备(例如, 可以是该网卡设备)将 该第一数据报文发送给与该负载均衡处理的结果相对应的目的服务器。 并将 该服务器信息发送给网卡设备。 After receiving the first data packet sent by the network card device, the processor parses the L3/4 layer of the data packet, for example, performs a shallow packet inspection (SPI, Shallow Packet Inspection) on the data packet to obtain the data packet. The L3/4 layer information of the data packet (for example, the source IP address, the destination IP address, the source port, the destination port, and the like), in the embodiment of the present invention, the method for performing load balancing processing by the processor according to the L3/4 layer information It is the same as the prior art, and the description thereof is omitted here to avoid redundancy. In the embodiment of the present invention, the control information is a result of the load balancing process, and may be, for example, server information indicating a destination server. In addition, in the embodiment of the present invention, the processor may directly control, according to the result of the load balancing process, the sending device (for example, the network card device) to send the first data packet to correspond to the result of the load balancing process. The destination server. And send the server information to the NIC device.
可选地, 在本发明实施例中, 该服务器信息可以用于指示该第一数据报 文的目的服务器的内部网际协议 IP地址和内部端口。 Optionally, in the embodiment of the present invention, the server information may be used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data message.
具体地说, 处理器可以将第一数据报文的目的服务器的内部 IP地址和 内部端口下发给网卡设备。 Specifically, the processor can send the internal IP address and the internal port of the destination server of the first data packet to the network card device.
在 S120中, 网卡设备可以从处理器获取该目的服务器的内部 IP地址和 内部端口。 并且, 网卡设备可以接收发送端发送的第二数据报文, 这里, 发 送端可以是上述客户端设备,也可以是服务器,本发明并未特别限定,例如, 在负载均衡器采用 DR式负载均衡或 IP TUN式负载均衡时, 服务器(目的 服务器)返回给客户端设备的报文不通过负载均衡器, 因此, 该第二数据报 文的发送端为客户端设备; 例如, 在负载均衡器采用 NAT式负载均衡时, 由于服务器(目的服务器)返回给客户端设备的报文需要通过负载均衡器, 因此, 该第二数据报文的发送端可以为客户端设备, 也可以为服务器(目的 服务器)。 以下, 以负载均衡器采用 NAT式负载均衡的情况为例进行说明。 In S120, the network card device can obtain an internal IP address and an internal port of the destination server from the processor. In addition, the network card device can receive the second data packet sent by the sending end. Here, the sending end can be the client device or the server, and the present invention is not specifically limited. For example, DR load balancing is adopted in the load balancer. Or IP TUN-type load balancing, the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is a client device; for example, in a load balancer. In the case of the NAT-type load balancing, the server that the server (the destination server) returns to the client device needs to pass the load balancer. Therefore, the sender of the second data packet can be the client device or the server (the destination server). ). Hereinafter, a case where the load balancer adopts NAT-type load balancing will be described as an example.
在 S130, 在接收到第二数据报文后, 网卡设备可以根据该控制信息控 制该第二数据报文的传输。 At S130, after receiving the second data packet, the network card device may control transmission of the second data packet according to the control information.
可选地, 在本发明实施例中, 该服务器信息是根据该第一数据报文的
L3/4层信息确定的, 则 Optionally, in the embodiment of the present invention, the server information is based on the first data packet. If the L3/4 layer information is determined, then
该根据该控制信息, 控制该第二数据报文的传输, 具体为: The controlling the transmission of the second data packet according to the control information is specifically:
当该第二数据报文的五元组与该第一数据报文的五元组相同时,根据该 服务器信息, 向该第一数据报文的目的服务器发送该第二数据报文, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地址、 目的端口和传输层协议号。 When the quintuple of the second data packet is the same as the quintuple of the first data packet, the second data packet is sent to the destination server of the first data packet according to the server information, where The quintuple is the source IP address, source port, destination IP address, destination port, and transport layer protocol number.
具体地说, 一方面, 在发送端为客户端设备时, 如果该第二数据报文的 目的 IP地址、 源 IP地址、 目的端口、 源端口以及传输层协议号(TCP连接 或 UDP连接 )与该第一数据报文的目的 IP地址、 源 IP地址、 目的端口、 源 端口以及传输层协议号 ( TCP连接或 UDP连接)相同, 由于负载均衡处理 器基于 L3/4层信息进行负载均衡处理,对于第二数据报文的处理依据即 L3/4 层信息 (包括该第二数据报文的目的 IP地址、 源 IP地址、 目的端口、 源端 口以及传输层协议号)与对于第一数据报文的处理依据相同,可以确定该第 二数据报文的目的服务器与第一数据报文的目的服务器相同 (即, 第二数据 报文与第一数据报文属于该客户端设备与该目的服务器之间的同一次通信 连接)。 Specifically, on the one hand, when the sending end is a client device, if the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are The destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) of the first data packet are the same. The load balancing processor performs load balancing processing based on the L3/4 layer information. The processing of the second data packet is the L3/4 layer information (including the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet) and the first data packet. The processing of the second data packet is the same as that of the destination server of the first data packet (ie, the second data packet and the first data packet belong to the client device and the destination server) The same communication connection between).
从而, 网卡设备可以将该第二数据报文的目的 IP地址修改为该(第一 数据报文的) 目的服务器的内部 IP地址, 并将该第二数据报文的目的端口 修改为该(第一数据报文的) 目的服务器的内部端口, 以向该(第一数据报 文的) 目的服务器发送该第二数据报文。 Therefore, the network card device can modify the destination IP address of the second data packet to the internal IP address of the destination server (of the first data packet), and modify the destination port of the second data packet to the An internal port of the destination server of the data packet to send the second data packet to the destination server (of the first data message).
以上, 列举了根据数据报文的五元组来确定第一数据报文的目标服务器 与第二数据报文是否属于该客户端设备与该目的服务器之间的同一次通信 连接的实施例, 但本发明并不限定于此, 例如, 如果负载均衡器仅与一个服 务器集群相连接, 且该服务器集群仅有一个统一的外部 IP地址, 则对于到 达该负载均衡器的数据报文, 目的 IP地址和目的端口相同, 因此, 可以仅 判定源 IP地址、 源端口和传输层协议号是否相同即可。 以下, 省略对相同 或相似情况的说明。 The above is an example of determining whether the target server and the second data packet of the first data packet belong to the same communication connection between the client device and the destination server according to the quintuple of the data packet, but The present invention is not limited thereto. For example, if the load balancer is only connected to one server cluster, and the server cluster has only one unified external IP address, the destination IP address for the data packet arriving at the load balancer. It is the same as the destination port. Therefore, it can be determined only whether the source IP address, source port, and transport layer protocol number are the same. Hereinafter, the description of the same or similar cases will be omitted.
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
具体地说, 处理器在根据第一数据报文的 L3/4层信息进行负载均衡处 理(对应 DR式负载均衡或 IP TUN式负载均衡) 并确定目的服务器后, 可
以根据该第一数据报文的 L3/4层信息, 仅生成正方向的控制信息表项。 这里, 正方向是指从客户端设备到服务器的方向, 具体地说, 正方向控 制信息表项可以包括, 例如, 第一数据报文的源 IP地址、 源端口、 目的 IP 地址、 目的端口以及第一数据报文的传输层协议号 (以下, 为了便于说明, 筒称第一五元组)与目的服务器信息 (例如, 包括该目的服务器的 IP地址 和端口) 的对应关系, 从而在 S130, 网卡设备可以根据第二数据报文的源 IP地址、 源端口、 目的 IP地址、 目的端口以及第二数据 文的传输层协议 号 (以下, 为了便于说明, 筒称第二五元组), 查找该控制信息表项, 在该 第二五元组与控制信息表项中记载的第一五元组相同的情况下, 可以确定, 指示该第二数据报文的目的服务器的目的服务器信息为与该第一五元组相 对应的服务器信息。 从而, 网卡设备可以将该第二数据报文的目的 IP地址 修改为该(与第一五元组相对应的控制信息指示的) 目的服务器的 IP地址, 并将该第二数据报文的目的端口修改为该(与第一五元组相对应的控制信息 指示的) 目的服务器的端口, 能够向该(与第一五元组相对应的控制信息指 示的) 目的服务器发送该第二数据报文。 Specifically, after the processor performs load balancing processing (corresponding to DR-type load balancing or IP TUN-type load balancing) according to the L3/4 layer information of the first data packet, and determining the destination server, the processor may The control information table entry in the positive direction is generated only according to the L3/4 layer information of the first data packet. Here, the forward direction refers to the direction from the client device to the server. Specifically, the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and Corresponding relationship between the transport layer protocol number of the first data packet (hereinafter, referred to as the first quintuple for convenience of explanation) and the destination server information (for example, including the IP address and port of the destination server), and thus, at S130, The NIC device may search according to the source IP address, the source port, the destination IP address, the destination port of the second data packet, and the transport layer protocol number of the second data packet (hereinafter, for convenience of description, the second quintuple) The control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple. Therefore, the network card device can modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the purpose of the second data packet. The port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and the second datagram can be sent to the destination server (indicated by the control information corresponding to the first quintuple) Text.
可选地, 在本发明实施例中, 该服务器信息还用于指示该第一数据报文 的目的服务器的外部 IP地址和外部端口, 则 Optionally, in the embodiment of the present invention, the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet,
该根据该控制信息, 控制该第二数据报文的传输, 具体为: The controlling the transmission of the second data packet according to the control information is specifically:
当该第二数据报文的源 IP地址与该目的服务器的内部 IP地址相同, 且 该第二数据报文的源端口与该目的服务器的内部端口信息相同,且该第二数 据报文的目的 IP地址与该第一数据报文的源 IP地址相同, 且该第二数据报 文的目的端口与该第一数据报文的源端口相同,且该第二数据报文的传输层 协议号与该第一数据报文的传输层协议号相同时, 根据该第一数据报文的 目的服务器的外部 IP地址和外部端口, 控制该发送单元向该客户端设备发 送该第二数据报文。 The source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the destination of the second data packet is The IP address is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the transport layer protocol number of the second data packet is When the transport layer protocol number of the first data packet is the same, the sending unit controls the sending unit to send the second data packet to the client device according to the external IP address of the destination server of the first data packet and the external port.
具体地说, 在发送端为服务器时(对应 NAT式负载均衡), 如果该第二 数据报文的目的 IP地址与第一数据报文的源 IP地址相同, 该第二数据报文 的源 IP地址与处理器在对第一数据进行均衡处理后确定的目的服务器的内 部 IP地址相同, 该第二数据报文的目的端口与第一数据报文的源 IP地址相 同, 该第二数据报文的源端口与处理器在对第一数据进行均衡处理后确定的 目的服务器的内部端口相同,以及第二数据报文传输层协议号与该第一数据
报文的传输层协议号相同, 由于负载均衡处理器基于 L3/4层信息进行负载 均衡处理, 可以确定该第二数据报文是目的服务器生成的与该第一数据报文 相对应的响应数据报文(即, 第二数据报文与第一数据报文属于该客户端设 备与该目的服务器之间的同一次通信连接)。 Specifically, when the sending end is a server (corresponding to NAT-type load balancing), if the destination IP address of the second data packet is the same as the source IP address of the first data packet, the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized. The destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet. The source port is the same as the internal port of the destination server determined by the processor after equalizing the first data, and the second data packet transport layer protocol number and the first data The transport layer protocol number of the packet is the same. The load balancing processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is the response data generated by the destination server and corresponding to the first data packet. The message (ie, the second data message and the first data message belong to the same communication connection between the client device and the destination server).
从而, 网卡设备可以将该第二数据报文的源 IP地址修改为目的服务器 的外部 IP地址(与该第一数据报文的目的 IP地址相同 ),并将该第二数据报 文的源端口修改为目的服务器的外部端口(与该第一数据报文的目的端口相 同 ), 以向该(发送第一数据报文的)客户端设备发送该第二数据报文。 Therefore, the network card device can modify the source IP address of the second data packet to be the external IP address of the destination server (same as the destination IP address of the first data packet), and the source port of the second data packet. The external port of the destination server is the same as the destination port of the first data packet, and the second data packet is sent to the client device that sends the first data packet.
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
该服务器信息包括第二控制信息表项,该第二控制信息表项用于指示该 第一数据报文的目的服务器的内部 IP地址、 该第一数据报文的目的服务器 的内部端口、 该第一数据 文的源 IP地址、 该第一数据 ^艮文的源端口以及 该第一数据报文的传输层协议号与该第一数据报文的目的服务器的外部 IP 地址和外部端口的对应关系。 The server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, and the The source IP address of the data packet, the source port of the first data packet, and the correspondence between the transport layer protocol number of the first data packet and the external IP address and the external port of the destination server of the first data packet .
具体地说, 处理器在根据第一数据报文的 L3/4层信息进行负载均衡处 理(NAT 式负载均衡) 并确定目的服务器后, 可以根据该第一数据报文的 L3/4层信息, 生成正反两个方向的控制信息表项。 Specifically, after performing load balancing processing (NAT-type load balancing) according to the L3/4 layer information of the first data packet and determining the destination server, the processor may be configured according to the L3/4 layer information of the first data packet. Generate control information entries in both forward and reverse directions.
这里, 正方向是指从客户端设备到服务器的方向, 具体地说, 正方向控 制信息表项可以包括, 例如, 第一数据报文的源 IP地址、 源端口、 目的 IP 地址、 目的端口以及第一数据报文的传输层协议号 (以下, 为了便于说明, 筒称第一五元组)与目的服务器信息 (例如, 包括该目的服务器的 IP地址 和端口) 的对应关系, 从而网卡设备可以根据第二数据 ^艮文的源 IP地址、 源端口、 目的 IP地址、 目的端口以及第二数据报文的传输层协议号(以下, 为了便于说明, 筒称第二五元组), 查找该控制信息表项, 在该第二五元组 与控制信息表项中记载的第一五元组相同的情况下, 可以确定, 指示该第二 数据报文的目的服务器的目的服务器信息为与该第一五元组相对应的服务 器信息。从而, 网卡设备可以将该第二数据报文的目的 IP地址修改为该(与 第一五元组相对应的控制信息指示的) 目的服务器的 IP地址, 并将该第二 数据报文的目的端口修改为该(与第一五元组相对应的控制信息指示的 ) 目
的服务器的端口, 能够向该(与第一五元组相对应的控制信息指示的) 目的 服务器发送该第二数据报文。 Here, the forward direction refers to the direction from the client device to the server. Specifically, the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The correspondence between the transport layer protocol number of the first data packet (hereinafter, for convenience of description, the first quintuple) and the destination server information (for example, including the IP address and port of the destination server), so that the network card device can According to the source IP address of the second data, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet (hereinafter, for convenience of description, the cartridge is called the second quintuple), The control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple. Therefore, the network card device can modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the purpose of the second data packet. The port is modified to this (indicated by the control information corresponding to the first quintuple) The port of the server is capable of transmitting the second data message to the destination server (indicated by the control information corresponding to the first quintuple).
这里, 反方向是指从服务器到客户端设备的方向, 具体地说, 反方向控 制信息表项可以包括, 例如, 目的服务器的内部 IP地址、 目的服务器的内 部端口、 第一数据报文的源 IP地址、 第一数据报文的源端口以及第一数据 报文的传输层协议号(以下, 为了便于说明, 筒称第三五元组)与第一数据 报文的目的 IP地址(与目的服务器的外部 IP地址相同)、第一数据报文的目 的端口 (与目的服务器的外部端口相同)的对应关系, 从而, 网卡设备可以 根据第二数据 4艮文的源 IP地址、 源端口、 目的 IP地址、 目的端口以及第二 数据报文的传输层协议号 (上述第二五元组), 查找该控制信息表项, 在该 第二五元组与控制信息表项中记载的第三五元组相同的情况下, 可以确定, 发送该第二数据报文的服务器为与该第一五元组相对应的第一数据报文的 目的服务器。 从而, 网卡设备可以将该第二数据报文的源 IP地址修改为该 控制信息表项指示的与第三五元组相对应的第一数据报文的目的 IP地址(与 目的服务器的外部 IP地址相同 ), 并将该第二数据报文的目的端口修改为该 控制信息表项指示的与第一五元组相对应的第一数据报文的目的端口(与目 的服务器的外部端口相同), 从而能够向该 (发送第一数据报文的)客户端 设备发送该第二数据报文。 Here, the reverse direction refers to the direction from the server to the client device. Specifically, the reverse direction control information entry may include, for example, an internal IP address of the destination server, an internal port of the destination server, and a source of the first data packet. The IP address, the source port of the first data packet, and the transport layer protocol number of the first data packet (hereinafter, for convenience of description, the third quintuple) and the destination IP address of the first data packet (and purpose) The server has the same external IP address, and the destination port of the first data packet (same as the external port of the destination server), so that the network card device can use the source IP address, source port, and destination of the second data. The IP address, the destination port, and the transport layer protocol number of the second data packet (the second quintuple), and the control information entry, the third five recorded in the second quintuple and the control information entry. If the tuple is the same, the server that sends the second data packet is the first data packet corresponding to the first quintuple. The destination server. Therefore, the network card device can modify the source IP address of the second data packet to the destination IP address of the first data packet corresponding to the third quintuple indicated by the control information entry (with the external IP address of the destination server) The destination port of the second data packet is modified to be the destination port of the first data packet corresponding to the first quintuple (the same as the external port of the destination server) indicated by the control information entry. Therefore, the second data packet can be sent to the client device that sends the first data packet.
以上列举了根据第二数据报文的源 IP地址、 源端口、 目的 IP地址、 目 的端口以及第二数据报文的传输层协议号,确定能够根据该控制信息控制该 第二数据报文的传输, 应理解, 本发明并不限定于此, 其他判定是否能够根 据该控制信息控制该第二数据报文的传输的方法(例如, 确定第一数据报文 与第二数据报文属于同一客户端设备与同一服务器之间的同一次通信连接 的方法), 均落入本发明的保护范围内。 以下, 省略对相同或相似情况的说 明。 The above determines that the second data packet can be controlled according to the control information according to the source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet. It should be understood that the present invention is not limited thereto, and other methods for determining whether the second data message can be transmitted according to the control information (for example, determining that the first data message and the second data message belong to the same client) The method of the same communication connection between the device and the same server) falls within the scope of the present invention. Hereinafter, the description of the same or similar cases will be omitted.
可选地, 在本发明实施例中, 在接收到该控制信息表项后, 该方法还包 括: Optionally, in the embodiment of the present invention, after receiving the control information entry, the method further includes:
在接收到该第一控制信息表项后, 启动定时器, 并确定在该定时器超时 之前未接收到该第二数据报文; 或 After receiving the first control information entry, starting a timer, and determining that the second data message is not received before the timer expires; or
确定在该客户端设备和该第一数据报文的目的服务器之间建立的用于 传输该第一数据报文的通信连接结束;
删除该第一控制信息表项。 Determining that the communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet ends; Delete the first control information entry.
并且, 该方法还包括: And, the method further includes:
在接收到该第二控制信息表项后, 启动定时器, 并确定在该定时器超时 之前未接收到该第二数据报文; 或 After receiving the second control information entry, starting a timer, and determining that the second data message is not received before the timer expires; or
确定在该客户端设备和该第一数据报文的目的服务器之间建立的用于 传输该第一数据报文的通信连接结束; Determining that the communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet ends;
删除该第二控制信息表项。 The second control information entry is deleted.
具体地说, 网卡设备在从处理器获取控制信息表项(包括第一控制信息 表项和第二控制信息表项)后, 在长时间 (定时器超时后, 例如, 30分钟) 未接收到能够根据该控制信息表项包括的控制信息进行传输的数据报文(例 如, 上述第二数据报文), 可以认为第一数据报文所属通信连接已结束, 从 而可以删除该控制信息表项(包括第一控制信息表项和第二控制信息表项)。 Specifically, after acquiring the control information entry (including the first control information entry and the second control information entry) from the processor, the network card device does not receive the message after a long time (for example, 30 minutes after the timer expires). The data packet that can be transmitted according to the control information included in the control information table (for example, the second data packet) can be considered as having ended the communication connection of the first data packet, so that the control information entry can be deleted ( The first control information table item and the second control information table item are included.
并且, 网卡设备在从处理器获取控制信息表项(包括第一控制信息表项 和第二控制信息表项)后, 检测到指示通信连接结束的数据报文后, 可以认 为第一数据报文所属通信连接已结束, 从而可以删除该控制信息表项(包括 第一控制信息表项和第二控制信息表项)。 以下, 省略对相同或相似情况的 说明。 And after the network card device obtains the control information entry (including the first control information entry and the second control information entry) from the processor, after detecting the data packet indicating the end of the communication connection, the network data device can consider the first data packet. The associated communication connection has been completed, so that the control information entry (including the first control information entry and the second control information entry) can be deleted. Hereinafter, the description of the same or similar cases will be omitted.
下面, 对处理器根据数据报文的 L7层信息, 或者, L3/4层信息和 L7 层信息进行负载均衡的情况(情况 2 )进行说明。 The following describes the case where the processor performs load balancing according to the L7 layer information of the data packet, or the L3/4 layer information and the L7 layer information (case 2).
情况 2 Situation 2
处理器接收到网卡设备发送的第一数据报文后,通过对数据报文的 L3/4 层进行解析, 例如, 对数据报文进行浅层报文探测 (SPI, Shallow Packet Inspection ), 从而获取该数据报文的 L3/4层信息 (例如, 源 IP地址、 目的 IP地址、 源端口和目的端口等), 并且, 通过对数据 文的 L7层进行解析, 例如, 对数据 文进行深层 文探测 (DPI, Deep Packet Inspection ), 从而 获取该数据报文的 L7层信息 (例如, 该数据报文的 URL等)。 After receiving the first data packet sent by the network card device, the processor parses the L3/4 layer of the data packet, for example, performs a shallow packet inspection (SPI, Shallow Packet Inspection) on the data packet to obtain the data packet. L3/4 layer information of the data packet (for example, source IP address, destination IP address, source port, destination port, etc.), and by parsing the L7 layer of the data text, for example, deep-text detection of the data text (DPI, Deep Packet Inspection), thereby obtaining L7 layer information of the data packet (for example, the URL of the data packet, etc.).
在本发明实施例中, 可能存在第一数据报文的 L7层信息为空 (即, 不 存在 URL等 )的情况, 此时, 处理器仅根据 L3/4层信息进行负载均衡处理, 并且该根据 L3/4层信息进行负载均衡处理的方法与现有技术相同, 这里, 为避免赘述, 省略其说明。 In the embodiment of the present invention, there may be a case where the L7 layer information of the first data packet is empty (that is, there is no URL or the like). At this time, the processor performs load balancing processing only according to the L3/4 layer information, and the The method of performing load balancing processing based on the L3/4 layer information is the same as that of the prior art, and the description thereof is omitted here to avoid redundancy.
并且, 在第一数据报文的 L7层信息不为空(即, 存在 URL等)的情况
下,处理器可以根据 L7层信息进行负载均衡处理, 并且该根据 L7层信息进 行负载均衡处理的方法与现有技术相同, 这里, 为避免赘述, 省略其说明。 And, in the case where the L7 layer information of the first data message is not empty (ie, there is a URL or the like) The processor may perform load balancing processing according to the L7 layer information, and the method for performing load balancing processing according to the L7 layer information is the same as the prior art. Here, in order to avoid redundancy, the description thereof is omitted.
在本发明实施例中, 控制信息作为该负载均衡处理的结果, 例如, 可以 包括指示目的服务器的服务器信息, 以及指示网卡设备需要对后续数据报文 指示标识。并且,在本发明实施例中,处理器可以根据负载均衡处理的结果, 直接控制发送设备 (例如, 可以是该网卡设备)将该第一数据报文发送给与 该负载均衡处理的结果相对应的目的服务器。 并将该控制信息发送给网卡设 备。 In the embodiment of the present invention, the control information, as a result of the load balancing process, may include, for example, server information indicating the destination server, and indicating that the network card device needs to indicate the subsequent data packet. In addition, in the embodiment of the present invention, the processor may directly control, according to the result of the load balancing process, the sending device (for example, the network card device) to send the first data packet to correspond to the result of the load balancing process. The destination server. And send this control information to the NIC device.
可选地, 在本发明实施例中, 该服务器信息可以用于指示该目的服务器 的内部 IP地址和内部端口。 Optionally, in the embodiment of the present invention, the server information may be used to indicate an internal IP address and an internal port of the destination server.
具体地说, 处理器可以将第一数据报文的目的服务器的内部 IP地址和 内部端口下发给网卡设备。 Specifically, the processor can send the internal IP address and the internal port of the destination server of the first data packet to the network card device.
在 S120' 中, 网卡设备可以从处理器获取该目的服务器的 IP地址、 端 口以及 L7层解析指示标识。 并且, 网卡设备可以接收发送端发送的第二数 据报文, 这里, 发送端可以是上述客户端设备, 也可以是服务器, 本发明并 未特别限定, 例如, 在负载均衡器采用 DR式负载均衡或 IP TUN式负载均 衡时, 服务器(目的服务器)返回给客户端设备的报文不通过负载均衡器, 因此, 该第二数据报文的发送端为客户端设备; 例如, 在负载均衡器采用 NAT式负载均衡时, 由于服务器(目的服务器)返回给客户端设备的报文需 要通过负载均衡器, 因此, 该第二数据报文的发送端可以为客户端设备, 也 可以为服务器(目的服务器)。 以下, 以负载均衡器采用 NAT式负载均衡的 情况为例进行说明。 In S120', the network card device can obtain the IP address, the port, and the L7 layer resolution indication identifier of the destination server from the processor. In addition, the network card device can receive the second data packet sent by the sending end. Here, the sending end can be the client device or the server, and the present invention is not particularly limited. For example, DR load balancing is adopted in the load balancer. Or IP TUN-type load balancing, the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is a client device; for example, in a load balancer. In the case of the NAT-type load balancing, the server that the server (the destination server) returns to the client device needs to pass the load balancer. Therefore, the sender of the second data packet can be the client device or the server (the destination server). ). Hereinafter, a case where the load balancer adopts NAT-type load balancing will be described as an example.
在 S130' 中, 在接收到第二数据报文后, 网卡设备可以根据该控制信 息控制控制该第二数据报文的传输。 In S130', after receiving the second data packet, the network card device can control the transmission of the second data packet according to the control information.
可选地, 在本发明实施例中, 该服务器信息是根据该第一数据报文的 L3/4层信息和 L7层信息确定的, 或 Optionally, in the embodiment of the present invention, the server information is determined according to L3/4 layer information and L7 layer information of the first data packet, or
且该控制信息还包括 L7层解析指示标识, 贝' J And the control information further includes an L7 layer resolution indication identifier, and the shell
该根据该控制信息, 控制该第二数据报文的传输, 具体为: The controlling the transmission of the second data packet according to the control information is specifically:
当该第二数据报文的五元组与该第一数据报文的五元组相同时,根据该 When the quintuple of the second data packet is the same as the quintuple of the first data packet, according to the
L7层解析指示标识, 对该第二数据报文进行 L7层信息解析, 以获取用于指
示该第二数据报文的目的服务器的统一资源定位器 URL地址的 URL信息, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地址、 目的端口和传输层协 议号; The L7 layer parses the indication identifier, and performs L7 layer information parsing on the second data packet to obtain a URL information of a Uniform Resource Locator URL address of the destination server of the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number;
如果该 URL信息不为空, 则向该负载均衡处理器发送该第二数据报文 和该 URL信息, 以便于该负载均衡处理器根据该 URL信息, 确定该第二数 据报文的目的服务器, 并向该第二数据报文的目的服务器发送该第二数据报 文; 或 If the URL information is not empty, sending the second data packet and the URL information to the load balancing processor, so that the load balancing processor determines the destination server of the second data packet according to the URL information, And sending the second data packet to the destination server of the second data packet; or
如果该 URL信息为空, 则根据该服务器信息, 向该第一数据报文的目 的服务器发送该第二数据报文。 If the URL information is empty, the second data message is sent to the destination server of the first data message according to the server information.
具体地说, 一方面, 在发送端为客户端设备时, 如果该第二数据报文的 目的 IP地址、 源 IP地址、 目的端口、 源端口以及传输层协议号( TCP连接 或 UDP连接 )与该第一数据报文的目的 IP地址、 源 IP地址、 目的端口、 源 端口以及传输层协议号 ( TCP连接或 UDP连接)相同, 由于负载均衡处理 器基于 L3/4层信息进行负载均衡处理,对于第二数据报文的处理依据即 L3/4 层信息 (包括该第二数据报文的目的 IP地址、 源 IP地址、 目的端口、 源端 口以及传输层协议号)与对于第一数据报文的处理依据相同,可以确定该第 二数据报文的目的服务器与第一数据报文的目的服务器相同 (即, 第二数据 报文与第一数据报文属于该客户端设备与该目的服务器之间的同一次通信 连接)。 Specifically, on the one hand, when the transmitting end is a client device, if the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are The destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) of the first data packet are the same. The load balancing processor performs load balancing processing based on the L3/4 layer information. The processing of the second data packet is the L3/4 layer information (including the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet) and the first data packet. The processing of the second data packet is the same as that of the destination server of the first data packet (ie, the second data packet and the first data packet belong to the client device and the destination server) The same communication connection between).
从而, 网卡设备可以根据 L7层解析指示标识, 获取第二数据报文的 L7 层信息,即,第二数据报文的 URL地址。如果能够获取第二数据报文的 URL 地址, 则向处理器发送该第二数据报文以及该 URL地址, 从而, 处理器无 需对该第二数据报文进行 L7层解析,可以直接根据该 URL地址进行负载均 衡处理, 在本发明实施例中, 由于解析 URL的过程由网卡设备进行, 即通 过硬件解析, 与通过处理器利用软件解析的方式相比, 提高了解析速度, 并 降低了对处理器的负担。 处理器在根据 URL确定该第二数据报文的目的服 务器后(可能与第一数据报文的目的服务器相同, 也可能与第一数据报文的 目的服务器相异), 可以通过发送设备(例如, 该网关设备), 发送该第二数 据报文。 Therefore, the NIC device can obtain the L7 layer information of the second data packet, that is, the URL address of the second data packet, according to the L7 layer resolution indication identifier. If the URL address of the second data packet is obtained, the second data packet and the URL address are sent to the processor, so that the processor does not need to perform L7 layer parsing on the second data packet, and can directly according to the URL. The address is subjected to load balancing processing. In the embodiment of the present invention, since the process of parsing the URL is performed by the network card device, that is, by hardware analysis, the parsing speed is improved and the processing is reduced compared with the manner of using the software to parse by the processor. The burden of the device. After the processor determines the destination server of the second data packet according to the URL (may be the same as the destination server of the first data packet, or may be different from the destination server of the first data packet), the processor may be configured by using a sending device (for example, , the gateway device), sending the second data packet.
另外, 如果不能获取第二数据报文的 URL地址(第二数据报文的 L7层 信息为空), 则可以根据该服务器信息, 发送该第二数据报文, 该过程与网
卡设备 S130中执行的过程相同, 这里省略其说明。 In addition, if the URL address of the second data packet cannot be obtained (the L7 layer information of the second data packet is empty), the second data packet may be sent according to the server information, the process and the network. The process performed in the card device S130 is the same, and the description thereof is omitted here.
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
具体地说, 处理器在根据第一数据报文的 L3/4层信息进行负载均衡处 理(对应 DR式负载均衡或 IP TUN式负载均衡) 并确定目的服务器后, 可 以根据该第一数据报文的 L3/4层信息, 仅生成上述正方向的控制信息表项。 Specifically, after performing load balancing processing (corresponding to DR-type load balancing or IP TUN-type load balancing) according to the L3/4 layer information of the first data packet, and determining the destination server, the processor may be configured according to the first data packet. The L3/4 layer information only generates the control information entries in the above positive direction.
可选地, 在本发明实施例中, 该服务器信息还用于指示该第一数据报文 的目的服务器的外部 IP地址和外部端口, 则 Optionally, in the embodiment of the present invention, the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet,
该根据该控制信息, 控制该第二数据报文的传输, 具体为: The controlling the transmission of the second data packet according to the control information is specifically:
当该第二数据报文的源 IP地址与该目的服务器的内部 IP地址相同, 且 该第二数据报文的源端口与该目的服务器的内部端口信息相同,且该第二数 据报文的目的 IP地址与该第一数据报文的源 IP地址相同, 且该第二数据报 文的目的端口与该第一数据报文的源端口相同,且该第二数据报文的传输层 协议号与该第一数据报文的传输层协议号相同时, 根据该第一数据报文的 目的服务器的外部 IP地址和外部端口, 控制该发送单元发送该第二数据报 文。 The source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the destination of the second data packet is The IP address is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the transport layer protocol number of the second data packet is When the transport layer protocol number of the first data packet is the same, the sending unit controls the sending unit to send the second data packet according to the external IP address of the destination server of the first data packet and the external port.
具体地说, 在发送端为服务器时(对应 NAT式负载均衡), 如果该第二 数据报文的目的 IP地址与第一数据报文的源 IP地址相同, 该第二数据报文 的源 IP地址与处理器在对第一数据进行均衡处理后确定的目的服务器的内 部 IP地址相同, 该第二数据报文的目的端口与第一数据报文的源 IP地址相 同, 该第二数据报文的源端口与处理器在对第一数据进行均衡处理后确定的 目的服务器的内部端口相同,以及第二数据报文的传输层协议号与该第一数 据报文的传输层协议号相同, 由于负载均衡处理器基于 L3/4层信息进行负 载均衡处理, 可以确定该第二数据报文是目的服务器生成的与该第一数据报 文相对应的响应数据报文(即, 第二数据报文与第一数据报文属于该客户端 设备与该目的服务器之间的同一次通信连接)。 Specifically, when the sending end is a server (corresponding to NAT-type load balancing), if the destination IP address of the second data packet is the same as the source IP address of the first data packet, the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized. The destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet. The source port is the same as the internal port of the destination server determined by the processor after the first data is equalized, and the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet, The load balancing processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server (that is, the second data packet) And the first data message belongs to the same communication connection between the client device and the destination server).
从而, 网卡设备可以将该第二数据报文的源 IP地址修改为目的服务器 的外部 IP地址(与该第一数据报文的目的 IP地址相同 ),并将该第二数据报 文的源端口修改为目的服务器的外部端口(与该第一数据报文的目的端口相 同), 以向该(发送第一数据报文的)客户端设备发送该第二数据报文。
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Therefore, the network card device can modify the source IP address of the second data packet to be the external IP address of the destination server (same as the destination IP address of the first data packet), and the source port of the second data packet. The external port of the destination server is the same as the destination port of the first data packet, and the second data packet is sent to the client device that sends the first data packet. Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
该服务器信息包括第二控制信息表项,该第二控制信息表项用于指示该 第一数据报文的目的服务器的内部 IP地址、 该第一数据报文的目的服务器 的内部端口、 该第一数据 文的源 IP地址、 该第一数据 4艮文的源端口以及 该第一数据报文的传输层协议号与该第一数据报文的目的服务器的外部 IP 地址和外部端口的对应关系。 The server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, and the The source IP address of the data, the source port of the first data, and the correspondence between the transport layer protocol number of the first data packet and the external IP address and the external port of the destination server of the first data packet .
具体地说, 处理器在根据第一数据报文的 L3/4层信息进行负载均衡处 理(NAT 式负载均衡) 并确定目的服务器后, 可以根据该第一数据报文的 L3/4层信息, 生成上述正反两个方向的控制信息表项。 Specifically, after performing load balancing processing (NAT-type load balancing) according to the L3/4 layer information of the first data packet and determining the destination server, the processor may be configured according to the L3/4 layer information of the first data packet. The control information entry in the forward and reverse directions is generated.
可选地, 如上所述, 在本发明实施例中, 在接收到该控制信息表项后, 该方法还包括: Optionally, as described above, in the embodiment of the present invention, after receiving the control information entry, the method further includes:
在接收到该第一控制信息表项后, 启动定时器, 并确定在该定时器超时 之前未接收到该第二数据报文; 或 After receiving the first control information entry, starting a timer, and determining that the second data message is not received before the timer expires; or
确定在该客户端设备和该第一数据报文的目的服务器之间建立的用于 传输该第一数据报文的通信连接结束; Determining that the communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet ends;
删除该第一控制信息表项。 Delete the first control information entry.
并且, 该方法还包括: And, the method further includes:
在接收到该第二控制信息表项后, 启动定时器, 并确定在该定时器超时 之前未接收到该第二数据报文; 或 After receiving the second control information entry, starting a timer, and determining that the second data message is not received before the timer expires; or
确定在该客户端设备和该第一数据报文的目的服务器之间建立的用于 传输该第一数据报文的通信连接结束; Determining that the communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet ends;
删除该第二控制信息表项。 The second control information entry is deleted.
应理解, 在以上实施例中, 已对负载均衡器采用 NAT式负载均衡的实 施例进行了说明, 但本发明并不在于此, 例如, 负载均衡器还可以采用 DR 式负载均衡或 IP TUN式负载均衡, 此时, 服务器(目的服务器)返回给客 户端设备的报文不通过负载均衡器, 因此, 该第二数据报文的发送端为客户 端设备。 It should be understood that in the foregoing embodiment, the embodiment in which the load balancer adopts NAT-type load balancing has been described, but the present invention is not limited thereto. For example, the load balancer may also adopt the DR-type load balancing or the IP TUN type. Load balancing. At this time, the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is the client device.
根据本发明实施例的控制数据传输的方法,通过负载均衡处理器根据第 一数据报文确定控制信息, 并向网卡设备下发该控制信息, 网卡设备在接收
到第二数据报文并确定能够根据该控制信息传输该第二数据报文后, 可以根 据该控制信息直接向目的服务器发送该第二数据报文, 或者, 可以获取该第 二数据报文中 URL信息并通知负载均衡处理器以使负载均衡处理器无需对 第二数据报文进行解析,从而,减少负载均衡处理器的处理,提高访问速度, 减小负载均衡处理器的负担。 According to the method for controlling data transmission according to the embodiment of the present invention, the load balancing processor determines the control information according to the first data packet, and sends the control information to the network card device, where the network card device receives After the second data packet is sent to the second data packet, the second data packet can be directly sent to the destination server according to the control information, or the second data packet can be obtained in the second data packet. The URL information notifies the load balancing processor that the load balancing processor does not need to parse the second data packet, thereby reducing the processing of the load balancing processor, improving the access speed, and reducing the load of the load balancing processor.
上文中, 结合图 1 , 详细描述了根据本发明实施例的控制数据传输的方 法, 下面将结合图 2, 详细描述根据本发明实施例的控制数据传输的装置。 Hereinabove, a method of controlling data transmission according to an embodiment of the present invention is described in detail with reference to FIG. 1, and an apparatus for controlling data transmission according to an embodiment of the present invention will be described in detail below with reference to FIG.
图 2示出了根据本发明实施例的控制数据传输的装置 200 的示意性框 图。 如图 2所示, 该装置 200包括: Figure 2 shows a schematic block diagram of an apparatus 200 for controlling data transmission in accordance with an embodiment of the present invention. As shown in Figure 2, the apparatus 200 includes:
发送单元 210, 用于向负载均衡处理器发送来自客户端设备的第一数据 报文; The sending unit 210 is configured to send, to the load balancing processor, the first data packet from the client device.
接收单元 220, 用于接收该负载均衡处理器发送的控制信息, 以及向处 理单元 230传输该控制信息, 其中, 该控制信息是该负载均衡处理器根据该 第一数据报文的 L3/4层信息和 /或该第一数据报文的 L7层信息确定的,该控 制信息包括用于指示该第一数据报文的目的服务器的服务器信息; The receiving unit 220 is configured to receive the control information sent by the load balancing processor, and transmit the control information to the processing unit 230, where the control information is the L3/4 layer of the first data packet by the load balancing processor. Determining information and/or L7 layer information of the first data message, the control information including server information indicating a destination server of the first data message;
用于当接收到第二数据报文时, 向处理单元 230传输该第二数据报文; 处理单元 230, 用于从该接收单元 220获取该控制信息和该第二数据报 文, 并根据该控制信息, 控制该发送单元传输该第二数据报文; For transmitting the second data message to the processing unit 230 when receiving the second data message; the processing unit 230 is configured to obtain the control information and the second data message from the receiving unit 220, and according to the Controlling information, controlling the sending unit to transmit the second data packet;
用于根据该控制信息, 控制该发送单元 210传输该第二数据报文。 And configured to control the sending unit 210 to transmit the second data packet according to the control information.
具体地说, 在用户需要访问由服务器集群提供的业务时, 客户端设备可 以根据该服务器集群对外统一的 IP地址和端口 (即, 外部 IP地址和外部端 口), 发送该业务的首个数据报文(第一数据报文), 该数据报文首先到达负 载均衡器(由网卡设备接收)。 网卡设备的接收单元 220可以接收该第一数 据报文, 并且, 该网卡设备的发送单元 210可以将该第一数据报文发送给负 载均衡器的负载均衡处理器(以下, 为了便于说明, 筒称处理器), 从而, 该处理器可以采用预先设置的算法, 通过上述任意负载均衡方式, 从服务器 集群中, 确定该数据报文的目的服务器。 Specifically, when the user needs to access the service provided by the server cluster, the client device may send the first datagram of the service according to the externally unified IP address and port of the server cluster (ie, the external IP address and the external port). Text (first data message), the data message first arrives at the load balancer (received by the network card device). The receiving unit 220 of the network card device can receive the first data packet, and the sending unit 210 of the network card device can send the first data packet to the load balancing processor of the load balancer (hereinafter, for convenience of description, the cartridge Referring to the processor, the processor can determine the destination server of the data packet from the server cluster by using any of the foregoing load balancing methods.
处理器可以根据网络的不同层次(网络七层)来进行负载均衡, 具体地 说, 可以根据数据报文的 L3/4层进行负载均衡, 也可以根据数据报文的 L7 层进行负载均衡。 The processor can perform load balancing according to different layers of the network (network seven layers). Specifically, load balancing can be performed according to the L3/4 layer of the data packet, or load balancing can be performed according to the L7 layer of the data packet.
其中, 在本发明实施例中, L3/4层可以包括 L3层, 或 L4层, 或 L3层
和 L4层。 L3层信息可以包括 OSI网络模型中的网络层的 IP地址信息, L4 层信息可以包括 OSI网络模型中的 TCP/UDP端口信息。 因此, L3/4层信息 可以包括传输该业务的业务服务器的 IP地址、 端口等信息。 L7层信息可以 包括应用层信息, 具体地说, 是数据报文携带的 URL地址。 In the embodiment of the present invention, the L3/4 layer may include an L3 layer, or an L4 layer, or an L3 layer. And L4 layer. The L3 layer information may include IP address information of a network layer in the OSI network model, and the L4 layer information may include TCP/UDP port information in the OSI network model. Therefore, the L3/4 layer information may include information such as an IP address, a port, and the like of a service server that transmits the service. The L7 layer information may include application layer information, specifically, a URL address carried in the data message.
下面, 首先对处理器用于根据数据报文的 L3/4层信息进行负载均衡的 情况进行说明。 Next, the case where the processor is used for load balancing based on the L3/4 layer information of the data message will be described first.
处理器接收到网卡设备发送的第一数据报文后,通过对数据报文的 L3/4 层进行解析, 例如, 对数据报文进行 SPI, 从而获取该数据报文的 L3/4层信 息 (例如, 源 IP地址、 目的 IP地址、 源端口和目的端口等), 在本发明实施 例中, 处理器根据 L3/4层信息进行负载均衡处理的方法与现有技术相同, 这里, 为避免赘述, 省略其说明。 在本发明实施例中, 作为该负载均衡处理 的结果, 例如, 控制信息可以是指示目的服务器的服务器信息。 并且, 在本 发明实施例中,处理器可以根据负载均衡处理的结果,直接控制发送设备(例 如, 可以是该网卡设备)将该第一数据报文发送给与该负载均衡处理的结果 相对应的目的服务器。 并将该服务器信息发送给网卡设备。 After receiving the first data packet sent by the network card device, the processor parses the L3/4 layer of the data packet, for example, performs SPI on the data packet to obtain L3/4 layer information of the data packet ( For example, the source IP address, the destination IP address, the source port, the destination port, and the like, in the embodiment of the present invention, the method for the processor to perform load balancing processing according to the L3/4 layer information is the same as the prior art, where , the description is omitted. In the embodiment of the present invention, as a result of the load balancing process, for example, the control information may be server information indicating a destination server. In addition, in the embodiment of the present invention, the processor may directly control, according to the result of the load balancing process, the sending device (for example, the network card device) to send the first data packet to correspond to the result of the load balancing process. The destination server. And send the server information to the network card device.
在本发明实施例中, 该服务器信息用于指示该第一数据报文的目的服务 器的内部网际协议 IP地址和内部端口。 In the embodiment of the present invention, the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data packet.
并且, 可选地, 在本发明实施例中, 该服务器信息是根据该第一数据报 文的 L3/4层信息确定的则 In addition, in the embodiment of the present invention, the server information is determined according to the L3/4 layer information of the first data packet.
该处理单元 230具体用于当该第二数据 文的五元组与该第一数据 4艮文 的五元组相同时, 根据该服务器信息, 控制该发送单元向该第一数据报文的 目的服务器发送该第二数据报文, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地址、 目的端口和传输层协议号。 The processing unit 230 is specifically configured to control, according to the server information, the purpose of the sending unit to the first data packet when the quintuple of the second data text is the same as the quintuple of the first data file The server sends the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
具体地说, 处理器可以将目的服务器的内部 IP地址和内部端口下发给 网卡设备。 内部的内部 IP地址和内部端口。 其后, 网卡设备的接收单元 220可以接收 发送端发送的第二数据报文, 这里, 发送端可以是上述客户端设备, 也可以 是服务器, 本发明并未特别限定, 例如, 在负载均衡器采用 DR式负载均衡 或 IP TUN式负载均衡时, 服务器(目的服务器)返回给客户端设备的报文 不通过负载均衡器, 因此, 该第二数据报文的发送端为客户端设备; 例如,
在负载均衡器采用 NAT式负载均衡时, 由于服务器(目的服务器)返回给 客户端设备的报文需要通过负载均衡器, 因此, 该第二数据报文的发送端可 以为客户端设备, 也可以为服务器(目的服务器)。 以下, 以负载均衡器采 用 NAT式负载均衡的情况为例进行说明。 该第二数据报文的传输。 Specifically, the processor can send the internal IP address and the internal port of the destination server to the network card device. Internal internal IP address and internal port. The receiving unit 220 of the network card device may receive the second data packet sent by the sending end. Here, the sending end may be the client device or the server, and the present invention is not particularly limited, for example, in a load balancer. When the DR-type load balancing or the IP TUN-type load balancing is used, the packet returned by the server (the destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is the client device; for example, When the load balancer adopts NAT-type load balancing, the packet sent by the server (the destination server) to the client device needs to pass through the load balancer. Therefore, the sender of the second data packet can be a client device, or For the server (destination server). Hereinafter, a case where the load balancer adopts NAT type load balancing will be described as an example. The transmission of the second data message.
具体地说, 一方面, 如果该第二数据 文的目的 IP地址、 源 IP地址、 目的端口、 源端口以及传输层协议号 ( TCP连接或 UDP连接)与该第一数 据才艮文的目的 IP地址、源 IP地址、目的端口、源端口以及传输层协议号( TCP 连接或 UDP连接)相同, 由于负载均衡处理器基于 L3/4层信息进行负载均 衡处理, 对于第二数据报文的处理依据即 L3/4层信息 (包括该第二数据报 文的目的 IP地址、 源 IP地址、 目的端口、 源端口以及传输层协议号)与对 于第一数据报文的处理依据相同, 可以确定该第二数据报文的目的服务器与 第一数据报文的目的服务器相同 (即, 第二数据报文与第一数据报文属于该 客户端设备与该目的服务器之间的同一次通信连接)。 Specifically, on the one hand, if the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) of the second data packet and the destination IP address of the first data packet The address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) are the same. The load balancing processor processes the load based on the L3/4 layer information. That is, the L3/4 layer information (including the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet) is the same as that for the first data packet, and the first The destination server of the second data packet is the same as the destination server of the first data packet (ie, the second data packet and the first data packet belong to the same communication connection between the client device and the destination server).
从而, 网卡设备的处理单元 230可以控制发送单元 210将该第二数据报 文的目的 IP地址修改为该 (第一数据报文的) 目的服务器的 IP地址, 并将 该第二数据报文的目的端口修改为该(第一数据报文的)目的服务器的端口, 能够向该(第一数据报文的) 目的服务器发送该第二数据报文。 Therefore, the processing unit 230 of the network card device can control the sending unit 210 to modify the destination IP address of the second data packet to the IP address of the destination server (of the first data packet), and the second data packet is The destination port is modified to be the port of the destination server (of the first data packet), and the second data packet can be sent to the destination server (of the first data packet).
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
具体地说, 处理器在根据第一数据报文的 L3/4层信息进行负载均衡处 理(对应 DR式负载均衡或 IP TUN式负载均衡) 并确定目的服务器后, 可 以根据该第一数据报文的 L3/4层信息, 仅生成正方向的控制信息表项。 Specifically, after performing load balancing processing (corresponding to DR-type load balancing or IP TUN-type load balancing) according to the L3/4 layer information of the first data packet, and determining the destination server, the processor may be configured according to the first data packet. The L3/4 layer information only generates the control information entries in the positive direction.
这里, 正方向是指从客户端设备到服务器的方向, 具体地说, 正方向控 制信息表项可以包括, 例如, 第一数据报文的源 IP地址、 源端口、 目的 IP 地址、 目的端口以及第一数据报文的传输层协议号 (以下, 为了便于说明, 筒称第一五元组)与目的服务器信息 (例如, 包括该目的服务器的 IP地址 和端口) 的对应关系, 从而处理单元 230可以根据第二数据报文的源 IP地 址、 源端口、 目的 IP地址、 目的端口以及第二数据报文的传输层协议号(以
下, 为了便于说明, 筒称第二五元组), 查找该控制信息表项, 在该第二五 元组与控制信息表项中记载的第一五元组相同的情况下, 可以确定, 指示该 第二数据报文的目的服务器的目的服务器信息为与该第一五元组相对应的 服务器信息。 从而处理单元 230可以将该第二数据报文的目的 IP地址修改 为该(与第一五元组相对应的控制信息指示的) 目的服务器的 IP地址, 并 将该第二数据报文的目的端口修改为该(与第一五元组相对应的控制信息指 示的) 目的服务器的端口, 能够向该(与第一五元组相对应的控制信息指示 的) 目的服务器发送该第二数据报文。 Here, the forward direction refers to the direction from the client device to the server. Specifically, the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The correspondence between the transport layer protocol number of the first data packet (hereinafter, referred to as the first quintuple for convenience of explanation) and the destination server information (for example, including the IP address and port of the destination server), thereby processing unit 230 The source layer address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet may be used according to the second data packet. In the following, for convenience of description, the second quintuple is called, and the control information table item is found. When the second quintuple is the same as the first quintuple described in the control information table item, it may be determined that The destination server information indicating the destination server of the second data packet is server information corresponding to the first quintuple. Therefore, the processing unit 230 may modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the purpose of the second data packet. The port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and the second datagram can be sent to the destination server (indicated by the control information corresponding to the first quintuple) Text.
可选地, 在本发明实施例中, 该服务器信息还用于指示该第一数据报文 的目的服务器的外部 IP地址和外部端口, 则 Optionally, in the embodiment of the present invention, the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet,
该处理单元具体用于当该第二数据报文的源 IP地址与该目的服务器的 内部 IP地址相同, 且该第二数据报文的源端口与该目的服务器的内部端口 信息相同, 且该第二数据报文的目的 IP地址与该第一数据报文的源 IP地址 相同, 且该第二数据报文的目的端口与该第一数据报文的源端口相同, 且该 第二数据报文的传输层协议号与该第一数据报文的传输层协议号相同时, 根据该第一数据报文的目的服务器的外部 IP地址和外部端口, 控制该发送 单元向该客户端设备发送该第二数据报文。 The processing unit is configured to: when the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the The destination IP address of the second data packet is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the second data packet is the second data packet. When the transport layer protocol number is the same as the transport layer protocol number of the first data packet, the sending unit is controlled to send the first unit to the client device according to the external IP address and the external port of the destination server of the first data packet. Two data messages.
具体地说, 在发送端为服务器时(对应 NAT式负载均衡), 如果该第二 数据报文的目的 IP地址与第一数据报文的源 IP地址相同, 该第二数据报文 的源 IP地址与处理器在对第一数据进行均衡处理后确定的目的服务器的内 部 IP地址相同, 该第二数据报文的目的端口与第一数据报文的源 IP地址相 同, 该第二数据报文的源端口与处理器在对第一数据进行均衡处理后确定的 目的服务器的内部端口相同,以及第二数据报文的传输层协议号与该第一数 据报文的传输层协议号相同, 由于负载均衡处理器基于 L3/4层信息进行负 载均衡处理, 可以确定该第二数据报文是目的服务器生成的与该第一数据报 文相对应的响应数据报文(即, 第二数据报文与第一数据报文属于该客户端 设备与该目的服务器之间的同一次通信连接)。 Specifically, when the sending end is a server (corresponding to NAT-type load balancing), if the destination IP address of the second data packet is the same as the source IP address of the first data packet, the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized. The destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet. The source port is the same as the internal port of the destination server determined by the processor after the first data is equalized, and the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet, The load balancing processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server (that is, the second data packet) And the first data message belongs to the same communication connection between the client device and the destination server).
从而, 发送单元 220可以将该第二数据报文的源 IP地址修改为第一数 据报文的目的服务器的外部 IP地址(与该第一数据报文的目的 IP地址相同), 并将该第二数据报文的源端口修改为第一数据报文的目的服务器的外部端 口 (与该第一数据报文的目的端口相同), 从而能够向该 (发送第一数据报
文的)客户端设备发送该第二数据报文。 Therefore, the sending unit 220 may modify the source IP address of the second data packet to the external IP address of the destination server of the first data packet (same as the destination IP address of the first data packet), and the first The source port of the second data packet is modified to be the external port of the destination server of the first data packet (same as the destination port of the first data packet), so that the first datagram can be sent to The client device sends the second data packet.
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
并且, 该服务器信息包括第二控制信息表项, 该第二控制信息表项用于 指示该第一数据报文的目的服务器的内部 IP地址、 该第一数据报文的目的 服务器的内部端口、 该第一数据报文的源 IP地址、 该第一数据报文的源端 口以及该第一数据报文的传输层协议号与该第一数据报文的目的服务器的 外部 IP地址和外部端口的对应关系。 And the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet, and an external IP address and an external port of the destination server of the first data packet Correspondence relationship.
具体地说, 处理器在根据第一数据报文的 L3/4层信息进行负载均衡处 理(NAT 式负载均衡) 并确定目的服务器后, 可以根据该第一数据报文的 L3/4层信息, 生成正反两个方向的控制信息表项。 Specifically, after performing load balancing processing (NAT-type load balancing) according to the L3/4 layer information of the first data packet and determining the destination server, the processor may be configured according to the L3/4 layer information of the first data packet. Generate control information entries in both forward and reverse directions.
这里, 正方向是指从客户端设备到服务器的方向, 具体地说, 正方向控 制信息表项可以包括, 例如, 第一数据报文的源 IP地址、 源端口、 目的 IP 地址、 目的端口以及第一数据报文的传输层协议号 (以下, 为了便于说明, 筒称第一五元组)与目的服务器信息 (例如, 包括该目的服务器的 IP地址 和端口) 的对应关系, 从而处理单元 230可以根据第二数据报文的源 IP地 址、 源端口、 目的 IP地址、 目的端口以及第二数据报文的传输层协议号(以 下, 为了便于说明, 筒称第二五元组), 查找该控制信息表项, 在该第二五 元组与控制信息表项中记载的第一五元组相同的情况下, 可以确定, 指示该 第二数据报文的目的服务器的目的服务器信息为与该第一五元组相对应的 服务器信息。 从而发送单元 210可以将该第二数据报文的目的 IP地址修改 为该(与第一五元组相对应的控制信息指示的) 目的服务器的 IP地址, 并 将该第二数据报文的目的端口修改为该(与第一五元组相对应的控制信息指 示的) 目的服务器的端口, 能够向该(与第一五元组相对应的控制信息指示 的) 目的服务器发送该第二数据报文。 Here, the forward direction refers to the direction from the client device to the server. Specifically, the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The correspondence between the transport layer protocol number of the first data packet (hereinafter, referred to as the first quintuple for convenience of explanation) and the destination server information (for example, including the IP address and port of the destination server), thereby processing unit 230 The source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet (hereinafter, referred to as the second quintuple for convenience of description) may be searched according to the source IP address, the source port, the destination IP address, the destination port, and the second data packet. The control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple. Therefore, the sending unit 210 may modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the purpose of the second data packet. The port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and the second datagram can be sent to the destination server (indicated by the control information corresponding to the first quintuple) Text.
这里, 反方向是指从服务器到客户端设备的方向, 具体地说, 反方向控 制信息表项可以包括, 例如, 目的服务器的内部 IP地址、 目的服务器的内 部端口、 第一数据报文的源 IP地址、 第一数据报文的源端口以及第一数据 报文的传输层协议号(以下, 为了便于说明, 筒称第三五元组)与第一数据 报文的目的 IP地址(与目的服务器的外部 IP地址相同)、第一数据报文的目
的端口 (与目的服务器的外部端口相同)的对应关系, 从而处理单元 230可 以根据第二数据 4艮文的源 IP地址、 源端口、 目的 IP地址、 目的端口以及第 二数据报文的传输层协议号 (上述第二五元组), 查找该控制信息表项, 在 该第二五元组与控制信息表项中记载的第三五元组相同的情况下, 可以确 定,发送该第二数据报文的服务器为与该第一五元组相对应的第一数据报文 的目的服务器。 从而发送单元 210可以将该第二数据报文的源 IP地址修改 为该控制信息表项指示的与第三五元组相对应的第一数据报文的目的 IP地 址(与目的服务器的外部 IP地址相同 ), 并将该第二数据报文的目的端口修 改为该控制信息表项指示的与第一五元组相对应的第一数据报文的目的端 口 (与目的服务器的外部端口相同 ), 从而能够向该(发送第一数据报文的) 客户端设备发送该第二数据报文。 Here, the reverse direction refers to the direction from the server to the client device. Specifically, the reverse direction control information entry may include, for example, an internal IP address of the destination server, an internal port of the destination server, and a source of the first data packet. The IP address, the source port of the first data packet, and the transport layer protocol number of the first data packet (hereinafter, for convenience of description, the third quintuple) and the destination IP address of the first data packet (and purpose) The external IP address of the server is the same), the destination of the first data packet Corresponding relationship between the port (same as the external port of the destination server), so that the processing unit 230 can use the source IP address, the source port, the destination IP address, the destination port, and the transport layer of the second data packet according to the second data The protocol number (the second quintuple) is used to find the control information entry. When the second quintuple is the same as the third quintuple described in the control information entry, the second quintuple can be determined to send the second The server of the data message is the destination server of the first data message corresponding to the first quintuple. Therefore, the sending unit 210 may modify the source IP address of the second data packet to the destination IP address of the first data packet corresponding to the third quintuple indicated by the control information entry (with the external IP address of the destination server) The destination port of the second data packet is modified to be the destination port of the first data packet corresponding to the first quintuple (the same as the external port of the destination server) indicated by the control information entry. Therefore, the second data message can be sent to the client device that sends the first data packet.
可选地, 在本发明实施例中, 该处理单元 230还用于在确定该接收单元 220接收到该第一控制信息表项后, 启动定时器, 并确定在该定时器超时之 前未接收到该第二数据报文; 或 Optionally, in the embodiment of the present invention, the processing unit 230 is further configured to: after determining that the receiving unit 220 receives the first control information entry, start a timer, and determine that the timer is not received before the timer expires. The second data message; or
用于确定在该客户端设备和该第一数据报文的目的服务器之间建立的 用于传输该第一数据报文的通信连接结束; And determining to end a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet;
用于删除该第一控制信息表项。 Used to delete the first control information entry.
并且, 该处理单元 230还用于在确定该接收单元 220接收到该第二控制 信息表项后, 启动定时器, 并确定在该定时器超时之前未接收到该第二数据 报文; 或 And the processing unit 230 is further configured to: after determining that the receiving unit 220 receives the second control information entry, start a timer, and determine that the second data message is not received before the timer expires; or
用于确定在该客户端设备和该第一数据报文的目的服务器之间建立的 用于传输该第一数据报文的通信连接结束; And determining to end a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet;
用于删除该第二控制信息表项。 Used to delete the second control information entry.
具体地说, 处理单元 230在通过接收单元 220从处理器获取控制信息表 项(包括第一控制信息表项和第二控制信息表项)后, 在长时间 (定时器超 时后, 例如, 30分钟)未接收到能够根据该控制信息表项包括的控制信息进 行传输的数据报文(例如, 上述第二数据报文), 可以认为第一数据报文所 属通信连接已结束, 从而可以删除该控制信息表项(包括第一控制信息表项 和第二控制信息表项)。 Specifically, after the processing unit 230 acquires the control information entry (including the first control information entry and the second control information entry) from the processor by the receiving unit 220, the processing unit 230 is for a long time (after the timer expires, for example, 30) If the data packet that can be transmitted according to the control information included in the control information table (for example, the second data packet) is not received, the communication connection to which the first data packet belongs may be considered to be deleted. Control information entry (including the first control information entry and the second control information entry).
并且,处理单元 230在通过接收单元 220从处理器获取控制信息表项(包 括第一控制信息表项和第二控制信息表项)后, 检测到指示通信连接结束的
数据报文后, 可以认为第一数据报文所属通信连接已结束, 从而可以删除该 控制信息表项 (包括第一控制信息表项和第二控制信息表项)。 以下, 省略 对相同或相似情况的说明。 And, after the processing unit 230 acquires the control information table item (including the first control information table item and the second control information table item) from the processor, the processing unit 230 detects that the communication connection is ended. After the data packet, the communication connection to which the first data packet belongs is considered to be ended, so that the control information entry (including the first control information entry and the second control information entry) can be deleted. Hereinafter, the description of the same or similar cases will be omitted.
以上列举了根据第二数据报文的源 IP地址、 源端口、 目的 IP地址、 目 的端口以及第二数据报文的传输层协议号,确定能够根据该控制信息控制该 第二数据报文的传输, 应理解, 本发明并不限定于此, 其他判定是否能够根 据该控制信息控制该第二数据报文的传输的方法(例如, 确定第一数据报文 与第二数据报文属于同一客户端设备与同一服务器之间的同一次通信连接 的方法), 均落入本发明的保护范围内。 The above determines that the second data packet can be controlled according to the control information according to the source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet. It should be understood that the present invention is not limited thereto, and other methods for determining whether the second data message can be transmitted according to the control information (for example, determining that the first data message and the second data message belong to the same client) The method of the same communication connection between the device and the same server) falls within the scope of the present invention.
下面, 对处理器用于根据数据报文的 L7层信息, 或者, L3/4层信息和 Next, the processor is used for L7 layer information according to data packets, or L3/4 layer information and
L7层信息进行负载均衡的情况进行说明。 The case where the L7 layer information performs load balancing will be described.
处理器接收到网卡设备的发送单元 210发送的第一数据报文后,通过对 数据报文的 L3/4层进行解析, 例如, 对数据报文进行 SPI, 从而获取该数据 报文的 L3/4层信息(例如,源 IP地址、目的 IP地址、源端口和目的端口等), 并且, 通过对数据报文的 L7层进行解析, 例如, 对数据报文进行 DPI, 从 而获取该数据报文的 L7层信息 (例如, 该数据报文的 URL等)。 After receiving the first data packet sent by the sending unit 210 of the network card device, the processor parses the L3/4 layer of the data packet, for example, performs SPI on the data packet to obtain the L3/ of the data packet. Layer 4 information (for example, the source IP address, the destination IP address, the source port, the destination port, and so on), and the L7 layer of the data packet is parsed, for example, DPI is performed on the data packet to obtain the data packet. L7 layer information (for example, the URL of the data message, etc.).
在本发明实施例中, 可能存在第一数据报文的 L7层信息为空 (即, 不 存在 URL等 )的情况, 此时, 处理器仅根据 L3/4层信息进行负载均衡处理, 并且该根据 L3/4层信息进行负载均衡处理的方法与现有技术相同, 这里, 为避免赘述, 省略其说明。 In the embodiment of the present invention, there may be a case where the L7 layer information of the first data packet is empty (that is, there is no URL or the like). At this time, the processor performs load balancing processing only according to the L3/4 layer information, and the The method of performing load balancing processing based on the L3/4 layer information is the same as that of the prior art, and the description thereof is omitted here to avoid redundancy.
并且, 在第一数据报文的 L7层信息不为空(即, 存在 URL等)的情况 下,处理器可以根据 L7层信息进行负载均衡处理, 并且该根据 L7层信息进 行负载均衡处理的方法与现有技术相同, 这里, 为避免赘述, 省略其说明。 Moreover, in a case where the L7 layer information of the first data packet is not empty (ie, there is a URL or the like), the processor may perform load balancing processing according to the L7 layer information, and the method for performing load balancing processing according to the L7 layer information It is the same as the prior art, and the description thereof is omitted here to avoid redundancy.
在本发明实施例中, 作为该负载均衡处理的结果, 例如, 控制信息可以 是指示目的服务器的服务器信息, 以及指示网卡设备需要对后续数据报文 (主要是客户端设备发送给服务器的数据报文)进行 L7层解析的 L7层解析 指示标识。并且,在本发明实施例中,处理器可以根据负载均衡处理的结果, 直接控制发送设备 (例如, 可以是该网卡设备)将该第一数据报文发送给与 该负载均衡处理的结果相对应的目的服务器。 并将该控制信息发送给网卡设 备。 In the embodiment of the present invention, as a result of the load balancing process, for example, the control information may be server information indicating the destination server, and the network card device is required to send subsequent data packets (mainly the data packets sent by the client device to the server). The L7 layer resolution indication flag for L7 layer parsing. In addition, in the embodiment of the present invention, the processor may directly control, according to the result of the load balancing process, the sending device (for example, the network card device) to send the first data packet to correspond to the result of the load balancing process. The destination server. And send this control information to the NIC device.
在本发明实施例中,该服务器信息用于指示该目的服务器的内部地址和
内部端口。 In the embodiment of the present invention, the server information is used to indicate an internal address of the destination server and Internal port.
具体地说处理器可以将目的服务器的内部 IP地址和内部端口以及 L7层 解析指示标识下发给网卡设备。 Specifically, the processor may send the internal IP address and the internal port of the destination server and the L7 layer resolution indication identifier to the network card device.
网卡设备的发送单元 210可以从处理器获取该目的服务器的在服务器集 群内部的内部 IP地址、 内部端口以及 L7层解析指示标识。 The sending unit 210 of the network card device may acquire, from the processor, an internal IP address, an internal port, and an L7 layer resolution indication identifier of the destination server within the server cluster.
网卡设备的发送单元 210可以接收发送端发送的第二数据报文, 这里, 发送端可以是上述客户端设备, 也可以是服务器, 本发明并未特别限定, 例 如,在负载均衡器采用 DR式负载均衡或 IP TUN式负载均衡时,服务器(目 的服务器)返回给客户端设备的报文不通过负载均衡器, 因此, 该第二数据 报文的发送端为客户端设备; 例如, 在负载均衡器采用 NAT式负载均衡时, 由于服务器(目的服务器)返回给客户端设备的报文需要通过负载均衡器, 因此, 该第二数据报文的发送端可以为客户端设备, 也可以为服务器(目的 服务器)。 以下, 以负载均衡器采用 NAT式负载均衡的情况为例进行说明。 The sending unit 210 of the network card device may receive the second data packet sent by the sending end. Here, the sending end may be the client device or the server, and the present invention is not particularly limited. For example, the DR is adopted in the load balancer. During load balancing or IP TUN load balancing, the packets returned by the server (destination server) to the client device do not pass through the load balancer. Therefore, the sender of the second data packet is the client device; for example, in load balancing. In the case of the NAT-type load balancing, the server that the server (the destination server) returns to the client device needs to pass the load balancer. Therefore, the sender of the second data packet can be a client device or a server. Destination server). Hereinafter, a case where the load balancer adopts NAT-type load balancing will be described as an example.
网卡设备的处理单元 230 判定是否能够根据从处理器获取的服务器信 息, 发送该第二数据报文的传输。 The processing unit 230 of the network card device determines whether the transmission of the second data message can be transmitted based on the server information acquired from the processor.
可选地, 在本发明实施例中, 该服务器信息是根据该第一数据报文的 L3/4层信息和 L7层信息确定的, 或 Optionally, in the embodiment of the present invention, the server information is determined according to L3/4 layer information and L7 layer information of the first data packet, or
该服务器信息是根据该第一数据报文的 L7层信息确定的, The server information is determined according to the L7 layer information of the first data packet.
该服务器信息用于指示该第一数据报文的目的服务器的内部网际协议 IP地址和内部端口, 该控制信息还包括 L7层解析指示标识, 贝' J The server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data packet, and the control information further includes an L7 layer resolution indication identifier,
该处理单元具体用于当该第二数据报文的五元组与该第一数据报文的 五元组相同时,根据该 L7层解析指示标识,对该第二数据报文进行 L7层信 息解析, 以获取用于指示该第二数据报文的目的服务器的统一资源定位器 URL地址的 URL信息, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地 址、 目的端口和传输层协议号; The processing unit is configured to: when the quintuple of the second data packet is the same as the quintuple of the first data packet, perform L7 layer information on the second data packet according to the L7 layer resolution indication identifier Parsing, to obtain URL information of a Uniform Resource Locator URL address of the destination server for indicating the second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer Agreement number;
用于如果该 URL信息不为空, 则控制该发送单元向该负载均衡处理器 发送该第二数据报文和该 URL信息, 以便于该负载均衡处理器根据该 URL 信息, 确定该第二数据报文的目的服务器, 并向该第二数据报文的目的服务 器发送该第二数据报文; 或 And if the sending information is sent to the load balancing processor to send the second data packet and the URL information, so that the load balancing processor determines the second data according to the URL information. a destination server of the packet, and sending the second data packet to the destination server of the second data packet; or
用于如果该 URL信息为空, 则根据该服务器信息, 控制该发送单元向 该第一数据报文的目的服务器发送该第二数据报文。
具体地说, 一方面, 在发送端为客户端设备时, 如果该第二数据报文的 目的 IP地址、 源 IP地址、 目的端口、 源端口以及传输层协议号( TCP连接 或 UDP连接 )与该第一数据报文的目的 IP地址、 源 IP地址、 目的端口、 源 端口以及传输层协议号( TCP连接或 UDP连接)相同,由于处理器基于 L3/4 层信息进行负载均衡处理,对于第二数据报文的处理依据即 L3/4层信息(包 括该第二数据 文的目的 IP地址、 源 IP地址、 目的端口、 源端口以及传输 层协议号)与对于第一数据报文的处理依据相同, 处理单元 230可以确定该 第二数据报文的目的服务器与第一数据报文的目的服务器相同 (即, 第二数 据报文与第一数据报文属于该客户端设备与该目的服务器之间的同一次通 信连接)。 And if the URL information is empty, the sending unit is controlled to send the second data packet to the destination server of the first data packet according to the server information. Specifically, on the one hand, when the transmitting end is a client device, if the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are The destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) of the first data packet are the same. The processor performs load balancing processing based on the L3/4 layer information. The processing of the second data packet is the L3/4 layer information (including the destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet) and the processing basis for the first data packet. Similarly, the processing unit 230 may determine that the destination server of the second data packet is the same as the destination server of the first data packet (ie, the second data packet and the first data packet belong to the client device and the destination server. The same communication connection between).
其后, 网卡设备的处理单元 230可以根据 L7层解析指示标识, 获取第 二数据报文的 L7层信息, 即, 第二数据报文的 URL地址。 Then, the processing unit 230 of the network card device can obtain the L7 layer information of the second data packet, that is, the URL address of the second data packet, according to the L7 layer resolution indication identifier.
如果处理单元 230能够获取第二数据报文的 URL地址,则发送单元 210 向处理器发送该第二数据报文以及该 URL地址, 从而, 处理器无需对该第 二数据报文进行 L7层解析, 可以直接根据该 URL地址进行负载均衡处理, 在本发明实施例中, 由于解析 URL的过程由网卡设备进行, 即通过硬件解 析, 与通过处理器利用软件解析的方式相比, 提高了解析速度, 并降低了对 处理器的负担。处理器在根据 URL确定该第二数据报文的目的服务器后(可 能与第一数据报文的目的服务器相同,也可能与第一数据报文的目的服务器 相异), 可以通过发送设备(例如, 该网关设备), 发送该第二数据报文。 If the processing unit 230 can obtain the URL address of the second data packet, the sending unit 210 sends the second data packet and the URL address to the processor, so that the processor does not need to perform L7 layer parsing on the second data packet. The load balancing process can be performed directly according to the URL address. In the embodiment of the present invention, since the process of parsing the URL is performed by the network card device, that is, by hardware analysis, the resolution speed is improved compared with the method of using the software to parse by the processor. And reduce the burden on the processor. After the processor determines the destination server of the second data packet according to the URL (may be the same as the destination server of the first data packet, or may be different from the destination server of the first data packet), the processor may be configured by using a sending device (for example, , the gateway device), sending the second data packet.
另外, 如果处理单元 230不能获取第二数据报文的 URL地址(第二数 据报文的 L7层信息为空), 则可以根据该服务器信息, 控制发送单元 210发 送该第二数据报文。 In addition, if the processing unit 230 is unable to obtain the URL address of the second data packet (the L7 layer information of the second data packet is empty), the control sending unit 210 may send the second data packet according to the server information.
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
具体地说, 处理器在根据第一数据报文的 L7层信息进行负载均衡处理 (对应 DR式负载均衡或 IP TUN式负载均衡)并确定目的服务器后, 可以 根据该第一数据报文的 L3/4层信息, 仅生成上述正方向的控制信息表项。 Specifically, after the processor performs load balancing processing (corresponding to DR-type load balancing or IP TUN-type load balancing) according to the L7 layer information of the first data packet, and determining the destination server, the processor may be configured according to the L3 of the first data packet. /4 layer information, only the control information entries in the above positive direction are generated.
可选地, 在本发明实施例中, 该服务器信息还用于指示该第一数据报文 的目的服务器的外部 IP地址和外部端口, 则
该处理单元 230具体用于当该第二数据报文的源 IP地址与该目的服务 器的内部 IP地址相同, 且该第二数据报文的源端口与该目的服务器的内部 端口信息相同, 且该第二数据报文的目的 IP地址与该第一数据报文的源 IP 地址相同, 且该第二数据报文的目的端口与该第一数据报文的源端口相同, 且该第二数据报文的传输层协议号与该第一数据报文的传输层协议号相同 时, 根据该第一数据报文的目的服务器的外部 IP地址和外部端口, 控制该 发送单元向该客户端设备发送该第二数据报文。 Optionally, in the embodiment of the present invention, the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet, The processing unit 230 is specifically configured to: when the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the The destination IP address of the second data packet is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the second data packet is When the transport layer protocol number of the text is the same as the transport layer protocol number of the first data packet, the sending unit is controlled to send the sending unit to the client device according to the external IP address and the external port of the destination server of the first data packet. Second data message.
具体地说, 在发送端为服务器时(对应 NAT式负载均衡), 如果该第二 数据报文的目的 IP地址与第一数据报文的源 IP地址相同, 该第二数据报文 的源 IP地址与处理器在对第一数据进行均衡处理后确定的目的服务器的内 部 IP地址相同, 该第二数据报文的目的端口与第一数据报文的源 IP地址相 同, 该第二数据报文的源端口与处理器在对第一数据进行均衡处理后确定的 目的服务器的内部端口相同,以及第二数据报文的传输层协议号与该第一数 据报文的传输层协议号相同, 由于负载均衡处理器基于 L3/4层信息进行负 载均衡处理, 可以确定该第二数据报文是目的服务器生成的与该第一数据报 文相对应的响应数据报文(即, 第二数据报文与第一数据报文属于该客户端 设备与该目的服务器之间的同一次通信连接)。 Specifically, when the sending end is a server (corresponding to NAT-type load balancing), if the destination IP address of the second data packet is the same as the source IP address of the first data packet, the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized. The destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet. The source port is the same as the internal port of the destination server determined by the processor after the first data is equalized, and the transport layer protocol number of the second data packet is the same as the transport layer protocol number of the first data packet, The load balancing processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server (that is, the second data packet) And the first data message belongs to the same communication connection between the client device and the destination server).
从而, 发送单元 220可以将该第二数据报文的源 IP地址修改为第一数 据报文的目的服务器的外部 IP地址(与该第一数据报文的目的 IP地址相同), 并将该第二数据报文的源端口修改为第一数据报文的目的服务器的外部端 口 (与该第一数据报文的目的端口相同), 从而能够向该 (发送第一数据报 文的)客户端设备发送该第二数据报文。 Therefore, the sending unit 220 may modify the source IP address of the second data packet to the external IP address of the destination server of the first data packet (same as the destination IP address of the first data packet), and the first The source port of the second data packet is modified to be the external port of the destination server of the first data packet (same as the destination port of the first data packet), so that the client device (which sends the first data packet) can be Send the second data packet.
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
并且, 该服务器信息包括第二控制信息表项, 该第二控制信息表项用于 指示该第一数据报文的目的服务器的内部 IP地址、 该第一数据报文的目的 服务器的内部端口、 该第一数据报文的源 IP地址、 该第一数据报文的源端 口以及该第一数据报文的传输层协议号与该第一数据报文的目的服务器的 外部 IP地址和外部端口的对应关系。 And the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet, and an external IP address and an external port of the destination server of the first data packet Correspondence relationship.
具体地说, 处理器在根据第一数据报文的 L3/4层信息进行负载均衡处
理(NAT 式负载均衡) 并确定目的服务器后, 可以根据该第一数据报文的 L3/4层信息, 生成上述正反两个方向的控制信息表项。 Specifically, the processor performs load balancing according to the L3/4 layer information of the first data packet. After the NAT server is determined and the destination server is determined, the control information entries in the forward and reverse directions can be generated according to the L3/4 layer information of the first data packet.
可选地, 如上所述, 在本发明实施例中, 该处理单元 230还用于在确定 该接收单元 220接收到该第一控制信息表项后, 启动定时器, 并确定在该定 时器超时之前未接收到该第二数据报文; 或 Optionally, as described above, in the embodiment of the present invention, the processing unit 230 is further configured to: after determining that the receiving unit 220 receives the first control information entry, start a timer, and determine that the timer expires The second data message has not been received before; or
用于确定在该客户端设备和该第一数据报文的目的服务器之间建立的 用于传输该第一数据报文的通信连接结束; And determining to end a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet;
用于删除该第一控制信息表项。 Used to delete the first control information entry.
并且, 该处理单元 230还用于在确定该接收单元 220接收到该第二控制 信息表项后, 启动定时器, 并确定在该定时器超时之前未接收到该第二数据 报文; 或 And the processing unit 230 is further configured to: after determining that the receiving unit 220 receives the second control information entry, start a timer, and determine that the second data message is not received before the timer expires; or
用于确定在该客户端设备和该第一数据报文的目的服务器之间建立的 用于传输该第一数据报文的通信连接结束; And determining to end a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet;
用于删除该第二控制信息表项。 Used to delete the second control information entry.
应理解, 在以上实施例中, 已对负载均衡器采用 NAT式负载均衡的实 施例进行了说明, 但本发明并不在于此, 例如, 负载均衡器还可以采用 DR 式负载均衡或 IP TUN式负载均衡, 此时, 服务器(目的服务器)返回给客 户端设备的报文不通过负载均衡器, 因此, 该第二数据报文的发送端为客户 端设备。 置 200中的各单元和上述其他操作和 /或功能分别为了实现图 1中的方法 100 的相应流程。 It should be understood that in the foregoing embodiment, the embodiment in which the load balancer adopts NAT-type load balancing has been described, but the present invention is not limited thereto. For example, the load balancer may also adopt the DR-type load balancing or the IP TUN type. Load balancing. At this time, the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is the client device. The units in 200 and the other operations and/or functions described above are respectively implemented to implement the corresponding flow of method 100 in FIG.
根据本发明实施例的控制数据传输的装置,通过负载均衡处理器根据第 一数据报文确定控制信息, 并向网卡设备下发该控制信息, 网卡设备在接收 到第二数据报文并确定能够根据该控制信息传输该第二数据报文后, 可以根 据该控制信息直接向目的服务器发送该第二数据报文, 或者, 可以获取该第 二数据报文中 URL信息并通知负载均衡处理器以使负载均衡处理器无需对 第二数据报文进行解析,从而,减少负载均衡处理器的处理,提高访问速度, 减小负载均衡处理器的负担。 The device for controlling data transmission according to the embodiment of the present invention determines the control information according to the first data packet by the load balancing processor, and sends the control information to the network card device, and the network card device receives the second data packet and determines that After the second data packet is transmitted according to the control information, the second data packet may be directly sent to the destination server according to the control information, or the URL information in the second data packet may be obtained and notified to the load balancing processor. The load balancing processor does not need to parse the second data packet, thereby reducing the processing of the load balancing processor, improving the access speed, and reducing the load of the load balancing processor.
上文中, 结合图 1 , 详细描述了根据本发明实施例的控制数据传输的方 法, 并结合图 2详细描述了根据本发明实施例的控制数据传输的装置, 下面
将结合图 3, 详细描述根据本发明实施例的控制数据传输的系统。 Hereinabove, a method of controlling data transmission according to an embodiment of the present invention is described in detail with reference to FIG. 1, and a device for controlling data transmission according to an embodiment of the present invention is described in detail with reference to FIG. A system for controlling data transmission according to an embodiment of the present invention will be described in detail with reference to FIG.
图 3 示出了根据本发明实施例的控制数据传输的系统 300 的示意性框 图。 如图 3所示, 该系统包括: FIG. 3 shows a schematic block diagram of a system 300 for controlling data transmission in accordance with an embodiment of the present invention. As shown in Figure 3, the system includes:
负载均衡处理模块 310, 用于从网卡模块 320获取第一数据报文, 并根 据该第一数据报文的 L3/4层信息和 /或该第一数据报文的 L7层信息,确定用 于指示该第一数据报文的目的服务器的服务器信息, 向该网卡模块发送包括 该服务器信息的控制信息; The load balancing processing module 310 is configured to obtain the first data packet from the network card module 320, and determine, according to the L3/4 layer information of the first data packet and/or the L7 layer information of the first data packet, Instructing server information of the destination server of the first data packet, and sending control information including the server information to the network card module;
网卡模块 320, 用于向负载均衡处理模块 310发送来自用户设备的该第 一数据报文, 以及从该负载均衡处理模块 310获取该控制信息, 当接收到第 二数据报文时, 根据该控制信息, 控制该第二数据报文的传输。 The NIC module 320 is configured to send the first data packet from the user equipment to the load balancing processing module 310, and obtain the control information from the load balancing processing module 310. When receiving the second data packet, according to the control Information, controlling the transmission of the second data message.
具体地说, 在用户需要访问由服务器集群提供的业务时, 客户端设备可 以根据该服务器集群对外统一的 IP地址和端口 (即, 外部 IP地址和外部端 口), 发送该业务的首个数据报文(第一数据报文), 该数据报文首先到达负 载均衡器(由网卡设备接收)。 该网卡模块 320可以将该第一数据报文发送 给负载均衡器的负载均衡处理模块 310, 从而, 该均衡处理模块 310可以采 用预先设置的算法, 通过上述任意负载均衡方式, 从服务器集群中, 确定该 数据报文的目的服务器。 Specifically, when the user needs to access the service provided by the server cluster, the client device may send the first datagram of the service according to the externally unified IP address and port of the server cluster (ie, the external IP address and the external port). Text (first data message), the data message first arrives at the load balancer (received by the network card device). The NIC module 320 can send the first data packet to the load balancing processing module 310 of the load balancer, so that the equalization processing module 310 can adopt a preset algorithm, and use any of the foregoing load balancing methods to obtain a slave server cluster. Determine the destination server for this data message.
在本发明实施例中, 均衡处理模块 310可以根据网络的不同层次(网络 七层) 来进行负载均衡, 具体地说, 可以根据数据报文的 L3/4层进行负载 均衡, 也可以根据数据报文的 L7层进行负载均衡。 In the embodiment of the present invention, the equalization processing module 310 can perform load balancing according to different layers of the network (network seven layers), specifically, load balancing according to the L3/4 layer of the data packet, or according to the datagram. The L7 layer of the text performs load balancing.
其中, 在本发明实施例中, L3/4层可以包括 L3层, 或 L4层, 或 L3层 和 L4层。 L3层信息可以包括 OSI网络模型中的网络层的 IP地址信息, L4 层信息可以包括 OSI网络模型中的 TCP/UDP端口信息。 因此, L3/4层信息 可以包括传输该业务的业务服务器的 IP地址、 端口等信息。 L7层信息可以 包括应用层信息, 具体地说, 是数据报文携带的 URL地址。 Wherein, in the embodiment of the present invention, the L3/4 layer may include an L3 layer, or an L4 layer, or an L3 layer and an L4 layer. The L3 layer information may include IP address information of the network layer in the OSI network model, and the L4 layer information may include TCP/UDP port information in the OSI network model. Therefore, the L3/4 layer information may include information such as an IP address, a port, and the like of a service server that transmits the service. The L7 layer information may include application layer information, specifically, a URL address carried in the data packet.
下面, 首先对均衡处理模块 310用于根据数据报文的 L3/4层信息进行 负载均衡的情况进行说明。 Next, the case where the equalization processing module 310 performs load balancing based on the L3/4 layer information of the data message will be described first.
均衡处理模块 310接收到网卡模块 320发送的第一数据报文后,通过对 数据报文的 L3/4层进行解析, 例如, 对数据报文进行 SPI, 从而获取该数据 报文的 L3/4层信息(例如,源 IP地址、目的 IP地址、源端口和目的端口等), 在本发明实施例中, 均衡处理模块 310根据 L3/4层信息进行负载均衡处理
的方法与现有技术相同, 这里, 为避免赘述, 省略其说明。 在本发明实施例 中, 作为该负载均衡处理的结果, 例如, 控制信息可以是指示目的服务器的 服务器信息。 并且, 在本发明实施例中, 均衡处理模块 310可以根据负载均 衡处理的结果, 直接控制发送设备(例如, 可以是该网卡模块 320 )将该第 一数据报文发送给与该负载均衡处理的结果相对应的目的服务器。 并将该服 务器信息发送给网卡模块 320。 After receiving the first data packet sent by the network card module 320, the equalization processing module 310 parses the L3/4 layer of the data packet, for example, performs SPI on the data packet to obtain the L3/4 of the data packet. In the embodiment of the present invention, the equalization processing module 310 performs load balancing processing according to the L3/4 layer information, in the layer information (for example, the source IP address, the destination IP address, the source port, the destination port, and the like). The method is the same as that of the prior art, and the description thereof is omitted here to avoid redundancy. In the embodiment of the present invention, as a result of the load balancing process, for example, the control information may be server information indicating a destination server. In addition, in the embodiment of the present invention, the equalization processing module 310 can directly control the sending device (for example, the network card module 320) to send the first data packet to the load balancing process according to the result of the load balancing process. The result corresponds to the destination server. And sending the server information to the network card module 320.
在本发明实施例中, 该服务器信息用于指示该第一数据报文的目的服务 器的内部网际协议 IP地址和内部端口。 In the embodiment of the present invention, the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data packet.
可选地, 在本发明实施例中, 该服务器信息是该负载均衡处理模块 310 根据该第一数据报文的 L3/4层信息确定的, 贝' J Optionally, in the embodiment of the present invention, the server information is determined by the load balancing processing module 310 according to the L3/4 layer information of the first data packet,
该网卡模块 320具体用于当该第二数据报文的五元组与该第一数据报文 的五元组相同时, 根据该服务器信息, 向该第一数据报文的目的服务器发送 该第二数据 文, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地址、 目 的端口和传输层协议号。 The NIC module 320 is configured to send the quintuple of the second data packet to the destination server of the first data packet according to the server information when the quintuple of the second data packet is the same as the quintuple of the first data packet. The second data packet, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number.
具体地说, 均衡处理模块 310可以将目的服务器的在服务器集群内部的 内部 IP地址和内部端口下发给网卡模块 320。 Specifically, the equalization processing module 310 can send the internal IP address and the internal port of the destination server in the server cluster to the network card module 320.
其后, 网卡模块 320可以从均衡处理模块 310获取该目的服务器的在服 务器集群内部的内部 IP地址和内部端口。 Thereafter, the network card module 320 can obtain the internal IP address and the internal port of the destination server within the server cluster from the equalization processing module 310.
其后, 网卡模块 320可以接收发送端发送的第二数据报文, 这里, 发送 端可以是上述客户端设备, 也可以是服务器, 本发明并未特别限定, 例如, 在负载均衡器采用 DR式负载均衡或 IP TUN式负载均衡时, 服务器(目的 服务器)返回给客户端设备的报文不通过负载均衡器, 因此, 该第二数据报 文的发送端为客户端设备; 例如, 在负载均衡器采用 NAT式负载均衡时, 由于服务器(目的服务器)返回给客户端设备的报文需要通过负载均衡器, 因此, 该第二数据报文的发送端可以为客户端设备, 也可以为服务器(目的 服务器)。 以下, 以负载均衡器采用 NAT式负载均衡的情况为例进行说明。 Then, the network card module 320 can receive the second data packet sent by the sending end. Here, the sending end can be the client device or the server, and the invention is not particularly limited. For example, the DR is used in the load balancer. In load balancing or IP TUN load balancing, the packets returned by the server (destination server) to the client device do not pass through the load balancer. Therefore, the sender of the second data packet is the client device; for example, in load balancing. In the case of the NAT-type load balancing, the server that the server (the destination server) returns to the client device needs to pass the load balancer. Therefore, the sender of the second data packet can be a client device or a server. Destination server). Hereinafter, a case where the load balancer adopts NAT-type load balancing will be described as an example.
其后, 网卡模块 320根据从均衡处理模块 310获取的服务器信息, 控制 该第二数据报文的传输。 Thereafter, the network card module 320 controls the transmission of the second data message based on the server information acquired from the equalization processing module 310.
具体地说, 一方面, 在发送端为客户端设备时, 如果该第二数据报文的 目的 IP地址、 源 IP地址、 目的端口、 源端口以及传输层协议号( TCP连接 或 UDP连接 )与该第一数据报文的目的 IP地址、 源 IP地址、 目的端口、 源
端口以及传输层协议号 ( TCP连接或 UDP连接)相同, 由于负载均衡处理 器基于 L3/4层信息进行负载均衡处理,对于第二数据报文的处理依据即 L3/4 层信息 (包括该第二数据报文的目的 IP地址、 源 IP地址、 目的端口、 源端 口以及传输层协议号)与对于第一数据报文的处理依据相同,可以确定该第 二数据报文的目的服务器与第一数据报文的目的服务器相同 (即, 第二数据 报文与第一数据报文属于该客户端设备与该目的服务器之间的同一次通信 连接)。 Specifically, on the one hand, when the transmitting end is a client device, if the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are Destination IP address, source IP address, destination port, and source of the first data packet The port and the transport layer protocol number (TCP connection or UDP connection) are the same, because the load balancing processor performs load balancing processing based on the L3/4 layer information, and the processing basis of the second data packet is L3/4 layer information (including the first The destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number of the second data packet are the same as those for the first data packet, and the destination server of the second data packet can be determined. The destination server of the data packet is the same (that is, the second data packet and the first data packet belong to the same communication connection between the client device and the destination server).
从而,网卡模块 320可以将该第二数据报文的目的 IP地址修改为该(第 一数据报文的) 目的服务器的 IP地址, 并将该第二数据报文的目的端口修 改为该 (第一数据报文的) 目的服务器的端口, 以向该 (第一数据报文的) 目的服务器发送该第二数据报文。 Therefore, the network card module 320 can modify the destination IP address of the second data packet to the IP address of the destination server (of the first data packet), and modify the destination port of the second data packet to the a port of the destination server of the data packet, to send the second data packet to the destination server (of the first data message).
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
具体地说, 负载均衡处理模块 310在根据第一数据报文的 L3/4层信息 进行负载均衡处理(对应 DR式负载均衡或 IP TUN式负载均衡) 并确定目 的服务器后, 可以根据该第一数据报文的 L3/4层信息, 仅生成正方向的控 制信息表项。 Specifically, the load balancing processing module 310 may perform load balancing processing (corresponding to DR-type load balancing or IP TUN-type load balancing) according to the L3/4 layer information of the first data packet, and determine the destination server, according to the first The L3/4 layer information of the data packet only generates the control information entry in the positive direction.
这里, 正方向是指从客户端设备到服务器的方向, 具体地说, 正方向控 制信息表项可以包括, 例如, 第一数据报文的源 IP地址、 源端口、 目的 IP 地址、 目的端口以及第一数据报文的传输层协议号 (以下, 为了便于说明, 筒称第一五元组)与目的服务器信息 (例如, 包括该目的服务器的 IP地址 和端口) 的对应关系, 从而网卡模块 320可以根据第二数据报文的源 IP地 址、 源端口、 目的 IP地址、 目的端口以及第二数据报文的传输层协议号(以 下, 为了便于说明, 筒称第二五元组), 查找该控制信息表项, 在该第二五 元组与控制信息表项中记载的第一五元组相同的情况下, 可以确定, 指示该 第二数据报文的目的服务器的目的服务器信息为与该第一五元组相对应的 服务器信息。 从而, 网卡模块 320可以将该第二数据报文的目的 IP地址修 改为该 (与第一五元组相对应的控制信息指示的) 目的服务器的 IP地址, 并将该第二数据报文的目的端口修改为该(与第一五元组相对应的控制信息 指示的) 目的服务器的端口, 能够向该(与第一五元组相对应的控制信息指
示的) 目的服务器发送该第二数据报文。 Here, the forward direction refers to the direction from the client device to the server. Specifically, the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The transport layer protocol number of the first data message (hereinafter, for convenience of description, the first quintuple) and the destination server information (for example, including the IP address and port of the destination server), so that the network card module 320 The source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet (hereinafter, referred to as the second quintuple for convenience of description) may be searched according to the source IP address, the source port, the destination IP address, the destination port, and the second data packet. The control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple. Therefore, the network card module 320 can modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the second data packet is The destination port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and can be directed to the control information corresponding to the first quintuple The destination server sends the second data packet.
可选地, 在本发明实施例中, 该服务器信息还用于指示该第一数据报文 的目的服务器的外部 IP地址和外部端口, 则 Optionally, in the embodiment of the present invention, the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet,
该网卡模块具体用于当该第二数据报文的源 IP地址与该目的服务器的 内部 IP地址相同, 且该第二数据报文的源端口与该目的服务器的内部端口 信息相同, 且该第二数据报文的目的 IP地址与该第一数据报文的源 IP地址 相同, 且该第二数据报文的目的端口与该第一数据报文的源端口相同, 且该 第二数据报文的传输层协议号与该第一数据报文的传输层协议号相同时, 根据该第一数据报文的目的服务器的外部 IP地址和外部端口, 发送该第二 数据报文。 The NIC module is specifically configured to: when the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the The destination IP address of the second data packet is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the second data packet is the second data packet. When the transport layer protocol number is the same as the transport layer protocol number of the first data packet, the second data packet is sent according to the external IP address and the external port of the destination server of the first data packet.
具体地说, 在发送端为服务器时(对应 NAT式负载均衡), 如果该第二 数据报文的目的 IP地址与第一数据报文的源 IP地址相同, 该第二数据报文 的源 IP地址与处理器在对第一数据进行均衡处理后确定的目的服务器的内 部 IP地址相同, 该第二数据报文的目的端口与第一数据报文的源 IP地址相 同, 该第二数据报文的源端口与处理器在对第一数据进行均衡处理后确定的 目的服务器的内部端口相同,以及第二数据报文传输层协议号与该第一数据 报文的传输层协议号相同, 由于负载均衡处理器基于 L3/4层信息进行负载 均衡处理, 可以确定该第二数据报文是目的服务器生成的与该第一数据报文 相对应的响应数据报文(即, 第二数据报文与第一数据报文属于该客户端设 备与该目的服务器之间的同一次通信连接)。 Specifically, when the sending end is a server (corresponding to NAT-type load balancing), if the destination IP address of the second data packet is the same as the source IP address of the first data packet, the source IP address of the second data packet The address is the same as the internal IP address of the destination server determined by the processor after the first data is equalized. The destination port of the second data packet is the same as the source IP address of the first data packet, and the second data packet is the second data packet. The source port is the same as the internal port of the destination server determined by the processor after equalizing the first data, and the second data packet transport layer protocol number is the same as the transport layer protocol number of the first data packet, due to the load The equalization processor performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server (ie, the second data packet is The first data packet belongs to the same communication connection between the client device and the destination server).
从而, 网卡模块 320可以将该第二数据报文的源 IP地址修改为该第一 数据报文的目的服务器的外部 IP地址的目的 IP地址(与第一数据报文的目 的 IP相同 ), 并将该第二数据报文的源端口修改为该第一数据报文的目的服 务器的外部端口 (与第一数据报文的目的端口相同), 从而能够向该 (发送 第一数据报文的 )客户端设备发送该第二数据报文。 Therefore, the network card module 320 can modify the source IP address of the second data packet to the destination IP address of the external IP address of the destination server of the first data packet (same as the destination IP address of the first data packet), and Modifying the source port of the second data packet to the external port of the destination server of the first data packet (same as the destination port of the first data packet), so as to be able to send the first data packet The client device sends the second data packet.
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
并且, 该服务器信息包括第二控制信息表项, 该第二控制信息表项用于 指示该第一数据报文的目的服务器的内部 IP地址、 该第一数据报文的目的 服务器的内部端口、 该第一数据报文的源 IP地址、 该第一数据报文的源端
口以及该第一数据报文的传输层协议号与该第一数据报文的目的服务器的 外部 IP地址和外部端口的对应关系。 And the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, The source IP address of the first data packet and the source end of the first data packet Correspondence between the port and the transport layer protocol number of the first data packet and the external IP address and the external port of the destination server of the first data packet.
具体地说, 负载均衡处理模块 310在根据第一数据报文的 L3/4层信息 进行负载均衡处理(NAT式负载均衡)并确定目的服务器后, 可以根据该第 一数据报文的 L3/4层信息, 生成正反两个方向的控制信息表项。 Specifically, after the load balancing processing (NAT-type load balancing) is performed according to the L3/4 layer information of the first data packet, and the destination server is determined, the load balancing processing module 310 may be configured according to the L3/4 of the first data packet. Layer information, generating control information entries in both forward and reverse directions.
这里, 正方向是指从客户端设备到服务器的方向, 具体地说, 正方向控 制信息表项可以包括, 例如, 第一数据报文的源 IP地址、 源端口、 目的 IP 地址、 目的端口以及第一数据报文的传输层协议号 (以下, 为了便于说明, 筒称第一五元组)与目的服务器信息 (例如, 包括该目的服务器的 IP地址 和端口) 的对应关系, 从而网卡模块 320可以根据第二数据报文的源 IP地 址、 源端口、 目的 IP地址、 目的端口以及第二数据报文的传输层协议号(以 下, 为了便于说明, 筒称第二五元组), 查找该控制信息表项, 在该第二五 元组与控制信息表项中记载的第一五元组相同的情况下, 可以确定, 指示该 第二数据报文的目的服务器的目的服务器信息为与该第一五元组相对应的 服务器信息。 从而, 网卡模块 320可以将该第二数据报文的目的 IP地址修 改为该 (与第一五元组相对应的控制信息指示的) 目的服务器的 IP地址, 并将该第二数据报文的目的端口修改为该(与第一五元组相对应的控制信息 指示的) 目的服务器的端口, 能够向该(与第一五元组相对应的控制信息指 示的) 目的服务器发送该第二数据报文。 Here, the forward direction refers to the direction from the client device to the server. Specifically, the forward direction control information entry may include, for example, a source IP address of the first data packet, a source port, a destination IP address, a destination port, and The transport layer protocol number of the first data message (hereinafter, for convenience of description, the first quintuple) and the destination server information (for example, including the IP address and port of the destination server), so that the network card module 320 The source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet (hereinafter, referred to as the second quintuple for convenience of description) may be searched according to the source IP address, the source port, the destination IP address, the destination port, and the second data packet. The control information entry may be determined when the second quintuple is the same as the first quintuple described in the control information entry, and the destination server information indicating the destination server of the second data packet is The server information corresponding to the first quintuple. Therefore, the network card module 320 can modify the destination IP address of the second data packet to the IP address of the destination server (indicated by the control information corresponding to the first quintuple), and the second data packet is The destination port is modified to be the port of the destination server (indicated by the control information corresponding to the first quintuple), and the second server is capable of transmitting the second data to the destination server (indicated by the control information corresponding to the first quintuple) Message.
这里, 反方向是指从服务器到客户端设备的方向, 具体地说, 反方向控 制信息表项可以包括, 例如, 目的服务器的内部 IP地址、 目的服务器的内 部端口、 第一数据报文的源 IP地址、 第一数据报文的源端口以及第一数据 报文的传输层协议号(以下, 为了便于说明, 筒称第三五元组)与第一数据 报文的目的 IP地址(与目的服务器的外部 IP地址相同)、第一数据报文的目 的端口 (与目的服务器的外部端口相同)的对应关系, 从而网卡模块 320可 以根据第二数据 4艮文的源 IP地址、 源端口、 目的 IP地址、 目的端口以及第 二数据报文的传输层协议号 (上述第二五元组), 查找该控制信息表项, 在 该第二五元组与控制信息表项中记载的第三五元组相同的情况下, 可以确 定,发送该第二数据报文的服务器为与该第一五元组相对应的第一数据报文 的目的服务器。 从而, 网卡模块 320可以将该第二数据报文的源 IP地址修 改为该控制信息表项指示的与第三五元组相对应的第一数据报文的目的 IP
地址(与目的服务器的外部 IP地址相同), 并将该第二数据报文的目的端口 修改为该控制信息表项指示的与第一五元组相对应的第一数据报文的目的 端口 (与目的服务器的外部端口相同), 从而能够向该 (发送第一数据报文 的)客户端设备发送该第二数据报文。 以下,省略对相同或相似情况的说明。 Here, the reverse direction refers to the direction from the server to the client device. Specifically, the reverse direction control information entry may include, for example, an internal IP address of the destination server, an internal port of the destination server, and a source of the first data packet. The IP address, the source port of the first data packet, and the transport layer protocol number of the first data packet (hereinafter, for convenience of description, the third quintuple) and the destination IP address of the first data packet (and purpose) The server has the same external IP address, and the destination port of the first data packet (same as the external port of the destination server), so that the network card module 320 can use the source IP address, source port, and destination of the second data. The IP address, the destination port, and the transport layer protocol number of the second data packet (the second quintuple), and the control information entry, the third five recorded in the second quintuple and the control information entry. If the tuple is the same, it may be determined that the server that sends the second data packet is the destination server of the first data packet corresponding to the first quintuple. Therefore, the network card module 320 can modify the source IP address of the second data packet to the destination IP address of the first data packet corresponding to the third quintuple indicated by the control information entry. An address (which is the same as the external IP address of the destination server), and the destination port of the second data packet is modified to be the destination port of the first data packet corresponding to the first quintuple indicated by the control information entry ( The same as the external port of the destination server, so that the second data packet can be sent to the client device that sends the first data packet. Hereinafter, the description of the same or similar cases will be omitted.
可选地, 在本发明实施例中, 该网卡模块 320还用于在接收到该第一控 制信息表项后, 启动定时器, 并确定在该定时器超时之前未接收到该第二数 据报文; 或 Optionally, in the embodiment of the present invention, the network card module 320 is further configured to: after receiving the first control information entry, start a timer, and determine that the second datagram is not received before the timer expires. Text; or
用于确定在该客户端设备和该第一数据报文的目的服务器之间建立的 用于传输该第一数据报文的通信连接结束; And determining to end a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet;
用于删除该第一控制信息表项。 Used to delete the first control information entry.
并且, 该网卡模块 320还用于在接收到该第二控制信息表项后, 启动定 时器, 并确定在该定时器超时之前未接收到该第二数据报文; 或 And the NIC module 320 is further configured to: after receiving the second control information entry, start the timer, and determine that the second data packet is not received before the timer expires; or
用于确定在该客户端设备和该第一数据报文的目的服务器之间建立的 用于传输该第一数据报文的通信连接结束; And determining to end a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet;
用于删除该第二控制信息表项。 Used to delete the second control information entry.
具体地说, 网卡模块 320在从负载均衡处理模块 310获取控制信息表项 (包括第一控制信息表项和第二控制信息表项)后, 在长时间 (定时器超时 后, 例如, 30分钟)未接收到能够根据该控制信息表项包括的控制信息进行 传输的数据报文(例如, 上述第二数据报文), 可以认为第一数据报文所属 通信连接已结束, 从而可以删除该控制信息表项(包括第一控制信息表项和 第二控制信息表项)。 Specifically, after acquiring the control information entry (including the first control information entry and the second control information entry) from the load balancing processing module 310, the NIC module 320 is for a long time (after the timer expires, for example, 30 minutes) The data packet (for example, the second data packet) that can be transmitted according to the control information included in the control information table is not received, and the communication connection to which the first data packet belongs is considered to be ended, so that the control can be deleted. The information item (including the first control information item and the second control information item).
并且, 网卡模块 320在从负载均衡处理模块 310获取控制信息表项(包 括第一控制信息表项和第二控制信息表项 )后, 检测到指示通信连接结束的 数据报文后, 可以认为第一数据报文所属通信连接已结束, 从而可以删除该 控制信息表项 (包括第一控制信息表项和第二控制信息表项)。 以下, 省略 对相同或相似情况的说明。 After the NIC module 320 obtains the control information entry (including the first control information entry and the second control information entry) from the load balancing processing module 310, after detecting the data packet indicating the end of the communication connection, the NIC module 320 may consider The communication connection to which the data packet belongs is ended, so that the control information entry (including the first control information entry and the second control information entry) can be deleted. Hereinafter, the description of the same or similar cases will be omitted.
以上列举了根据第二数据报文的源 IP地址、 源端口、 目的 IP地址、 目 的端口以及第二数据报文的传输层协议号,确定能够根据该控制信息控制该 第二数据报文的传输, 应理解, 本发明并不限定于此, 其他判定是否能够根 据该控制信息控制该第二数据报文的传输的方法(例如, 确定第一数据报文 与第二数据报文属于同一客户端设备与同一服务器之间的同一次通信连接
的方法), 均落入本发明的保护范围内。 The above determines that the second data packet can be controlled according to the control information according to the source IP address, the source port, the destination IP address, the destination port, and the transport layer protocol number of the second data packet. It should be understood that the present invention is not limited thereto, and other methods for determining whether the second data message can be transmitted according to the control information (for example, determining that the first data message and the second data message belong to the same client) The same communication connection between the device and the same server The method) falls within the scope of protection of the present invention.
下面, 对处理器用于根据数据报文的 L7层信息, 或者, L3/4层信息和 L7层信息进行负载均衡的情况进行说明。 In the following, the processor is configured to perform load balancing according to the L7 layer information of the data packet, or the L3/4 layer information and the L7 layer information.
负载均衡处理模块 310接收到网卡模块 320发送的第一数据报文后,通 过对数据报文的 L3/4层进行解析, 例如, 对数据报文进行 SPI, 从而获取该 数据 文的 L3/4层信息(例如, 源 IP地址、 目的 IP地址、 源端口和目的端 口等), 并且, 通过对数据报文的 L7 层进行解析, 例如, 对数据报文进行 DPI, 从而获取该数据报文的 L7层信息 (例如, 该数据报文的 URL等)。 After receiving the first data packet sent by the network card module 320, the load balancing processing module 310 parses the L3/4 layer of the data packet, for example, performs SPI on the data packet to obtain the L3/4 of the data packet. The layer information (for example, the source IP address, the destination IP address, the source port, the destination port, and the like), and the L7 layer of the data packet is parsed, for example, DPI is performed on the data packet, thereby acquiring the data packet. L7 layer information (for example, the URL of the data message, etc.).
在本发明实施例中, 可能存在第一数据报文的 L7层信息为空 (即, 不 存在 URL等) 的情况, 此时, 负载均衡处理模块 310仅根据 L3/4层信息进 行负载均衡处理, 并且该根据 L3/4层信息进行负载均衡处理的方法与现有 技术相同, 这里, 为避免赘述, 省略其说明。 In the embodiment of the present invention, the L7 layer information of the first data packet may be empty (that is, there is no URL or the like). At this time, the load balancing processing module 310 performs load balancing processing only according to the L3/4 layer information. The method of performing load balancing processing based on the L3/4 layer information is the same as that of the prior art. Here, in order to avoid redundancy, the description thereof will be omitted.
并且, 在第一数据报文的 L7层信息不为空(即, 存在 URL等)的情况 下, 负载均衡处理模块 310可以根据 L7层信息进行负载均衡处理, 并且该 根据 L7层信息进行负载均衡处理的方法与现有技术相同, 这里, 为避免赘 述, 省略其说明。 Moreover, in a case where the L7 layer information of the first data packet is not empty (that is, there is a URL or the like), the load balancing processing module 310 may perform load balancing processing according to the L7 layer information, and perform load balancing according to the L7 layer information. The method of processing is the same as that of the prior art, and the description thereof is omitted here to avoid redundancy.
在本发明实施例中, 控制信息作为该负载均衡处理的结果, 例如, 可以 包括指示目的服务器的服务器信息, 以及指示网卡模块 320需要对后续数据 报文(主要是客户端设备发送给服务器的数据报文)进行 L7 层解析的 L7 层解析指示标识。 并且, 在本发明实施例中, 负载均衡处理模块 310可以根 据负载均衡处理的结果, 直接控制发送设备(例如, 可以是该网卡模块 320 ) 将该第一数据报文发送给与该负载均衡处理的结果相对应的目的服务器。 并 将该控制信息发送给网卡模块 320。 In the embodiment of the present invention, the control information, as a result of the load balancing process, may include, for example, server information indicating the destination server, and indicating that the network card module 320 needs to send subsequent data packets (mainly data sent by the client device to the server). Message) The L7 layer resolution indication flag for L7 layer parsing. In addition, in the embodiment of the present invention, the load balancing processing module 310 can directly control the sending device (for example, the network card module 320) to send the first data packet to the load balancing processing according to the result of the load balancing processing. The result corresponds to the destination server. And sending the control information to the network card module 320.
在本发明实施例中, 该服务器信息用于指示该第一数据报文的目的服务 器的内部网际协议 IP地址和内部端口。 In the embodiment of the present invention, the server information is used to indicate an internal internet protocol IP address and an internal port of the destination server of the first data packet.
可选地, 在本发明实施例中, 该服务器信息是该负载均衡处理模块根据 该第一数据报文的 L3/4层信息和 L7层信息确定的, 或 Optionally, in the embodiment of the present invention, the server information is determined by the load balancing processing module according to the L3/4 layer information and the L7 layer information of the first data packet, or
该服务器信息是该负载均衡处理模块根据该第一数据报文的 L7层信息 确定的, 该控制信息还包括 L7层解析指示标识, 贝' J The server information is determined by the load balancing processing module according to the L7 layer information of the first data packet, where the control information further includes an L7 layer resolution indication identifier,
该网卡模块具体用于当该第二数据报文的五元组与该第一数据报文的 五元组相同时,根据该 L7层解析指示标识,对该第二数据报文进行 L7层信
息解析, 以获取用于指示该第二数据报文的目的服务器的统一资源定位器The NIC module is specifically configured to: when the quintuple of the second data packet is the same as the quintuple of the first data packet, perform L7 layer signaling on the second data packet according to the L7 layer resolution indication identifier Parsing to obtain a uniform resource locator for indicating the destination server of the second data packet
URL地址的 URL信息, 其中, 该五元组为源 IP地址、 源端口、 目的 IP地 址、 目的端口和传输层协议号; URL information of the URL address, where the quintuple is a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol number;
如果该 URL信息不为空, 则向该负载均衡处理器发送该第二数据报文 和该 URL信息, 以便于该负载均衡处理器根据该 URL信息, 确定该第二数 据报文的目的服务器, 并向该第二数据报文的目的服务器发送该第二数据报 文; 或 If the URL information is not empty, sending the second data packet and the URL information to the load balancing processor, so that the load balancing processor determines the destination server of the second data packet according to the URL information, And sending the second data packet to the destination server of the second data packet; or
如果该 URL信息为空, 则根据该服务器信息, 向该第一数据报文的目 的服务器发送该第二数据报文。 If the URL information is empty, the second data message is sent to the destination server of the first data message according to the server information.
具体地说负载均衡处理模块 310可以将目的服务器的在服务器集群内部 的内部 IP地址和内部端口下发给网卡模块 320。 Specifically, the load balancing processing module 310 can send the internal IP address and the internal port of the destination server in the server cluster to the network card module 320.
网卡模块 320可以从负载均衡处理模块 310获取该目的服务器的在服务 器集群内部的内部 IP地址、 内部端口以及 L7层解析指示标识, 并且, 负载 均衡处理模块 310可以为该目的服务器的 IP地址、端口以及 L7层解析指示 标识。 The NIC module 320 may obtain the internal IP address, the internal port, and the L7 layer resolution indication identifier of the destination server in the server cluster from the load balancing processing module 310, and the load balancing processing module 310 may be the IP address and port of the destination server. And the L7 layer resolution indication identifier.
网卡模块 320可以接收发送端发送的第二数据报文, 这里, 发送端可以 是上述客户端设备, 也可以是服务器, 本发明并未特别限定, 例如, 在负载 均衡器采用 DR式负载均衡或 IP TUN式负载均衡时, 服务器(目的服务器 ) 返回给客户端设备的报文不通过负载均衡器, 因此, 该第二数据报文的发送 端为客户端设备; 例如, 在负载均衡器采用 NAT式负载均衡时, 由于服务 器(目的服务器)返回给客户端设备的报文需要通过负载均衡器, 因此, 该 第二数据报文的发送端可以为客户端设备, 也可以为服务器(目的服务器)。 以下, 以负载均衡器采用 NAT式负载均衡的情况为例进行说明。 The NIC module 320 can receive the second data packet sent by the sending end. Here, the sending end can be the client device or the server, and the present invention is not particularly limited. For example, the load balancer adopts DR load balancing or In the IP TUN load balancing mode, the server (destination server) returns the packet to the client device without passing through the load balancer. Therefore, the sender of the second data packet is the client device; for example, the NAT is used in the load balancer. In the load balancing mode, the packet sent by the server (destination server) to the client device needs to pass through the load balancer. Therefore, the sender of the second data packet may be a client device or a server (destination server). . Hereinafter, a case where the load balancer adopts NAT-type load balancing will be described as an example.
网卡模块 320根据从负载均衡处理模块 310获取的服务器信息,发送该 第二数据报文的传输。 The network card module 320 transmits the transmission of the second data message based on the server information acquired from the load balancing processing module 310.
具体地说, 一方面, 在发送端为客户端设备时, 如果该第二数据报文的 目的 IP地址、 源 IP地址、 目的端口、 源端口以及传输层协议号(TCP连接 或 UDP连接 )与该第一数据报文的目的 IP地址、 源 IP地址、 目的端口、 源 端口以及传输层协议号 ( TCP连接或 UDP连接)相同, 由于负载均衡处理 模块 310基于 L3/4层信息进行负载均衡处理, 对于第二数据报文的处理依 据即 L3/4层信息(包括该第二数据报文的目的 IP地址、 源 IP地址、 目的端
口、 源端口以及传输层协议号)与对于第一数据报文的处理依据相同, 网卡 模块 320可以确定该第二数据报文的目的服务器与第一数据报文的目的服务 器相同 (即, 第二数据报文与第一数据报文属于该客户端设备与该目的服务 器之间的同一次通信连接)。 Specifically, on the one hand, when the sending end is a client device, if the destination IP address, source IP address, destination port, source port, and transport layer protocol number (TCP connection or UDP connection) of the second data packet are The destination IP address, the source IP address, the destination port, the source port, and the transport layer protocol number (TCP connection or UDP connection) of the first data packet are the same, because the load balancing processing module 310 performs load balancing processing based on the L3/4 layer information. For processing the second data packet, that is, L3/4 layer information (including the destination IP address, source IP address, and destination end of the second data packet) The port, the source port, and the transport layer protocol number are the same as the processing for the first data packet, and the network card module 320 can determine that the destination server of the second data packet is the same as the destination server of the first data packet (ie, The two data messages and the first data message belong to the same communication connection between the client device and the destination server.
其后, 网卡模块 320可以根据 L7层解析指示标识, 获取第二数据报文 的 L7层信息, 即, 第二数据报文的 URL地址。 Then, the NIC module 320 can obtain the L7 layer information of the second data packet, that is, the URL address of the second data packet, according to the L7 layer resolution indication identifier.
如果网卡模块 320能够获取第二数据报文的 URL地址, 则向负载均衡 处理模块 310发送该第二数据报文以及该 URL地址, 从而, 负载均衡处理 模块 310无需对该第二数据报文进行 L7层解析,可以直接根据该 URL地址 进行负载均衡处理, 在本发明实施例中, 由于解析 URL的过程由网卡模块 320进行, 即通过硬件解析, 与通过负载均衡处理模块 310利用软件解析的 方式相比, 提高了解析速度, 并降低了对负载均衡处理模块 310的负担。 负 载均衡处理模块 310在根据 URL确定该第二数据报文的目的服务器后 (可 能与第一数据报文的目的服务器相同,也可能与第一数据报文的目的服务器 相异), 可以通过发送设备(例如, 该网关设备), 发送该第二数据报文。。 If the network card module 320 can obtain the URL address of the second data packet, the second data packet and the URL address are sent to the load balancing processing module 310, so that the load balancing processing module 310 does not need to perform the second data packet. In the L7 layer parsing, the load balancing process can be directly performed according to the URL address. In the embodiment of the present invention, the process of parsing the URL is performed by the network card module 320, that is, by hardware parsing, and by means of the software that is parsed by the load balancing processing module 310. In comparison, the resolution speed is increased and the burden on the load balancing processing module 310 is reduced. After the destination server of the second data packet is determined according to the URL (may be the same as the destination server of the first data packet, and may be different from the destination server of the first data packet), the load balancing processing module 310 may send The device (eg, the gateway device) sends the second data message. .
另外, 如果网卡模块 320不能获取第二数据报文的 URL地址(第二数 据报文的 L7层信息为空 ),则可以根据该服务器信息,发送该第二数据报文。 In addition, if the network card module 320 cannot obtain the URL address of the second data packet (the L7 layer information of the second data packet is empty), the second data packet may be sent according to the server information.
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
具体地说, 负载均衡处理模块 310在根据第一数据报文的 L7层信息进 行负载均衡处理(对应 DR式负载均衡或 IP TUN式负载均衡)并确定目的 服务器后, 可以根据该第一数据报文的 L3/4层信息, 仅生成上述正方向的 控制信息表项。 Specifically, the load balancing processing module 310 may perform load balancing processing (corresponding to DR-type load balancing or IP TUN-type load balancing) according to the L7 layer information of the first data packet, and determine the destination server, according to the first datagram. For the L3/4 layer information of the text, only the control information entries in the positive direction described above are generated.
可选地, 在本发明实施例中, 该服务器信息还用于指示该第一数据报文 的目的服务器的外部 IP地址和外部端口, 则 Optionally, in the embodiment of the present invention, the server information is further used to indicate an external IP address and an external port of the destination server of the first data packet,
该网卡模块具体用于当该第二数据报文的源 IP地址与该目的服务器的 内部 IP地址相同, 且该第二数据报文的源端口与该目的服务器的内部端口 信息相同, 且该第二数据报文的目的 IP地址与该第一数据报文的源 IP地址 相同, 且该第二数据报文的目的端口与该第一数据报文的源端口相同, 且该 第二数据报文的传输层协议号与该第一数据报文的传输层协议号相同时,
根据该第一数据报文的目的服务器的外部 IP地址和外部端口, 发送该第二 数据报文。 The NIC module is specifically configured to: when the source IP address of the second data packet is the same as the internal IP address of the destination server, and the source port of the second data packet is the same as the internal port information of the destination server, and the The destination IP address of the second data packet is the same as the source IP address of the first data packet, and the destination port of the second data packet is the same as the source port of the first data packet, and the second data packet is the second data packet. When the transport layer protocol number is the same as the transport layer protocol number of the first data packet, And sending the second data packet according to the external IP address of the destination server of the first data packet and the external port.
具体地说, 在发送端为服务器时(对应 NAT式负载均衡), 如果该第二 数据报文的目的 IP地址与第一数据报文的源 IP地址相同, 该第二数据报文 的源 IP地址与负载均衡处理模块 310在对第一数据进行均衡处理后确定的 目的服务器的内部 IP地址相同, 该第二数据报文的目的端口与第一数据报 文的源 IP地址相同, 该第二数据报文的源端口与负载均衡处理模块 310在 对第一数据进行均衡处理后确定的目的服务器的内部端口相同, 以及第二数 据报文传输层协议号与该第一数据报文的传输层协议号相同, 由于负载均 衡处理模块 310基于 L3/4层信息进行负载均衡处理, 可以确定该第二数据 报文是目的服务器生成的与该第一数据报文相对应的响应数据报文(即, 第 二数据报文与第一数据报文属于该客户端设备与该目的服务器之间的同一 次通信连接)。 Specifically, when the sending end is a server (corresponding to NAT-type load balancing), if the destination IP address of the second data packet is the same as the source IP address of the first data packet, the source IP address of the second data packet The address and load balancing processing module 310 determines that the internal IP address of the destination server is the same after the equalization processing of the first data, and the destination port of the second data packet is the same as the source IP address of the first data packet, and the second The source port of the data packet is the same as the internal port of the destination server determined by the load balancing processing module 310 after the equalization processing on the first data, and the second data packet transport layer protocol number and the transport layer of the first data packet. The protocol number is the same. The load balancing processing module 310 performs load balancing processing based on the L3/4 layer information, and determines that the second data packet is a response data packet corresponding to the first data packet generated by the destination server. The second data packet and the first data packet belong to the same communication connection between the client device and the destination server.
从而, 网卡模块 320可以将该第二数据报文的源 IP地址修改为该第一 数据报文的目的服务器的外部 IP地址的目的 IP地址(与第一数据报文的目 的 IP相同 ), 并将该第二数据报文的源端口修改为该第一数据报文的目的服 务器的外部端口 (与第一数据报文的目的端口相同), 从而能够向该 (发送 第一数据报文的)客户端设备发送该第二数据报文。 Therefore, the network card module 320 can modify the source IP address of the second data packet to the destination IP address of the external IP address of the destination server of the first data packet (same as the destination IP address of the first data packet), and Modifying the source port of the second data packet to the external port of the destination server of the first data packet (same as the destination port of the first data packet), so as to be able to send the first data packet The client device sends the second data packet.
可选地, 在本发明实施例中, 该服务器信息包括第一控制信息表项, 该 第一控制信息表项用于指示该第一数据报文的五元组与该第一数据报文的 目的月良务器的内部 IP地址和内部端口的对应关系。 Optionally, in the embodiment of the present invention, the server information includes a first control information entry, where the first control information entry is used to indicate a quintuple of the first data packet and the first data packet. The correspondence between the internal IP address of the destination server and the internal port.
并且, 该服务器信息包括第二控制信息表项, 该第二控制信息表项用于 指示该第一数据报文的目的服务器的内部 IP地址、 该第一数据报文的目的 服务器的内部端口、 该第一数据报文的源 IP地址、 该第一数据报文的源端 口以及该第一数据报文的传输层协议号与该第一数据报文的目的服务器的 外部 IP地址和外部端口的对应关系。 And the server information includes a second control information entry, where the second control information entry is used to indicate an internal IP address of the destination server of the first data packet, an internal port of the destination server of the first data packet, a source IP address of the first data packet, a source port of the first data packet, and a transport layer protocol number of the first data packet, and an external IP address and an external port of the destination server of the first data packet Correspondence relationship.
具体地说, 负载均衡处理模块 310在根据第一数据报文的 L3/4层信息 进行负载均衡处理(NAT式负载均衡)并确定目的服务器后, 可以根据该第 一数据报文的 L3/4层信息, 生成上述正反两个方向的控制信息表项。 Specifically, after the load balancing processing (NAT-type load balancing) is performed according to the L3/4 layer information of the first data packet, and the destination server is determined, the load balancing processing module 310 may be configured according to the L3/4 of the first data packet. Layer information, generating control information entries in both the forward and reverse directions.
可选地, 如上所述, 在本发明实施例中, 该网卡模块 320还用于在接收 到该第一控制信息表项后, 启动定时器, 并确定在该定时器超时之前未接收
到该第二数据报文; 或 Optionally, as described above, in the embodiment of the present invention, the network card module 320 is further configured to: after receiving the first control information entry, start a timer, and determine that the timer is not received before the timer expires. To the second data message; or
用于确定在该客户端设备和该第一数据报文的目的服务器之间建立的 用于传输该第一数据报文的通信连接结束; And determining to end a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet;
用于删除该第一控制信息表项。 Used to delete the first control information entry.
并且, 该网卡模块 320还用于在接收到该第二控制信息表项后, 启动定 时器, 并确定在该定时器超时之前未接收到该第二数据报文; 或 And the NIC module 320 is further configured to: after receiving the second control information entry, start the timer, and determine that the second data packet is not received before the timer expires; or
用于确定在该客户端设备和该第一数据报文的目的服务器之间建立的 用于传输该第一数据报文的通信连接结束; And determining to end a communication connection established between the client device and the destination server of the first data packet for transmitting the first data packet;
用于删除该第二控制信息表项。 Used to delete the second control information entry.
应理解, 在以上实施例中, 已对负载均衡器采用 NAT式负载均衡的实 施例进行了说明, 但本发明并不在于此, 例如, 负载均衡器还可以采用 DR 式负载均衡或 IP TUN式负载均衡, 此时, 服务器(目的服务器)返回给客 户端设备的报文不通过负载均衡器, 因此, 该第二数据报文的发送端为客户 端设备。 统 300中的各单元和上述其他操作和 /或功能分别为了实现图 1中的方法 100 的相应流程。 It should be understood that in the foregoing embodiment, the embodiment in which the load balancer adopts NAT-type load balancing has been described, but the present invention is not limited thereto. For example, the load balancer may also adopt the DR-type load balancing or the IP TUN type. Load balancing. At this time, the packet returned by the server (destination server) to the client device does not pass through the load balancer. Therefore, the sender of the second data packet is the client device. The units in system 300 and the other operations and/or functions described above are respectively implemented to implement the corresponding processes of method 100 in FIG.
根据本发明实施例的控制数据传输的装置,通过负载均衡处理器根据第 一数据报文确定控制信息, 并向网卡设备下发该控制信息, 网卡设备在接收 到第二数据报文并确定能够根据该控制信息传输该第二数据报文后, 可以根 据该控制信息直接向目的服务器发送该第二数据报文, 或者, 可以获取该第 二数据报文中 URL信息并通知负载均衡处理器以使负载均衡处理器无需对 第二数据报文进行解析,从而,减少负载均衡处理器的处理,提高访问速度, 减小负载均衡处理器的负担。 The device for controlling data transmission according to the embodiment of the present invention determines the control information according to the first data packet by the load balancing processor, and sends the control information to the network card device, and the network card device receives the second data packet and determines that After the second data packet is transmitted according to the control information, the second data packet may be directly sent to the destination server according to the control information, or the URL information in the second data packet may be obtained and notified to the load balancing processor. The load balancing processor does not need to parse the second data packet, thereby reducing the processing of the load balancing processor, improving the access speed, and reducing the load of the load balancing processor.
应理解, 本文中术语 "和 /或", 仅仅是一种描述关联对象的关联关系, 表示可以存在三种关系, 例如, A和 /或 B, 可以表示: 单独存在 A, 同时存 在 A和 B, 单独存在 B这三种情况。 另外, 本文中字符 "/" , 一般表示前后 关联对象是一种 "或" 的关系。 It should be understood that the term "and/or" in this context is merely an association describing the associated object, indicating that there may be three relationships, for example, A and / or B, which may represent: A exists separately, and A and B exist simultaneously There are three cases of B alone. In addition, the character "/" in this article generally indicates that the context object is an "or" relationship.
应理解, 在本发明的各种实施例中, 上述各过程的序号的大小并不意味 着执行顺序的先后, 各过程的执行顺序应以其功能和内在逻辑确定, 而不应 对本发明实施例的实施过程构成任何限定。
本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的各 示例的单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件的结 合来实现。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方案的特 定应用和设计约束条件。 专业技术人员可以对每个特定的应用来使用不同方 法来实现所描述的功能, 但是这种实现不应认为超出本发明的范围。 It should be understood that, in various embodiments of the present invention, the size of the sequence numbers of the above processes does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not be taken to the embodiments of the present invention. The implementation process constitutes any limitation. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
所属领域的技术人员可以清楚地了解到, 为描述的方便和筒洁, 上述描 述的系统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的对应 过程, 在此不再赘述。 It will be apparent to those skilled in the art that, for the convenience of the description and the cleaning process, the specific operation of the system, the device and the unit described above may be referred to the corresponding processes in the foregoing method embodiments, and details are not described herein again.
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置和 方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示 意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可 以有另外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个 系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间 的耦合或直接耦合或通信连接可以是通过一些接口, 装置或单元的间接耦合 或通信连接, 可以是电性, 机械或其它的形式。 In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作 为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或 者全部单元来实现本实施例方案的目的。 The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元 中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一 个单元中。 In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使 用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明 的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部 分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质 中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。 而前 述的存储介质包括: U盘、移动硬盘、只读存储器( ROM, Read-Only Memory )、 随机存取存储器(RAM, Random Access Memory ), 磁碟或者光盘等各种可 以存储程序代码的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护 范围应以所述权利要求的保护范围为准。
The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention, which is essential to the prior art or part of the technical solution, may be embodied in the form of a software product stored in a storage medium, including The instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. . The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.
Claims
1、 一种控制数据传输的方法, 其特征在于, 所述方法包括: 1. A method of controlling data transmission, characterized in that the method includes:
向负载均衡处理器发送来自客户端设备的第一数据报文; Send the first data packet from the client device to the load balancing processor;
接收所述负载均衡处理器发送的控制信息, 其中, 所述控制信息是所述 负载均衡处理器根据所述第一数据报文的 L3/4层信息和 /或所述第一数据报 文的 L7层信息确定的, 所述控制信息包括用于指示所述第一数据报文的目 的服务器的服务器信息; Receive control information sent by the load balancing processor, wherein the control information is the load balancing processor based on the L3/4 layer information of the first data packet and/or the first data packet. Determined by L7 layer information, the control information includes server information indicating the destination server of the first data message;
当接收到第二数据报文时, 根据所述控制信息, 控制所述第二数据报文 的传输。 When the second data message is received, the transmission of the second data message is controlled according to the control information.
2、 根据权利要求 1所述的方法, 其特征在于, 所述服务器信息用于指 示所述第一数据报文的目的服务器的内部网际协议 IP地址和内部端口。 2. The method according to claim 1, wherein the server information is used to indicate the internal Internet Protocol IP address and internal port of the destination server of the first data message.
3、 根据权利要求 2所述的方法, 其特征在于, 所述服务器信息是根据 所述第一数据报文的 L3/4层信息确定的, 贝' J 3. The method according to claim 2, characterized in that the server information is determined based on the L3/4 layer information of the first data message.
所述根据所述控制信息, 控制所述第二数据报文的传输, 具体为: 当所述第二数据报文的五元组与所述第一数据报文的五元组相同时,根 据所述服务器信息, 向所述第一数据报文的目的服务器发送所述第二数据报 文, 其中, 所述五元组为源 IP地址、 源端口、 目的 IP地址、 目的端口和传 输层协议号。 The control of the transmission of the second data message according to the control information is specifically: when the five-tuple of the second data message is the same as the five-tuple of the first data message, according to The server information sends the second data packet to the destination server of the first data packet, wherein the five-tuple is a source IP address, a source port, a destination IP address, a destination port and a transport layer protocol. Number.
4、 根据权利要求 2所述的方法, 其特征在于, 所述服务器信息是根据 所述第一数据报文的 L3/4层信息和第一数据报文的 L7层信息确定的,或根 据所述第一数据报文的 L7层信息确定的, 4. The method according to claim 2, wherein the server information is determined based on the L3/4 layer information of the first data packet and the L7 layer information of the first data packet, or based on the The L7 layer information of the first data packet is determined,
且所述控制信息还包括 L7层解析指示标识, 贝' J And the control information also includes the L7 layer parsing indicator, Bei'J
所述根据所述控制信息, 控制所述第二数据报文的传输, 具体为: 当所述第二数据报文的五元组与所述第一数据报文的五元组相同时,根 据所述 L7层解析指示标识,对所述第二数据报文进行 L7层信息解析, 以获 取用于指示所述第二数据报文的目的服务器的统一资源定位器 URL地址的 The control of the transmission of the second data message according to the control information is specifically: when the five-tuple of the second data message is the same as the five-tuple of the first data message, according to The L7 layer parsing indication indicator performs L7 layer information parsing on the second data message to obtain the Uniform Resource Locator URL address used to indicate the destination server of the second data message.
URL信息, 其中, 所述五元组为源 IP地址、 源端口、 目的 IP地址、 目的端 口和传输层协议号; URL information, wherein the five-tuple is the source IP address, source port, destination IP address, destination port and transport layer protocol number;
如果所述 URL信息不为空, 则向所述负载均衡处理器发送所述第二数 据报文和所述 URL信息, 以便于所述负载均衡处理器根据所述 URL信息, 确定所述第二数据报文的目的服务器, 并向所述第二数据报文的目的服务器
发送所述第二数据报文; If the URL information is not empty, the second data packet and the URL information are sent to the load balancing processor, so that the load balancing processor determines the second data packet based on the URL information. the destination server of the data message, and to the destination server of the second data message Send the second data message;
如果所述 URL信息为空, 则根据所述服务器信息, 向所述第一数据报 文的目的服务器发送所述第二数据报文。 If the URL information is empty, the second data packet is sent to the destination server of the first data packet according to the server information.
5、 根据权利要求 3或 4所述的方法, 其特征在于, 所述服务器信息包 括第一控制信息表项,所述第一控制信息表项用于指示所述第一数据报文的 五元组与所述第一数据报文的目的服务器的内部 IP地址和内部端口的对应 关系。 5. The method according to claim 3 or 4, characterized in that, the server information includes a first control information entry, and the first control information entry is used to indicate the five-element value of the first data message. The corresponding relationship between the group and the internal IP address and internal port of the destination server of the first data message.
6、 根据权利要求 5所述的方法, 其特征在于, 所述方法还包括: 在接收到所述第一控制信息表项后, 启动定时器, 并确定在所述定时器 超时之前未接收到所述第二数据报文; 或 6. The method according to claim 5, characterized in that, the method further includes: after receiving the first control information entry, starting a timer, and determining that the first control information entry is not received before the timer times out. the second data message; or
确定在所述客户端设备与所述第一数据报文的目的服务器之间建立的 用于传输所述第一数据报文的通信连接结束; Determining that the communication connection established between the client device and the destination server of the first data message for transmitting the first data message ends;
删除所述第一控制信息表项。 Delete the first control information entry.
7、 根据权利要求 2至 6中任一项所述的方法, 其特征在于, 所述服务 器信息还用于指示所述第一数据报文的目的服务器的外部 IP地址和外部端 口, 则 7. The method according to any one of claims 2 to 6, characterized in that the server information is also used to indicate the external IP address and external port of the destination server of the first data message, then
所述根据所述控制信息, 控制所述第二数据报文的传输, 具体为: 当所述第二数据报文的源 IP地址与所述目的服务器的内部 IP地址相同, 且所述第二数据报文的源端口与所述目的服务器的内部端口信息相同,且所 述第二数据报文的目的 IP地址与所述第一数据报文的源 IP地址相同, 且所 述第二数据报文的目的端口与所述第一数据报文的源端口相同,且所述第二 数据报文的传输层协议号与所述第一数据报文的传输层协议号相同时, 根 据所述第一数据报文的目的服务器的外部 IP地址和外部端口, 向所述客户 端设备发送所述第二数据报文。 Controlling the transmission of the second data message based on the control information is specifically: when the source IP address of the second data message is the same as the internal IP address of the destination server, and the second The source port of the data packet is the same as the internal port information of the destination server, and the destination IP address of the second data packet is the same as the source IP address of the first data packet, and the second data packet When the destination port of the message is the same as the source port of the first data message, and the transport layer protocol number of the second data message is the same as the transport layer protocol number of the first data message, according to the third The external IP address and external port of the destination server of the data message are used to send the second data message to the client device.
8、 根据权利要求 7所述的方法, 其特征在于, 所述服务器信息包括第 二控制信息表项, 所述第二控制信息表项用于指示所述第一数据报文的目的 服务器的内部 IP地址、 所述第一数据报文的目的服务器的内部端口、 所述 第一数据报文的源 IP地址、 所述第一数据报文的源端口以及所述第一数据 报文的传输层协议号与所述第一数据报文的目的服务器的外部 IP地址和外 部端口的对应关系。 8. The method according to claim 7, wherein the server information includes a second control information entry, and the second control information entry is used to indicate the internal content of the destination server of the first data message. IP address, the internal port of the destination server of the first data message, the source IP address of the first data message, the source port of the first data message, and the transport layer of the first data message Correspondence between the protocol number and the external IP address and external port of the destination server of the first data message.
9、 根据权利要求 8所述的方法, 其特征在于, 所述方法还包括:
在接收到所述第二控制信息表项后, 启动定时器, 并确定在所述定时器 超时之前未接收到所述第二数据报文; 或 9. The method according to claim 8, characterized in that, the method further includes: After receiving the second control information entry, start a timer, and determine that the second data message is not received before the timer times out; or
确定在所述客户端设备和所述第一数据报文的目的服务器之间建立的 用于传输所述第一数据报文的通信连接结束; Determining that the communication connection established between the client device and the destination server of the first data message for transmitting the first data message ends;
删除所述第二控制信息表项。 Delete the second control information entry.
10、 一种控制数据传输的装置, 其特征在于, 所述装置包括: 10. A device for controlling data transmission, characterized in that the device includes:
发送单元, 用于向负载均衡处理器发送来自客户端设备的第一数据报 文; 以及根据处理单元的控制, 传输第二数据报文; A sending unit, configured to send the first data message from the client device to the load balancing processor; and according to the control of the processing unit, transmit the second data message;
接收单元, 用于接收所述负载均衡处理器发送的控制信息, 其中, 所述 控制信息是所述负载均衡处理器根据所述第一数据报文的 L3/4层信息和 /或 所述第一数据报文的 L7层信息确定的, 所述控制信息包括用于指示所述第 一数据报文的目的服务器的服务器信息; 以及用于接收所述第二数据报文; 所述处理单元, 用于当所述接收单元接收所述第二数据报文时, 根据所 述控制信息, 控制所述发送单元传输所述第二数据报文。 A receiving unit configured to receive control information sent by the load balancing processor, wherein the control information is the L3/4 layer information of the load balancing processor according to the first data message and/or the third Determined by the L7 layer information of a data message, the control information includes server information used to indicate the destination server of the first data message; and used to receive the second data message; the processing unit, It is used to control the sending unit to transmit the second data message according to the control information when the receiving unit receives the second data message.
11、 根据权利要求 10所述的装置, 其特征在于, 所述服务器信息用于 指示所述第一数据报文的目的服务器的内部网际协议 IP地址和内部端口。 11. The device according to claim 10, wherein the server information is used to indicate the internal Internet Protocol IP address and internal port of the destination server of the first data message.
12、 根据权利要求 11所述的装置, 其特征在于, 所述服务器信息是根 据所述第一数据报文的 L3/4层信息确定的, 贝' J 12. The device according to claim 11, wherein the server information is determined based on the L3/4 layer information of the first data message.
所述处理单元具体用于当所述第二数据报文的五元组与所述第一数据 报文的五元组相同时, 根据所述服务器信息, 控制所述发送单元向所述第一 数据报文的目的服务器发送所述第二数据报文, 其中, 所述五元组为源 IP 地址、 源端口、 目的 IP地址、 目的端口和传输层协议号。 The processing unit is specifically configured to control the sending unit to the first data message according to the server information when the five-tuple of the second data message is the same as the five-tuple of the first data message. The destination server of the data message sends the second data message, wherein the five-tuple is a source IP address, a source port, a destination IP address, a destination port and a transport layer protocol number.
13、 根据权利要求 11所述的装置, 其特征在于, 所述服务器信息是根 据所述第一数据报文的 L3/4层信息和 L7层信息确定的,或根据所述第一数 据报文的 L7层信息确定的, 13. The device according to claim 11, wherein the server information is determined based on the L3/4 layer information and L7 layer information of the first data packet, or based on the first data packet. The L7 layer information is determined,
且所述控制信息还包括 L7层解析指示标识, 贝' J And the control information also includes the L7 layer parsing indicator, Bei'J
所述处理单元具体用于当所述第二数据报文的五元组与所述第一数据 报文的五元组相同时, 根据所述 L7层解析指示标识, 对所述第二数据报文 进行 L7层信息解析, 以获取用于指示所述第二数据报文的目的服务器的统 一资源定位器 URL地址的 URL信息, 其中, 所述五元组为源 IP地址、 源 端口、 目的 IP地址、 目的端口和传输层协议号;
用于如果所述 URL信息不为空, 则控制所述发送单元向所述负载均衡 处理器发送所述第二数据报文和所述 URL信息, 以便于所述负载均衡处理 器根据所述 URL信息, 确定所述第二数据报文的目的服务器, 并向所述第 二数据报文的目的服务器发送所述第二数据报文; 或 The processing unit is specifically configured to, when the quintuple of the second data packet is the same as the quintuple of the first data packet, process the second data packet according to the L7 layer parsing indicator. Perform L7 layer information parsing on the second data message to obtain URL information indicating the Uniform Resource Locator URL address of the destination server of the second data message, where the five-tuple is the source IP address, source port, and destination IP. Address, destination port and transport layer protocol number; Used to control the sending unit to send the second data message and the URL information to the load balancing processor if the URL information is not empty, so that the load balancing processor can process the data according to the URL. information, determine the destination server of the second data message, and send the second data message to the destination server of the second data message; or
用于如果所述 URL信息为空, 则根据所述服务器信息, 控制所述发送 单元向所述第一数据报文的目的服务器发送所述第二数据报文。 It is used to control the sending unit to send the second data message to the destination server of the first data message according to the server information if the URL information is empty.
14、 根据权利要求 12或 13所述的装置, 其特征在于, 所述服务器信息 包括第一控制信息表项,所述第一控制信息表项用于指示所述第一数据报文 的五元组与所述第一数据报文的目的服务器的内部 IP地址和内部端口的对 应关系。 14. The device according to claim 12 or 13, characterized in that: the server information includes a first control information entry, and the first control information entry is used to indicate the five-element value of the first data message. The corresponding relationship between the group and the internal IP address and internal port of the destination server of the first data message.
15、 根据权利要求 14所述的装置, 其特征在于, 所述处理单元还用于 在确定所述接收单元接收到所述第一控制信息表项后, 启动定时器, 并确定 在所述定时器超时之前未接收到所述第二数据报文; 或 15. The device according to claim 14, wherein the processing unit is further configured to start a timer after determining that the receiving unit receives the first control information entry, and determine that at the timing The second data message is not received before the controller times out; or
用于确定在所述客户端设备和所述第一数据报文的目的服务器之间建 立的用于传输所述第一数据报文的通信连接结束; For determining that the communication connection established between the client device and the destination server of the first data message for transmitting the first data message ends;
用于删除所述第一控制信息表项。 Used to delete the first control information entry.
16、 根据权利要求 11至 15中任一项所述的装置, 其特征在于, 所述服 务器信息还用于指示所述第一数据报文的目的服务器的外部 IP地址和外部 端口, 则 16. The device according to any one of claims 11 to 15, wherein the server information is also used to indicate the external IP address and external port of the destination server of the first data message, then
所述处理单元具体用于当所述第二数据报文的源 IP地址与所述目的服 务器的内部 IP地址相同, 且所述第二数据报文的源端口与所述目的服务器 的内部端口信息相同, 且所述第二数据报文的目的 IP地址与所述第一数据 报文的源 IP地址相同, 且所述第二数据报文的目的端口与所述第一数据报 文的源端口相同,且所述第二数据报文的传输层协议号与所述第一数据报文 的传输层协议号相同时, 根据所述第一数据报文的目的服务器的外部 IP地 址和外部端口, 控制所述发送单元向所述客户端设备发送所述第二数据报 文。 The processing unit is specifically configured to process when the source IP address of the second data message is the same as the internal IP address of the destination server, and the source port of the second data message is the same as the internal port information of the destination server. The same, and the destination IP address of the second data message is the same as the source IP address of the first data message, and the destination port of the second data message is the same as the source port of the first data message. are the same, and the transport layer protocol number of the second data message is the same as the transport layer protocol number of the first data message, according to the external IP address and external port of the destination server of the first data message, Control the sending unit to send the second data message to the client device.
17、 根据权利要求 16所述的装置, 其特征在于, 所述服务器信息包括 第二控制信息表项, 所述第二控制信息表项用于指示所述第一数据报文的目 的服务器的内部 IP地址、 所述第一数据报文的目的服务器的内部端口、 所 述第一数据报文的源 IP地址、 所述第一数据报文的源端口以及所述第一数
据报文的传输层协议号与所述第一数据报文的目的服务器的外部 IP地址和 外部端口的对应关系。 17. The device according to claim 16, wherein the server information includes a second control information entry, and the second control information entry is used to indicate the internal contents of the destination server of the first data message. IP address, the internal port of the destination server of the first data message, the source IP address of the first data message, the source port of the first data message and the first data The corresponding relationship between the transport layer protocol number of the data message and the external IP address and external port of the destination server of the first data message.
18、 根据权利要求 17所述的装置, 其特征在于, 所述处理单元还用于 在确定所述接收单元接收到所述第二控制信息表项后, 启动定时器, 并确定 在所述定时器超时之前未接收到所述第二数据报文; 或 18. The device according to claim 17, wherein the processing unit is further configured to start a timer after determining that the receiving unit receives the second control information entry, and determine that at the timing The second data message is not received before the controller times out; or
用于确定在所述客户端设备和所述第一数据报文的目的服务器之间建 立的用于传输所述第一数据报文的通信连接结束; For determining that the communication connection established between the client device and the destination server of the first data message for transmitting the first data message ends;
用于删除所述第二控制信息表项。 Used to delete the second control information entry.
19、 一种控制数据传输的系统, 其特征在于, 所述系统包括: 19. A system for controlling data transmission, characterized in that the system includes:
负载均衡处理模块, 用于从网卡模块获取第一数据报文, 并根据所述第 一数据报文的 L3/4层信息和 /或所述第一数据报文的 L7层信息,确定用于指 示所述第一数据报文的目的服务器的服务器信息, 向所述网卡模块发送包括 所述服务器信息的控制信息; The load balancing processing module is configured to obtain the first data packet from the network card module, and determine the data packet for the first data packet according to the L3/4 layer information of the first data packet and/or the L7 layer information of the first data packet. Indicate the server information of the destination server of the first data message, and send control information including the server information to the network card module;
网卡模块, 用于向负载均衡处理模块发送来自用户设备的所述第一数据 报文, 以及从所述负载均衡处理模块获取所述控制信息, 当接收到第二数据 报文时, 根据所述控制信息, 控制所述第二数据报文的传输。 The network card module is configured to send the first data packet from the user equipment to the load balancing processing module, and obtain the control information from the load balancing processing module. When receiving the second data packet, according to the Control information, controlling the transmission of the second data message.
20、 根据权利要求 19所述的系统, 其特征在于, 所述服务器信息用于 指示所述第一数据报文的目的服务器的内部网际协议 IP地址和内部端口。 20. The system according to claim 19, wherein the server information is used to indicate the internal Internet Protocol IP address and internal port of the destination server of the first data message.
21、 根据权利要求 20所述的系统, 其特征在于, 所述服务器信息是所 述负载均衡处理模块根据所述第一数据报文的 L3/4层信息确定的, 贝' J 21. The system according to claim 20, wherein the server information is determined by the load balancing processing module based on the L3/4 layer information of the first data message.
所述网卡模块具体用于当所述第二数据报文的五元组与所述第一数据 报文的五元组相同时, 根据所述服务器信息, 向所述第一数据报文的目的服 务器发送所述第二数据报文, 其中, 所述五元组为源 IP地址、 源端口、 目 的 IP地址、 目的端口和传输层协议号。 The network card module is specifically configured to send a message to the destination of the first data message according to the server information when the five-tuple of the second data message is the same as the five-tuple of the first data message. The server sends the second data message, wherein the five-tuple is a source IP address, a source port, a destination IP address, a destination port and a transport layer protocol number.
22、 根据权利要求 20所述的系统, 其特征在于, 所述服务器信息是所 述负载均衡处理模块根据所述第一数据报文的 L3/4层信息和 L7层信息确定 的, 或 22. The system according to claim 20, wherein the server information is determined by the load balancing processing module based on the L3/4 layer information and L7 layer information of the first data message, or
所述服务器信息是所述负载均衡处理模块根据所述第一数据报文的 L7 层信息确定的, The server information is determined by the load balancing processing module based on the L7 layer information of the first data message,
且所述控制信息还包括 L7层解析指示标识, 贝' J And the control information also includes the L7 layer parsing indicator, Bei'J
所述网卡模块具体用于当所述第二数据报文的五元组与所述第一数据
报文的五元组相同时, 根据所述 L7层解析指示标识, 对所述第二数据报文 进行 L7层信息解析, 以获取用于指示所述第二数据报文的目的服务器的统 一资源定位器 URL地址的 URL信息, 其中, 所述五元组为源 IP地址、 源 端口、 目的 IP地址、 目的端口和传输层协议号; The network card module is specifically used to when the five-tuple of the second data message is the same as the first data When the quintuples of the messages are the same, perform L7 layer information parsing on the second data message according to the L7 layer parsing indication mark to obtain unified resources used to indicate the destination server of the second data message. URL information of the locator URL address, wherein the five-tuple is the source IP address, source port, destination IP address, destination port and transport layer protocol number;
如果所述 URL信息不为空, 则向所述负载均衡处理器发送所述第二数 据报文和所述 URL信息, 以便于所述负载均衡处理器根据所述 URL信息, 确定所述第二数据报文的目的服务器, 并向所述第二数据报文的目的服务器 发送所述第二数据报文; 或 If the URL information is not empty, the second data packet and the URL information are sent to the load balancing processor, so that the load balancing processor determines the second data packet based on the URL information. The destination server of the data message, and sends the second data message to the destination server of the second data message; or
如果所述 URL信息为空, 则根据所述服务器信息, 向所述第一数据报 文的目的服务器发送所述第二数据报文。 If the URL information is empty, the second data packet is sent to the destination server of the first data packet according to the server information.
23、 根据权利要求 21或 22所述的系统, 其特征在于, 所述服务器信息 包括第一控制信息表项,所述第一控制信息表项用于指示所述第一数据报文 的五元组与所述第一数据报文的目的服务器的内部 IP地址和内部端口的对 应关系。 23. The system according to claim 21 or 22, characterized in that: the server information includes a first control information entry, and the first control information entry is used to indicate the five-element value of the first data message. The corresponding relationship between the group and the internal IP address and internal port of the destination server of the first data message.
24、 根据权利要求 23所述的系统, 其特征在于, 所述网卡模块还用于 在接收到所述第一控制信息表项后, 启动定时器, 并确定在所述定时器超时 之前未接收到所述第二数据报文; 或 24. The system according to claim 23, wherein the network card module is further configured to start a timer after receiving the first control information entry, and determine that no entry is received before the timer times out. to the second data message; or
用于确定在所述客户端设备和所述第一数据报文的目的服务器之间建 立的用于传输所述第一数据报文的通信连接结束; For determining that the communication connection established between the client device and the destination server of the first data message for transmitting the first data message ends;
用于删除所述第一控制信息表项。 Used to delete the first control information entry.
25、 根据权利要求 20至 24中任一项所述的系统, 其特征在于, 所述服 务器信息还用于指示所述第一数据报文的目的服务器的外部 IP地址和外部 端口, 则 25. The system according to any one of claims 20 to 24, wherein the server information is also used to indicate the external IP address and external port of the destination server of the first data message, then
所述网卡模块具体用于当所述第二数据报文的源 IP地址与所述目的服 务器的内部 IP地址相同, 且所述第二数据报文的源端口与所述目的服务器 的内部端口信息相同, 且所述第二数据报文的目的 IP地址与所述第一数据 报文的源 IP地址相同, 且所述第二数据报文的目的端口与所述第一数据报 文的源端口相同,且所述第二数据报文的传输层协议号与所述第一数据报文 的传输层协议号相同时, 根据所述第一数据报文的目的服务器的外部 IP地 址和外部端口, 向所述客户端设备发送所述第二数据报文。 The network card module is specifically used when the source IP address of the second data message is the same as the internal IP address of the destination server, and the source port of the second data message is the same as the internal port information of the destination server. The same, and the destination IP address of the second data message is the same as the source IP address of the first data message, and the destination port of the second data message is the same as the source port of the first data message. are the same, and the transport layer protocol number of the second data message is the same as the transport layer protocol number of the first data message, according to the external IP address and external port of the destination server of the first data message, Send the second data packet to the client device.
26、 根据权利要求 25所述的系统, 其特征在于, 所述服务器信息包括
第二控制信息表项, 所述第二控制信息表项用于指示所述第一数据报文的目 的服务器的内部 IP地址、 所述第一数据报文的目的服务器的内部端口、 所 述第一数据报文的源 IP地址、 所述第一数据报文的源端口以及所述第一数 据报文的传输层协议号与所述第一数据报文的目的服务器的外部 IP地址和 外部端口的对应关系。 26. The system according to claim 25, characterized in that the server information includes The second control information entry is used to indicate the internal IP address of the destination server of the first data message, the internal port of the destination server of the first data message, the third The source IP address of a data message, the source port of the first data message, the transport layer protocol number of the first data message, and the external IP address and external port of the destination server of the first data message. corresponding relationship.
27、 根据权利要求 26所述的系统, 其特征在于, 所述网卡模块还用于 在接收到所述第二控制信息表项后, 启动定时器, 并确定在所述定时器超时 之前未接收到所述第二数据报文; 或 27. The system according to claim 26, wherein the network card module is further configured to start a timer after receiving the second control information entry, and determine that no entry is received before the timer times out. to the second data message; or
用于确定在所述客户端设备和所述第一数据报文的目的服务器之间建 立的用于传输所述第一数据报文的通信连接结束; For determining that the communication connection established between the client device and the destination server of the first data message for transmitting the first data message ends;
用于删除所述第二控制信息表项。
Used to delete the second control information entry.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2012/079887 WO2014023003A1 (en) | 2012-08-09 | 2012-08-09 | Method, apparatus, and system for controlling data transmission |
CN201280002537.0A CN103201989B (en) | 2012-08-09 | 2012-08-09 | The methods, devices and systems of control data transmission |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2012/079887 WO2014023003A1 (en) | 2012-08-09 | 2012-08-09 | Method, apparatus, and system for controlling data transmission |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014023003A1 true WO2014023003A1 (en) | 2014-02-13 |
Family
ID=48723125
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2012/079887 WO2014023003A1 (en) | 2012-08-09 | 2012-08-09 | Method, apparatus, and system for controlling data transmission |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103201989B (en) |
WO (1) | WO2014023003A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106230992A (en) * | 2016-09-28 | 2016-12-14 | 中国银联股份有限公司 | A kind of load-balancing method and load balancing node |
CN114363256A (en) * | 2020-09-28 | 2022-04-15 | 华为云计算技术有限公司 | Network card-based message analysis method and related device |
CN117354368A (en) * | 2023-12-05 | 2024-01-05 | 北京轻网科技股份有限公司 | Client information transparent transmission method, device and equipment under seven-layer proxy and storage medium |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104158755B (en) * | 2014-07-30 | 2017-12-05 | 华为技术有限公司 | The methods, devices and systems of transmitting message |
WO2016082167A1 (en) * | 2014-11-28 | 2016-06-02 | 华为技术有限公司 | Service processing apparatus and method |
CN105554065B (en) * | 2015-12-03 | 2019-06-18 | 华为技术有限公司 | Handle method, converting unit and the applying unit of message |
CN107493239A (en) * | 2016-06-12 | 2017-12-19 | 中兴通讯股份有限公司 | UDP message forwarding methods, equipment and system |
CN107493254B (en) * | 2016-06-12 | 2021-12-28 | 中兴通讯股份有限公司 | TCP message forwarding method, device and system |
US10419330B2 (en) * | 2016-07-21 | 2019-09-17 | Alibaba Group Holding Limited | Express route transmissions between virtual machines and cloud service computing devices |
CN106131204A (en) * | 2016-07-22 | 2016-11-16 | 无锡华云数据技术服务有限公司 | It is applied to message rapid distribution method and the system thereof of SiteServer LBS |
CN107948088B (en) * | 2018-01-05 | 2021-10-01 | 宝牧科技(天津)有限公司 | Method for balancing network application layer load |
CN111147381B (en) * | 2018-11-02 | 2022-01-18 | 华为技术有限公司 | Flow balancing method and device |
CN109361602B (en) * | 2018-11-12 | 2021-06-22 | 网宿科技股份有限公司 | Method and system for forwarding message based on OpenStack cloud platform |
CN113691410B (en) * | 2020-05-19 | 2023-05-12 | 花瓣云科技有限公司 | Network performance data acquisition method, device and server |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101442493A (en) * | 2008-12-26 | 2009-05-27 | 华为技术有限公司 | Method for distributing IP message, cluster system and load equalizer |
EP2159983A1 (en) * | 2008-08-26 | 2010-03-03 | BRITISH TELECOMMUNICATIONS public limited company | Content distribution network |
CN101808118A (en) * | 2010-03-02 | 2010-08-18 | 浪潮(北京)电子信息产业有限公司 | Access method, device and system of server |
CN102131239A (en) * | 2010-10-27 | 2011-07-20 | 华为技术有限公司 | Business processing unit and method, business control gateway and load balancing method |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2003211955A1 (en) * | 2003-02-13 | 2004-09-06 | Fujitsu Limited | Transmission system, distribution route control device, load information collection device, and distribution route control method |
CN100372323C (en) * | 2003-06-12 | 2008-02-27 | 华为技术有限公司 | A method for accessing server group |
CN101335709B (en) * | 2008-08-07 | 2010-09-22 | 杭州华三通信技术有限公司 | Method for implementing load sharing among flow analysis servers and shunting equipment |
CN102118433A (en) * | 2010-12-27 | 2011-07-06 | 网宿科技股份有限公司 | Multiple-tier distributed cluster system |
-
2012
- 2012-08-09 CN CN201280002537.0A patent/CN103201989B/en active Active
- 2012-08-09 WO PCT/CN2012/079887 patent/WO2014023003A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2159983A1 (en) * | 2008-08-26 | 2010-03-03 | BRITISH TELECOMMUNICATIONS public limited company | Content distribution network |
CN101442493A (en) * | 2008-12-26 | 2009-05-27 | 华为技术有限公司 | Method for distributing IP message, cluster system and load equalizer |
CN101808118A (en) * | 2010-03-02 | 2010-08-18 | 浪潮(北京)电子信息产业有限公司 | Access method, device and system of server |
CN102131239A (en) * | 2010-10-27 | 2011-07-20 | 华为技术有限公司 | Business processing unit and method, business control gateway and load balancing method |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106230992A (en) * | 2016-09-28 | 2016-12-14 | 中国银联股份有限公司 | A kind of load-balancing method and load balancing node |
CN106230992B (en) * | 2016-09-28 | 2019-04-26 | 中国银联股份有限公司 | A kind of load-balancing method and load balancing node |
CN114363256A (en) * | 2020-09-28 | 2022-04-15 | 华为云计算技术有限公司 | Network card-based message analysis method and related device |
CN114363256B (en) * | 2020-09-28 | 2024-10-18 | 华为云计算技术有限公司 | Message parsing method based on network card and related device |
CN117354368A (en) * | 2023-12-05 | 2024-01-05 | 北京轻网科技股份有限公司 | Client information transparent transmission method, device and equipment under seven-layer proxy and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN103201989B (en) | 2016-05-25 |
CN103201989A (en) | 2013-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014023003A1 (en) | Method, apparatus, and system for controlling data transmission | |
JP7004405B2 (en) | Systems and methods for distributed flow state P2P configuration in virtual networks | |
US12047287B2 (en) | Data transmission method and apparatus, network adapter, and storage medium | |
US10129137B2 (en) | Transferring data in a gateway | |
US8913613B2 (en) | Method and system for classification and management of inter-blade network traffic in a blade server | |
US9871720B1 (en) | Using packet duplication with encapsulation in a packet-switched network to increase reliability | |
US9460289B2 (en) | Securing a virtual environment | |
CA2968964C (en) | Source ip address transparency systems and methods | |
US9338192B1 (en) | Connection management using connection request transfer protocol | |
US9712649B2 (en) | CCN fragmentation gateway | |
WO2017050117A1 (en) | Network load balance processing system, method, and apparatus | |
WO2012151904A1 (en) | Data packet forwarding method and device | |
CN106302322B (en) | Virtual machine data flow management method and system | |
JP2009302847A (en) | Network virtualizing system and program | |
WO2022089169A1 (en) | Method and apparatus for sending computing routing information, device, and storage medium | |
CN109120556B (en) | A kind of method and system of cloud host access object storage server | |
WO2024001701A1 (en) | Data processing method, apparatus and system | |
CN105100101A (en) | Method, apparatus and system based on SSL session | |
CN115865802A (en) | Virtual instance flow mirroring method and device, virtual machine platform and storage medium | |
CN112994928B (en) | Virtual machine management method, device and system | |
JP2013126219A (en) | Transfer server and transfer program | |
CN109981463B (en) | Information processing method, device, gateway and storage medium | |
CN105227420B (en) | Processing method, device and the system of data frame | |
JP6279970B2 (en) | Processor, communication apparatus, communication system, communication method, and computer program | |
US9853885B1 (en) | Using packet duplication in a packet-switched network to increase reliability |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 12882814 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 12882814 Country of ref document: EP Kind code of ref document: A1 |